/** * Create current class object (create once). * * @return Phpdays */ public static function singleton() { // create itself only once if (is_null(self::$_oInstatce)) { $sClassName = __CLASS__; self::$_oInstatce = new $sClassName(); } // return link to itself object return self::$_oInstatce; }
* - "exit": exit * * @copyright Copyright (c) 2009 phpDays foundation (http://phpdays.org) * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @link http://code.google.com/p/phpdays/wiki/EnLibDaysAcl * @package Days * @subpackage Tool * @author Anton Danilchenko <*****@*****.**> * @version 1.1 */ // include dependencies include_once realpath(dirname(__FILE__) . '/../lib/Days/Tool/AppGenerator.php'); // start application try { // create generator object $generator = Days_Tool_AppGenerator::singleton(); // start screen (introduction) print "\tPHPDAYS APPLICATION GENERATOR\n"; print "\n"; print "Syntax: command [app_name|controller_name] parameter1 parameter2 parameter3\n"; print "Example: add user: register login logout new\n"; print "\n"; print "Commands:\n"; print " - NEW: create new project\n"; print " - REMOVE: remove an existing project. Backup saved in user chosen location.\n"; print " - ADD: create new controller with actions (always create default action 'index')\n"; print " - DEL: delete actions in controller. Backup files save in directory 'backup'\n"; print " - REPLACE: replace selected actions in controller to new empty actions. Backup files save in directory 'backup'\n"; print " - CHECK: check files structure (all files in project on relations) and show log\n"; print "\n"; print "Press Enter for exit (no input command name)\n";