Changeset 98
- Timestamp:
- 03/08/06 23:20:54 (3 years ago)
- Files:
-
- trunk/build/manifests/jelix-dev.mn (modified) (1 diff)
- trunk/build/manifests/jelix-lib.mn (modified) (3 diffs)
- trunk/build/manifests/myapp.mn (modified) (1 diff)
- trunk/build/manifests/testapp.mn (modified) (2 diffs)
- trunk/lib/jelix-modules/auth/actiongroups/login.ag.php (modified) (5 diffs)
- trunk/lib/jelix-modules/auth/actions.xml (deleted)
- trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.ini.php.dist (modified) (3 diffs)
- trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.php (modified) (5 diffs)
- trunk/lib/jelix-modules/jelix/locales/en_US/errors.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix-modules/jelix/locales/fr_FR/errors.ISO-8859-1.properties (modified) (1 diff)
- trunk/lib/jelix-plugins/magicquotes/magicquotes.plugin.php (modified) (1 diff)
- trunk/lib/jelix-scripts/commands/createmodule.cmd.php (modified) (2 diffs)
- trunk/lib/jelix-scripts/templates/actions.xml.tpl (deleted)
- trunk/lib/jelix/core/jActionDesc.class.php (deleted)
- trunk/lib/jelix/core/jActionGroup.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jActionsCompiler.class.php (deleted)
- trunk/lib/jelix/core/jConfig.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jDefaultConfig.lib.php (modified) (1 diff)
- trunk/lib/jelix/core/jIPlugin.iface.php (modified) (1 diff)
- trunk/lib/jelix/core/jRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jSelector.class.php (modified) (4 diffs)
- trunk/lib/jelix/init.php (modified) (1 diff)
- trunk/myapp/modules/myapp/actiongroups/main.ag.php (modified) (1 diff)
- trunk/myapp/modules/myapp/actions.xml (deleted)
- trunk/myapp/var/config/config.classic.ini.php.dist (modified) (1 diff)
- trunk/testapp/modules/testapp/actiongroups/main.ag.php (modified) (3 diffs)
- trunk/testapp/modules/testapp/actions.xml (deleted)
- trunk/testapp/modules/testapp/templates/testzone.tpl (modified) (1 diff)
- trunk/testapp/modules/unittest/actiongroups/default.ag.php (modified) (5 diffs)
- trunk/testapp/modules/unittest/actiongroups/urlsig.ag.php (modified) (1 diff)
- trunk/testapp/modules/unittest/actions.xml (deleted)
- trunk/testapp/modules/unittest/classes/utcreateurls.class.php (modified) (5 diffs)
- trunk/testapp/modules/unittest/classes/utparseurls.class.php (modified) (2 diffs)
- trunk/testapp/var/config/config.classic.ini.php.dist (modified) (2 diffs)
- trunk/testapp/var/config/urls.xml (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/manifests/jelix-dev.mn
r89 r98 122 122 template.tpl 123 123 zone.tpl 124 actions.xml.tpl125 124 project.xml.tpl 126 125 application.init.php.tpl trunk/build/manifests/jelix-lib.mn
r89 r98 1 1 cd . 2 2 README 3 3 4 4 cd lib 5 5 .htaccess … … 18 18 19 19 cd lib/jelix/core 20 jActionDesc.class.php21 20 jActionGroup.class.php 22 jActionsCompiler.class.php23 21 jConfig.class.php 24 22 jContext.class.php … … 160 158 auth.ISO-8859-1.properties 161 159 cd lib/jelix-modules/auth 162 actions.xml163 160 module.xml 164 161 cd lib/jelix-modules/auth/plugins/auth trunk/build/manifests/myapp.mn
r89 r98 20 20 .htaccess 21 21 cd myapp/modules/myapp 22 actions.xml23 22 module.xml 24 23 cd myapp/modules/myapp/actiongroups trunk/build/manifests/testapp.mn
r89 r98 24 24 .htaccess 25 25 cd testapp/modules/testapp 26 actions.xml27 26 module.xml 28 27 cd testapp/modules/testapp/locales/en_US … … 44 43 cd testapp/modules/unittest 45 44 events.xml 46 actions.xml47 45 module.xml 48 46 cd testapp/modules/unittest/classes trunk/lib/jelix-modules/auth/actiongroups/login.ag.php
r79 r98 18 18 19 19 class AGLogin extends jActionGroup { 20 21 public $pluginParams = array( 22 '*'=>array('auth.required'=>false) 23 ); 24 20 25 /** 21 26 * 22 27 */ 23 function doLogin (){28 function in (){ 24 29 $conf = $GLOBALS['gJCoord']->getPlugin ('auth')->config; 25 30 … … 30 35 if (!jAuth::login($this->param('login'), $this->param('password'))){ 31 36 sleep (intval($conf['on_error_sleep'])); 32 $url_return = jUrl::get('auth~login form',array ('login'=>$this->param('login'), 'failed'=>1));37 $url_return = jUrl::get('auth~login_form',array ('login'=>$this->param('login'), 'failed'=>1)); 33 38 } 34 39 35 $rep = $this->getResponse(' next');40 $rep = $this->getResponse('redirectUrl'); 36 41 $rep->url = $url_return; 37 42 return $rep; … … 41 46 * 42 47 */ 43 function doLogout (){48 function out (){ 44 49 jAuth::logout(); 45 50 $conf = $GLOBALS['gJCoord']->getPlugin ('auth')->config; … … 48 53 $url_return = jUrl::get($conf['after_logout']); 49 54 } 50 $rep = $this->getResponse(' next');55 $rep = $this->getResponse('redirectUrl'); 51 56 $rep->url = $url_return; 52 57 return $rep; … … 56 61 * Shows the login form 57 62 */ 58 function getLoginForm() {59 $rep = $this->getResponse(' loginform');63 function form() { 64 $rep = $this->getResponse('html'); 60 65 61 66 $rep->title = jLocale::get ('auth.titlePage.login'); trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.ini.php.dist
r21 r98 27 27 28 28 ; action �xecuter en cas de d�ut d'authentification quand onError = 2 29 on_error_ag = auth~login 30 on_error_method = doLogout 29 on_error_action = auth~login_out 31 30 32 31 ; nombre de secondes d'attentes apr�un d�ut d'authentification … … 41 40 42 41 ; action en cas de piratage de la session et si onError = 2 43 bad_ip_ag = auth~login 44 bad_ip_method = doLogout 42 bad_ip_action = auth~login_out 45 43 46 44 enable_after_login_override = off … … 48 46 49 47 enable_after_logout_override = off 50 after_logout = auth~login 48 after_logout = auth~login_out 51 49 52 50 login_template = auth~login.form trunk/lib/jelix-modules/auth/plugins/auth/auth.plugin.php
r21 r98 25 25 26 26 /** 27 * IPCheck if needed, creating the user object if not yet. 28 * @param CopixAction $action le descripteur de page d�ct� * @access public 29 */30 public function beforeProcess ( &$action){27 * @param array $params plugin parameters for the current action 28 * @return null or jSelectorAct if action should change 29 */ 30 public function beforeProcess ($params){ 31 31 $notLogged = false; 32 32 $badip = false; 33 $selector = null; 33 34 34 35 //Do we check the ip ? … … 39 40 if (($_SESSION['JELIX_AUTH_SECURE_WITH_IP'] != $this->_getIpForSecure ())){ 40 41 session_destroy (); 41 $sel= new jSelectorAg($this->config['bad_ip_ag']); 42 $action->actionsGroupPath = $sel->getPath(); 43 $action->actionsGroupClass = 'AG'.$sel->ressource; 44 $action->method = $this->config['bad_ip_method']; 42 $selector = new jSelectorAct($this->config['bad_ip_action']); 45 43 $notLogged = true; 46 44 $badip = true; … … 66 64 } 67 65 68 $needAuth = isset($action->pluginParams['auth.required']) ? ($action->pluginParams['auth.required']== 'true'):$this->config['auth_required'];66 $needAuth = isset($action->pluginParams['auth.required']) ? ($action->pluginParams['auth.required']==true):$this->config['auth_required']; 69 67 $authok = false; 70 68 … … 76 74 }else{ 77 75 if(!$badip){ 78 $sel= new jSelectorAg($this->config['on_error_ag']); 79 $action->actionsGroupPath = $sel->getPath(); 80 $action->actionsGroupClass = 'AG'.$sel->ressource; 81 $action->method = $this->config['on_error_method']; 76 $selector= new jSelectorAct($this->config['on_error_action']); 82 77 } 83 78 } … … 88 83 $authok= true; 89 84 } 85 86 return $selector; 90 87 } 91 88 trunk/lib/jelix-modules/jelix/locales/en_US/errors.ISO-8859-1.properties
r42 r98 7 7 8 8 ad.response.unknow=(110)Action %s : response %s doesn't exists (file : %s) 9 ad.response.type.unknow=(111)Action %s : the type "%s" of the response %s is unknown (file : %s) 10 ad.response.not.loaded=(112)Action %s : the class for the response %3$s (type "%2$s") can't be loaded 9 ad.response.type.unknow=(111)Action %s : the response type "%s" is unknown (file : %s) 10 ad.response.not.loaded=(112)Action %s : the class for the response type "%s" can't be loaded (file : %s) 11 ad.response.type.notallowed=(112)Action %s : the response type "%s" is not allowed for the current request (file : %s) 11 12 12 13 trunk/lib/jelix-modules/jelix/locales/fr_FR/errors.ISO-8859-1.properties
r42 r98 7 7 8 8 ad.response.unknow=(110)Action %s : la r�nse %s n'existe pas (fichier : %s) 9 ad.response.type.unknow=(111)Action %s : Le type "%s" de la r�nse %s est inconnu (fichier : %s) 10 ad.response.not.loaded=(112)Action %s : La classe pour la r�nse %3$s de type "%2$s" ne peut �e charg� 9 ad.response.type.unknow=(111)Action %s : Le type de r�nse "%s" est inconnu (fichier : %s) 10 ad.response.not.loaded=(112)Action %s : La classe pour la r�nse de type "%s" ne peut �e charg�(fichier : %s) 11 ad.response.type.notallowed=(112)Action %s : le type de reponse "%s" n'est pas permis pour la requ� courante (file : %s) 11 12 12 13 #---- compilateur d'action trunk/lib/jelix-plugins/magicquotes/magicquotes.plugin.php
r31 r98 47 47 } 48 48 } 49 /** 50 * @param jAction $action action that will be executed 49 /** 50 * @param array $params plugin parameters for the current action 51 * @return null or jSelectorAct if action should change 51 52 */ 52 public function beforeAction(& $action){ } 53 53 public function beforeAction($params){ return null;} 54 54 public function beforeOutput() {} 55 55 trunk/lib/jelix-scripts/commands/createmodule.cmd.php
r20 r98 19 19 public $syntaxhelp = "[-nosubdir] [-noag] MODULE"; 20 20 public $help=" 21 Cr� un nouveau module, avec son fichier module.xml, action.xml21 Cr� un nouveau module, avec son fichier module.xml, 22 22 et un actiongroup par d�ut, ainsi que tous les sous-repertoires courants 23 23 (zones, templates, daos, locales, classes...). … … 36 36 $this->createDir($path); 37 37 $this->createFile($path.'module.xml','module.xml.tpl',array('name'=>$this->_parameters['module'])); 38 $this->createFile($path.'actions.xml','actions.xml.tpl',array('module'=>$this->_parameters['module']));38 //$this->createFile($path.'actions.xml','actions.xml.tpl',array('module'=>$this->_parameters['module'])); 39 39 40 40 if(!$this->getOption('-nosubdir')){ trunk/lib/jelix/core/jActionGroup.class.php
r40 r98 18 18 class jActionGroup { 19 19 20 public $pluginParams=array(); 20 21 private $request; 21 private $action;22 22 23 23 /** … … 25 25 * @param 26 26 */ 27 function __construct ( $action,$request){27 function __construct ( $request){ 28 28 $this->request = $request; 29 $this->action = $action;30 29 } 31 30 … … 50 49 51 50 protected function getResponse($name){ 52 return $this-> action->getResponse($name);51 return $this->request->getResponse($name); 53 52 } 54 53 trunk/lib/jelix/core/jConfig.class.php
r75 r98 44 44 $config->isWindows = (strtolower($os) == 'win'); 45 45 if(trim( $config->defaultAction) == '') 46 $config->defaultAction = ' default';46 $config->defaultAction = '_'; 47 47 48 48 $config->pluginsPathList = self::_loadPathList($config, $configFile,'plugins'); trunk/lib/jelix/core/jCoordinator.class.php
r66 r98 107 107 session_start(); 108 108 109 $this->moduleName = $this->request->getParam('module', $gJConfig->defaultModule,true); 110 $this->actionName = $this->request->getParam('action', $gJConfig->defaultAction,true); 109 $this->moduleName = $this->request->getParam('module'); 110 $this->actionName = $this->request->getParam('action'); 111 112 if($this->moduleName === null){ 113 $this->moduleName = $gJConfig->defaultModule; 114 if($this->actionName === null) 115 $this->actionName = $gJConfig->defaultAction; 116 } 117 if($this->actionName === null){ 118 $this->actionName = 'default_index'; 119 } 120 111 121 112 122 // verification du module … … 118 128 jContext::push ($this->moduleName); 119 129 120 $selector = new jSelectorAct($this->actionName); 121 122 $result = jIncluder::inc($selector); 123 if($result['compileok'] == false || $this->action===null){ 124 trigger_error(jLocale::get('jelix~errors.action.unknow',$this->actionName), E_USER_ERROR); 125 return; 126 } 127 130 $this->action = new jSelectorAct($this->actionName); 131 132 $ag = $this->getController($this->action); 133 134 $pluginparams = array(); 135 if(isset($ag->pluginsParam['*'])){ 136 $pluginparams = $ag->pluginsParam['*']; 137 } 138 139 if(isset($ag->pluginsParam[$this->action->method])){ 140 $pluginparams = array_merge($pluginparams, $ag->pluginsParam[$this->action->method]); 141 } 128 142 129 143 foreach ($this->plugins as $name => $obj){ 130 $this->plugins[$name]->beforeProcess ($this->action); 144 $result = $this->plugins[$name]->beforeProcess ($pluginparams); 145 if($result){ 146 $this->action = $result; 147 $ag = $this->getController($this->action); 148 break; 149 } 131 150 } 132 151 133 152 //try{ 134 $this->response = $ this->action->perform();153 $this->response = $ag->{$this->action->method}(); 135 154 /*}catch(jException $e){ 136 155 trigger_error($e->getLocaleMessage(), E_USER_ERROR); … … 160 179 161 180 jContext::pop(); 181 } 182 183 private function getController($selector){ 184 185 $agpath = $selector->getPath(); 186 $class = $selector->getClass(); 187 $method = $selector->method; 188 189 if(!file_exists($agpath)){ 190 trigger_error(jLocale::get('jelix~errors.ad.actiongroup.file.unknow',array($this->actionName,$agpath)),E_USER_ERROR); 191 return; 192 } 193 require($agpath); 194 if(!class_exists($class,false)){ 195 trigger_error(jLocale::get('jelix~errors.ad.actiongroup.class.unknow',array($this->actionName,$class, $agpath)),E_USER_ERROR); 196 return; 197 } 198 199 $ag = new $class($this->request); 200 201 if(!method_exists($ag,$method)){ 202 trigger_error(jLocale::get('jelix~errors.ad.actiongroup.method.unknow',array($this->actionName,$method, $class, $agpath)),E_USER_ERROR); 203 return; 204 } 205 return $ag; 162 206 } 163 207 trunk/lib/jelix/core/jDefaultConfig.lib.php
r75 r98 14 14 $gDefaultConfig = array ( 15 15 'defaultModule' => 'myapp', 16 'defaultAction' => ' default',16 'defaultAction' => '_', 17 17 'checkTrustedModules' => '', 18 18 'trustedModules' => '', // liste des modules, s�r�par des virgules, sans espace trunk/lib/jelix/core/jIPlugin.iface.php
r1 r98 24 24 25 25 /** 26 * @param jAction $action action that will be executed 26 * @param array $params plugin parameters for the current action 27 * @return null or jSelectorAct if action should change 27 28 */ 28 public function beforeAction( & $action);29 public function beforeAction($params); 29 30 30 31 /** trunk/lib/jelix/core/jRequest.class.php
r75 r98 98 98 } 99 99 100 public function getResponse($type=''){ 101 global $gJCoord, $gJConfig; 102 if($type == ''){ 103 $type = $this->defaultResponseType; 104 } 105 106 if(!isset($gJConfig->responses[$type])){ 107 trigger_error(jLocale::get('jelix~errors.ad.response.type.unknow',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 108 return null; 109 } 110 $respclass = $gJConfig->responses[$type]; 111 if(file_exists($path=JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php')){ 112 require_once ($path); 113 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 114 require_once ($path); 115 }else{ 116 trigger_error(jLocale::get('jelix~errors.ad.response.not.loaded',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 117 return null; 118 } 119 120 if(!$this->isAllowedResponse($respclass)){ 121 trigger_error(jLocale::get('jelix~errors.ad.response.type.notallowed',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 122 return null; 123 } 124 125 $response = new $respclass(); 126 $gJCoord->response= $response; 127 128 return $response; 129 } 100 130 } 101 131 trunk/lib/jelix/core/jSelector.class.php
r97 r98 138 138 public $type = 'act'; 139 139 public $request = ''; 140 public $controller = ''; 141 public $method=''; 140 142 protected $_dirname='actions/'; 141 143 142 144 function __construct($sel){ 143 145 global $gJCoord; 144 $this->_compiler='jActionsCompiler';145 $this->_compilerPath=JELIX_LIB_CORE_PATH.'jActionsCompiler.class.php';146 $this->request = $gJCoord->request->type;147 146 148 147 if(preg_match("/^(?:([\w\.]+|\#)~)?([\w\.]+|\#)(?:@([\w\.]+))?$/", $sel, $m)){ … … 161 160 $this->resource = $m[2]; 162 161 162 $r = explode('_',$this->resource); 163 164 if(count($r) == 1){ 165 $this->controller = 'default'; 166 $this->method = $r[0]==''?'index':$r[0]; 167 }else{ 168 $this->controller = $r[0]=='' ? 'default':$r[0]; 169 $this->method = $r[1]==''?'index':$r[1]; 170 } 171 163 172 if(isset($m[3]) && $m[3] != '') 164 173 $this->request = $m[3]; … … 179 188 $this->_valid = false; 180 189 }else{ 181 $this->_path = $gJConfig->modulesPathList[$this->module].'actions.xml'; 182 } 183 } 184 185 protected function _createCachePath(){ 186 $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/'.$this->_dirname.$this->module.'~'.$this->resource.'~'.$this->request.'.php'; 187 } 188 public function getCacheDir(){ 189 return JELIX_APP_TEMP_PATH.'compiled/'.$this->_dirname; 190 } 190 // $this->_path = $gJConfig->modulesPathList[$this->module].'actiongroups/'.$this->controller.'.'.$this->request.'.php'; 191 $this->_path = $gJConfig->modulesPathList[$this->module].'actiongroups/'.$this->controller.'.ag.php'; 192 } 193 } 194 195 protected function _createCachePath(){ 196 $this->_cachePath = ''; 197 } 198 191 199 public function toString($full=false){ 192 200 if($full) … … 195 203 return $this->module.'~'.$this->resource.'@'.$this->request; 196 204 } 205 206 public function getClass(){ 207 return 'AG'.$this->controller; 208 } 209 197 210 } 198 211 trunk/lib/jelix/init.php
r86 r98 41 41 require_once (JELIX_LIB_CORE_PATH . 'url/jUrl.class.php'); 42 42 require_once (JELIX_LIB_CORE_PATH . 'jCoordinator.class.php'); 43 require_once (JELIX_LIB_CORE_PATH . 'jActionDesc.class.php');44 43 require_once (JELIX_LIB_CORE_PATH . 'jActionGroup.class.php'); 45 44 require_once (JELIX_LIB_CORE_PATH . 'jRequest.class.php'); trunk/myapp/modules/myapp/actiongroups/main.ag.php
r40 r98 13 13 class AGMain extends jActionGroup { 14 14 15 function getDefault(){16 $rep = $this->getResponse('h ello');15 function index(){ 16 $rep = $this->getResponse('html'); 17 17 $rep->bodyTpl = 'myapp~hello'; 18 18 return $rep; trunk/myapp/var/config/config.classic.ini.php.dist
r75 r98 3 3 4 4 defaultModule = "myapp" 5 defaultAction = " default"5 defaultAction = "main_" 6 6 defaultLocale = "fr_FR" 7 7 defaultCharset = "ISO-8859-1" trunk/testapp/modules/testapp/actiongroups/main.ag.php
r69 r98 13 13 class AGMain extends jActionGroup { 14 14 15 function getDefault(){15 function index(){ 16 16 17 17 if($this->param('output') == 'text'){ 18 $rep = $this->getResponse(' hellotext');18 $rep = $this->getResponse('text'); 19 19 $rep->content = 'Hello World !'; 20 20 }else{ 21 21 22 $rep = $this->getResponse('h ello');22 $rep = $this->getResponse('html'); 23 23 $rep->title = 'Hello From Jelix !'; 24 24 $rep->bodyTpl = 'testapp~hello'; … … 30 30 } 31 31 32 33 34 function getTestDao(){ 32 function testdao(){ 35 33 if( $id=$this->param('newid')){ 36 34 $dao = jDAO::get('config'); … … 42 40 } 43 41 44 $rep = $this->getResponse(' dao');42 $rep = $this->getResponse('html'); 45 43 $rep->title = 'This is a DAO Test'; 46 44 $rep->bodyTpl = 'testapp~main'; trunk/testapp/modules/testapp/templates/testzone.tpl
r88 r98 23 23 <p>Link to actions:</p> 24 24 <ul> 25 <li> "testapp~ default@classic" : {jurl "testapp~default@classic"}</li>26 <li> " default@classic": {jurl "default@classic"}</li>27 <li> " default" : {jurl "default"}</li>28 <li> "testapp~ default" : {jurl "testapp~default"}</li>25 <li> "testapp~main_index@classic" : {jurl "testapp~main_index@classic"}</li> 26 <li> "main_index@classic": {jurl "main_index@classic"}</li> 27 <li> "main_index" : {jurl "main_index"}</li> 28 <li> "testapp~main_" : {jurl "testapp~main_"}</li> 29 29 <li> "testapp~#" : {jurl "testapp~#"}</li> 30 30 <li> "#~#" : {jurl "#~#"}</li> trunk/testapp/modules/unittest/actiongroups/default.ag.php
r78 r98 13 13 class AGDefault extends jActionGroup { 14 14 15 function home() {16 $rep = $this->getResponse( );15 function index() { 16 $rep = $this->getResponse('unittest'); 17 17 $rep->title = 'test unitaires'; 18 18 $rep->body->assign('MAIN',''); … … 23 23 * 24 24 */ 25 function getTestEvents(){26 $rep = $this->getResponse( );25 function testevent (){ 26 $rep = $this->getResponse('unittest'); 27 27 $rep->title = 'test unitaires sur jEvent'; 28 28 … … 35 35 36 36 function testurlcreate(){ 37 $rep = $this->getResponse( );37 $rep = $this->getResponse('unittest'); 38 38 $rep->title = 'test unitaires sur la creation d\'url avec jUrl'; 39 39 … … 45 45 } 46 46 function testurlparse(){ 47 $rep = $this->getResponse( );47 $rep = $this->getResponse('unittest'); 48 48 $rep->title = 'test unitaires sur le parsing d\'url avec jUrl'; 49 49 … … 53 53 54 54 return $rep; 55 }} 55 } 56 } 56 57 ?> trunk/testapp/modules/unittest/actiongroups/urlsig.ag.php
r71 r98 14 14 class AGUrlsig extends jActionGroup { 15 15 16 function getDummyUrl() {17 return $this->getResponse(' default');16 function url1() { 17 return $this->getResponse('testunit'); 18 18 } 19 20 19 function url2() { 20 return $this->getResponse('testunit'); 21 } 22 function url3() { 23 return $this->getResponse('testunit'); 24 } 25 function url4() { 26 return $this->getResponse('testunit'); 27 } 28 function url5() { 29 return $this->getResponse('testunit'); 30 } 21 31 } 22 32 trunk/testapp/modules/unittest/classes/utcreateurls.class.php
r75 r98 65 65 66 66 $urlList=array(); 67 $urlList[]= array('url 1', array('mois'=>'10', 'annee'=>'2005', 'id'=>'35'));68 $urlList[]= array('url 2', array('mois'=>'05', 'annee'=>'2004'));69 $urlList[]= array('unittest~url 3', array('rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c\'est la f� au village'));70 $urlList[]= array('unittest~url 4', array('first'=>'premier', 'second'=>'deuxieme'));67 $urlList[]= array('urlsig_url1', array('mois'=>'10', 'annee'=>'2005', 'id'=>'35')); 68 $urlList[]= array('urlsig_url2', array('mois'=>'05', 'annee'=>'2004')); 69 $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c\'est la f� au village')); 70 $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier', 'second'=>'deuxieme')); 71 71 // celle ci n'a pas de d�nition dans urls.xml *expr� 72 $urlList[]= array('url 5', array('foo'=>'oof', 'bar'=>'rab'));72 $urlList[]= array('urlsig_url5', array('foo'=>'oof', 'bar'=>'rab')); 73 73 $urlList[]= array('foo~bar@xmlrpc', array('aaa'=>'bbb')); 74 74 75 75 $trueResult=array( 76 "index.php?mois=10&annee=2005&id=35&module=unittest&action=url 1",77 "testnews.php?mois=05&annee=2004&module=unittest&action=url 2",78 "testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=url 3",79 "foo/bar.php?first=premier&second=deuxieme&module=unittest&action=url 4",80 "index.php?foo=oof&bar=rab&module=unittest&action=url 5",76 "index.php?mois=10&annee=2005&id=35&module=unittest&action=urlsig_url1", 77 "testnews.php?mois=05&annee=2004&module=unittest&action=urlsig_url2", 78 "testnews.php?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=urlsig_url3", 79 "foo/bar.php?first=premier&second=deuxieme&module=unittest&action=urlsig_url4", 80 "index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 81 81 "xmlrpc.php", 82 82 ); … … 92 92 $gJConfig->urlengine['multiview']=true; 93 93 $trueResult=array( 94 "index?mois=10&annee=2005&id=35&module=unittest&action=url 1",95 "testnews?mois=05&annee=2004&module=unittest&action=url 2",96 "testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=url 3",97 "foo/bar?first=premier&second=deuxieme&module=unittest&action=url 4",98 "index?foo=oof&bar=rab&module=unittest&action=url 5",94 "index?mois=10&annee=2005&id=35&module=unittest&action=urlsig_url1", 95 "testnews?mois=05&annee=2004&module=unittest&action=urlsig_url2", 96 "testnews?rubrique=actualite&id_art=65&article=c%27est+la+f%EAte+au+village&module=unittest&action=urlsig_url3", 97 "foo/bar?first=premier&second=deuxieme&module=unittest&action=urlsig_url4", 98 "index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 99 99 "xmlrpc", 100 100 ); … … 130 130 131 131 $urlList=array(); 132 $urlList[]= array('url 1', array('mois'=>'10', 'annee'=>'2005', 'id'=>'35'));133 $urlList[]= array('url 2', array('mois'=>'05', 'annee'=>'2004'));134 $urlList[]= array('unittest~url 3', array('rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c\'est la f� au village'));135 $urlList[]= array('unittest~url 4', array('first'=>'premier', 'second'=>'deuxieme'));132 $urlList[]= array('urlsig_url1', array('mois'=>'10', 'annee'=>'2005', 'id'=>'35')); 133 $urlList[]= array('urlsig_url2', array('mois'=>'05', 'annee'=>'2004')); 134 $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c\'est la f� au village')); 135 $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier', 'second'=>'deuxieme')); 136 136 // celle ci n'a pas de d�nition dans urls.xml *expr� 137 $urlList[]= array('url 5', array('foo'=>'oof', 'bar'=>'rab'));137 $urlList[]= array('urlsig_url5', array('foo'=>'oof', 'bar'=>'rab')); 138 138 $urlList[]= array('foo~bar@xmlrpc', array('aaa'=>'bbb')); 139 139 $urlList[]= array('news~bar', array('aaa'=>'bbb')); … … 144 144 "index.php/test/cms/actualite/65-c-est-la-fete-au-village", 145 145 "foo/bar.php/withhandler/premier/deuxieme", 146 "index.php?foo=oof&bar=rab&module=unittest&action=url 5",146 "index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 147 147 "xmlrpc.php", 148 148 "news.php?aaa=bbb&action=bar" … … 163 163 "index/test/cms/actualite/65-c-est-la-fete-au-village", 164 164 "foo/bar/withhandler/premier/deuxieme", 165 "index?foo=oof&bar=rab&module=unittest&action=url 5",165 "index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 166 166 "xmlrpc", 167 167 "news?aaa=bbb&action=bar" trunk/testapp/modules/unittest/classes/utparseurls.class.php
r76 r98 59 59 60 60 $resultList=array(); 61 $resultList[]= array('module'=>'unittest', 'action'=>'url 1', 'mois'=>'10', 'annee'=>'2005', 'id'=>'35');62 $resultList[]= array('module'=>'unittest', 'action'=>'url 8', 'mois'=>'10', 'annee'=>'2005', 'id'=>'35');63 $resultList[]= array('module'=>'unittest', 'action'=>'url 2', 'mois'=>'05', 'annee'=>'2004', "mystatic"=>"valeur statique");64 $resultList[]= array('module'=>'unittest', 'action'=>'url 3', 'rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c est la fete au village');65 $resultList[]= array('module'=>'unittest', 'action'=>'url 4', 'first'=>'premier', 'second'=>'deuxieme');61 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url1', 'mois'=>'10', 'annee'=>'2005', 'id'=>'35'); 62 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url8', 'mois'=>'10', 'annee'=>'2005', 'id'=>'35'); 63 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url2', 'mois'=>'05', 'annee'=>'2004', "mystatic"=>"valeur statique"); 64 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url3', 'rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c est la fete au village'); 65 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url4', 'first'=>'premier', 'second'=>'deuxieme'); 66 66 // celle ci n'a pas de d�nition dans urls.xml *expr� 67 $resultList[]= array('module'=>'unittest', 'action'=>'url 5', 'foo'=>'oof', 'bar'=>'rab');67 $resultList[]= array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof', 'bar'=>'rab'); 68 68 $resultList[]= array(); 69 $resultList[]= array('module'=>'news', 'action'=>' bar', 'aaa'=>'bbb');69 $resultList[]= array('module'=>'news', 'action'=>'main_bar', 'aaa'=>'bbb'); 70 70 71 71 $request=array( 72 72 array("index.php","/test/news/2005/10/35",array()), 73 array("index.php","/test/news/2005/10/35",array("action"=>"url 8")),73 array("index.php","/test/news/2005/10/35",array("action"=>"urlsig_url8")), 74 74 array("testnews.php","/2004/05",array()), 75 75 array("index.php","/test/cms/actualite/65-c-est-la-fete-au-village",array()), 76 76 array("foo/bar.php","/withhandler/premier/deuxieme",array()), 77 array("index.php",'',array('module'=>'unittest', 'action'=>'url 5', 'foo'=>'oof', 'bar'=>'rab')),77 array("index.php",'',array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof', 'bar'=>'rab')), 78 78 array("xmlrpc.php","",array()), 79 array("news.php","",array('aaa'=>'bbb','action'=>' bar'))79 array("news.php","",array('aaa'=>'bbb','action'=>'main_bar')) 80 80 ); 81 81 … … 95 95 $request=array( 96 96 array("index","/test/news/2005/10/35",array()), 97 array("index","/test/news/2005/10/35",array("action"=>"url 8")),97 array("index","/test/news/2005/10/35",array("action"=>"urlsig_url8")), 98 98 array("testnews","/2004/05",array()), 99 99 array("index","/test/cms/actualite/65-c-est-la-fete-au-village",array()), 100 100 array("foo/bar","/withhandler/premier/deuxieme",array()), 101 array("index",'',array('module'=>'unittest', 'action'=>'url 5', 'foo'=>'oof', 'bar'=>'rab')),101 array("index",'',array('module'=>'unittest', 'action'=>'urlsig_url5', 'foo'=>'oof', 'bar'=>'rab')), 102 102 array("xmlrpc","",array()), 103 array("news","",array('aaa'=>'bbb','action'=>' bar'))103 a
