PageRenderTime 52ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/yii/framework/YiiBase.php

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