diff --git a/update.php b/update.php index 0ff42e7..cb7cf0c 100644 --- a/update.php +++ b/update.php @@ -5,6 +5,9 @@ define('PHPBB_ROOT_PATH', '../'); define('IN_PHPBB', true); +define('SUPPORTED_RELEASE_MAJOR', 3); +define('SUPPORTED_RELEASE_MINOR', 2); + function confirm($message = 'Are you sure? ', $options = array('y', 'n'), $default ='n') { @@ -136,8 +139,8 @@ if (!empty($argv[1])) { // phpBB has major, minor and maintenance version scheme list($major, $minor, $patch) = explode('.', $installedVersion); - if ((intval($major) != 3) || (intval($minor) != 2)) { - echo "This script only supports phpBB 3.2 branch.", PHP_EOL; + if ((intval($major) != SUPPORTED_RELEASE_MAJOR) || (intval($minor) != SUPPORTED_RELEASE_MINOR)) { + echo 'This script only supports phpBB ' . SUPPORTED_RELEASE_MAJOR . '.' . SUPPORTED_RELEASE_MINOR . ' branch.', PHP_EOL; exit(1); } @@ -165,7 +168,7 @@ if (!empty($argv[1])) { // http://version.phpbb.com/phpbb/versions.json $json = file_get_contents('http://version.phpbb.com/phpbb/versions.json'); $versions = json_decode($json); - $currentVersion = $versions->{'stable'}->{'3.2'}->{'current'}; + $currentVersion = $versions->{'stable'}->{SUPPORTED_RELEASE_MAJOR . '.' . SUPPORTED_RELEASE_MINOR}->{'current'}; print("Current version: $currentVersion" . PHP_EOL); // check for existing update @@ -174,7 +177,10 @@ if (!empty($argv[1])) { mkdir ('dist'); } $currentFile = "phpBB-$currentVersion-deutsch.tar.bz2"; - $filePath = "http://downloads.phpbb.de/pakete/deutsch/3.2/$currentVersion/$currentFile"; + $filePath = 'http://downloads.phpbb.de/pakete/deutsch/' . SUPPORTED_RELEASE_MAJOR . '.' . SUPPORTED_RELEASE_MINOR . "/$currentVersion/$currentFile"; + echo $filePath; + die(); + $target = "dist/$currentFile"; if (!file_exists($target)) {