Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.35 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.  
  9.  
  10.  
  11.  
  12.  
  13. $config = array(
  14. 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
  15. 'name'=>'B2B',
  16. //'sourceLanguage' =>'pl',
  17. 'language' => 'pl',
  18. // 'sourceLanguage' => 'pl',
  19. // preloading 'log' component
  20. 'preload'=>array('log','bootstrap'),
  21.  
  22. // autoloading model and component classes
  23. 'import'=>array(
  24. 'application.models.*',
  25. 'application.components.*',
  26. 'ext.giix.components.*',
  27. 'application.modules.rights.*',
  28. 'application.modules.rights.components.*',
  29. 'application.modules.user.models.*',
  30. 'application.modules.user.components.*',
  31. 'ext.bootstrap.widgets.*',
  32. 'application.helpers.*',
  33. 'application.modules.customFields.components.*',
  34. 'ext.YiiMailer.YiiMailer',
  35. 'application.extensions.CAdvancedArBehavior.CAdvancedArBehavior',
  36. ),
  37.  
  38. 'aliases' => array(
  39. //assuming you extracted the files to the extensions folder
  40. 'xupload' => 'ext.xupload',
  41. 'RestfullYii' => realpath(__DIR__ . '/../extensions/starship/RestfullYii'),
  42. ),
  43. 'modules'=>array(
  44. // uncomment the following to enable the Gii tool
  45.  
  46. 'gii'=>array(
  47. 'class'=>'system.gii.GiiModule',
  48. 'generatorPaths' => array(
  49. 'ext.giix.generators', // giix generators
  50. 'bootstrap.gii',
  51. ),
  52. 'password'=>'pierogi1',
  53. // If removed, Gii defaults to localhost only. Edit carefully to taste.
  54. 'ipFilters'=>array('192.168.1.*'),
  55. ),
  56. 'user',
  57. 'rights'=>array( 'superuserName'=>'Admin', // Name of the role with super user privileges.
  58. 'authenticatedName'=>'Authenticated', // Name of the authenticated user role.
  59. 'userIdColumn'=>'usrId', // Name of the user id column in the database.
  60. 'userNameColumn'=>'usrUsername', // Name of the user name column in the database.
  61. 'enableBizRule'=>true, // Whether to enable authorization item business rules.
  62. 'enableBizRuleData'=>true, // Whether to enable data for business rules.
  63. 'displayDescription'=>true, // Whether to use item description instead of name.
  64. 'flashSuccessKey'=>'success', // Key to use for setting success flash messages.
  65. 'flashErrorKey'=>'error', // Key to use for setting error flash messages.
  66. 'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.
  67. 'install'=>false, // Whether to enable installer.
  68. 'debug'=>false, // Whether to enable debug mode.
  69. 'cssFile' => false
  70. ),
  71. 'image'=>array(
  72. 'createOnDemand'=>true, // requires apache mod_rewrite enabled
  73. 'install'=>true, // allows you to run the installer
  74. ),
  75.  
  76.  
  77. ),
  78.  
  79. // application components
  80. 'components'=>array(
  81.  
  82. 'assetManager' => array(
  83. 'linkAssets' => true,
  84. ),
  85. 'messages' => array(
  86. 'class' => 'CPhpMessageSource'
  87. ),
  88. 'session' => array (
  89. 'autoStart' => true,
  90. ),
  91. 'user'=>array(
  92. 'class' => 'RWebUser',
  93. 'loginUrl' => array('/user/login'),
  94. 'allowAutoLogin'=>false,
  95. ),
  96. 'image'=>array(
  97. 'class'=>'application.extensions.image.CImageComponent',
  98. // GD or ImageMagick
  99. 'driver'=>'GD',
  100. // ImageMagick setup path
  101. 'params'=>array('path'=>'/../uploads/',
  102. 'sizes'=> array(
  103. '_sys' => array('resize',80,60)
  104. )
  105. ),
  106. ),
  107.  
  108. // 'format'=>array(
  109. // 'class'=>'application.components.Formatter',
  110. // 'numberFormat'=>array('decimals'=>3, 'decimalSeparator'=>',', 'thousandSeparator'=>'-'),
  111. // ),
  112. //inicjalizacja bootstrap toolkit
  113. 'bootstrap'=>array(
  114. 'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
  115. 'coreCss'=>true, // whether to register the Bootstrap core CSS (bootstrap.min.css), defaults to true
  116. 'responsiveCss'=>true, // whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css), default to false
  117. 'plugins'=>array(
  118. // Optionally you can configure the "global" plugins (button, popover, tooltip and transition)
  119. // To prevent a plugin from being loaded set it to false as demonstrated below
  120. 'transition'=>false, // disable CSS transitions
  121. // 'tooltip'=>array(
  122. // 'selector'=>'[rel$="tooltip"]', // bind the plugin tooltip to anchor tags with the 'tooltip' class
  123. // 'options'=>array(
  124. // 'placement'=>'top', // place the tooltips below instead
  125. // ),
  126. // ),
  127. 'popover'=>array(
  128. 'selector'=>'[rel$="popover"]', // bind the plugin tooltip to anchor tags with the 'tooltip' class
  129. 'options'=>array(
  130. 'html'=>'true', // place the tooltips below instead
  131. ),
  132. ),
  133.  
  134. ),
  135. ),
  136.  
  137.  
  138. // uncomment the following to enable URLs in path-format
  139.  
  140. 'urlManager'=>array(
  141. 'urlFormat'=>'path',
  142. 'rules'=> require(
  143. 'routes.php'
  144. ),
  145. 'showScriptName'=>false,
  146. ),
  147. 'authManager' => array(
  148. 'class' => 'RDbAuthManager',
  149. 'defaultRoles'=>array('Guest'),
  150.  
  151.  
  152. ),
  153. // 'cache'=>array(
  154. // 'class'=>'system.caching.CApcCache',
  155. // ),
  156. 'settings'=>array(
  157. 'class' => 'application.extensions.Settings',
  158.  
  159. ),
  160.  
  161.  
  162.  
  163. 'db'=>array(
  164.  
  165. 'connectionString' => 'mysql:host=localhost;dbname=erp_2015',
  166. 'emulatePrepare' => true,
  167. 'username' => 'erp',
  168. 'password' => 'pierogi1',
  169. 'charset' => 'utf8',
  170. 'tablePrefix'=>'',
  171. 'enableProfiling'=>true,
  172. 'enableParamLogging'=>true,
  173.  
  174.  
  175. ),
  176. 'errorHandler'=>array(
  177. // use 'site/error' action to display errors
  178. 'errorAction'=>'layout/dashboard/error',
  179. ),
  180.  
  181. 'log'=>array(
  182. 'class'=>'CLogRouter',
  183. // 'routes'=>array(
  184. // array(
  185. // 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
  186. // 'ipFilters'=>array('127.0.0.1','82.177.80.150'),
  187. // ),
  188. // ),
  189. ),
  190.  
  191. 'ePdf' => array(
  192. 'class' => 'ext.yii-pdf.EYiiPdf',
  193. 'params' => array(
  194. 'mpdf' => array(
  195. 'librarySourcePath' => 'application.vendors.mpdf.*',
  196. 'constants' => array(
  197. '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.files'),
  198. // '_MPDF_TEMP_PATH' => __DIR__ . '/../runtime',
  199. ),
  200. 'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
  201. 'defaultParams' => array( // More info: http://mpdf1.com/manual/index.php?tid=184
  202. // 'mode' => '', // This parameter specifies the mode of the new document.
  203. 'format' => 'A4', // format A4, A5, ...
  204. // 'default_font_size' => 0, // Sets the default document font size in points (pt)
  205. // 'default_font' => '', // Sets the default font-family for the new document.
  206. // 'mgl' => 15, // margin_left. Sets the page margins for the new document.
  207. // 'mgr' => 15, // margin_right
  208. // 'mgb' => '50', // margin_bottom
  209. // 'mgt' => 10, // margin_top
  210. // 'mgh' => 9, // margin_header
  211. // 'mgf' => 9, // margin_footer
  212. // 'orientation' => 'P', // landscape or portrait orientation
  213. )
  214. )
  215. ),
  216. ),
  217.  
  218. 'barcode' => array(
  219. 'class' => 'ext.yii-barcode.EYiiBarcode',
  220. ),
  221.  
  222. ),
  223.  
  224. // application-level parameters that can be accessed
  225. // using Yii::app()->params['paramName']
  226. 'params'=>array(
  227. // this is used in contact page
  228. 'adminEmail'=>'webmaster@example.com',
  229. 'defaultPageSize' => 20,
  230. 'debug' => true,
  231. 'webRoot' => dirname(__FILE__).DIRECTORY_SEPARATOR.'../../',
  232. 'imap_password_seed' => 'abc123',
  233. 'filesPath' => '/files',
  234. 'win_app' => $_GET['win_app'],
  235. 'dbPrefix' => 'erp_',
  236. 'mysql' => 'C:\xampp\mysql\bin\mysql.exe',
  237. 'mysqlDump' => 'C:\xampp\mysql\bin\mysqldump.exe',
  238. 'directAdmin' => false,
  239. 'directAdminIp' => '62.75.206.132',
  240. 'directAdminLogin' => 'admin',
  241. 'directAdminPassword' => 'U6H=,z>;<I]k4}(',
  242. //zaczynamy od katalogu /protected
  243. 'backupDirectory' => "backup",
  244. 'RestfullYii' => array(
  245. 'req.auth.ajax.user' => function(){
  246. // return true;
  247. if(isset($_REQUEST)) {
  248. $username = trim($_REQUEST['username']) != '' ? trim($_REQUEST['username']) : false;
  249. $password = trim($_REQUEST['password']) != '' ? trim($_REQUEST['password']) : false;
  250. $identity = new UserIdentity($username, $password);
  251. $auth = $identity->apiAuthenticate();
  252. if($auth === true){
  253. return true;
  254. }
  255. else{
  256. echo $auth;
  257. exit();
  258. }
  259.  
  260. }
  261. },
  262. ),
  263.  
  264.  
  265. ),
  266. 'defaultController' => 'layout/dashboard/index',
  267.  
  268. );
  269.  
  270.  
  271.  
  272.  
  273. //pobieramy sciezke do katalogu z modulami
  274. $modules_dir = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR;
  275. //globalne moduly wczytywane zawsze
  276. $global_modules = array('user','rights','gii');
  277. //pobieramy liste modulow skanujac katalog /protected/modules/
  278. $modules_search = glob($modules_dir."*",GLOB_ONLYDIR);
  279. foreach ($modules_search as $value) {
  280.  
  281. $module_name = end(explode(DIRECTORY_SEPARATOR,$value));
  282. //sprawdzamy czy modul jest akatywny i nie nalezy do modulow globalnych (_ w nazwie katalogu oznacza, ze modul jest nieaktywny)
  283. if ($module_name[0] != '_' && !in_array($module_name, $global_modules)) {
  284. $config['modules'][] = $module_name;
  285. }
  286.  
  287. }
  288.  
  289. return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement