Changeset 357
- Timestamp:
- 01/24/07 02:21:28 (2 years ago)
- Files:
-
- trunk/build/buildjelix.php (modified) (6 diffs)
- trunk/build/config/jelix-dist-dev.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/lib/jBuild.inc.php (modified) (1 diff)
- trunk/build/manifests/jelix-lib.mn (modified) (1 diff)
- trunk/build/manifests/jelix-no-ext.mn (added)
- trunk/build/manifests/jelix-no-opt.mn (modified) (2 diffs)
- trunk/lib/jelix/auth/jAuth.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jConfig.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (9 diffs)
- trunk/lib/jelix/core/jController.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jIncluder.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jSelector.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/url/jUrl.class.php (modified) (2 diffs)
- trunk/lib/jelix/dao/jDaoCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/db/jDb.class.php (modified) (1 diff)
- trunk/lib/jelix/events/jEvent.class.php (modified) (1 diff)
- trunk/lib/jelix/init.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/buildjelix.php
r348 r357 35 35 false, 36 36 ), 37 'ENABLE_PHP_JELIX'=>array( 38 "true if jelix can use jelix php extension. WARNING ! EXPERIMENTAL !", 39 false, 40 ), 37 41 'WITH_BYTECODE_CACHE'=> array( 38 42 "says which bytecode cache engine will be recognized by jelix. Possible values : 'auto' (automatic detection), 'apc', 'eaccelerator' or '' for none", … … 44 48 true, 45 49 ), 46 'ENABLE_OPTIMIZE '=>array(47 "true if you want on optimized version of jelix, for production server",50 'ENABLE_OPTIMIZED_SOURCE'=>array( 51 "true if you want on optimized version of source code, for production server", 48 52 false, 49 53 ), … … 118 122 } 119 123 120 if(!$ENABLE_OPTIMIZE )124 if(!$ENABLE_OPTIMIZED_SOURCE) 121 125 $STRIP_COMMENT=''; 122 126 … … 130 134 $PACKAGE_NAME.='-php'.$PHP_VERSION_TARGET; 131 135 132 if($ENABLE_OPTIMIZE && $ENABLE_DEVELOPER)136 if($ENABLE_OPTIMIZED_SOURCE && $ENABLE_DEVELOPER) 133 137 $PACKAGE_NAME.='-optdev'; 134 elseif($ENABLE_OPTIMIZE )138 elseif($ENABLE_OPTIMIZED_SOURCE) 135 139 $PACKAGE_NAME.='-opt'; 136 140 elseif($ENABLE_DEVELOPER) … … 150 154 //... execution des manifests 151 155 jManifest::process('build/manifests/jelix-lib.mn', '.', $BUILD_TARGET_PATH, ENV::getAll(), $STRIP_COMMENT); 152 if(!$ENABLE_OPTIMIZE ){156 if(!$ENABLE_OPTIMIZED_SOURCE){ 153 157 jManifest::process('build/manifests/jelix-no-opt.mn', '.', $BUILD_TARGET_PATH , ENV::getAll(), $STRIP_COMMENT); 154 158 } 159 if(!$ENABLE_PHP_JELIX && !$ENABLE_OPTIMIZED_SOURCE){ 160 jManifest::process('build/manifests/jelix-no-ext.mn', '.', $BUILD_TARGET_PATH , ENV::getAll(), $STRIP_COMMENT); 161 } 162 155 163 if($ENABLE_DEVELOPER){ 156 164 jManifest::process('build/manifests/jelix-dev.mn', '.', $BUILD_TARGET_PATH , ENV::getAll()); … … 167 175 $view = array('PHP_VERSION_TARGET', 'LIB_VERSION', 'SVN_REVISION', 'ENABLE_PHP_FILTER', 168 176 'ENABLE_PHP_JSON', 'ENABLE_PHP_XMLRPC', 'WITH_BYTECODE_CACHE', 'ENABLE_DEVELOPER', 169 'ENABLE_OPTIMIZE ', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING' );177 'ENABLE_OPTIMIZED_SOURCE', 'STRIP_COMMENT', 'ENABLE_OLD_CLASS_NAMING' ); 170 178 171 179 $infos = 'BUILD_DATE= "'.date('Y-m-d H:i')."\"\n".ENV::getIniContent($view); trunk/build/config/jelix-dist-dev.ini
r314 r357 4 4 PACKAGE_ZIP = 1 5 5 STRIP_COMMENT = 6 ENABLE_OPTIMIZE =6 ENABLE_OPTIMIZED_SOURCE = 7 7 ENABLE_DEVELOPER = 1 8 8 ENABLE_PHP_FILTER = trunk/build/config/jelix-dist-opt.ini
r314 r357 8 8 PACKAGE_ZIP = 1 9 9 STRIP_COMMENT = 1 10 ENABLE_OPTIMIZE = 110 ENABLE_OPTIMIZED_SOURCE = 1 11 11 ENABLE_OLD_CLASS_NAMING = 1 trunk/build/config/jelix-test.ini
r314 r357 8 8 PACKAGE_ZIP = 9 9 STRIP_COMMENT = 10 ENABLE_OPTIMIZE =10 ENABLE_OPTIMIZED_SOURCE = 11 11 ENABLE_OLD_CLASS_NAMING = 1 trunk/build/lib/jBuild.inc.php
r347 r357 69 69 self::storeValue($k,$v); 70 70 }else{ 71 echo "warning: unknow option name ($ name) in the ini file\n";71 echo "warning: unknow option name ($k) in the ini file\n"; 72 72 } 73 73 } trunk/build/manifests/jelix-lib.mn
r354 r357 14 14 15 15 cd lib/jelix/auth 16 jAuth.class.php16 * jAuth.class.php 17 17 jAuthDriverDb.class.php 18 18 jAuthDriverClass.class.php trunk/build/manifests/jelix-no-opt.mn
r345 r357 2 2 * jConfig.class.php 3 3 jContext.class.php 4 jController.class.php4 * jController.class.php 5 5 jCoordinator.class.php 6 6 jErrorHandler.lib.php 7 7 jException.lib.php 8 jIncluder.class.php 9 jIPlugin.iface.php 8 * jIncluder.class.php 10 9 jLocale.class.php 11 10 jRequest.class.php … … 14 13 15 14 cd lib/jelix/core/url 16 jUrl.class.php15 * jUrl.class.php 17 16 18 17 cd lib/jelix/db trunk/lib/jelix/auth/jAuth.class.php
r339 r357 14 14 * 15 15 */ 16 16 #ifnot ENABLE_PHP_JELIX 17 17 /** 18 18 * interface for auth drivers … … 90 90 } 91 91 92 92 #endif 93 93 94 94 /** trunk/lib/jelix/core/jConfig.class.php
r345 r357 58 58 if(BYTECODE_CACHE_EXISTS){ 59 59 include($file); 60 $config = (object) $config; 60 61 }else{ 62 #if ENABLE_PHP_JELIX 63 $config = jelix_read_ini($file); 64 #else 61 65 $config = parse_ini_file($file,true); 66 $config = (object) $config; 67 #endif 62 68 } 63 69 #elseif WITH_BYTECODE_CACHE 64 70 include($file); 71 $config = (object) $config; 72 #else 73 #if ENABLE_PHP_JELIX 74 $config = jelix_read_ini($file); 65 75 #else 66 76 $config = parse_ini_file($file,true); 77 $config = (object) $config; 67 78 #endif 68 $config = (object) $config; 79 #endif 69 80 70 81 if($config->compilation['checkCacheFiletime']){ trunk/lib/jelix/core/jConfigCompiler.class.php
r345 r357 28 28 */ 29 29 static public function read($configFile){ 30 31 if(preg_match("/^(\w+).*$/", PHP_OS, $m)){ 32 $os=$m[1]; 33 }else{ 34 $os=PHP_OS; 35 } 36 37 #if ENABLE_PHP_JELIX 38 $config = jelix_read_ini(JELIX_LIB_CORE_PATH.'defaultconfig.ini.php'); 39 40 @jelix_read_ini(JELIX_APP_CONFIG_PATH.'defaultconfig.ini.php',$config); 41 42 if($configFile !='defaultconfig.ini.php'){ 43 if(!file_exists(JELIX_APP_CONFIG_PATH.$configFile)) 44 die("Jelix config file $configFile is missing !"); 45 if( false === @jelix_read_ini(JELIX_APP_CONFIG_PATH.$configFile,$config))) 46 die("Syntax error in the Jelix config file $configFile !"); 47 } 48 $config->OS = $os; 49 $os=strtolower($os); 50 $config->isWindows = ((strpos($os,'win')!== false) && (strpos($os,'darwin')=== false)); 51 if(trim( $config->defaultAction) == '') 52 $config->defaultAction = '_'; 53 54 $config->_pluginsPathList = self::_loadPathList($config->pluginsPath); 55 $config->_modulesPathList = self::_loadPathList($config->modulesPath); 56 57 self::_loadTplPathList($config, 'tplpluginsPath'); 58 59 if($config->checkTrustedModules){ 60 $config->_trustedModules = explode(',',$config->trustedModules); 61 }else{ 62 $config->_trustedModules = array_keys($config->_modulesPathList); 63 } 64 $path=$config->urlengine['basePath']; 65 if($path!='/'){ 66 if($path{0} != '/') $path='/'.$path; 67 if(substr($path,-1) != '/') $path.='/'; 68 $config->urlengine['basePath'] = $path; 69 } 70 #else 30 71 $config = jIniFile::read(JELIX_LIB_CORE_PATH.'defaultconfig.ini.php'); 31 72 … … 42 83 } 43 84 44 if(preg_match("/^(\w+).*$/", PHP_OS, $m)){45 $os=$m[1];46 }else{47 $os=PHP_OS;48 }49 85 $config['OS'] = $os; 50 86 $os=strtolower($os); … … 69 105 $config['urlengine']['basePath'] = $path; 70 106 } 107 #endif 108 71 109 #if WITH_BYTECODE_CACHE == 'auto' 72 110 if(BYTECODE_CACHE_EXISTS){ 73 111 $filename=JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.conf.php'; 74 112 if ($f = @fopen($filename, 'wb')) { 113 #if ENABLE_PHP_JELIX 114 fwrite($f, '<?php $config = '.var_export(get_object_vars($config),true).";\n?>"); 115 #else 75 116 fwrite($f, '<?php $config = '.var_export($config,true).";\n?>"); 117 #endif 76 118 fclose($f); 77 119 } else { … … 79 121 } 80 122 }else{ 123 #if ENABLE_PHP_JELIX 124 jIniFile::write(get_object_vars($config), JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.resultini.php'); 125 #else 81 126 jIniFile::write($config, JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.resultini.php'); 127 #endif 82 128 } 83 129 #elseif WITH_BYTECODE_CACHE 84 130 $filename=JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.conf.php'; 85 131 if ($f = @fopen($filename, 'wb')) { 132 #if ENABLE_PHP_JELIX 133 fwrite($f, '<?php $config = '.var_export(get_object_vars($config),true).";\n?>"); 134 #else 86 135 fwrite($f, '<?php $config = '.var_export($config,true).";\n?>"); 136 #endif 87 137 fclose($f); 88 138 } else { … … 90 140 } 91 141 #else 142 #if ENABLE_PHP_JELIX 143 jIniFile::write(get_object_vars($config), JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.resultini.php'); 144 #else 92 145 jIniFile::write($config, JELIX_APP_TEMP_PATH.str_replace('/','~',$configFile).'.resultini.php'); 93 146 #endif 147 #endif 148 #ifnot ENABLE_PHP_JELIX 94 149 $config = (object) $config; 150 #endif 95 151 return $config; 96 152 } … … 128 184 */ 129 185 static private function _loadTplPathList(&$config, $var){ 186 #if ENABLE_PHP_JELIX 187 $list = split(' *, *',$config->$var); 188 #else 130 189 $list = split(' *, *',$config[$var]); 190 #endif 131 191 foreach($list as $path){ 132 192 $p = str_replace(array('lib:','app:'), array(LIB_PATH, JELIX_APP_PATH), $path); … … 138 198 while (false !== ($f = readdir($handle))) { 139 199 if ($f{0} != '.' && is_dir($p.$f)) { 200 #if ENABLE_PHP_JELIX 201 $prop = '_tplpluginsPathList_'.$f; 202 $config->$prop[] = $p.$f.'/'; 203 #else 140 204 $config['_tplpluginsPathList_'.$f][] = $p.$f.'/'; 205 #endif 141 206 } 142 207 } … … 145 210 } 146 211 } 147 212 #ifnot ENABLE_PHP_JELIX 148 213 /** 149 214 * merge two array which are the result of a parse_ini_file call … … 168 233 169 234 } 235 #endif 170 236 } 171 237 trunk/lib/jelix/core/jController.class.php
r345 r357 10 10 * 11 11 */ 12 12 #ifnot ENABLE_PHP_JELIX 13 13 /** 14 14 * interface for controllers used for RESTFull request/response … … 22 22 public function delete(); 23 23 } 24 24 #endif 25 25 26 26 /** trunk/lib/jelix/core/jIncluder.class.php
r334 r357 13 13 */ 14 14 15 15 #ifnot ENABLE_PHP_JELIX 16 16 /** 17 17 * interface for compiler which needs only one source file … … 50 50 public function endCompile($cachefile); 51 51 } 52 52 #endif 53 53 /** 54 54 * This object is responsible to load cache files. trunk/lib/jelix/core/jSelector.class.php
r345 r357 41 41 } 42 42 } 43 43 #ifnot ENABLE_PHP_JELIX 44 44 /** 45 45 * interface of selector classes … … 70 70 public function toString($full=false); 71 71 } 72 72 #endif 73 73 74 74 /** … … 250 250 $className = $this->controller.'Ctrl'; 251 251 if($GLOBALS['gJConfig']->enableOldClassNaming && !class_exists($className,false)){ 252 $className = 'CT'.$this->controller; 252 if(class_exists('CT'.$this->controller,false)) 253 $className = 'CT'.$this->controller; 253 254 } 254 255 #else trunk/lib/jelix/core/url/jUrl.class.php
r338 r357 14 14 * http://www.copix.org 15 15 */ 16 16 #ifnot ENABLE_PHP_JELIX 17 17 /** 18 18 * interface for url engines … … 40 40 41 41 } 42 42 #endif 43 43 /** 44 44 * base class for jUrl and jUrlAction trunk/lib/jelix/dao/jDaoCompiler.class.php
r345 r357 9 9 * @licence http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file 10 10 * 11 #if ENABLE_OPTIMIZE 11 #if ENABLE_OPTIMIZED_SOURCE 12 12 * Une partie du code est issue des classes CopixDaoCompiler, CopixDAOGeneratorV1, CopixDAODefinitionV1 13 13 * du framework Copix 2.3dev20050901. http://www.copix.org trunk/lib/jelix/db/jDb.class.php
r345 r357 11 11 * API inspir�de la classe CopixDbFactory issue du framework Copix 2.3dev20050901. http://www.copix.org 12 12 */ 13 #if ENABLE_OPTIMIZE 13 #if ENABLE_OPTIMIZED_SOURCE 14 14 15 15 #includephp jDbConnection.class.php trunk/lib/jelix/events/jEvent.class.php
r345 r357 16 16 */ 17 17 18 #if ENABLE_OPTIMIZE 18 #if ENABLE_OPTIMIZED_SOURCE 19 19 20 20 #includephp jEventListener.class.php trunk/lib/jelix/init.php
r345 r357 3 3 * Initialize all defines and includes necessary files 4 4 * 5 #if ENABLE_OPTIMIZE 5 #if ENABLE_OPTIMIZED_SOURCE 6 6 * Some line of code come from php framework Copix 2.3dev20050901 7 7 * They are copyrighted 2001-2005 CopixTeam (LGPL Licence) … … 10 10 * @subpackage core 11 11 * @author Jouanneau Laurent 12 #if ENABLE_OPTIMIZE 12 #if ENABLE_OPTIMIZED_SOURCE 13 13 * @author Croes Gerald 14 14 * @contributor Loic Mathaud … … 24 24 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 25 25 */ 26 27 #if ENABLE_PHP_JELIX 28 if(!function_exists('jelix_version')){ 29 die('this edition of Jelix needs jelix php extension.'); 30 } 31 #endif 26 32 27 33 /** … … 69 75 #endif 70 76 71 #if ENABLE_OPTIMIZE 77 #if ENABLE_OPTIMIZED_SOURCE 72 78 73 79 #includephp core/jErrorHandler.lib.php … … 83 89 #includephp core/jLocale.class.php 84 90 #includephp core/jIncluder.class.php 91 #ifnot ENABLE_PHP_JELIX 85 92 #includephp core/jIPlugin.iface.php 86 93 #endif 87 94 #else 88 95 … … 100 107 require_once (JELIX_LIB_CORE_PATH . 'jLocale.class.php'); 101 108 require_once (JELIX_LIB_CORE_PATH . 'jIncluder.class.php'); 109 #ifnot ENABLE_PHP_JELIX 102 110 require_once (JELIX_LIB_CORE_PATH . 'jIPlugin.iface.php'); 103 111 #endif 104 112 #endif 105 113 … … 155 163 } 156 164 157 #if ENABLE_OPTIMIZE 165 #if ENABLE_OPTIMIZED_SOURCE 158 166 require_once($f); 159 167 #else
