The Controller in Components directory may be a customized controller extending from the frameworks CController. It should be loaded because import lists ‘application.components.*’. Strange.
The server config just overlays the mail and db application components. Can be managed in the local config. Also there is an additional parameter “‘mpdf5Path’=>’/vendors/MPDF54/mpdf.php’,” (seemingly for pdf generation).
In the local config there is a dependency on $env but the code referring to $isLocal is commented, so unless referred to from elsewhere (CApplication? code), should not be a problem.
(Also search all files for YII_ENVIRONMENT, may be a dependence somewhere on "local" or <mydomain.org>)
There is a lot of rules for the urlManager component. By setting showScriptName to true you won’t need the redirection in .htaccess.
First goal should be to see your applications start page. Tell us exactly what you see (screen shot).
Simple start script.
<?php
error_reporting( error_reporting() & ~E_NOTICE );
$yii = dirname(__FILE__) . '/protected/framework/yii.php';
$config = dirname(__FILE__) . '/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', 1);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
require_once($yii);
Yii::createWebApplication($config)->run();
Local config, better readability
<?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.
$isLocal = $env == 'local';
return array(
'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
'name' => 'XX',
// preloading 'log' component
'preload' => array('log'),
'language' => 'en',
// autoloading model and component classes
'import' => array(
'application.models.*',
'application.components.*',
'application.vendor.*',
'application.helpers.*',
//'application.extensions.jtogglecolumn.*',
'ext.mail.YiiMailMessage',
'ext.jui.EJuiDateTimePicker',
'application.extensions.easyPaypal.*'
),
'modules' => array(
// uncomment the following to enable the Gii tool
'gii' => array(
'generatorPaths' => array(
'bootstrap.gii'
),
'class' => 'system.gii.GiiModule',
'password' => 'XX',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters' => array('127.0.0.1', '::1'),
),
),
// application components
'components' => array(
'user' => array(
// enable cookie-based authentication
'allowAutoLogin' => true,
'class' => 'WebUser'
),
'akthumb' => array(
'class' => 'ext.thumb.AkThumb',
),
'clientScript' => array(
'coreScriptPosition' => 2, //CClientScript::POS_END
'defaultScriptPosition' => 2, //CClientScript::POS_END
'defaultScriptFilePosition' => 2, //CClientScript::POS_END
/*
'class' => 'application.vendor.yii-EClientScript.EClientScript',
'combineScriptFiles' => !$isLocal, // By default this is set to true, set this to true if you'd like to combine the script files
'combineCssFiles' => !$isLocal, // By default this is set to true, set this to true if you'd like to combine the css files
'optimizeScriptFiles' => !$isLocal, // @since: 1.1
'optimizeCssFiles' => !$isLocal, // @since: 1.1
'optimizeInlineScript' => false, // @since: 1.6, This may case response slower
'optimizeInlineCss' => false, // @since: 1.6, This may case response slower
*
*/
),
// uncomment the following to enable URLs in path-format
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'rules' => array(
'category/front/<slug:[\w\-]+>' => 'category/viewBySlug',
'r/<type:[\w\-]+>/<category_id:\d+>' => 'resource/list',
'r/front/<slug:[\w\-]+>/<type:\d+>' => 'resource/viewBySlug',
'r/front/<slug:[\w\-]+>/<type:\d+>/<category_id:\d+>' => 'resource/viewBySlug',
'event/list/<type:[\w\-]+>' => 'event/list',
'event/front/<slug:[\w\-]+>' => 'event/viewBySlug',
'newsletter/front/<slug:[\w\-]+>' => 'newsletter/viewBySlug',
'/login' => 'site/login',
'/logout' => 'site/logout',
'page/<view:\w+>' => 'site/page',
'p/<slug:[\w\-]+>' => 'cms/viewBySlug',
'/contact' => 'site/contactus',
'search' => 'site/search',
'sitemap' => 'site/sitemap',
'/enews' => 'subscriber/subscribe',
'/newsletter' => 'newsletter/list',
'/registerMember' => 'user/registerMember',
'/registerSaved' => 'user/registerSaved',
'activateUser/<token:[\w\-]+>' => 'site/activateUser',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'login' => 'site/login',
'iforgot' => 'site/forgot',
),
),
'db' => array(
'connectionString' => 'sqlite:' . dirname(__FILE__) . '/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db' => array(
'connectionString' => 'mysql:host=127.0.0.1;dbname=XX',
'emulatePrepare' => true,
'username' => 'XX',
'password' => 'XX',
'charset' => 'utf8',
),
'errorHandler' => array(
// use 'site/error' action to display errors
'errorAction' => 'site/error',
),
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => 'CFileLogRoute',
'levels' => 'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
'mail' => array(
'class' => 'ext.mail.YiiMail',
'transportType' => 'smtp',
'transportOptions' => array(
'host' => 'idreamhtml.com',
//'encryption' => 'ssl', // use ssl
'username' => 'XX',
'password' => '',
'port' => 25, // ssl port for gmail
),
'viewPath' => 'application.layouts.mails',
'logging' => true,
'dryRun' => false
),
'image' => array(
'class' => 'application.extensions.image.CImageComponent',
// GD or ImageMagick
'driver' => 'GD',
// ImageMagick setup path
'params' => array('directory' => '/opt/local/bin'),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params' => array(
// this is used in contact page
'adminEmail' => 'XX',
'defaultPageSize' => '25',
'googleMapApiKey' => 'XX',
// PayPal Settings
'PAYPAL_API_USERNAME' => 'XX',
'PAYPAL_API_PASSWORD' => 'XX',
'PAYPAL_API_SIGNATURE' => 'XX',
'PAYPAL_MODE' => 'sandbox1' // sandbox/live default=sandbox
),
);