Changeset 691
- Timestamp:
- 12/11/07 23:53:59 (1 year ago)
- Files:
-
- trunk/build/buildjelix.php (modified) (2 diffs)
- trunk/build/buildjelix.php (modified) (2 diffs)
- trunk/build/config/jelix-dist-dev.ini (modified) (1 diff)
- trunk/build/config/jelix-dist-dev.ini (modified) (1 diff)
- trunk/build/config/jelix-dist-gold.ini (modified) (1 diff)
- trunk/build/config/jelix-dist-gold.ini (modified) (1 diff)
- trunk/build/config/jelix-dist-opt.ini (modified) (1 diff)
- trunk/build/config/jelix-dist-opt.ini (modified) (1 diff)
- trunk/build/config/jelix-test.ini (modified) (1 diff)
- trunk/build/config/jelix-test.ini (modified) (1 diff)
- trunk/build/manifests/jelix-ext-php.mn (modified) (1 diff)
- trunk/build/manifests/jelix-ext-php.mn (modified) (1 diff)
- trunk/build/manifests/jelix-lib.mn (modified) (3 diffs)
- trunk/build/manifests/jelix-lib.mn (modified) (3 diffs)
- trunk/build/manifests/testapp.mn (modified) (2 diffs)
- trunk/build/manifests/testapp.mn (modified) (2 diffs)
- trunk/ext/jelix/jelix.c (modified) (3 diffs)
- trunk/ext/jelix/jelix.c (modified) (3 diffs)
- trunk/ext/jelix/php_jelix.h (modified) (1 diff)
- trunk/ext/jelix/php_jelix.h (modified) (1 diff)
- trunk/ext/jelix/tests/scan_action_sel_001.phpt (modified) (50 diffs)
- trunk/ext/jelix/tests/scan_action_sel_001.phpt (modified) (50 diffs)
- trunk/ext/jelix/tests/scan_action_sel_002.phpt (modified) (1 diff)
- trunk/ext/jelix/tests/scan_action_sel_002.phpt (modified) (1 diff)
- trunk/ext/jelix/tests/scan_old_action_sel_001.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_001.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_002.phpt (added)
- trunk/ext/jelix/tests/scan_old_action_sel_002.phpt (added)
- trunk/lib/jelix-modules/jauth/templates/login.form.tpl (modified) (1 diff)
- trunk/lib/jelix-modules/jauth/templates/login.form.tpl (modified) (1 diff)
- trunk/lib/jelix-modules/junittests/templates/main.tpl (modified) (2 diffs)
- trunk/lib/jelix-modules/junittests/templates/main.tpl (modified) (2 diffs)
- trunk/lib/jelix-scripts/templates/var/config/cmdline/config.ini.php.tpl (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/defaultconfig.ini.php.tpl (modified) (2 diffs)
- trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl (modified) (2 diffs)
- trunk/lib/jelix-scripts/templates/var/config/index/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/jsonrpc/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/xmlrpc/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/xmlrpc/config.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (2 diffs)
- trunk/lib/jelix/controllers/jControllerDaoCrud.class.php (modified) (2 diffs)
- trunk/lib/jelix/core-modules/jelix/controllers/help.cmdline.php (modified) (2 diffs)
- trunk/lib/jelix/core-modules/jelix/controllers/help.cmdline.php (modified) (2 diffs)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (4 diffs)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (4 diffs)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jSelector.class.php (modified) (8 diffs)
- trunk/lib/jelix/core/jSelector.class.php (modified) (8 diffs)
- trunk/lib/jelix/core/jUrl.class.php (modified) (6 diffs)
- trunk/lib/jelix/core/jUrl.class.php (modified) (6 diffs)
- trunk/lib/jelix/core/request/jCmdLineRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/request/jCmdLineRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/request/jXmlRpcRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/request/jXmlRpcRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/lib/jelix/init.php (modified) (1 diff)
- trunk/lib/jelix/init.php (modified) (1 diff)
- trunk/lib/jelix/plugins/coord/auth/auth.coord.ini.php.dist (modified) (1 diff)
- trunk/lib/jelix/plugins/coord/auth/auth.coord.ini.php.dist (modified) (1 diff)
- trunk/lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/urls/significant/jSignificantUrlsCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/plugins/urls/significant/significant.urls.php (modified) (5 diffs)
- trunk/lib/jelix/plugins/urls/significant/significant.urls.php (modified) (5 diffs)
- trunk/lib/jelix/plugins/urls/simple/simple.urls.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/urls/simple/simple.urls.php (modified) (2 diffs)
- trunk/lib/jelix/tpl/jTpl.class.php (modified) (1 diff)
- trunk/lib/jelix/tpl/jTpl.class.php (modified) (1 diff)
- trunk/myapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
- trunk/myapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
- trunk/myapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/myapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/templates/menu.tpl (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/templates/menu.tpl (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/core.old_selectors_action.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_selectors_action.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.selectors_action.html.php (modified) (8 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.selectors_action.html.php (modified) (8 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_generation.html.php (modified) (14 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_generation.html.php (modified) (14 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_parsing.html.php (modified) (9 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_parsing.html.php (modified) (9 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php (modified) (5 diffs)
- trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php (modified) (5 diffs)
- trunk/testapp/modules/testapp/controllers/forms.classic.php (modified) (4 diffs)
- trunk/testapp/modules/testapp/controllers/forms.classic.php (modified) (4 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (3 diffs)
- trunk/testapp/modules/testapp/controllers/sampleform.classic.php (modified) (3 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_edit.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_liste.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_liste.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/forms_view.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/forms_view.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello2.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/hello2.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sampleform.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/sommaire.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/sommaire.tpl (modified) (2 diffs)
- trunk/testapp/modules/testapp/templates/testzone.tpl (modified) (1 diff)
- trunk/testapp/modules/testapp/templates/testzone.tpl (modified) (1 diff)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (4 diffs)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (4 diffs)
- trunk/testapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/jsonrpc/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/jsonrpc/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/urls.xml (modified) (4 diffs)
- trunk/testapp/var/config/urls.xml (modified) (4 diffs)
- trunk/testapp/var/config/urls_old.xml (added)
- trunk/testapp/var/config/urls_old.xml (added)
- trunk/testapp/var/config/xmlrpc/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/xmlrpc/config.ini.php (modified) (1 diff)
- trunk/testapp/var/themes/default/junittests/main.tpl (modified) (2 diffs)
- trunk/testapp/var/themes/default/junittests/main.tpl (modified) (2 diffs)
- trunk/testapp/var/themes/default/testapp/hello2.tpl (modified) (1 diff)
- trunk/testapp/var/themes/default/testapp/hello2.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/buildjelix.php
r676 r691 65 65 ), 66 66 'ENABLE_OLD_CLASS_NAMING'=>array( 67 "old module class naming (jelix <= 1.0a5) can be used. deprecated for Jelix 1.0.", 68 false, 67 "old module class naming (jelix <= 1.0a5) can be used. deprecated for Jelix 1.0 and higher.", 68 false, 69 ), 70 'ENABLE_OLD_ACTION_SELECTOR'=>array( 71 "old action selector can be used. deprecated for Jelix 1.1 and higher.", 72 true, 69 73 ), 70 74 'INCLUDE_ALL_FONTS'=>array( … … 222 226 $view = array('EDITION_NAME', 'PHP_VERSION_TARGET', 'SVN_REVISION', 'ENABLE_PHP_FILTER', 223 227 'ENABLE_PHP_JSON', 'ENABLE_PHP_XMLRPC','ENABLE_PHP_JELIX', 'WITH_BYTECODE_CACHE', 'ENABLE_DEVELOPER', 224 'ENABLE_OPTIMIZED_SOURCE', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING' );228 'ENABLE_OPTIMIZED_SOURCE', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING', 'ENABLE_OLD_ACTION_SELECTOR' ); 225 229 226 230 $infos = '; --- build date: '.date('Y-m-d H:i')."\n; --- lib version: $LIB_VERSION\n".ENV::getIniContent($view); trunk/build/buildjelix.php
r676 r691 65 65 ), 66 66 'ENABLE_OLD_CLASS_NAMING'=>array( 67 "old module class naming (jelix <= 1.0a5) can be used. deprecated for Jelix 1.0.", 68 false, 67 "old module class naming (jelix <= 1.0a5) can be used. deprecated for Jelix 1.0 and higher.", 68 false, 69 ), 70 'ENABLE_OLD_ACTION_SELECTOR'=>array( 71 "old action selector can be used. deprecated for Jelix 1.1 and higher.", 72 true, 69 73 ), 70 74 'INCLUDE_ALL_FONTS'=>array( … … 222 226 $view = array('EDITION_NAME', 'PHP_VERSION_TARGET', 'SVN_REVISION', 'ENABLE_PHP_FILTER', 223 227 'ENABLE_PHP_JSON', 'ENABLE_PHP_XMLRPC','ENABLE_PHP_JELIX', 'WITH_BYTECODE_CACHE', 'ENABLE_DEVELOPER', 224 'ENABLE_OPTIMIZED_SOURCE', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING' );228 'ENABLE_OPTIMIZED_SOURCE', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING', 'ENABLE_OLD_ACTION_SELECTOR' ); 225 229 226 230 $infos = '; --- build date: '.date('Y-m-d H:i')."\n; --- lib version: $LIB_VERSION\n".ENV::getIniContent($view); trunk/build/config/jelix-dist-dev.ini
r676 r691 18 18 PACKAGE_ZIP = 1 19 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-dist-dev.ini
r676 r691 18 18 PACKAGE_ZIP = 1 19 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-dist-gold.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 1 18 18 PACKAGE_ZIP = 1 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-dist-gold.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 1 18 18 PACKAGE_ZIP = 1 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-dist-opt.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 1 18 18 PACKAGE_ZIP = 1 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-dist-opt.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 1 18 18 PACKAGE_ZIP = 1 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-test.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 18 18 PACKAGE_ZIP = 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/config/jelix-test.ini
r676 r691 17 17 PACKAGE_TAR_GZ = 18 18 PACKAGE_ZIP = 19 20 ENABLE_OLD_ACTION_SELECTOR = 1 trunk/build/manifests/jelix-ext-php.mn
r476 r691 8 8 clean.sh 9 9 EXPERIMENTAL 10 jelix.c11 php_jelix.h12 10 CREDITS 13 11 LICENCE 12 INSTALL 14 13 TODO 14 php_jelix.h 15 15 jelix_interfaces.c 16 INSTALL17 16 jelix_interfaces.h 17 jelix.c 18 18 cd ext/jelix/tests 19 jirestcontroller_001.phpt20 scan_action_sel_002.phpt21 version_001.phpt19 001.phpt 20 jelix2.ini 21 jelix_const_001.phpt 22 22 jelix.ini 23 23 jiauthdriver_001.phpt 24 24 jiauthdriver_002.phpt 25 jicoordplugin_001.phpt 26 jicoordplugin_002.phpt 27 jicoordplugin_003.phpt 28 jimultifilecompiler_001.phpt 29 jimultifilecompiler_002.phpt 30 jirestcontroller_001.phpt 31 jirestcontroller_002.phpt 25 32 jiselector_001.phpt 26 33 jiselector_002.phpt 27 jelix2.ini28 001.phpt29 jirestcontroller_002.phpt30 34 jisimplecompiler_001.phpt 31 jimultifilecompiler_001.phpt32 35 jisimplecompiler_002.phpt 33 jimultifilecompiler_002.phpt 36 jiurlengine_001.phpt 37 jiurlengine_002.phpt 34 38 read_ini_001.phpt 35 jiurlengine_001.phpt36 39 read_ini_002.phpt 37 jiurlengine_002.phpt38 40 read_ini_003.phpt 41 scan_action_sel_001.phpt 42 scan_action_sel_002.phpt 43 scan_class_sel_001.phpt 44 scan_locale_sel_001.phpt 39 45 scan_module_sel_001.phpt 40 jicoordplugin_001.phpt41 jelix_const_001.phpt42 jicoordplugin_002.phpt43 jicoordplugin_003.phpt44 46 scan_module_sel_002.phpt 45 scan_action_sel_001.phpt 47 scan_old_action_sel_001.phpt 48 scan_old_action_sel_002.phpt 49 version_001.phpt trunk/build/manifests/jelix-ext-php.mn
r476 r691 8 8 clean.sh 9 9 EXPERIMENTAL 10 jelix.c11 php_jelix.h12 10 CREDITS 13 11 LICENCE 12 INSTALL 14 13 TODO 14 php_jelix.h 15 15 jelix_interfaces.c 16 INSTALL17 16 jelix_interfaces.h 17 jelix.c 18 18 cd ext/jelix/tests 19 jirestcontroller_001.phpt20 scan_action_sel_002.phpt21 version_001.phpt19 001.phpt 20 jelix2.ini 21 jelix_const_001.phpt 22 22 jelix.ini 23 23 jiauthdriver_001.phpt 24 24 jiauthdriver_002.phpt 25 jicoordplugin_001.phpt 26 jicoordplugin_002.phpt 27 jicoordplugin_003.phpt 28 jimultifilecompiler_001.phpt 29 jimultifilecompiler_002.phpt 30 jirestcontroller_001.phpt 31 jirestcontroller_002.phpt 25 32 jiselector_001.phpt 26 33 jiselector_002.phpt 27 jelix2.ini28 001.phpt29 jirestcontroller_002.phpt30 34 jisimplecompiler_001.phpt 31 jimultifilecompiler_001.phpt32 35 jisimplecompiler_002.phpt 33 jimultifilecompiler_002.phpt 36 jiurlengine_001.phpt 37 jiurlengine_002.phpt 34 38 read_ini_001.phpt 35 jiurlengine_001.phpt36 39 read_ini_002.phpt 37 jiurlengine_002.phpt38 40 read_ini_003.phpt 41 scan_action_sel_001.phpt 42 scan_action_sel_002.phpt 43 scan_class_sel_001.phpt 44 scan_locale_sel_001.phpt 39 45 scan_module_sel_001.phpt 40 jicoordplugin_001.phpt41 jelix_const_001.phpt42 jicoordplugin_002.phpt43 jicoordplugin_003.phpt44 46 scan_module_sel_002.phpt 45 scan_action_sel_001.phpt 47 scan_old_action_sel_001.phpt 48 scan_old_action_sel_002.phpt 49 version_001.phpt trunk/build/manifests/jelix-lib.mn
r687 r691 27 27 cd lib/jelix/controllers 28 28 jControllerCmdLine.class.php 29 jControllerDaoCrud.class.php29 * jControllerDaoCrud.class.php 30 30 31 31 cd lib/jelix/core … … 36 36 cd lib/jelix/core/request 37 37 jClassicRequest.class.php 38 jCmdLineRequest.class.php38 * jCmdLineRequest.class.php 39 39 jJsonRpcRequest.class.php 40 40 jXmlRpcRequest.class.php … … 389 389 390 390 cd lib/jelix/plugins/urls/significant 391 jSignificantUrlsCompiler.class.php391 * jSignificantUrlsCompiler.class.php 392 392 * significant.urls.php 393 393 cd lib/jelix/plugins/urls/simple trunk/build/manifests/jelix-lib.mn
r687 r691 27 27 cd lib/jelix/controllers 28 28 jControllerCmdLine.class.php 29 jControllerDaoCrud.class.php29 * jControllerDaoCrud.class.php 30 30 31 31 cd lib/jelix/core … … 36 36 cd lib/jelix/core/request 37 37 jClassicRequest.class.php 38 jCmdLineRequest.class.php38 * jCmdLineRequest.class.php 39 39 jJsonRpcRequest.class.php 40 40 jXmlRpcRequest.class.php … … 389 389 390 390 cd lib/jelix/plugins/urls/significant 391 jSignificantUrlsCompiler.class.php391 * jSignificantUrlsCompiler.class.php 392 392 * significant.urls.php 393 393 cd lib/jelix/plugins/urls/simple trunk/build/manifests/testapp.mn
r690 r691 104 104 core.jlocale.html.php 105 105 core.selectors_action.html.php 106 core.old_selectors_action.html.php 106 107 core.selectors_module.html.php 107 108 core.urls_generation.html.php 109 core.old_urls_generation.html.php 108 110 core.urls_parsing.html.php 111 core.old_urls_parsing.html.php 109 112 events.simple_test.html.php 110 113 jacl.main_api.html.php … … 143 146 dbprofils.ini.php.dist 144 147 urls.xml 148 urls_old.xml 145 149 cd testapp/var/config/index 146 150 config.ini.php trunk/build/manifests/testapp.mn
r690 r691 104 104 core.jlocale.html.php 105 105 core.selectors_action.html.php 106 core.old_selectors_action.html.php 106 107 core.selectors_module.html.php 107 108 core.urls_generation.html.php 109 core.old_urls_generation.html.php 108 110 core.urls_parsing.html.php 111 core.old_urls_parsing.html.php 109 112 events.simple_test.html.php 110 113 jacl.main_api.html.php … … 143 146 dbprofils.ini.php.dist 144 147 urls.xml 148 urls_old.xml 145 149 cd testapp/var/config/index 146 150 config.ini.php trunk/ext/jelix/jelix.c
r669 r691 33 33 PHP_FE(jelix_scan_module_sel, NULL) 34 34 PHP_FE(jelix_scan_action_sel, NULL) 35 PHP_FE(jelix_scan_old_action_sel, NULL) 35 36 PHP_FE(jelix_scan_class_sel, NULL) 36 37 PHP_FE(jelix_scan_locale_sel, NULL) … … 412 413 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 413 414 */ 414 PHP_FUNCTION(jelix_scan_ action_sel)415 PHP_FUNCTION(jelix_scan_old_action_sel) 415 416 { 416 417 zval **selectorStr, **objectArg, **defaultActionArg; … … 651 652 /* }}} */ 652 653 654 655 /* {{{ proto boolean jelix_scan_action_sel(string arg, object tofill *) 656 scan a string as a jelix selector, and fill object properties with founded values 657 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_:]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 658 */ 659 PHP_FUNCTION(jelix_scan_action_sel) 660 { 661 zval **selectorStr, **objectArg, **defaultActionArg; 662 int length; 663 char * sel, *cursor, *module, *resource, *request; 664 665 666 if(ZEND_NUM_ARGS() != 3) { 667 ZEND_WRONG_PARAM_COUNT(); 668 } 669 if (zend_get_parameters_ex(3, &selectorStr, &objectArg, &defaultActionArg) == FAILURE) { 670 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read arguments"); 671 RETURN_FALSE; 672 } 673 674 if(Z_TYPE_P(*objectArg) != IS_OBJECT){ 675 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid second argument, not an object"); 676 RETURN_FALSE 677 } 678 if(Z_TYPE_P(*defaultActionArg) != IS_STRING){ 679 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid third argument, not a string"); 680 RETURN_FALSE 681 } 682 683 int module_length=0; 684 int resource_length=0; 685 int request_length=0; 686 int cursor_count=0; 687 688 convert_to_string_ex(selectorStr); 689 length = Z_STRLEN_PP(selectorStr); 690 sel = Z_STRVAL_PP(selectorStr); 691 692 cursor_count=0; 693 cursor = module = resource = sel; 694 695 int error = 0; 696 int sharpOk = 0; 697 int hasRequest=0; 698 int firstDashPos = -1; 699 int hasDot = 0; 700 701 // parse the module part 702 while(cursor_count < length){ 703 if(*cursor == '~' || *cursor == '@'){ 704 break; 705 } 706 if(*cursor == '#'){ 707 if(sharpOk || module_length > 1){ 708 RETURN_FALSE 709 } 710 sharpOk=1; 711 }else if(*cursor == '.'){ 712 hasDot = 1; 713 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 714 || ( *cursor >= 'A' && *cursor <= 'Z') 715 || ( *cursor >= '0' && *cursor <= '9') 716 || *cursor == '_' || *cursor == ':' ) || sharpOk){ 717 RETURN_FALSE 718 } 719 if(*cursor == ':' && firstDashPos == -1){ 720 firstDashPos = module_length; 721 } 722 723 module_length ++; 724 cursor_count ++; 725 cursor++; 726 } 727 728 if(cursor_count >= length){ 729 // we don't find any '~' characters, so we have parsed the resource 730 if(hasDot) RETURN_FALSE 731 732 resource_length = module_length; 733 module_length = 0; 734 }else if( *cursor == '@'){ 735 // we don't find any '~' characters, so we have parsed the resource 736 if(hasDot) RETURN_FALSE 737 738 resource_length = module_length; 739 module_length = 0; 740 hasRequest = 1; 741 // now we parse the @ section 742 cursor_count ++; 743 cursor++; 744 745 request = cursor; 746 request_length = 0; 747 while(cursor_count < length){ 748 if(!( ( *cursor >= 'a' && *cursor <= 'z') 749 || ( *cursor >= 'A' && *cursor <= 'Z') 750 || ( *cursor >= '0' && *cursor <= '9') 751 || *cursor == '_' || *cursor == ':' || *cursor == '.')){ 752 RETURN_FALSE 753 } 754 request_length ++; 755 cursor_count ++; 756 cursor++; 757 } 758 }else{ 759 // the string starts by a ~ : it's not really a problem, but we generate an error 760 // to keep compatibily with php version of selectors. 761 if(module_length == 0){ 762 RETURN_FALSE 763 } 764 firstDashPos=-1; 765 cursor_count++; 766 cursor++; 767 resource = cursor; 768 resource_length = 0; 769 sharpOk = 0; 770 while(cursor_count < length){ 771 if(*cursor == '@'){ 772 break; 773 } 774 775 if(*cursor == '#'){ 776 if(sharpOk || resource_length > 1){ 777 RETURN_FALSE 778 } 779 sharpOk=1; 780 }else if(!( ( *cursor >= 'a' && *cursor <= 'z') 781 || ( *cursor >= 'A' && *cursor <= 'Z') 782 || ( *cursor >= '0' && *cursor <= '9') 783 || *cursor == '_' || *cursor == ':') || sharpOk){ 784 RETURN_FALSE 785 } 786 if(*cursor == ':' && firstDashPos == -1){ 787 firstDashPos = resource_length; 788 } 789 790 resource_length ++; 791 cursor_count ++; 792 cursor++; 793 } 794 795 if(*cursor == '@'){ 796 hasRequest = 1; 797 cursor_count++; 798 cursor++; 799 request = cursor; 800 request_length = 0; 801 while(cursor_count < length){ 802 if(!( ( *cursor >= 'a' && *cursor <= 'z') 803 || ( *cursor >= 'A' && *cursor <= 'Z') 804 || ( *cursor >= '0' && *cursor <= '9') 805 || *cursor == '_' || *cursor == '.')){ 806 RETURN_FALSE 807 } 808 request_length ++; 809 cursor_count ++; 810 cursor++; 811 } 812 } 813 } 814 815 // request shouldn't empty if there is a @ 816 if(hasRequest && request_length == 0){ 817 RETURN_FALSE 818 } 819 820 if(resource_length == 0){ 821 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, "default_index", sizeof("default_index")-1 TSRMLS_CC); 822 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 823 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 824 }else{ 825 if(resource_length == 1 && *resource == '#'){ 826 resource_length = Z_STRLEN_PP(defaultActionArg); 827 resource = Z_STRVAL_PP(defaultActionArg); 828 firstDashPos=-1; 829 int i; 830 for(i=0; i < resource_length;i++){ 831 if(resource[i] == '_'){ 832 firstDashPos=i; 833 break; 834 } 835 } 836 } 837 838 if(firstDashPos == -1){ 839 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 840 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource, resource_length TSRMLS_CC); 841 842 char *r; 843 int ld = sizeof("default:") -1; 844 int lr = ld + resource_length; 845 r= emalloc(lr+1); 846 if (r) { 847 memcpy(r, "default:", ld); 848 memcpy(r+ld, resource, resource_length); 849 r[lr] = 0; 850 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 851 efree(r); 852 } 853 854 }else if(firstDashPos == 0){ 855 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, "default", sizeof("default")-1 TSRMLS_CC); 856 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+1, resource_length-1 TSRMLS_CC); 857 858 char *r; 859 int ld = sizeof("default") -1; 860 int lr = ld + resource_length; 861 r= emalloc(lr+1); 862 if (r) { 863 memcpy(r, "default", ld); 864 memcpy(r+ld, resource, resource_length); 865 r[lr] = 0; 866 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 867 efree(r); 868 } 869 870 }else if(firstDashPos == resource_length-1){ 871 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, resource_length-1 TSRMLS_CC); 872 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, "index", sizeof("index")-1 TSRMLS_CC); 873 char *r; 874 int ld = sizeof("index") -1; 875 int lr = resource_length + ld; 876 r= emalloc(lr+1); 877 if (r) { 878 memcpy(r, resource, resource_length); 879 memcpy(r+resource_length, "index", ld); 880 r[lr] = 0; 881 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, r, lr TSRMLS_CC); 882 efree(r); 883 } 884 885 }else{ 886 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "controller", sizeof("controller") - 1, resource, firstDashPos TSRMLS_CC); 887 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "method", sizeof("method") - 1, resource+firstDashPos+1, resource_length-firstDashPos-1 TSRMLS_CC); 888 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "resource", sizeof("resource") - 1, resource, resource_length TSRMLS_CC); 889 } 890 } 891 892 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "module", sizeof("module") - 1, module, module_length TSRMLS_CC); 893 zend_update_property_stringl(Z_OBJCE_P(*objectArg), *objectArg, "request", sizeof("request") - 1, request, request_length TSRMLS_CC); 894 RETURN_TRUE 895 } 896 /* }}} */ 897 898 653 899 /* {{{ proto boolean jelix_scan_class_sel(string arg, object tofill *) 654 900 scan a string as a jelix selector, and fill object properties with founded values trunk/ext/jelix/jelix.c
r669 r691 33 33 PHP_FE(jelix_scan_module_sel, NULL) 34 34 PHP_FE(jelix_scan_action_sel, NULL) 35 PHP_FE(jelix_scan_old_action_sel, NULL) 35 36 PHP_FE(jelix_scan_class_sel, NULL) 36 37 PHP_FE(jelix_scan_locale_sel, NULL) … … 412 413 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 413 414 */ 414 PHP_FUNCTION(jelix_scan_ action_sel)415 PHP_FUNCTION(jelix_scan_old_action_sel) 415 416 { 416 417 zval **selectorStr, **objectArg, **defaultActionArg; … … 651 652 /* }}} */ 652 653 654 655 /* {{{ proto boolean jelix_scan_action_sel(string arg, object tofill *) 656 scan a string as a jelix selector, and fill object properties with founded values 657 /^(?:([a-zA-Z0-9_\.]+|\#)~)?([a-zA-Z0-9_:]+|\#)?(?:@([a-zA-Z0-9_]+))?$/ 658 */ 659 PHP_FUNCTION(jelix_scan_action_sel) 660 { 661 zval **selectorStr, **objectArg, **defaultActionArg; 662 int length; 663 char * sel, *cursor, *module, *resource, *request; 664 665 666 if(ZEND_NUM_ARGS() != 3) { 667 ZEND_WRONG_PARAM_COUNT(); 668 } 669 if (zend_get_parameters_ex(3, &selectorStr, &objectArg, &defaultActionArg) == FAILURE) { 670 php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot read arguments"); 671 RETURN_FALSE; 672 } 673 674 if(Z_TYPE_P(*objectArg) != IS_OBJECT){
