Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2013
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.25 KB | None | 0 0
  1. <?php
  2.  
  3. // uncomment the following to define a path alias
  4. // Yii::setPathOfAlias('local','path/to/local-folder');
  5.  
  6. // This is the main Web application configuration. Any writable
  7. // CWebApplication properties can be configured here.
  8. return array(
  9. 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  10. 'name'=>'Timeline',
  11.  
  12. // preloading 'log' component
  13. 'preload'=>array('log'),
  14.  
  15. // autoloading model and component classes
  16. 'import'=>array(
  17. 'application.models.*',
  18. 'application.components.*',
  19. 'ext.yii-mail.YiiMailMessage',
  20. ),
  21.  
  22. 'modules'=>array(
  23. // uncomment the following to enable the Gii tool
  24. 'gii'=>array(
  25. 'class'=>'system.gii.GiiModule',
  26. 'password'=>'giipass',
  27. // If removed, Gii defaults to localhost only. Edit carefully to taste.
  28. 'ipFilters'=>array('127.0.0.1','::1'),
  29. ),
  30. ),
  31. // application components
  32. 'components'=>array(
  33. 'user'=>array(
  34. // enable cookie-based authentication
  35. 'allowAutoLogin'=>true,
  36. ),
  37. 'mail' => array(
  38. 'class' => 'ext.yii-mail.YiiMail',
  39. 'transportType'=>'smtp',
  40. 'transportOptions'=>array(
  41. 'encryption'=>'tls',
  42. 'host'=>'smtp.gmail.com',
  43. 'username'=>'<username>',
  44. 'password'=>'<password>',
  45. 'port'=>'465',
  46. ),
  47. 'viewPath' => 'application.views.mail',
  48. ),
  49. // uncomment the following to enable URLs in path-format
  50. 'urlManager'=>array(
  51. 'urlFormat'=>'path',
  52. 'rules'=>array(
  53. array('user/login', 'pattern'=>'api/login', 'verb'=>'POST'),
  54. array('user/logout', 'pattern'=>'api/logout', 'verb'=>'POST'),
  55. array('user/register', 'pattern'=>'api/register', 'verb'=>'POST'),
  56. array('user/rememberUser', 'pattern'=>'api/remember', 'verb'=>'GET, POST'),
  57. array('site/confirm', 'pattern'=>'confirm/<st:[\d\w]+>', 'verb'=>'GET'),
  58. array('project/view', 'pattern'=>'api/project/<id:\d+>', 'verb'=>'GET'),
  59. array('project/listMine', 'pattern'=>'api/project/mine', 'verb'=>'GET'),
  60. array('project/listAll', 'pattern'=>'api/project/all', 'verb'=>'GET'),
  61. array('project/create', 'pattern'=>'api/project/create', 'verb'=>'POST'),
  62. array('project/delete', 'pattern'=>'api/project/delete', 'verb'=>'POST'),
  63. array('project/update', 'pattern'=>'api/project/update', 'verb'=>'POST'),
  64. array('project/addLine', 'pattern'=>'api/project/addLine/', 'verb'=>'POST'),
  65. array('project/deleteLine', 'pattern'=>'api/project/deleteLine', 'verb'=>('POST')),
  66. array('project/save', 'pattern'=>'api/project/saveProject', 'verb'=>'POST'),
  67. array('project/addLine', 'pattern'=>'api/project/addLine', 'verb'=>'POST'),
  68. array('event/view', 'pattern'=>'api/event/<id:\d+>', 'verb'=>'GET'),
  69. array('event/list', 'pattern'=>'api/event/list', 'verb'=>'GET'),
  70. array('event/create', 'pattern'=>'api/event/create', 'verb'=>'POST'),
  71. array('event/delete', 'pattern'=>'api/event/delete', 'verb'=>'POST'),
  72. array('event/update', 'pattern'=>'api/event/update', 'verb'=>'POST'),
  73. array('event/addResource', 'pattern'=>'api/event/addResource', 'verb'=>'POST'),
  74. array('event/deleteResource', 'pattern'=>'api/event/add', 'verb'=>('POST')),
  75. array('line/view', 'pattern'=>'api/line/<id:\d+>', 'verb'=>'GET'),
  76. array('line/list', 'pattern'=>'api/line/list', 'verb'=>'GET'),
  77. array('line/create', 'pattern'=>'api/line/create/', 'verb'=>'POST'),
  78. array('line/delete', 'pattern'=>'api/line/delete', 'verb'=>'POST'),
  79. array('line/update', 'pattern'=>'api/line/update', 'verb'=>'POST'),
  80. array('line/addEvent', 'pattern'=>'api/line/addEvent', 'verb'=>'POST'),
  81. array('line/deleteEvent', 'pattern'=>'api/line/deleteEvent', 'verb'=>('POST')),
  82. array('resource/view', 'pattern'=>'api/resource/<id:\d+>', 'verb'=>'GET'),
  83. array('resource/list', 'pattern'=>'api/resource/list', 'verb'=>'GET'),
  84. array('resource/create', 'pattern'=>'api/resource/create', 'verb'=>'POST'),
  85. array('resource/delete', 'pattern'=>'api/resource/delete', 'verb'=>'POST'),
  86. array('resource/update', 'pattern'=>'api/resource/update', 'verb'=>'POST'),
  87. '<controller:\w+>/<id:\d+>'=>'<controller>/view',
  88. '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
  89. '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
  90. ),
  91. ),
  92. // uncomment the following to use a MySQL database
  93. 'db'=>array(
  94. 'connectionString' => 'mysql:host=localhost;dbname=c11_timeline',
  95. 'emulatePrepare' => true,
  96. 'username' => 'root', //c11_timeline
  97. 'password' => '', //x102030!
  98. 'charset' => 'utf8',
  99. ),
  100. 'errorHandler'=>array(
  101. // use 'site/error' action to display errors
  102. 'errorAction'=>'site/error',
  103. ),
  104. 'log'=>array(
  105. 'class'=>'CLogRouter',
  106. 'routes'=>array(
  107. array(
  108. 'class'=>'CFileLogRoute',
  109. 'levels'=>'error, warning',
  110. ),
  111. // uncomment the following to show log messages on web pages
  112. /*
  113. array(
  114. 'class'=>'CWebLogRoute',
  115. ),
  116. */
  117. ),
  118. ),
  119. ),
  120.  
  121. // application-level parameters that can be accessed
  122. // using Yii::app()->params['paramName']
  123. 'params'=>array(
  124. // this is used in contact page
  125. 'adminEmail'=>'[email protected]',
  126. 'ERR_LOGIN_MESSAGE'=>'You are not currently logged in',
  127. 'ERR_AUTH_MESSAGE'=>'You do not have authorization to access this resource',
  128. 'ERR_DNE_MESSAGE'=>'The requested resource does not exist',
  129. 'ERR_PARAMS_MESSAGE'=>'Paramater not allowed: ',
  130. 'ERR_SAVE_MESSAGE'=>'There was an error saving: ',
  131. 'ERR_DB_MESSAGE'=>'There was a database error',
  132. 'RESOURCE_DIR'=>'./resources/',
  133. 'ERR_LOGIN_CODE'=>1,
  134. 'ERR_AUTH_CODE'=>2,
  135. 'ERR_DNE_CODE'=>3,
  136. 'ERR_PARAMS_CODE'=>4,
  137. 'ERR_SAVE_CODE'=>5,
  138. 'ERR_DB_CODE'=>6,
  139. 'OWNER'=>0,
  140. 'VIEWER'=>1,
  141. 'NO_ACCESS'=>2,
  142. ),
  143. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement