diff --git a/Documentation/docs/cli/index.md b/Documentation/docs/cli/index.md index 36b4369f..6ce33a15 100644 --- a/Documentation/docs/cli/index.md +++ b/Documentation/docs/cli/index.md @@ -19,18 +19,20 @@ perform. To bootstrap a new application the command is fixed: ```sh -./vendor/bin/gishiki new application +./vendor/bin/gishiki init ``` This will create a basic and empty application that uses an sqlite3 database, -has a randomly-generated RSA private key, and is ready to be executed. +has a randomly-generated RSA private key, and an empty SQLite3 database. + +The application can be executed immediately if ext-pdo_sqlite is installed. ## Controller Creation To bootstrap a new controller the command requires controller name: ```sh -./vendor/bin/gishiki new controller ControllerName +./vendor/bin/gishiki new-controller ControllerName ``` This will create a basic controller with a small example piece of code. \ No newline at end of file diff --git a/Gishiki/Core/Environment.php b/Gishiki/Core/Environment.php index 9196db07..89ea80b0 100755 --- a/Gishiki/Core/Environment.php +++ b/Gishiki/Core/Environment.php @@ -275,23 +275,23 @@ public function getConfigurationProperty($property) case 'RESOURCE_DIR': case 'RESOURCE_DIRECTORY': - return APPLICATION_DIR.'Resources'.DS; + return APPLICATION_DIR.'Resources'.DIRECTORY_SEPARATOR; case 'MODEL_DIR': return APPLICATION_DIR.'Models'; case 'VIEW_DIR': case 'VIEW_DIRECTORY': - return APPLICATION_DIR.'Views'.DS; + return APPLICATION_DIR.'Views'.DIRECTORY_SEPARATOR; case 'CONTROLLER_DIR': case 'CONTROLLER_DIRECTORY': - return APPLICATION_DIR.'Controllers'.DS; + return APPLICATION_DIR.'Controllers'.DIRECTORY_SEPARATOR; case 'KEYS_DIR': case 'KEYS_DIRECTORY': case 'ASYMMETRIC_KEYS': - return APPLICATION_DIR.'Keyring'.DS; + return APPLICATION_DIR.'Keyring'.DIRECTORY_SEPARATOR; case 'APPLICATION_DIR': case 'APPLICATION_DIRECTORY': diff --git a/Gishiki/Gishiki.php b/Gishiki/Gishiki.php index 341f0165..66e14cb6 100755 --- a/Gishiki/Gishiki.php +++ b/Gishiki/Gishiki.php @@ -41,27 +41,16 @@ public static function initialize() //remove default execution time set_time_limit(0); - //get directory separator - if (!defined('DS')) { - //if php has a directory separator..... - if (defined('DIRECTORY_SEPARATOR')) { - define('DS', DIRECTORY_SEPARATOR); - } else { - //this is the universal separator - define('DS', '/'); - } - } - //get the root path $documentRoot = filter_input(INPUT_SERVER, 'DOCUMENT_ROOT'); (strlen($documentRoot) > 0) ? - define('ROOT', filter_input(INPUT_SERVER, 'DOCUMENT_ROOT').DS) : - define('ROOT', getcwd().DS); + define('ROOT', filter_input(INPUT_SERVER, 'DOCUMENT_ROOT').DIRECTORY_SEPARATOR) : + define('ROOT', getcwd().DIRECTORY_SEPARATOR); //the name of the directory that contains model, view and controller (must be placed in the root) if (!defined('APPLICATION_DIR')) { - define('APPLICATION_DIR', ROOT.DS); + define('APPLICATION_DIR', ROOT.DIRECTORY_SEPARATOR); } } @@ -90,7 +79,7 @@ public static function run() Environment::getCurrentEnvironment()->fulfillRequest(); } elseif (!defined('CLI_TOOLKIT')) { //show the no application page! - echo file_get_contents(__DIR__.DS.'no_application.html'); + echo file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'no_application.html'); } //the framework execution is complete