Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // uncomment the following to define a path alias
- // Yii::setPathOfAlias('local','path/to/local-folder');
- // This is the main Web application configuration. Any writable
- // CWebApplication properties can be configured here.
- $config = array(
- 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
- 'name'=>'B2B',
- //'sourceLanguage' =>'pl',
- 'language' => 'pl',
- // 'sourceLanguage' => 'pl',
- // preloading 'log' component
- 'preload'=>array('log','bootstrap'),
- // autoloading model and component classes
- 'import'=>array(
- 'application.models.*',
- 'application.components.*',
- 'ext.giix.components.*',
- 'application.modules.rights.*',
- 'application.modules.rights.components.*',
- 'application.modules.user.models.*',
- 'application.modules.user.components.*',
- 'ext.bootstrap.widgets.*',
- 'application.helpers.*',
- 'application.modules.customFields.components.*',
- 'ext.YiiMailer.YiiMailer',
- 'application.extensions.CAdvancedArBehavior.CAdvancedArBehavior',
- ),
- 'aliases' => array(
- //assuming you extracted the files to the extensions folder
- 'xupload' => 'ext.xupload',
- 'RestfullYii' => realpath(__DIR__ . '/../extensions/starship/RestfullYii'),
- ),
- 'modules'=>array(
- // uncomment the following to enable the Gii tool
- 'gii'=>array(
- 'class'=>'system.gii.GiiModule',
- 'generatorPaths' => array(
- 'ext.giix.generators', // giix generators
- 'bootstrap.gii',
- ),
- 'password'=>'pierogi1',
- // If removed, Gii defaults to localhost only. Edit carefully to taste.
- 'ipFilters'=>array('192.168.1.*'),
- ),
- 'user',
- 'rights'=>array( 'superuserName'=>'Admin', // Name of the role with super user privileges.
- 'authenticatedName'=>'Authenticated', // Name of the authenticated user role.
- 'userIdColumn'=>'usrId', // Name of the user id column in the database.
- 'userNameColumn'=>'usrUsername', // Name of the user name column in the database.
- 'enableBizRule'=>true, // Whether to enable authorization item business rules.
- 'enableBizRuleData'=>true, // Whether to enable data for business rules.
- 'displayDescription'=>true, // Whether to use item description instead of name.
- 'flashSuccessKey'=>'success', // Key to use for setting success flash messages.
- 'flashErrorKey'=>'error', // Key to use for setting error flash messages.
- 'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.
- 'install'=>false, // Whether to enable installer.
- 'debug'=>false, // Whether to enable debug mode.
- 'cssFile' => false
- ),
- 'image'=>array(
- 'createOnDemand'=>true, // requires apache mod_rewrite enabled
- 'install'=>true, // allows you to run the installer
- ),
- ),
- // application components
- 'components'=>array(
- 'assetManager' => array(
- 'linkAssets' => true,
- ),
- 'messages' => array(
- 'class' => 'CPhpMessageSource'
- ),
- 'session' => array (
- 'autoStart' => true,
- ),
- 'user'=>array(
- 'class' => 'RWebUser',
- 'loginUrl' => array('/user/login'),
- 'allowAutoLogin'=>false,
- ),
- 'image'=>array(
- 'class'=>'application.extensions.image.CImageComponent',
- // GD or ImageMagick
- 'driver'=>'GD',
- // ImageMagick setup path
- 'params'=>array('path'=>'/../uploads/',
- 'sizes'=> array(
- '_sys' => array('resize',80,60)
- )
- ),
- ),
- // 'format'=>array(
- // 'class'=>'application.components.Formatter',
- // 'numberFormat'=>array('decimals'=>3, 'decimalSeparator'=>',', 'thousandSeparator'=>'-'),
- // ),
- //inicjalizacja bootstrap toolkit
- 'bootstrap'=>array(
- 'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
- 'coreCss'=>true, // whether to register the Bootstrap core CSS (bootstrap.min.css), defaults to true
- 'responsiveCss'=>true, // whether to register the Bootstrap responsive CSS (bootstrap-responsive.min.css), default to false
- 'plugins'=>array(
- // Optionally you can configure the "global" plugins (button, popover, tooltip and transition)
- // To prevent a plugin from being loaded set it to false as demonstrated below
- 'transition'=>false, // disable CSS transitions
- // 'tooltip'=>array(
- // 'selector'=>'[rel$="tooltip"]', // bind the plugin tooltip to anchor tags with the 'tooltip' class
- // 'options'=>array(
- // 'placement'=>'top', // place the tooltips below instead
- // ),
- // ),
- 'popover'=>array(
- 'selector'=>'[rel$="popover"]', // bind the plugin tooltip to anchor tags with the 'tooltip' class
- 'options'=>array(
- 'html'=>'true', // place the tooltips below instead
- ),
- ),
- ),
- ),
- // uncomment the following to enable URLs in path-format
- 'urlManager'=>array(
- 'urlFormat'=>'path',
- 'rules'=> require(
- 'routes.php'
- ),
- 'showScriptName'=>false,
- ),
- 'authManager' => array(
- 'class' => 'RDbAuthManager',
- 'defaultRoles'=>array('Guest'),
- ),
- // 'cache'=>array(
- // 'class'=>'system.caching.CApcCache',
- // ),
- 'settings'=>array(
- 'class' => 'application.extensions.Settings',
- ),
- 'db'=>array(
- 'connectionString' => 'mysql:host=localhost;dbname=erp_2015',
- 'emulatePrepare' => true,
- 'username' => 'erp',
- 'password' => 'pierogi1',
- 'charset' => 'utf8',
- 'tablePrefix'=>'',
- 'enableProfiling'=>true,
- 'enableParamLogging'=>true,
- ),
- 'errorHandler'=>array(
- // use 'site/error' action to display errors
- 'errorAction'=>'layout/dashboard/error',
- ),
- 'log'=>array(
- 'class'=>'CLogRouter',
- // 'routes'=>array(
- // array(
- // 'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
- // 'ipFilters'=>array('127.0.0.1','82.177.80.150'),
- // ),
- // ),
- ),
- 'ePdf' => array(
- 'class' => 'ext.yii-pdf.EYiiPdf',
- 'params' => array(
- 'mpdf' => array(
- 'librarySourcePath' => 'application.vendors.mpdf.*',
- 'constants' => array(
- '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.files'),
- // '_MPDF_TEMP_PATH' => __DIR__ . '/../runtime',
- ),
- 'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
- 'defaultParams' => array( // More info: http://mpdf1.com/manual/index.php?tid=184
- // 'mode' => '', // This parameter specifies the mode of the new document.
- 'format' => 'A4', // format A4, A5, ...
- // 'default_font_size' => 0, // Sets the default document font size in points (pt)
- // 'default_font' => '', // Sets the default font-family for the new document.
- // 'mgl' => 15, // margin_left. Sets the page margins for the new document.
- // 'mgr' => 15, // margin_right
- // 'mgb' => '50', // margin_bottom
- // 'mgt' => 10, // margin_top
- // 'mgh' => 9, // margin_header
- // 'mgf' => 9, // margin_footer
- // 'orientation' => 'P', // landscape or portrait orientation
- )
- )
- ),
- ),
- 'barcode' => array(
- 'class' => 'ext.yii-barcode.EYiiBarcode',
- ),
- ),
- // application-level parameters that can be accessed
- // using Yii::app()->params['paramName']
- 'params'=>array(
- // this is used in contact page
- 'adminEmail'=>'webmaster@example.com',
- 'defaultPageSize' => 20,
- 'debug' => true,
- 'webRoot' => dirname(__FILE__).DIRECTORY_SEPARATOR.'../../',
- 'imap_password_seed' => 'abc123',
- 'filesPath' => '/files',
- 'win_app' => $_GET['win_app'],
- 'dbPrefix' => 'erp_',
- 'mysql' => 'C:\xampp\mysql\bin\mysql.exe',
- 'mysqlDump' => 'C:\xampp\mysql\bin\mysqldump.exe',
- 'directAdmin' => false,
- 'directAdminIp' => '62.75.206.132',
- 'directAdminLogin' => 'admin',
- 'directAdminPassword' => 'U6H=,z>;<I]k4}(',
- //zaczynamy od katalogu /protected
- 'backupDirectory' => "backup",
- 'RestfullYii' => array(
- 'req.auth.ajax.user' => function(){
- // return true;
- if(isset($_REQUEST)) {
- $username = trim($_REQUEST['username']) != '' ? trim($_REQUEST['username']) : false;
- $password = trim($_REQUEST['password']) != '' ? trim($_REQUEST['password']) : false;
- $identity = new UserIdentity($username, $password);
- $auth = $identity->apiAuthenticate();
- if($auth === true){
- return true;
- }
- else{
- echo $auth;
- exit();
- }
- }
- },
- ),
- ),
- 'defaultController' => 'layout/dashboard/index',
- );
- //pobieramy sciezke do katalogu z modulami
- $modules_dir = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR;
- //globalne moduly wczytywane zawsze
- $global_modules = array('user','rights','gii');
- //pobieramy liste modulow skanujac katalog /protected/modules/
- $modules_search = glob($modules_dir."*",GLOB_ONLYDIR);
- foreach ($modules_search as $value) {
- $module_name = end(explode(DIRECTORY_SEPARATOR,$value));
- //sprawdzamy czy modul jest akatywny i nie nalezy do modulow globalnych (_ w nazwie katalogu oznacza, ze modul jest nieaktywny)
- if ($module_name[0] != '_' && !in_array($module_name, $global_modules)) {
- $config['modules'][] = $module_name;
- }
- }
- return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement