Changeset 2100
- Timestamp:
- 09/14/06 23:48:09 (2 years ago)
- Files:
-
- branches/synace/data/config/autoload.yml (modified) (1 diff)
- branches/synace/data/config/settings.yml (modified) (1 diff)
- branches/synace/data/skeleton/app/app/config/settings.yml (modified) (1 diff)
- branches/synace/lib/config/sfLoader.class.php (modified) (2 diffs)
- branches/synace/lib/debug/sfWebDebug.class.php (modified) (1 diff)
- branches/synace/lib/filter/sfCommonFilter.class.php (modified) (1 diff)
- branches/synace/lib/helper/AssetHelper.class.php (added)
- branches/synace/lib/helper/AssetHelper.php (deleted)
- branches/synace/lib/helper/CacheHelper.class.php (added)
- branches/synace/lib/helper/CacheHelper.php (deleted)
- branches/synace/lib/helper/DateHelper.class.php (added)
- branches/synace/lib/helper/DateHelper.php (deleted)
- branches/synace/lib/helper/DebugHelper.class.php (added)
- branches/synace/lib/helper/DebugHelper.php (deleted)
- branches/synace/lib/helper/EscapingHelper.class.php (added)
- branches/synace/lib/helper/EscapingHelper.php (deleted)
- branches/synace/lib/helper/FormHelper.class.php (added)
- branches/synace/lib/helper/FormHelper.php (deleted)
- branches/synace/lib/helper/HelperHelper.class.php (added)
- branches/synace/lib/helper/HelperHelper.php (deleted)
- branches/synace/lib/helper/I18NHelper.class.php (added)
- branches/synace/lib/helper/I18NHelper.php (deleted)
- branches/synace/lib/helper/JavascriptHelper.class.php (added)
- branches/synace/lib/helper/JavascriptHelper.php (deleted)
- branches/synace/lib/helper/NumberHelper.class.php (added)
- branches/synace/lib/helper/NumberHelper.php (deleted)
- branches/synace/lib/helper/ObjectAdminHelper.class.php (added)
- branches/synace/lib/helper/ObjectAdminHelper.php (deleted)
- branches/synace/lib/helper/ObjectHelper.class.php (added)
- branches/synace/lib/helper/ObjectHelper.php (deleted)
- branches/synace/lib/helper/PartialHelper.class.php (added)
- branches/synace/lib/helper/PartialHelper.php (deleted)
- branches/synace/lib/helper/TagHelper.class.php (added)
- branches/synace/lib/helper/TagHelper.php (deleted)
- branches/synace/lib/helper/TextHelper.class.php (added)
- branches/synace/lib/helper/TextHelper.php (deleted)
- branches/synace/lib/helper/UrlHelper.class.php (added)
- branches/synace/lib/helper/UrlHelper.php (deleted)
- branches/synace/lib/helper/ValidationHelper.class.php (added)
- branches/synace/lib/helper/ValidationHelper.php (deleted)
- branches/synace/lib/helper/sfHelper.class.php (added)
- branches/synace/test/functionnal/fixtures/project/apps/frontend/config/settings.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/synace/data/config/autoload.yml
r1941 r2100 56 56 path: %SF_APP_DIR%/modules/*/lib 57 57 recursive: on 58 59 # helpers 60 helpers_lib: 61 name: helpers lib 62 path: %SF_SYMFONY_LIB_DIR%/helpers 63 recursive: on branches/synace/data/config/settings.yml
r2011 r2100 75 75 76 76 escaping_strategy: bc 77 escaping_method: E SC_ENTITIES77 escaping_method: EscapingHelper::ESC_ENTITIES 78 78 79 79 prototype_web_dir: /sf/prototype branches/synace/data/skeleton/app/app/config/settings.yml
r2011 r2100 97 97 # 98 98 # escaping_strategy: bc 99 # escaping_method: E SC_ENTITIES99 # escaping_method: EscapingHelper::ESC_ENTITIES 100 100 # 101 101 # prototype_web_dir: /sf/prototype branches/synace/lib/config/sfLoader.class.php
r2031 r2100 120 120 static $loaded = array(); 121 121 122 array_unshift($helpers, 'sf'); 123 122 124 $dirs = self::getHelperDirs($moduleName); 123 125 foreach ($helpers as $helperName) 124 126 { 127 $className = $helperName.'Helper'; 125 128 if (isset($loaded[$helperName])) 126 129 { 127 130 continue; 128 131 } 129 130 $fileName = $helperName.'Helper.php'; 131 foreach ($dirs as $dir) 132 { 133 $included = false; 134 if (is_readable($dir.'/'.$fileName)) 135 { 136 include($dir.'/'.$fileName); 132 elseif(class_exists($className)) 133 { 134 self::initHelperClass($className); 135 continue; 136 } 137 138 if (!$included) 139 { 140 //$fileName = $helperName.'Helper.php'; 141 $fileName = $helperName.'Helper.class.php'; 142 foreach ($dirs as $dir) 143 { 144 $included = false; 145 if (is_readable($dir.'/'.$fileName)) 146 { 147 include($dir.'/'.$fileName); 148 $included = true; 149 break; 150 } 151 } 152 } 153 if (!$included) 154 { 155 //attempt to autoload 156 if (is_callable(array($className, '_initialize'))) 157 { 137 158 $included = true; 138 break; 139 } 140 } 141 159 } 160 } 142 161 if (!$included) 143 162 { … … 150 169 151 170 $loaded[$helperName] = true; 152 } 153 } 154 171 172 self::initHelperClass($className); 173 } 174 } 175 static public function initHelperClass($className) 176 { 177 //backwards compatibility for built in helper classes 178 if (class_exists($className)) 179 { 180 foreach (get_class_methods($className) as $methodName) 181 { 182 if (substr($methodName, 0, 2) == '_') 183 { 184 continue; 185 } 186 if (!function_exists($methodName)) 187 { 188 eval('function ' . $methodName . '() { $args = func_get_args(); return call_user_func_array(array("' . $className. '", "' . $methodName . '"), $args); }'); 189 } 190 } 191 if (is_callable(array($className, '_initialize'))) 192 { 193 call_user_func_array(array($className, '_initialize'), array()); 194 } 195 } 196 } 155 197 static public function loadPluginConfig() 156 198 { branches/synace/lib/debug/sfWebDebug.class.php
r2032 r2100 111 111 private function loadHelpers() 112 112 { 113 // require needed helpers 114 foreach (array('Helper', 'Url', 'Asset', 'Tag', 'Javascript') as $helperName) 115 { 116 include_once(sfConfig::get('sf_symfony_lib_dir').'/helper/'.$helperName.'Helper.php'); 117 } 113 sfLoader::loadHelpers(array('Helper', 'Url', 'Asset', 'Tag', 'Javascript')); 118 114 } 119 115 branches/synace/lib/filter/sfCommonFilter.class.php
r2015 r2100 46 46 47 47 // include javascripts and stylesheets 48 require_once(sfConfig::get('sf_symfony_lib_dir').'/helper/TagHelper.php'); 49 require_once(sfConfig::get('sf_symfony_lib_dir').'/helper/AssetHelper.php'); 48 sfLoader::loadHelpers(array('Tag', 'Asset')); 50 49 $html = $this->include_javascripts($response); 51 50 $html .= $this->include_stylesheets($response); branches/synace/test/functionnal/fixtures/project/apps/frontend/config/settings.yml
r2069 r2100 97 97 # 98 98 # escaping_strategy: bc 99 # escaping_method: E SC_ENTITIES99 # escaping_method: EscapingHelper::ESC_ENTITIES 100 100 # 101 101 # prototype_web_dir: /sf/prototype