main.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. 'db'=>array(
  45. 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
  46. ),
  47. // uncomment the following to use a MySQL database
  48. /*
  49. 'db'=>array(
  50. 'connectionString' => 'mysql:host=localhost;dbname=testdrive',
  51. 'emulatePrepare' => true,
  52. 'username' => 'root',
  53. 'password' => '',
  54. 'charset' => 'utf8',
  55. ),
  56. */
  57. 'errorHandler'=>array(
  58. // use 'site/error' action to display errors
  59. 'errorAction'=>'site/error',
  60. ),
  61. 'log'=>array(
  62. 'class'=>'CLogRouter',
  63. 'routes'=>array(
  64. array(
  65. 'class'=>'CFileLogRoute',
  66. 'levels'=>'error, warning',
  67. ),
  68. // uncomment the following to show log messages on web pages
  69. /*
  70. array(
  71. 'class'=>'CWebLogRoute',
  72. ),
  73. */
  74. ),
  75. ),
  76. ),
  77. // application-level parameters that can be accessed
  78. // using Yii::app()->params['paramName']
  79. 'params'=>array(
  80. // this is used in contact page
  81. 'adminEmail'=>'webmaster@example.com',
  82. ),
  83. );