PageRenderTime 57ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/framework/YiiBase.php

https://bitbucket.org/dinhtrung/yiicorecms/
PHP | 850 lines | 562 code | 32 blank | 256 comment | 42 complexity | 1a41b08611ee4207288788f82612485b MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, CC0-1.0, BSD-2-Clause, GPL-2.0, LGPL-2.1, LGPL-3.0
  1. <?php
  2. /**
  3. * YiiBase class file.
  4. *
  5. * @author Qiang Xue <qiang.xue@gmail.com>
  6. * @link http://www.yiiframework.com/
  7. * @copyright Copyright &copy; 2008-2011 Yii Software LLC
  8. * @license http://www.yiiframework.com/license/
  9. * @version $Id: YiiBase.php 3325 2011-06-26 18:01:42Z qiang.xue $
  10. * @package system
  11. * @since 1.0
  12. */
  13. /**
  14. * Gets the application start timestamp.
  15. */
  16. defined('YII_BEGIN_TIME') or define('YII_BEGIN_TIME',microtime(true));
  17. /**
  18. * This constant defines whether the application should be in debug mode or not. Defaults to false.
  19. */
  20. defined('YII_DEBUG') or define('YII_DEBUG',false);
  21. /**
  22. * This constant defines how much call stack information (file name and line number) should be logged by Yii::trace().
  23. * Defaults to 0, meaning no backtrace information. If it is greater than 0,
  24. * at most that number of call stacks will be logged. Note, only user application call stacks are considered.
  25. */
  26. defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0);
  27. /**
  28. * This constant defines whether exception handling should be enabled. Defaults to true.
  29. */
  30. defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER',true);
  31. /**
  32. * This constant defines whether error handling should be enabled. Defaults to true.
  33. */
  34. defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER',true);
  35. /**
  36. * Defines the Yii framework installation path.
  37. */
  38. defined('YII_PATH') or define('YII_PATH',dirname(__FILE__));
  39. /**
  40. * Defines the Zii library installation path.
  41. */
  42. defined('YII_ZII_PATH') or define('YII_ZII_PATH',YII_PATH.DIRECTORY_SEPARATOR.'zii');
  43. /**
  44. * YiiBase is a helper class serving common framework functionalities.
  45. *
  46. * Do not use YiiBase directly. Instead, use its child class {@link Yii} where
  47. * you can customize methods of YiiBase.
  48. *
  49. * @author Qiang Xue <qiang.xue@gmail.com>
  50. * @version $Id: YiiBase.php 3325 2011-06-26 18:01:42Z qiang.xue $
  51. * @package system
  52. * @since 1.0
  53. */
  54. class YiiBase
  55. {
  56. /**
  57. * @var array class map used by the Yii autoloading mechanism.
  58. * The array keys are the class names and the array values are the corresponding class file paths.
  59. * @since 1.1.5
  60. */
  61. public static $classMap=array();
  62. /**
  63. * @var boolean whether to rely on PHP include path to autoload class files. Defaults to true.
  64. * You may set this to be false if your hosting environment doesn't allow changing PHP include path,
  65. * or if you want to append additional autoloaders to the default Yii autoloader.
  66. * @since 1.1.8
  67. */
  68. public static $enableIncludePath=true;
  69. private static $_aliases=array('system'=>YII_PATH,'zii'=>YII_ZII_PATH); // alias => path
  70. private static $_imports=array(); // alias => class name or directory
  71. private static $_includePaths; // list of include paths
  72. private static $_app;
  73. private static $_logger;
  74. /**
  75. * @return string the version of Yii framework
  76. */
  77. public static function getVersion()
  78. {
  79. return '1.1.9-dev';
  80. }
  81. /**
  82. * Creates a Web application instance.
  83. * @param mixed $config application configuration.
  84. * If a string, it is treated as the path of the file that contains the configuration;
  85. * If an array, it is the actual configuration information.
  86. * Please make sure you specify the {@link CApplication::basePath basePath} property in the configuration,
  87. * which should point to the directory containing all application logic, template and data.
  88. * If not, the directory will be defaulted to 'protected'.
  89. * @return CWebApplication
  90. */
  91. public static function createWebApplication($config=null)
  92. {
  93. return self::createApplication('CWebApplication',$config);
  94. }
  95. /**
  96. * Creates a console application instance.
  97. * @param mixed $config application configuration.
  98. * If a string, it is treated as the path of the file that contains the configuration;
  99. * If an array, it is the actual configuration information.
  100. * Please make sure you specify the {@link CApplication::basePath basePath} property in the configuration,
  101. * which should point to the directory containing all application logic, template and data.
  102. * If not, the directory will be defaulted to 'protected'.
  103. * @return CConsoleApplication
  104. */
  105. public static function createConsoleApplication($config=null)
  106. {
  107. return self::createApplication('CConsoleApplication',$config);
  108. }
  109. /**
  110. * Creates an application of the specified class.
  111. * @param string $class the application class name
  112. * @param mixed $config application configuration. This parameter will be passed as the parameter
  113. * to the constructor of the application class.
  114. * @return mixed the application instance
  115. * @since 1.0.10
  116. */
  117. public static function createApplication($class,$config=null)
  118. {
  119. return new $class($config);
  120. }
  121. /**
  122. * Returns the application singleton, null if the singleton has not been created yet.
  123. * @return CApplication the application singleton, null if the singleton has not been created yet.
  124. */
  125. public static function app()
  126. {
  127. return self::$_app;
  128. }
  129. /**
  130. * Stores the application instance in the class static member.
  131. * This method helps implement a singleton pattern for CApplication.
  132. * Repeated invocation of this method or the CApplication constructor
  133. * will cause the throw of an exception.
  134. * To retrieve the application instance, use {@link app()}.
  135. * @param CApplication $app the application instance. If this is null, the existing
  136. * application singleton will be removed.
  137. * @throws CException if multiple application instances are registered.
  138. */
  139. public static function setApplication($app)
  140. {
  141. if(self::$_app===null || $app===null)
  142. self::$_app=$app;
  143. else
  144. throw new CException(Yii::t('yii','Yii application can only be created once.'));
  145. }
  146. /**
  147. * @return string the path of the framework
  148. */
  149. public static function getFrameworkPath()
  150. {
  151. return YII_PATH;
  152. }
  153. /**
  154. * Creates an object and initializes it based on the given configuration.
  155. *
  156. * The specified configuration can be either a string or an array.
  157. * If the former, the string is treated as the object type which can
  158. * be either the class name or {@link YiiBase::getPathOfAlias class path alias}.
  159. * If the latter, the 'class' element is treated as the object type,
  160. * and the rest name-value pairs in the array are used to initialize
  161. * the corresponding object properties.
  162. *
  163. * Any additional parameters passed to this method will be
  164. * passed to the constructor of the object being created.
  165. *
  166. * NOTE: the array-typed configuration has been supported since version 1.0.1.
  167. *
  168. * @param mixed $config the configuration. It can be either a string or an array.
  169. * @return mixed the created object
  170. * @throws CException if the configuration does not have a 'class' element.
  171. */
  172. public static function createComponent($config)
  173. {
  174. if(is_string($config))
  175. {
  176. $type=$config;
  177. $config=array();
  178. }
  179. else if(isset($config['class']))
  180. {
  181. $type=$config['class'];
  182. unset($config['class']);
  183. }
  184. else
  185. throw new CException(Yii::t('yii','Object configuration must be an array containing a "class" element.'));
  186. if(!class_exists($type,false))
  187. $type=Yii::import($type,true);
  188. if(($n=func_num_args())>1)
  189. {
  190. $args=func_get_args();
  191. if($n===2)
  192. $object=new $type($args[1]);
  193. else if($n===3)
  194. $object=new $type($args[1],$args[2]);
  195. else if($n===4)
  196. $object=new $type($args[1],$args[2],$args[3]);
  197. else
  198. {
  199. unset($args[0]);
  200. $class=new ReflectionClass($type);
  201. // Note: ReflectionClass::newInstanceArgs() is available for PHP 5.1.3+
  202. // $object=$class->newInstanceArgs($args);
  203. $object=call_user_func_array(array($class,'newInstance'),$args);
  204. }
  205. }
  206. else
  207. $object=new $type;
  208. foreach($config as $key=>$value)
  209. $object->$key=$value;
  210. return $object;
  211. }
  212. /**
  213. * Imports a class or a directory.
  214. *
  215. * Importing a class is like including the corresponding class file.
  216. * The main difference is that importing a class is much lighter because it only
  217. * includes the class file when the class is referenced the first time.
  218. *
  219. * Importing a directory is equivalent to adding a directory into the PHP include path.
  220. * If multiple directories are imported, the directories imported later will take
  221. * precedence in class file searching (i.e., they are added to the front of the PHP include path).
  222. *
  223. * Path aliases are used to import a class or directory. For example,
  224. * <ul>
  225. * <li><code>application.components.GoogleMap</code>: import the <code>GoogleMap</code> class.</li>
  226. * <li><code>application.components.*</code>: import the <code>components</code> directory.</li>
  227. * </ul>
  228. *
  229. * The same path alias can be imported multiple times, but only the first time is effective.
  230. * Importing a directory does not import any of its subdirectories.
  231. *
  232. * Starting from version 1.1.5, this method can also be used to import a class in namespace format
  233. * (available for PHP 5.3 or above only). It is similar to importing a class in path alias format,
  234. * except that the dot separator is replaced by the backslash separator. For example, importing
  235. * <code>application\components\GoogleMap</code> is similar to importing <code>application.components.GoogleMap</code>.
  236. * The difference is that the former class is using qualified name, while the latter unqualified.
  237. *
  238. * Note, importing a class in namespace format requires that the namespace is corresponding to
  239. * a valid path alias if we replace the backslash characters with dot characters.
  240. * For example, the namespace <code>application\components</code> must correspond to a valid
  241. * path alias <code>application.components</code>.
  242. *
  243. * @param string $alias path alias to be imported
  244. * @param boolean $forceInclude whether to include the class file immediately. If false, the class file
  245. * will be included only when the class is being used. This parameter is used only when
  246. * the path alias refers to a class.
  247. * @return string the class name or the directory that this alias refers to
  248. * @throws CException if the alias is invalid
  249. */
  250. public static function import($alias,$forceInclude=false)
  251. {
  252. if(isset(self::$_imports[$alias])) // previously imported
  253. return self::$_imports[$alias];
  254. if(class_exists($alias,false) || interface_exists($alias,false))
  255. return self::$_imports[$alias]=$alias;
  256. if(($pos=strrpos($alias,'\\'))!==false) // a class name in PHP 5.3 namespace format
  257. {
  258. $namespace=str_replace('\\','.',ltrim(substr($alias,0,$pos),'\\'));
  259. if(($path=self::getPathOfAlias($namespace))!==false)
  260. {
  261. $classFile=$path.DIRECTORY_SEPARATOR.substr($alias,$pos+1).'.php';
  262. if($forceInclude)
  263. {
  264. if(is_file($classFile))
  265. require($classFile);
  266. else
  267. throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file.',array('{alias}'=>$alias)));
  268. self::$_imports[$alias]=$alias;
  269. }
  270. else
  271. self::$classMap[$alias]=$classFile;
  272. return $alias;
  273. }
  274. else
  275. throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing directory.',
  276. array('{alias}'=>$namespace)));
  277. }
  278. if(($pos=strrpos($alias,'.'))===false) // a simple class name
  279. {
  280. if($forceInclude && self::autoload($alias))
  281. self::$_imports[$alias]=$alias;
  282. return $alias;
  283. }
  284. $className=(string)substr($alias,$pos+1);
  285. $isClass=$className!=='*';
  286. if($isClass && (class_exists($className,false) || interface_exists($className,false)))
  287. return self::$_imports[$alias]=$className;
  288. if(($path=self::getPathOfAlias($alias))!==false)
  289. {
  290. if($isClass)
  291. {
  292. if($forceInclude)
  293. {
  294. if(is_file($path.'.php'))
  295. require($path.'.php');
  296. else
  297. throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file.',array('{alias}'=>$alias)));
  298. self::$_imports[$alias]=$className;
  299. }
  300. else
  301. self::$classMap[$className]=$path.'.php';
  302. return $className;
  303. }
  304. else // a directory
  305. {
  306. if(self::$_includePaths===null)
  307. {
  308. self::$_includePaths=array_unique(explode(PATH_SEPARATOR,get_include_path()));
  309. if(($pos=array_search('.',self::$_includePaths,true))!==false)
  310. unset(self::$_includePaths[$pos]);
  311. }
  312. array_unshift(self::$_includePaths,$path);
  313. if(self::$enableIncludePath && set_include_path('.'.PATH_SEPARATOR.implode(PATH_SEPARATOR,self::$_includePaths))===false)
  314. self::$enableIncludePath=false;
  315. return self::$_imports[$alias]=$path;
  316. }
  317. }
  318. else
  319. throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing directory or file.',
  320. array('{alias}'=>$alias)));
  321. }
  322. /**
  323. * Translates an alias into a file path.
  324. * Note, this method does not ensure the existence of the resulting file path.
  325. * It only checks if the root alias is valid or not.
  326. * @param string $alias alias (e.g. system.web.CController)
  327. * @return mixed file path corresponding to the alias, false if the alias is invalid.
  328. */
  329. public static function getPathOfAlias($alias)
  330. {
  331. if(isset(self::$_aliases[$alias]))
  332. return self::$_aliases[$alias];
  333. else if(($pos=strpos($alias,'.'))!==false)
  334. {
  335. $rootAlias=substr($alias,0,$pos);
  336. if(isset(self::$_aliases[$rootAlias]))
  337. return self::$_aliases[$alias]=rtrim(self::$_aliases[$rootAlias].DIRECTORY_SEPARATOR.str_replace('.',DIRECTORY_SEPARATOR,substr($alias,$pos+1)),'*'.DIRECTORY_SEPARATOR);
  338. else if(self::$_app instanceof CWebApplication)
  339. {
  340. if(self::$_app->findModule($rootAlias)!==null)
  341. return self::getPathOfAlias($alias);
  342. }
  343. }
  344. return false;
  345. }
  346. /**
  347. * Create a path alias.
  348. * Note, this method neither checks the existence of the path nor normalizes the path.
  349. * @param string $alias alias to the path
  350. * @param string $path the path corresponding to the alias. If this is null, the corresponding
  351. * path alias will be removed.
  352. */
  353. public static function setPathOfAlias($alias,$path)
  354. {
  355. if(empty($path))
  356. unset(self::$_aliases[$alias]);
  357. else
  358. self::$_aliases[$alias]=rtrim($path,'\\/');
  359. }
  360. /**
  361. * Class autoload loader.
  362. * This method is provided to be invoked within an __autoload() magic method.
  363. * @param string $className class name
  364. * @return boolean whether the class has been loaded successfully
  365. */
  366. public static function autoload($className)
  367. {
  368. // use include so that the error PHP file may appear
  369. if(isset(self::$_coreClasses[$className]))
  370. include(YII_PATH.self::$_coreClasses[$className]);
  371. else if(isset(self::$classMap[$className]))
  372. include(self::$classMap[$className]);
  373. else
  374. {
  375. // include class file relying on include_path
  376. if(strpos($className,'\\')===false) // class without namespace
  377. {
  378. if(self::$enableIncludePath===false)
  379. {
  380. foreach(self::$_includePaths as $path)
  381. {
  382. $classFile=$path.DIRECTORY_SEPARATOR.$className.'.php';
  383. if(is_file($classFile))
  384. {
  385. include($classFile);
  386. break;
  387. }
  388. }
  389. }
  390. else
  391. include($className.'.php');
  392. }
  393. else // class name with namespace in PHP 5.3
  394. {
  395. $namespace=str_replace('\\','.',ltrim($className,'\\'));
  396. if(($path=self::getPathOfAlias($namespace))!==false)
  397. include($path.'.php');
  398. else
  399. return false;
  400. }
  401. return class_exists($className,false) || interface_exists($className,false);
  402. }
  403. return true;
  404. }
  405. /**
  406. * Writes a trace message.
  407. * This method will only log a message when the application is in debug mode.
  408. * @param string $msg message to be logged
  409. * @param string $category category of the message
  410. * @see log
  411. */
  412. public static function trace($msg,$category='application')
  413. {
  414. if(YII_DEBUG)
  415. self::log($msg,CLogger::LEVEL_TRACE,$category);
  416. }
  417. /**
  418. * Logs a message.
  419. * Messages logged by this method may be retrieved via {@link CLogger::getLogs}
  420. * and may be recorded in different media, such as file, email, database, using
  421. * {@link CLogRouter}.
  422. * @param string $msg message to be logged
  423. * @param string $level level of the message (e.g. 'trace', 'warning', 'error'). It is case-insensitive.
  424. * @param string $category category of the message (e.g. 'system.web'). It is case-insensitive.
  425. */
  426. public static function log($msg,$level=CLogger::LEVEL_INFO,$category='application')
  427. {
  428. if(self::$_logger===null)
  429. self::$_logger=new CLogger;
  430. if(YII_DEBUG && YII_TRACE_LEVEL>0 && $level!==CLogger::LEVEL_PROFILE)
  431. {
  432. $traces=debug_backtrace();
  433. $count=0;
  434. foreach($traces as $trace)
  435. {
  436. if(isset($trace['file'],$trace['line']) && strpos($trace['file'],YII_PATH)!==0)
  437. {
  438. $msg.="\nin ".$trace['file'].' ('.$trace['line'].')';
  439. if(++$count>=YII_TRACE_LEVEL)
  440. break;
  441. }
  442. }
  443. }
  444. self::$_logger->log($msg,$level,$category);
  445. }
  446. /**
  447. * Marks the begin of a code block for profiling.
  448. * This has to be matched with a call to {@link endProfile()} with the same token.
  449. * The begin- and end- calls must also be properly nested, e.g.,
  450. * <pre>
  451. * Yii::beginProfile('block1');
  452. * Yii::beginProfile('block2');
  453. * Yii::endProfile('block2');
  454. * Yii::endProfile('block1');
  455. * </pre>
  456. * The following sequence is not valid:
  457. * <pre>
  458. * Yii::beginProfile('block1');
  459. * Yii::beginProfile('block2');
  460. * Yii::endProfile('block1');
  461. * Yii::endProfile('block2');
  462. * </pre>
  463. * @param string $token token for the code block
  464. * @param string $category the category of this log message
  465. * @see endProfile
  466. */
  467. public static function beginProfile($token,$category='application')
  468. {
  469. self::log('begin:'.$token,CLogger::LEVEL_PROFILE,$category);
  470. }
  471. /**
  472. * Marks the end of a code block for profiling.
  473. * This has to be matched with a previous call to {@link beginProfile()} with the same token.
  474. * @param string $token token for the code block
  475. * @param string $category the category of this log message
  476. * @see beginProfile
  477. */
  478. public static function endProfile($token,$category='application')
  479. {
  480. self::log('end:'.$token,CLogger::LEVEL_PROFILE,$category);
  481. }
  482. /**
  483. * @return CLogger message logger
  484. */
  485. public static function getLogger()
  486. {
  487. if(self::$_logger!==null)
  488. return self::$_logger;
  489. else
  490. return self::$_logger=new CLogger;
  491. }
  492. /**
  493. * Sets the logger object.
  494. * @param CLogger $logger the logger object.
  495. * @since 1.1.8
  496. */
  497. public static function setLogger($logger)
  498. {
  499. self::$_logger=$logger;
  500. }
  501. /**
  502. * Returns a string that can be displayed on your Web page showing Powered-by-Yii information
  503. * @return string a string that can be displayed on your Web page showing Powered-by-Yii information
  504. */
  505. public static function powered()
  506. {
  507. return 'Powered by <a href="http://www.yiiframework.com/" rel="external">Yii Framework</a>.';
  508. }
  509. /**
  510. * Translates a message to the specified language.
  511. * Starting from version 1.0.2, this method supports choice format (see {@link CChoiceFormat}),
  512. * i.e., the message returned will be chosen from a few candidates according to the given
  513. * number value. This feature is mainly used to solve plural format issue in case
  514. * a message has different plural forms in some languages.
  515. * @param string $category message category. Please use only word letters. Note, category 'yii' is
  516. * reserved for Yii framework core code use. See {@link CPhpMessageSource} for
  517. * more interpretation about message category.
  518. * @param string $message the original message
  519. * @param array $params parameters to be applied to the message using <code>strtr</code>.
  520. * Starting from version 1.0.2, the first parameter can be a number without key.
  521. * And in this case, the method will call {@link CChoiceFormat::format} to choose
  522. * an appropriate message translation.
  523. * Starting from version 1.1.6 you can pass parameter for {@link CChoiceFormat::format}
  524. * or plural forms format without wrapping it with array.
  525. * @param string $source which message source application component to use.
  526. * Defaults to null, meaning using 'coreMessages' for messages belonging to
  527. * the 'yii' category and using 'messages' for the rest messages.
  528. * @param string $language the target language. If null (default), the {@link CApplication::getLanguage application language} will be used.
  529. * This parameter has been available since version 1.0.3.
  530. * @return string the translated message
  531. * @see CMessageSource
  532. */
  533. public static function t($category,$message,$params=array(),$source=null,$language=null)
  534. {
  535. if(self::$_app!==null)
  536. {
  537. if($source===null)
  538. $source=($category==='yii'||$category==='zii')?'coreMessages':'messages';
  539. if(($source=self::$_app->getComponent($source))!==null)
  540. $message=$source->translate($category,$message,$language);
  541. }
  542. if($params===array())
  543. return $message;
  544. if(!is_array($params))
  545. $params=array($params);
  546. if(isset($params[0])) // number choice
  547. {
  548. if(strpos($message,'|')!==false)
  549. {
  550. if(strpos($message,'#')===false)
  551. {
  552. $chunks=explode('|',$message);
  553. $expressions=self::$_app->getLocale($language)->getPluralRules();
  554. if($n=min(count($chunks),count($expressions)))
  555. {
  556. for($i=0;$i<$n;$i++)
  557. $chunks[$i]=$expressions[$i].'#'.$chunks[$i];
  558. $message=implode('|',$chunks);
  559. }
  560. }
  561. $message=CChoiceFormat::format($message,$params[0]);
  562. }
  563. if(!isset($params['{n}']))
  564. $params['{n}']=$params[0];
  565. unset($params[0]);
  566. }
  567. return $params!==array() ? strtr($message,$params) : $message;
  568. }
  569. /**
  570. * Registers a new class autoloader.
  571. * The new autoloader will be placed before {@link autoload} and after
  572. * any other existing autoloaders.
  573. * @param callback $callback a valid PHP callback (function name or array($className,$methodName)).
  574. * @param boolean $append whether to append the new autoloader after the default Yii autoloader.
  575. * @since 1.0.10
  576. */
  577. public static function registerAutoloader($callback, $append=false)
  578. {
  579. if($append)
  580. {
  581. self::$enableIncludePath=false;
  582. spl_autoload_register($callback);
  583. }
  584. else
  585. {
  586. spl_autoload_unregister(array('YiiBase','autoload'));
  587. spl_autoload_register($callback);
  588. spl_autoload_register(array('YiiBase','autoload'));
  589. }
  590. }
  591. /**
  592. * @var array class map for core Yii classes.
  593. * NOTE, DO NOT MODIFY THIS ARRAY MANUALLY. IF YOU CHANGE OR ADD SOME CORE CLASSES,
  594. * PLEASE RUN 'build autoload' COMMAND TO UPDATE THIS ARRAY.
  595. */
  596. private static $_coreClasses=array(
  597. 'CApplication' => '/base/CApplication.php',
  598. 'CApplicationComponent' => '/base/CApplicationComponent.php',
  599. 'CBehavior' => '/base/CBehavior.php',
  600. 'CComponent' => '/base/CComponent.php',
  601. 'CErrorEvent' => '/base/CErrorEvent.php',
  602. 'CErrorHandler' => '/base/CErrorHandler.php',
  603. 'CException' => '/base/CException.php',
  604. 'CExceptionEvent' => '/base/CExceptionEvent.php',
  605. 'CHttpException' => '/base/CHttpException.php',
  606. 'CModel' => '/base/CModel.php',
  607. 'CModelBehavior' => '/base/CModelBehavior.php',
  608. 'CModelEvent' => '/base/CModelEvent.php',
  609. 'CModule' => '/base/CModule.php',
  610. 'CSecurityManager' => '/base/CSecurityManager.php',
  611. 'CStatePersister' => '/base/CStatePersister.php',
  612. 'CApcCache' => '/caching/CApcCache.php',
  613. 'CCache' => '/caching/CCache.php',
  614. 'CDbCache' => '/caching/CDbCache.php',
  615. 'CDummyCache' => '/caching/CDummyCache.php',
  616. 'CEAcceleratorCache' => '/caching/CEAcceleratorCache.php',
  617. 'CFileCache' => '/caching/CFileCache.php',
  618. 'CMemCache' => '/caching/CMemCache.php',
  619. 'CWinCache' => '/caching/CWinCache.php',
  620. 'CXCache' => '/caching/CXCache.php',
  621. 'CZendDataCache' => '/caching/CZendDataCache.php',
  622. 'CCacheDependency' => '/caching/dependencies/CCacheDependency.php',
  623. 'CChainedCacheDependency' => '/caching/dependencies/CChainedCacheDependency.php',
  624. 'CDbCacheDependency' => '/caching/dependencies/CDbCacheDependency.php',
  625. 'CDirectoryCacheDependency' => '/caching/dependencies/CDirectoryCacheDependency.php',
  626. 'CExpressionDependency' => '/caching/dependencies/CExpressionDependency.php',
  627. 'CFileCacheDependency' => '/caching/dependencies/CFileCacheDependency.php',
  628. 'CGlobalStateCacheDependency' => '/caching/dependencies/CGlobalStateCacheDependency.php',
  629. 'CAttributeCollection' => '/collections/CAttributeCollection.php',
  630. 'CConfiguration' => '/collections/CConfiguration.php',
  631. 'CList' => '/collections/CList.php',
  632. 'CListIterator' => '/collections/CListIterator.php',
  633. 'CMap' => '/collections/CMap.php',
  634. 'CMapIterator' => '/collections/CMapIterator.php',
  635. 'CQueue' => '/collections/CQueue.php',
  636. 'CQueueIterator' => '/collections/CQueueIterator.php',
  637. 'CStack' => '/collections/CStack.php',
  638. 'CStackIterator' => '/collections/CStackIterator.php',
  639. 'CTypedList' => '/collections/CTypedList.php',
  640. 'CTypedMap' => '/collections/CTypedMap.php',
  641. 'CConsoleApplication' => '/console/CConsoleApplication.php',
  642. 'CConsoleCommand' => '/console/CConsoleCommand.php',
  643. 'CConsoleCommandRunner' => '/console/CConsoleCommandRunner.php',
  644. 'CHelpCommand' => '/console/CHelpCommand.php',
  645. 'CDbCommand' => '/db/CDbCommand.php',
  646. 'CDbConnection' => '/db/CDbConnection.php',
  647. 'CDbDataReader' => '/db/CDbDataReader.php',
  648. 'CDbException' => '/db/CDbException.php',
  649. 'CDbMigration' => '/db/CDbMigration.php',
  650. 'CDbTransaction' => '/db/CDbTransaction.php',
  651. 'CActiveFinder' => '/db/ar/CActiveFinder.php',
  652. 'CActiveRecord' => '/db/ar/CActiveRecord.php',
  653. 'CActiveRecordBehavior' => '/db/ar/CActiveRecordBehavior.php',
  654. 'CDbColumnSchema' => '/db/schema/CDbColumnSchema.php',
  655. 'CDbCommandBuilder' => '/db/schema/CDbCommandBuilder.php',
  656. 'CDbCriteria' => '/db/schema/CDbCriteria.php',
  657. 'CDbExpression' => '/db/schema/CDbExpression.php',
  658. 'CDbSchema' => '/db/schema/CDbSchema.php',
  659. 'CDbTableSchema' => '/db/schema/CDbTableSchema.php',
  660. 'CMssqlColumnSchema' => '/db/schema/mssql/CMssqlColumnSchema.php',
  661. 'CMssqlCommandBuilder' => '/db/schema/mssql/CMssqlCommandBuilder.php',
  662. 'CMssqlPdoAdapter' => '/db/schema/mssql/CMssqlPdoAdapter.php',
  663. 'CMssqlSchema' => '/db/schema/mssql/CMssqlSchema.php',
  664. 'CMssqlTableSchema' => '/db/schema/mssql/CMssqlTableSchema.php',
  665. 'CMysqlColumnSchema' => '/db/schema/mysql/CMysqlColumnSchema.php',
  666. 'CMysqlSchema' => '/db/schema/mysql/CMysqlSchema.php',
  667. 'CMysqlTableSchema' => '/db/schema/mysql/CMysqlTableSchema.php',
  668. 'COciColumnSchema' => '/db/schema/oci/COciColumnSchema.php',
  669. 'COciCommandBuilder' => '/db/schema/oci/COciCommandBuilder.php',
  670. 'COciSchema' => '/db/schema/oci/COciSchema.php',
  671. 'COciTableSchema' => '/db/schema/oci/COciTableSchema.php',
  672. 'CPgsqlColumnSchema' => '/db/schema/pgsql/CPgsqlColumnSchema.php',
  673. 'CPgsqlSchema' => '/db/schema/pgsql/CPgsqlSchema.php',
  674. 'CPgsqlTableSchema' => '/db/schema/pgsql/CPgsqlTableSchema.php',
  675. 'CSqliteColumnSchema' => '/db/schema/sqlite/CSqliteColumnSchema.php',
  676. 'CSqliteCommandBuilder' => '/db/schema/sqlite/CSqliteCommandBuilder.php',
  677. 'CSqliteSchema' => '/db/schema/sqlite/CSqliteSchema.php',
  678. 'CChoiceFormat' => '/i18n/CChoiceFormat.php',
  679. 'CDateFormatter' => '/i18n/CDateFormatter.php',
  680. 'CDbMessageSource' => '/i18n/CDbMessageSource.php',
  681. 'CGettextMessageSource' => '/i18n/CGettextMessageSource.php',
  682. 'CLocale' => '/i18n/CLocale.php',
  683. 'CMessageSource' => '/i18n/CMessageSource.php',
  684. 'CNumberFormatter' => '/i18n/CNumberFormatter.php',
  685. 'CPhpMessageSource' => '/i18n/CPhpMessageSource.php',
  686. 'CGettextFile' => '/i18n/gettext/CGettextFile.php',
  687. 'CGettextMoFile' => '/i18n/gettext/CGettextMoFile.php',
  688. 'CGettextPoFile' => '/i18n/gettext/CGettextPoFile.php',
  689. 'CDbLogRoute' => '/logging/CDbLogRoute.php',
  690. 'CEmailLogRoute' => '/logging/CEmailLogRoute.php',
  691. 'CFileLogRoute' => '/logging/CFileLogRoute.php',
  692. 'CLogFilter' => '/logging/CLogFilter.php',
  693. 'CLogRoute' => '/logging/CLogRoute.php',
  694. 'CLogRouter' => '/logging/CLogRouter.php',
  695. 'CLogger' => '/logging/CLogger.php',
  696. 'CProfileLogRoute' => '/logging/CProfileLogRoute.php',
  697. 'CWebLogRoute' => '/logging/CWebLogRoute.php',
  698. 'CDateTimeParser' => '/utils/CDateTimeParser.php',
  699. 'CFileHelper' => '/utils/CFileHelper.php',
  700. 'CFormatter' => '/utils/CFormatter.php',
  701. 'CMarkdownParser' => '/utils/CMarkdownParser.php',
  702. 'CPropertyValue' => '/utils/CPropertyValue.php',
  703. 'CTimestamp' => '/utils/CTimestamp.php',
  704. 'CVarDumper' => '/utils/CVarDumper.php',
  705. 'CBooleanValidator' => '/validators/CBooleanValidator.php',
  706. 'CCaptchaValidator' => '/validators/CCaptchaValidator.php',
  707. 'CCompareValidator' => '/validators/CCompareValidator.php',
  708. 'CDateValidator' => '/validators/CDateValidator.php',
  709. 'CDefaultValueValidator' => '/validators/CDefaultValueValidator.php',
  710. 'CEmailValidator' => '/validators/CEmailValidator.php',
  711. 'CExistValidator' => '/validators/CExistValidator.php',
  712. 'CFileValidator' => '/validators/CFileValidator.php',
  713. 'CFilterValidator' => '/validators/CFilterValidator.php',
  714. 'CInlineValidator' => '/validators/CInlineValidator.php',
  715. 'CNumberValidator' => '/validators/CNumberValidator.php',
  716. 'CRangeValidator' => '/validators/CRangeValidator.php',
  717. 'CRegularExpressionValidator' => '/validators/CRegularExpressionValidator.php',
  718. 'CRequiredValidator' => '/validators/CRequiredValidator.php',
  719. 'CSafeValidator' => '/validators/CSafeValidator.php',
  720. 'CStringValidator' => '/validators/CStringValidator.php',
  721. 'CTypeValidator' => '/validators/CTypeValidator.php',
  722. 'CUniqueValidator' => '/validators/CUniqueValidator.php',
  723. 'CUnsafeValidator' => '/validators/CUnsafeValidator.php',
  724. 'CUrlValidator' => '/validators/CUrlValidator.php',
  725. 'CValidator' => '/validators/CValidator.php',
  726. 'CActiveDataProvider' => '/web/CActiveDataProvider.php',
  727. 'CArrayDataProvider' => '/web/CArrayDataProvider.php',
  728. 'CAssetManager' => '/web/CAssetManager.php',
  729. 'CBaseController' => '/web/CBaseController.php',
  730. 'CCacheHttpSession' => '/web/CCacheHttpSession.php',
  731. 'CClientScript' => '/web/CClientScript.php',
  732. 'CController' => '/web/CController.php',
  733. 'CDataProvider' => '/web/CDataProvider.php',
  734. 'CDbHttpSession' => '/web/CDbHttpSession.php',
  735. 'CExtController' => '/web/CExtController.php',
  736. 'CFormModel' => '/web/CFormModel.php',
  737. 'CHttpCookie' => '/web/CHttpCookie.php',
  738. 'CHttpRequest' => '/web/CHttpRequest.php',
  739. 'CHttpSession' => '/web/CHttpSession.php',
  740. 'CHttpSessionIterator' => '/web/CHttpSessionIterator.php',
  741. 'COutputEvent' => '/web/COutputEvent.php',
  742. 'CPagination' => '/web/CPagination.php',
  743. 'CSort' => '/web/CSort.php',
  744. 'CSqlDataProvider' => '/web/CSqlDataProvider.php',
  745. 'CTheme' => '/web/CTheme.php',
  746. 'CThemeManager' => '/web/CThemeManager.php',
  747. 'CUploadedFile' => '/web/CUploadedFile.php',
  748. 'CUrlManager' => '/web/CUrlManager.php',
  749. 'CWebApplication' => '/web/CWebApplication.php',
  750. 'CWebModule' => '/web/CWebModule.php',
  751. 'CWidgetFactory' => '/web/CWidgetFactory.php',
  752. 'CAction' => '/web/actions/CAction.php',
  753. 'CInlineAction' => '/web/actions/CInlineAction.php',
  754. 'CViewAction' => '/web/actions/CViewAction.php',
  755. 'CAccessControlFilter' => '/web/auth/CAccessControlFilter.php',
  756. 'CAuthAssignment' => '/web/auth/CAuthAssignment.php',
  757. 'CAuthItem' => '/web/auth/CAuthItem.php',
  758. 'CAuthManager' => '/web/auth/CAuthManager.php',
  759. 'CBaseUserIdentity' => '/web/auth/CBaseUserIdentity.php',
  760. 'CDbAuthManager' => '/web/auth/CDbAuthManager.php',
  761. 'CPhpAuthManager' => '/web/auth/CPhpAuthManager.php',
  762. 'CUserIdentity' => '/web/auth/CUserIdentity.php',
  763. 'CWebUser' => '/web/auth/CWebUser.php',
  764. 'CFilter' => '/web/filters/CFilter.php',
  765. 'CFilterChain' => '/web/filters/CFilterChain.php',
  766. 'CInlineFilter' => '/web/filters/CInlineFilter.php',
  767. 'CForm' => '/web/form/CForm.php',
  768. 'CFormButtonElement' => '/web/form/CFormButtonElement.php',
  769. 'CFormElement' => '/web/form/CFormElement.php',
  770. 'CFormElementCollection' => '/web/form/CFormElementCollection.php',
  771. 'CFormInputElement' => '/web/form/CFormInputElement.php',
  772. 'CFormStringElement' => '/web/form/CFormStringElement.php',
  773. 'CGoogleApi' => '/web/helpers/CGoogleApi.php',
  774. 'CHtml' => '/web/helpers/CHtml.php',
  775. 'CJSON' => '/web/helpers/CJSON.php',
  776. 'CJavaScript' => '/web/helpers/CJavaScript.php',
  777. 'CPradoViewRenderer' => '/web/renderers/CPradoViewRenderer.php',
  778. 'CViewRenderer' => '/web/renderers/CViewRenderer.php',
  779. 'CWebService' => '/web/services/CWebService.php',
  780. 'CWebServiceAction' => '/web/services/CWebServiceAction.php',
  781. 'CWsdlGenerator' => '/web/services/CWsdlGenerator.php',
  782. 'CActiveForm' => '/web/widgets/CActiveForm.php',
  783. 'CAutoComplete' => '/web/widgets/CAutoComplete.php',
  784. 'CClipWidget' => '/web/widgets/CClipWidget.php',
  785. 'CContentDecorator' => '/web/widgets/CContentDecorator.php',
  786. 'CFilterWidget' => '/web/widgets/CFilterWidget.php',
  787. 'CFlexWidget' => '/web/widgets/CFlexWidget.php',
  788. 'CHtmlPurifier' => '/web/widgets/CHtmlPurifier.php',
  789. 'CInputWidget' => '/web/widgets/CInputWidget.php',
  790. 'CMarkdown' => '/web/widgets/CMarkdown.php',
  791. 'CMaskedTextField' => '/web/widgets/CMaskedTextField.php',
  792. 'CMultiFileUpload' => '/web/widgets/CMultiFileUpload.php',
  793. 'COutputCache' => '/web/widgets/COutputCache.php',
  794. 'COutputProcessor' => '/web/widgets/COutputProcessor.php',
  795. 'CStarRating' => '/web/widgets/CStarRating.php',
  796. 'CTabView' => '/web/widgets/CTabView.php',
  797. 'CTextHighlighter' => '/web/widgets/CTextHighlighter.php',
  798. 'CTreeView' => '/web/widgets/CTreeView.php',
  799. 'CWidget' => '/web/widgets/CWidget.php',
  800. 'CCaptcha' => '/web/widgets/captcha/CCaptcha.php',
  801. 'CCaptchaAction' => '/web/widgets/captcha/CCaptchaAction.php',
  802. 'CBasePager' => '/web/widgets/pagers/CBasePager.php',
  803. 'CLinkPager' => '/web/widgets/pagers/CLinkPager.php',
  804. 'CListPager' => '/web/widgets/pagers/CListPager.php',
  805. );
  806. }
  807. spl_autoload_register(array('YiiBase','autoload'));
  808. require(YII_PATH.'/base/interfaces.php');