Changeset 1204
- Timestamp:
- 04/14/06 08:11:54 (4 years ago)
- Files:
-
- trunk/data/config/settings.yml (modified) (1 diff)
- trunk/lib/symfony.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/data/config/settings.yml
r1155 r1204 73 73 validation_error_class: form_error 74 74 validation_error_id_prefix: error_for_ 75 76 autoloading_functions: ~ trunk/lib/symfony.php
r1038 r1204 55 55 } 56 56 57 /** 58 * Handles autoloading of classes that have been specified in autoload.yml. 59 * 60 * @param string A class name. 61 * 62 * @return void 63 */ 64 if (!function_exists('__autoload')) 65 { 66 function __autoload($class) 57 class Symfony 58 { 59 public static function autoload($class) 67 60 { 68 61 static $loaded; … … 91 84 require_once($module_lib); 92 85 93 return ;86 return true; 94 87 } 95 88 } 96 89 } 97 90 98 // unspecified class 99 $error = sprintf('Autoloading of class "%s" failed. Try to clear the symfony cache and refresh. [err0003]', $class); 100 $e = new sfAutoloadException($error); 101 102 $e->printStackTrace(); 91 return false; 103 92 } 104 93 else … … 106 95 // class exists, let's include it 107 96 require_once($classes[$class]); 108 } 97 98 return true; 99 } 100 } 101 } 102 103 /** 104 * Handles autoloading of classes that have been specified in autoload.yml. 105 * 106 * @param string A class name. 107 * 108 * @return void 109 */ 110 if (!function_exists('__autoload')) 111 { 112 function __autoload($class) 113 { 114 static $functions; 115 116 if (!$functions) 117 { 118 // load functions and methods that can autoload classes 119 $functions = is_array(sfConfig::get('sf_autoloading_functions')) ? sfConfig::get('sf_autoloading_functions') : array(); 120 array_unshift($functions, array('Symfony', 'autoload')); 121 } 122 123 foreach ($functions as $function) 124 { 125 if (call_user_func($function, $class)) 126 { 127 return true; 128 } 129 } 130 131 // unspecified class 132 $error = sprintf('Autoloading of class "%s" failed. Try to clear the symfony cache and refresh. [err0003]', $class); 133 $e = new sfAutoloadException($error); 134 135 $e->printStackTrace(); 109 136 } 110 137 }

