Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.12 KB | None | 0 0
  1. <?php
  2. if (file_exists(PATH_ROOT . '/protected/config/develop.php')) {
  3. $developConfig = require_once(PATH_ROOT . '/protected/config/develop.php');
  4. }
  5. if (file_exists(PATH_ROOT . '/protected/config/production.php')) {
  6. $productionConfig = require_once(PATH_ROOT . '/protected/config/production.php');
  7. }
  8.  
  9. // uncomment the following to define a path alias
  10. // Yii::setPathOfAlias('local','path/to/local-folder');
  11.  
  12. // This is the main Web application configuration. Any writable
  13. // CWebApplication properties can be configured here.
  14. $result = array(
  15. 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  16. 'name'=>'Cabinet tltdgkh',
  17. 'language' => 'ru',
  18. // preloading 'log' component
  19. 'preload'=>array('log'),
  20.  
  21. // autoloading model and component classes
  22. 'import'=>array(
  23. 'cab.models.*',
  24. 'application.forms.*',
  25. 'application.components.*',
  26. 'cab.extensions.*',
  27. 'application.views.helpers.*',
  28. 'cab.extensions.mailer.EMailer',
  29. 'cab.extensions.runactions.components.ERunActions',
  30. 'cab.extensions.EHttpClient.*',
  31. ),
  32.  
  33.  
  34. // application components
  35. 'components'=>array(
  36.  
  37. 'user'=>array(
  38. // enable cookie-based authentication
  39. 'allowAutoLogin'=>true,
  40. 'class'=>'WebUser',
  41. 'loginUrl'=>'/site/login'
  42. ),
  43. 'session' => array (
  44. 'autoStart' => empty($_POST['PHPSESSID']),
  45. 'cookieMode' => 'only',
  46. 'class' => 'application.components.MyCDbHttpSession',
  47. 'connectionID' => 'db',
  48. 'sessionTableName' => 'session',
  49. 'timeout' => 3600*24*30, // 30 days
  50. 'useTransparentSessionID' => !empty($_POST['PHPSESSID']),
  51. 'autoStart' => 'true',
  52. 'autoCreateSessionTable' => true,
  53. //Extension properties
  54. 'compareIpAddress'=>true,
  55. 'compareUserAgent'=>true,
  56. 'compareIpBlocks'=>0
  57. ),
  58.  
  59. // uncomment the following to enable URLs in path-format
  60. 'urlManager'=>array(
  61. 'urlFormat'=>'path',
  62. 'showScriptName' => false,
  63. 'urlSuffix' => '/',
  64. 'rules'=>array(
  65. '' => 'users',
  66. '<controller:\w+>/<id:\d+>'=>'<controller>/view',
  67. '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
  68. '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
  69. 'login'=>'site/login',
  70. 'logout'=>'site/logout',
  71. ),
  72. ),
  73.  
  74. /*'db'=>array(
  75. 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
  76. ),*/
  77. // uncomment the following to use a MySQL database
  78.  
  79. 'db'=>array(
  80. 'connectionString' => 'mysql:host=localhost;dbname=tltdgkh',
  81. 'emulatePrepare' => true,
  82. 'username' => 'root',
  83. 'password' => '11',
  84. 'charset' => 'utf8',
  85. 'tablePrefix' => 'yii_'
  86. ),
  87. 'authManager'=>array(
  88. 'class'=>'CDbAuthManager',
  89. 'connectionID' => 'db'
  90. ),
  91. 'errorHandler'=>array(
  92. // use 'site/error' action to display errors
  93. 'errorAction'=>'site/error',
  94. ),
  95. 'log'=>array(
  96. 'class'=>'CLogRouter',
  97. 'routes'=>array(
  98. array(
  99. 'class'=>'CFileLogRoute',
  100. 'levels'=>'error, warning',
  101. ),
  102. array(
  103. 'class' => 'MyCEmailLogRoute',
  104. 'levels' => 'error, warning',
  105. 'emails' => array('email@gmail.com'),
  106. /*'categories' => 'exception.*, system.*',*/
  107. 'except' => 'exception.CHttpException.404', // игнорим 404
  108. 'sentFrom' => 'noreply@tltdgkh.ru',
  109. 'subject' => 'Error',
  110. 'config' => array(
  111. 'SMTP',
  112. 'Host' => "smtp.gmail.com",
  113. 'SMTPAuth' => true, // enable SMTP authentication
  114. 'SMTPSecure' => "ssl", // sets the prefix to the server
  115. // Attention: Remember to enable the SSL module in PHP
  116. 'Port' => 465, // set the SMTP port for the GMAIL server
  117. 'Username' => "email@gmail.com", // GMAIL username
  118. 'Password' => "", // GMAIL password
  119. 'CharSet' => "UTF-8",
  120. )
  121. ),
  122. // uncomment the following to show log messages on web pages
  123. /*
  124. array(
  125. 'class'=>'CWebLogRoute',
  126. ),
  127. */
  128. ),
  129. ),
  130. 'mailer' => array(
  131. 'class' => 'application.extensions.mailer.EMailer',
  132. 'pathViews' => 'application.views.email',
  133. 'pathLayouts' => 'application.views.email.layouts'
  134. ),
  135. ),
  136.  
  137. // application-level parameters that can be accessed
  138. // using Yii::app()->params['paramName']
  139. 'params'=>array(
  140. // this is used in contact page
  141. 'adminEmail'=>'email@gmail.com',
  142. 'countersEmail' => 'robaweb@gmail.com', // почта для отправки показаний
  143. 'mailer' => array (
  144. 'Mailer' => 'smtp',
  145. 'ContentType' => 'text/html',
  146. 'SMTPAuth' => true,
  147. 'SMTPSecure' => 'ssl',
  148. 'CharSet' => 'UTF-8',
  149. 'Timeout' => 15,
  150. 'Host' => 'smtp.gmail.com',
  151. 'Port' => 465,
  152. 'Username' => 'email@gmail.com',
  153. 'Password' => '',
  154. )
  155. ),
  156. );
  157.  
  158.  
  159. if (isset($developConfig)) {
  160. $result = array_merge_recursive_distinct($result, $developConfig);
  161. }
  162.  
  163. if (isset($productionConfig)) {
  164. $result = array_merge_recursive_distinct($result, $productionConfig);
  165. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement