main.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. // uncomment the following to define a path alias
  3. // Yii::setPathOfAlias('local','path/to/local-folder');
  4. // This is the main Web application configuration. Any writable
  5. // CWebApplication properties can be configured here.
  6. return array(
  7. 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  8. 'name'=>'My Web Application',
  9. // preloading 'log' component
  10. 'preload'=>array('log'),
  11. // autoloading model and component classes
  12. 'import'=>array(
  13. 'application.models.*',
  14. 'application.components.*',
  15. ),
  16. 'modules'=>array(
  17. // uncomment the following to enable the Gii tool
  18. /*
  19. 'gii'=>array(
  20. 'class'=>'system.gii.GiiModule',
  21. 'password'=>'Enter Your Password Here',
  22. // If removed, Gii defaults to localhost only. Edit carefully to taste.
  23. 'ipFilters'=>array('127.0.0.1','::1'),
  24. ),
  25. */
  26. ),
  27. // application components
  28. 'components'=>array(
  29. 'user'=>array(
  30. // enable cookie-based authentication
  31. 'allowAutoLogin'=>true,
  32. ),
  33. // uncomment the following to enable URLs in path-format
  34. /*
  35. 'urlManager'=>array(
  36. 'urlFormat'=>'path',
  37. 'rules'=>array(
  38. '<controller:\w+>/<id:\d+>'=>'<controller>/view',
  39. '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
  40. '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
  41. ),
  42. ),
  43. */
  44. // database settings are configured in database.php
  45. 'db'=>require(dirname(__FILE__).'/database.php'),
  46. 'errorHandler'=>array(
  47. // use 'site/error' action to display errors
  48. 'errorAction'=>'site/error',
  49. ),
  50. 'log'=>array(
  51. 'class'=>'CLogRouter',
  52. 'routes'=>array(
  53. array(
  54. 'class'=>'CFileLogRoute',
  55. 'levels'=>'error, warning',
  56. ),
  57. // uncomment the following to show log messages on web pages
  58. /*
  59. array(
  60. 'class'=>'CWebLogRoute',
  61. ),
  62. */
  63. ),
  64. ),
  65. ),
  66. // application-level parameters that can be accessed
  67. // using Yii::app()->params['paramName']
  68. 'params'=>array(
  69. // this is used in contact page
  70. 'adminEmail'=>'webmaster@example.com',
  71. ),
  72. );