Changeset 1092
- Timestamp:
- 09/16/08 22:41:23 (4 months ago)
- Files:
-
- trunk/lib/jelix-scripts/commands/createapp.cmd.php (modified) (6 diffs)
- trunk/lib/jelix-scripts/commands/createmodule.cmd.php (modified) (1 diff)
- trunk/lib/jelix-scripts/jelix.php (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/cmdline/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/index/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/jsonrpc/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/soap/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/xmlrpc/config.ini.php.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-scripts/commands/createapp.cmd.php
r1018 r1092 16 16 17 17 public $name = 'createapp'; 18 public $allowed_options=array('-nodefaultmodule'=>false, '-withcmdline'=>false );18 public $allowed_options=array('-nodefaultmodule'=>false, '-withcmdline'=>false, '-withrpc'=>false); 19 19 public $allowed_parameters=array(); 20 20 … … 67 67 $this->createDir(JELIX_APP_CONFIG_PATH); 68 68 $this->createDir(JELIX_APP_CONFIG_PATH.'index/'); 69 $this->createDir(JELIX_APP_CONFIG_PATH.'jsonrpc/');70 $this->createDir(JELIX_APP_CONFIG_PATH.'xmlrpc/');71 69 $this->createDir(JELIX_APP_VAR_PATH.'overloads/'); 72 70 $this->createDir(JELIX_APP_VAR_PATH.'themes/'); … … 104 102 $this->createFile(JELIX_APP_PATH.'application.init.php','application.init.php.tpl',$param); 105 103 106 $param = array('appname'=>$GLOBALS['APPNAME'] );104 $param = array('appname'=>$GLOBALS['APPNAME'], 'modulename'=>''); 107 105 $param['rp_jelix'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH, true); 108 106 $param['rp_app'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH, true); … … 115 113 $cmd->init(array('-addinstallzone'=>true),array('module'=>$GLOBALS['APPNAME'])); 116 114 $cmd->run(); 117 $this->createFile(JELIX_APP_PATH.'modules/'.$GLOBALS['APPNAME'].'/templates/main.tpl', 'main.tpl.tpl',$param); 115 $param['modulename'] = $GLOBALS['APPNAME']; 116 $this->createFile(JELIX_APP_PATH.'modules/'.$GLOBALS['APPNAME'].'/templates/main.tpl', 'main.tpl.tpl', $param); 118 117 } 119 118 … … 126 125 $this->createDir(JELIX_APP_CMD_PATH); 127 126 $this->createDir(JELIX_APP_CONFIG_PATH.'cmdline'); 128 $this->createFile(JELIX_APP_CONFIG_PATH.'cmdline/config.ini.php','var/config/cmdline/config.ini.php.tpl', $param);127 $this->createFile(JELIX_APP_CONFIG_PATH.'cmdline/config.ini.php','var/config/cmdline/config.ini.php.tpl', $param); 129 128 $param['rp_cmd'] =jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH,true); 130 129 $this->createFile(JELIX_APP_CMD_PATH.'cmdline.php','scripts/cmdline.php.tpl',$param); … … 132 131 133 132 if($this->getOption('-withrpc')){ 133 $this->createDir(JELIX_APP_CONFIG_PATH.'jsonrpc/'); 134 $this->createDir(JELIX_APP_CONFIG_PATH.'xmlrpc/'); 134 135 $this->createFile(JELIX_APP_WWW_PATH.'jsonrpc.php','www/jsonrpc.php.tpl',$param); 135 136 $this->createFile(JELIX_APP_WWW_PATH.'xmlrpc.php','www/xmlrpc.php.tpl',$param); trunk/lib/jelix-scripts/commands/createmodule.cmd.php
r1018 r1092 41 41 42 42 public function run(){ 43 $path= $this->getModulePath($this->_parameters['module'], false); 43 jxs_init_jelix_env(); 44 $path= $this->getModulePath($this->_parameters['module'], false); 44 45 45 if(file_exists($path)){46 die("Error: module '".$this->_parameters['module']."' already exists");47 }48 $this->createDir($path);49 $this->createFile($path.'module.xml','module.xml.tpl',array('name'=>$this->_parameters['module']));46 if(file_exists($path)){ 47 die("Error: module '".$this->_parameters['module']."' already exists"); 48 } 49 $this->createDir($path); 50 $this->createFile($path.'module.xml','module.xml.tpl',array('name'=>$this->_parameters['module'])); 50 51 51 if(!$this->getOption('-nosubdir')){52 $this->createDir($path.'classes/');53 $this->createDir($path.'zones/');54 $this->createDir($path.'controllers/');55 $this->createDir($path.'templates/');56 $this->createDir($path.'classes/');57 $this->createDir($path.'daos/');58 $this->createDir($path.'forms/');59 $this->createDir($path.'locales/');60 $this->createDir($path.'locales/en_EN/');61 $this->createDir($path.'locales/fr_FR/');62 }52 if(!$this->getOption('-nosubdir')){ 53 $this->createDir($path.'classes/'); 54 $this->createDir($path.'zones/'); 55 $this->createDir($path.'controllers/'); 56 $this->createDir($path.'templates/'); 57 $this->createDir($path.'classes/'); 58 $this->createDir($path.'daos/'); 59 $this->createDir($path.'forms/'); 60 $this->createDir($path.'locales/'); 61 $this->createDir($path.'locales/en_EN/'); 62 $this->createDir($path.'locales/fr_FR/'); 63 } 63 64 64 if(!$this->getOption('-nocontroller')){ 65 $agcommand = jxs_load_command('createctrl'); 66 $options = array(); 67 if ($this->getOption('-cmdline')) { 68 $options = array('-cmdline'=>true); 69 } 70 if ($this->getOption('-addinstallzone')) { 71 $options = array('-addinstallzone'=>true); 72 } 73 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>'default','method'=>'index')); 74 $agcommand->run(); 75 } 65 if(!$this->getOption('-nocontroller')){ 66 $agcommand = jxs_load_command('createctrl'); 67 $options = array(); 68 if ($this->getOption('-cmdline')) { 69 $options = array('-cmdline'=>true); 70 } 71 if ($this->getOption('-addinstallzone')) { 72 $options = array('-addinstallzone'=>true); 73 } 74 $agcommand->init($options,array('module'=>$this->_parameters['module'], 'name'=>'default','method'=>'index')); 75 $agcommand->run(); 76 } 77 $inifiles = array(JELIX_APP_CONFIG_PATH.'index/config.ini.php', 78 JELIX_APP_CONFIG_PATH.'cmdline/config.ini.php', 79 JELIX_APP_CONFIG_PATH.'jsonrpc/config.ini.php', 80 JELIX_APP_CONFIG_PATH.'xmlrpc/config.ini.php', 81 ); 82 foreach($inifiles as $filename) { 83 try { 84 $ini = new jIniFileModifier($filename); 85 if ($ini->getValue('startModule') == '') 86 $ini->setValue('startModule', $this->_parameters['module']); 87 $ini->save(); 88 }catch(Exception $e){} 89 } 76 90 } 77 91 } trunk/lib/jelix-scripts/jelix.php
r1018 r1092 2 2 /** 3 3 * @package jelix-scripts 4 * @version $Id$5 4 * @author Jouanneau Laurent 6 5 * @contributor Loic Mathaud trunk/lib/jelix-scripts/templates/var/config/cmdline/config.ini.php.tpl
r809 r1092 2 2 ;for security reasons , don't remove or modify the first line 3 3 4 startModule = "%% appname%%"4 startModule = "%%modulename%%" 5 5 startAction = "default:index" trunk/lib/jelix-scripts/templates/var/config/index/config.ini.php.tpl
r838 r1092 2 2 ;for security reasons , don't remove or modify the first line 3 3 4 startModule = "%% appname%%"4 startModule = "%%modulename%%" 5 5 startAction = "default:index" 6 6 trunk/lib/jelix-scripts/templates/var/config/jsonrpc/config.ini.php.tpl
r838 r1092 2 2 ;for security reasons , don't remove or modify the first line 3 3 4 startModule = "%% appname%%"4 startModule = "%%modulename%%" 5 5 startAction = "default:index" 6 6 trunk/lib/jelix-scripts/templates/var/config/soap/config.ini.php.tpl
r879 r1092 2 2 ;for security reasons , don't remove or modify the first line 3 3 4 startModule = "%% appname%%"4 startModule = "%%modulename%%" 5 5 startAction = "default:index" 6 6 trunk/lib/jelix-scripts/templates/var/config/xmlrpc/config.ini.php.tpl
r838 r1092 2 2 ;for security reasons , don't remove or modify the first line 3 3 4 startModule = "%% appname%%"4 startModule = "%%modulename%%" 5 5 startAction = "default:index" 6 6
