diff --git a/aowow b/aowow new file mode 100644 index 00000000..e3a0fee5 --- /dev/null +++ b/aowow @@ -0,0 +1,12 @@ + diff --git a/includes/shared.php b/includes/shared.php new file mode 100644 index 00000000..9b5f5248 --- /dev/null +++ b/includes/shared.php @@ -0,0 +1,26 @@ +'.$r." was not found. Please check if it should exist, using \"php -m\"\n\n"; + +if (version_compare(PHP_VERSION, '5.5.0') < 0) + $error .= 'PHP Version 5.5.0 or higher required! Your version is '.PHP_VERSION.".\nCore functions are unavailable!\n"; + +if ($error) +{ + echo CLI ? strip_tags($error) : $error; + die(); +} + + +// include all necessities, set up basics +require_once 'includes/kernel.php'; + +?> diff --git a/index.php b/index.php index 2be36d64..20ae26ee 100644 --- a/index.php +++ b/index.php @@ -1,38 +1,9 @@ '.$r." was not found. Please check if it should exist, using \"php -m\"\n\n"; - -if (version_compare(PHP_VERSION, '5.5.0') < 0) - $error .= 'PHP Version 5.5.0 or higher required! Your version is '.PHP_VERSION.".\nCore functions are unavailable!\n"; - -// not in root dir -if (CLI && getcwd().DIRECTORY_SEPARATOR.'index.php' != __FILE__) - $error .= "Aowow must be used from root directory\n"; - -if ($error) -{ - echo CLI ? strip_tags($error) : $error; - die(); -} - - -// include all necessities, set up basics -require_once 'includes/kernel.php'; - +require 'includes/shared.php'; if (CLI) -{ - require 'setup/setup.php'; - die(); -} + die("this script must not be run from CLI.\nto setup aowow use 'php aowow'\n"); // maybe add additional setup checks? diff --git a/setup/tools/fileGen.class.php b/setup/tools/fileGen.class.php index 236d410c..f6344711 100644 --- a/setup/tools/fileGen.class.php +++ b/setup/tools/fileGen.class.php @@ -161,7 +161,7 @@ class FileGen public static function printCLIHelp() { - echo "\nusage: php index.php --build= [-h --help] [-f --force]\n\n"; + echo "\nusage: php aowow --build= [-h --help] [-f --force]\n\n"; echo "--build : available subScripts:\n"; foreach (array_merge(array_keys(self::$tplFiles), array_keys(self::$datasets)) as $s) { diff --git a/setup/tools/sqlGen.class.php b/setup/tools/sqlGen.class.php index 30dcfeae..44bd0018 100644 --- a/setup/tools/sqlGen.class.php +++ b/setup/tools/sqlGen.class.php @@ -131,7 +131,7 @@ class SqlGen public static function printCLIHelp() { - echo "\nusage: php index.php --sql= [-h --help]\n\n"; + echo "\nusage: php aowow --sql= [-h --help]\n\n"; echo "--sql : available tables:\n"; foreach (self::$tables as $t => $info) echo " * ".str_pad($t, 24).(isset($info[3]) ? ' - TC deps: '.implode(', ', $info[3]) : '').(isset($info[2]) ? ' - Aowow deps: '.implode(', ', $info[2]) : '')."\n";