Changeset 722
- Timestamp:
- 01/02/08 12:35:05 (1 year ago)
- Files:
-
- trunk/lib/jelix-scripts/commands/createapp.cmd.php (modified) (5 diffs)
- trunk/lib/jelix-scripts/commands/createapp.cmd.php (modified) (5 diffs)
- trunk/lib/jelix-scripts/commands/createapp.cmd.php (modified) (5 diffs)
- trunk/lib/jelix-scripts/includes/utils.lib.php (modified) (2 diffs)
- trunk/lib/jelix-scripts/includes/utils.lib.php (modified) (2 diffs)
- trunk/lib/jelix-scripts/includes/utils.lib.php (modified) (2 diffs)
- trunk/testapp/INSTALL.txt (modified) (1 diff)
- trunk/testapp/INSTALL.txt (modified) (1 diff)
- trunk/testapp/INSTALL.txt (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php (modified) (2 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php (modified) (2 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-scripts/commands/createapp.cmd.php
r673 r722 14 14 15 15 public $name = 'createapp'; 16 public $allowed_options=array('- withdefaultmodule'=>false, '-withcmdline'=>false);16 public $allowed_options=array('-nodefaultmodule'=>false, '-withcmdline'=>false); 17 17 public $allowed_parameters=array(); 18 18 19 public $syntaxhelp = "[- withdefaultmodule] [-withcmdline] [-withrpc]";19 public $syntaxhelp = "[-nodefaultmodule] [-withcmdline] [-withrpc]"; 20 20 public $help=''; 21 21 … … 23 23 $this->help= array( 24 24 'fr'=>" 25 Créer une nouvelle application avec tous les répertoires nécessaires. 25 Créer une nouvelle application avec tous les répertoires nécessaires et un module 26 du même nom que l'application. 26 27 27 Si l'option -withdefaultmodule est présente, créer également un module du 28 même nom que l'application. 28 Si l'option -nodefaultmodule est présente, le module n'est pas crée. 29 29 30 30 Si l'option -withcmdline est présente, créer un point d'entrée afin de … … 37 37 ", 38 38 'en'=>" 39 Create a new application with all directories 39 Create a new application with all directories and a module which have 40 the same name of the application. 40 41 41 If you give -withdefaultmodule option, it create also a module which have 42 the same name of the application. 42 If you give -nodefaultmodule option, it won't create the module. 43 43 44 44 If you give the -withcmdline option, it will create an entry point for … … 55 55 public function run(){ 56 56 if(file_exists(JELIX_APP_PATH)){ 57 die("Err eur : application déjà existante\n");57 die("Error : this application already created\n"); 58 58 } 59 59 … … 90 90 $this->createFile(JELIX_APP_CONFIG_PATH.'index/config.ini.php','var/config/index/config.ini.php.tpl',$param); 91 91 92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH,true);93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH,true);94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH,true);95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH,true);96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH,true);97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH,true);92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH, true, true); 93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH, true, true); 94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH, true, true); 95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH, true, true); 96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH, true, true); 97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH, true, true); 98 98 99 99 $this->createFile(JELIX_APP_PATH.'application.init.php','application.init.php.tpl',$param); 100 100 101 101 $param = array('appname'=>$GLOBALS['APPNAME']); 102 $param['rp_jelix'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH ,true);103 $param['rp_app'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH,true);102 $param['rp_jelix'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH, true, true); 103 $param['rp_app'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH, true, true); 104 104 105 105 $this->createFile(JELIX_APP_WWW_PATH.'index.php','www/index.php.tpl',$param); 106 107 if( $this->getOption('-withdefaultmodule')){106 107 if(!$this->getOption('-nodefaultmodule')){ 108 108 $cmd = jxs_load_command('createmodule'); 109 109 $cmd->init(array(),array('module'=>$GLOBALS['APPNAME'])); trunk/lib/jelix-scripts/commands/createapp.cmd.php
r673 r722 14 14 15 15 public $name = 'createapp'; 16 public $allowed_options=array('- withdefaultmodule'=>false, '-withcmdline'=>false);16 public $allowed_options=array('-nodefaultmodule'=>false, '-withcmdline'=>false); 17 17 public $allowed_parameters=array(); 18 18 19 public $syntaxhelp = "[- withdefaultmodule] [-withcmdline] [-withrpc]";19 public $syntaxhelp = "[-nodefaultmodule] [-withcmdline] [-withrpc]"; 20 20 public $help=''; 21 21 … … 23 23 $this->help= array( 24 24 'fr'=>" 25 Créer une nouvelle application avec tous les répertoires nécessaires. 25 Créer une nouvelle application avec tous les répertoires nécessaires et un module 26 du même nom que l'application. 26 27 27 Si l'option -withdefaultmodule est présente, créer également un module du 28 même nom que l'application. 28 Si l'option -nodefaultmodule est présente, le module n'est pas crée. 29 29 30 30 Si l'option -withcmdline est présente, créer un point d'entrée afin de … … 37 37 ", 38 38 'en'=>" 39 Create a new application with all directories 39 Create a new application with all directories and a module which have 40 the same name of the application. 40 41 41 If you give -withdefaultmodule option, it create also a module which have 42 the same name of the application. 42 If you give -nodefaultmodule option, it won't create the module. 43 43 44 44 If you give the -withcmdline option, it will create an entry point for … … 55 55 public function run(){ 56 56 if(file_exists(JELIX_APP_PATH)){ 57 die("Err eur : application déjà existante\n");57 die("Error : this application already created\n"); 58 58 } 59 59 … … 90 90 $this->createFile(JELIX_APP_CONFIG_PATH.'index/config.ini.php','var/config/index/config.ini.php.tpl',$param); 91 91 92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH,true);93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH,true);94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH,true);95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH,true);96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH,true);97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH,true);92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH, true, true); 93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH, true, true); 94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH, true, true); 95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH, true, true); 96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH, true, true); 97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH, true, true); 98 98 99 99 $this->createFile(JELIX_APP_PATH.'application.init.php','application.init.php.tpl',$param); 100 100 101 101 $param = array('appname'=>$GLOBALS['APPNAME']); 102 $param['rp_jelix'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH ,true);103 $param['rp_app'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH,true);102 $param['rp_jelix'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH, true, true); 103 $param['rp_app'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH, true, true); 104 104 105 105 $this->createFile(JELIX_APP_WWW_PATH.'index.php','www/index.php.tpl',$param); 106 107 if( $this->getOption('-withdefaultmodule')){106 107 if(!$this->getOption('-nodefaultmodule')){ 108 108 $cmd = jxs_load_command('createmodule'); 109 109 $cmd->init(array(),array('module'=>$GLOBALS['APPNAME'])); trunk/lib/jelix-scripts/commands/createapp.cmd.php
r673 r722 14 14 15 15 public $name = 'createapp'; 16 public $allowed_options=array('- withdefaultmodule'=>false, '-withcmdline'=>false);16 public $allowed_options=array('-nodefaultmodule'=>false, '-withcmdline'=>false); 17 17 public $allowed_parameters=array(); 18 18 19 public $syntaxhelp = "[- withdefaultmodule] [-withcmdline] [-withrpc]";19 public $syntaxhelp = "[-nodefaultmodule] [-withcmdline] [-withrpc]"; 20 20 public $help=''; 21 21 … … 23 23 $this->help= array( 24 24 'fr'=>" 25 Créer une nouvelle application avec tous les répertoires nécessaires. 25 Créer une nouvelle application avec tous les répertoires nécessaires et un module 26 du même nom que l'application. 26 27 27 Si l'option -withdefaultmodule est présente, créer également un module du 28 même nom que l'application. 28 Si l'option -nodefaultmodule est présente, le module n'est pas crée. 29 29 30 30 Si l'option -withcmdline est présente, créer un point d'entrée afin de … … 37 37 ", 38 38 'en'=>" 39 Create a new application with all directories 39 Create a new application with all directories and a module which have 40 the same name of the application. 40 41 41 If you give -withdefaultmodule option, it create also a module which have 42 the same name of the application. 42 If you give -nodefaultmodule option, it won't create the module. 43 43 44 44 If you give the -withcmdline option, it will create an entry point for … … 55 55 public function run(){ 56 56 if(file_exists(JELIX_APP_PATH)){ 57 die("Err eur : application déjà existante\n");57 die("Error : this application already created\n"); 58 58 } 59 59 … … 90 90 $this->createFile(JELIX_APP_CONFIG_PATH.'index/config.ini.php','var/config/index/config.ini.php.tpl',$param); 91 91 92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH,true);93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH,true);94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH,true);95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH,true);96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH,true);97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH,true);92 $param['rp_temp']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_TEMP_PATH, true, true); 93 $param['rp_var'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_VAR_PATH, true, true); 94 $param['rp_log'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_LOG_PATH, true, true); 95 $param['rp_conf']= jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CONFIG_PATH, true, true); 96 $param['rp_www'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_WWW_PATH, true, true); 97 $param['rp_cmd'] = jxs_getRelativePath(JELIX_APP_PATH, JELIX_APP_CMD_PATH, true, true); 98 98 99 99 $this->createFile(JELIX_APP_PATH.'application.init.php','application.init.php.tpl',$param); 100 100 101 101 $param = array('appname'=>$GLOBALS['APPNAME']); 102 $param['rp_jelix'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH ,true);103 $param['rp_app'] =jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH,true);102 $param['rp_jelix'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_LIB_PATH, true, true); 103 $param['rp_app'] = jxs_getRelativePath(JELIX_APP_WWW_PATH, JELIX_APP_PATH, true, true); 104 104 105 105 $this->createFile(JELIX_APP_WWW_PATH.'index.php','www/index.php.tpl',$param); 106 107 if( $this->getOption('-withdefaultmodule')){106 107 if(!$this->getOption('-nodefaultmodule')){ 108 108 $cmd = jxs_load_command('createmodule'); 109 109 $cmd->init(array(),array('module'=>$GLOBALS['APPNAME'])); trunk/lib/jelix-scripts/includes/utils.lib.php
r575 r722 104 104 105 105 106 function jxs_getRelativePath($path, $targetPath, $intoString=false ){106 function jxs_getRelativePath($path, $targetPath, $intoString=false, $useDSConst = false){ 107 107 $cut = (DIRECTORY_SEPARATOR == '/'? '!/!': "![/\\\\]!"); 108 108 $sep = DIRECTORY_SEPARATOR; … … 121 121 } 122 122 if(count($path)){ 123 $relativePath=str_repeat('..'.$sep,count($path));123 $relativePath=str_repeat('..'.$sep,count($path)); 124 124 }else{ 125 $relativePath='.'.$sep;125 $relativePath='.'.$sep; 126 126 } 127 127 if(count($targetPath) && $dir != $targetdir){ 128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath);128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath); 129 129 }elseif(count($targetPath) ){ 130 130 $relativePath.= implode($sep,$targetPath); 131 131 } 132 132 if(substr($relativePath,-1) != $sep) 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') 135 $relativePath = str_replace('\\','\\\\', $relativePath); 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') { 135 if ($useDSConst) 136 $relativePath = str_replace('\\','\'.DIRECTORY_SEPARATOR.\'', $relativePath); 137 else 138 $relativePath = str_replace('\\','\\\\', $relativePath); 139 } 136 140 return $relativePath; 137 141 } trunk/lib/jelix-scripts/includes/utils.lib.php
r575 r722 104 104 105 105 106 function jxs_getRelativePath($path, $targetPath, $intoString=false ){106 function jxs_getRelativePath($path, $targetPath, $intoString=false, $useDSConst = false){ 107 107 $cut = (DIRECTORY_SEPARATOR == '/'? '!/!': "![/\\\\]!"); 108 108 $sep = DIRECTORY_SEPARATOR; … … 121 121 } 122 122 if(count($path)){ 123 $relativePath=str_repeat('..'.$sep,count($path));123 $relativePath=str_repeat('..'.$sep,count($path)); 124 124 }else{ 125 $relativePath='.'.$sep;125 $relativePath='.'.$sep; 126 126 } 127 127 if(count($targetPath) && $dir != $targetdir){ 128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath);128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath); 129 129 }elseif(count($targetPath) ){ 130 130 $relativePath.= implode($sep,$targetPath); 131 131 } 132 132 if(substr($relativePath,-1) != $sep) 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') 135 $relativePath = str_replace('\\','\\\\', $relativePath); 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') { 135 if ($useDSConst) 136 $relativePath = str_replace('\\','\'.DIRECTORY_SEPARATOR.\'', $relativePath); 137 else 138 $relativePath = str_replace('\\','\\\\', $relativePath); 139 } 136 140 return $relativePath; 137 141 } trunk/lib/jelix-scripts/includes/utils.lib.php
r575 r722 104 104 105 105 106 function jxs_getRelativePath($path, $targetPath, $intoString=false ){106 function jxs_getRelativePath($path, $targetPath, $intoString=false, $useDSConst = false){ 107 107 $cut = (DIRECTORY_SEPARATOR == '/'? '!/!': "![/\\\\]!"); 108 108 $sep = DIRECTORY_SEPARATOR; … … 121 121 } 122 122 if(count($path)){ 123 $relativePath=str_repeat('..'.$sep,count($path));123 $relativePath=str_repeat('..'.$sep,count($path)); 124 124 }else{ 125 $relativePath='.'.$sep;125 $relativePath='.'.$sep; 126 126 } 127 127 if(count($targetPath) && $dir != $targetdir){ 128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath);128 $relativePath.= $targetdir.$sep.implode($sep,$targetPath); 129 129 }elseif(count($targetPath) ){ 130 130 $relativePath.= implode($sep,$targetPath); 131 131 } 132 132 if(substr($relativePath,-1) != $sep) 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') 135 $relativePath = str_replace('\\','\\\\', $relativePath); 133 $relativePath.=$sep; 134 if($intoString && $sep =='\\') { 135 if ($useDSConst) 136 $relativePath = str_replace('\\','\'.DIRECTORY_SEPARATOR.\'', $relativePath); 137 else 138 $relativePath = str_replace('\\','\\\\', $relativePath); 139 } 136 140 return $relativePath; 137 141 } trunk/testapp/INSTALL.txt
r716 r722 8 8 testapppdo if you have pdo extension and testapp_pgsql if you have postgresql sql 9 9 don't touch other sections. 10 - create the "testapp/" directory in the temp directory of Jelix 10 11 - put write access for apache on temp/testapp/ trunk/testapp/INSTALL.txt
r716 r722 8 8 testapppdo if you have pdo extension and testapp_pgsql if you have postgresql sql 9 9 don't touch other sections. 10 - create the "testapp/" directory in the temp directory of Jelix 10 11 - put write access for apache on temp/testapp/ trunk/testapp/INSTALL.txt
r716 r722 8 8 testapppdo if you have pdo extension and testapp_pgsql if you have postgresql sql 9 9 don't touch other sections. 10 - create the "testapp/" directory in the temp directory of Jelix 10 11 - put write access for apache on temp/testapp/ trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php
r716 r722 21 21 class UTjrequest extends jUnitTestCase { 22 22 protected $currentServer; 23 protected $currentBasePath; 24 protected $currentConfigScriptName; 23 25 24 26 function setUp() { 25 27 $this->currentServer = $_SERVER; 26 28 $this->currentConfigScriptName = $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable']; 29 $this->currentBasePath = $GLOBALS['gJConfig']->urlengine['basePath']; 30 $GLOBALS['gJConfig']->urlengine['basePath'] = '/'; 27 31 } 28 32 … … 30 34 $_SERVER = $this->currentServer; 31 35 $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable'] = $this->currentConfigScriptName; 36 $GLOBALS['gJConfig']->urlengine['basePath'] = $this->currentBasePath; 32 37 } 33 38 trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php
r716 r722 21 21 class UTjrequest extends jUnitTestCase { 22 22 protected $currentServer; 23 protected $currentBasePath; 24 protected $currentConfigScriptName; 23 25 24 26 function setUp() { 25 27 $this->currentServer = $_SERVER; 26 28 $this->currentConfigScriptName = $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable']; 29 $this->currentBasePath = $GLOBALS['gJConfig']->urlengine['basePath']; 30 $GLOBALS['gJConfig']->urlengine['basePath'] = '/'; 27 31 } 28 32 … … 30 34 $_SERVER = $this->currentServer; 31 35 $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable'] = $this->currentConfigScriptName; 36 $GLOBALS['gJConfig']->urlengine['basePath'] = $this->currentBasePath; 32 37 } 33 38 trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php
r716 r722 21 21 class UTjrequest extends jUnitTestCase { 22 22 protected $currentServer; 23 protected $currentBasePath; 24 protected $currentConfigScriptName; 23 25 24 26 function setUp() { 25 27 $this->currentServer = $_SERVER; 26 28 $this->currentConfigScriptName = $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable']; 29 $this->currentBasePath = $GLOBALS['gJConfig']->urlengine['basePath']; 30 $GLOBALS['gJConfig']->urlengine['basePath'] = '/'; 27 31 } 28 32 … … 30 34 $_SERVER = $this->currentServer; 31 35 $GLOBALS['gJConfig']->urlengine['scriptNameServerVariable'] = $this->currentConfigScriptName; 36 $GLOBALS['gJConfig']->urlengine['basePath'] = $this->currentBasePath; 32 37 } 33 38
