@@ -2,92 +2,92 @@ |
||
| 2 | 2 | |
| 3 | 3 | class ThemeSettings extends CiiSettingsModel |
| 4 | 4 | {
|
| 5 | - /** |
|
| 6 | - * The active theme |
|
| 7 | - * @var string |
|
| 8 | - */ |
|
| 9 | - public $theme = 'default'; |
|
| 5 | + /** |
|
| 6 | + * The active theme |
|
| 7 | + * @var string |
|
| 8 | + */ |
|
| 9 | + public $theme = 'default'; |
|
| 10 | 10 | |
| 11 | - /** |
|
| 12 | - * Validation rules for the theme |
|
| 13 | - * @return array |
|
| 14 | - */ |
|
| 15 | - public function rules() |
|
| 16 | - {
|
|
| 17 | - return array( |
|
| 18 | - array('theme', 'required'),
|
|
| 19 | - array('theme', 'length', 'max' => 255)
|
|
| 20 | - ); |
|
| 21 | - } |
|
| 11 | + /** |
|
| 12 | + * Validation rules for the theme |
|
| 13 | + * @return array |
|
| 14 | + */ |
|
| 15 | + public function rules() |
|
| 16 | + {
|
|
| 17 | + return array( |
|
| 18 | + array('theme', 'required'),
|
|
| 19 | + array('theme', 'length', 'max' => 255)
|
|
| 20 | + ); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Attribute labels for themes |
|
| 25 | - * @return array |
|
| 26 | - */ |
|
| 27 | - public function attributeLabels() |
|
| 28 | - {
|
|
| 29 | - return array( |
|
| 30 | - 'theme' => Yii::t('ciims.models.theme', 'Theme'),
|
|
| 31 | - ); |
|
| 32 | - } |
|
| 23 | + /** |
|
| 24 | + * Attribute labels for themes |
|
| 25 | + * @return array |
|
| 26 | + */ |
|
| 27 | + public function attributeLabels() |
|
| 28 | + {
|
|
| 29 | + return array( |
|
| 30 | + 'theme' => Yii::t('ciims.models.theme', 'Theme'),
|
|
| 31 | + ); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Returns the active theme name |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public function getTheme() |
|
| 39 | - {
|
|
| 40 | - return $this->theme; |
|
| 41 | - } |
|
| 34 | + /** |
|
| 35 | + * Returns the active theme name |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public function getTheme() |
|
| 39 | + {
|
|
| 40 | + return $this->theme; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Retrieves all of the themes from webroot.themes and returns them in an array group by type, each containing |
|
| 45 | - * the contents of theme.json. |
|
| 46 | - * |
|
| 47 | - * The themes are then cached for easy retrieval later. (I really hate unecessary DiskIO if something isn't changing...) |
|
| 48 | - * |
|
| 49 | - * @return array |
|
| 50 | - */ |
|
| 51 | - public function getThemes() |
|
| 52 | - {
|
|
| 53 | - $themes = Yii::app()->cache->get('settings_themes');
|
|
| 43 | + /** |
|
| 44 | + * Retrieves all of the themes from webroot.themes and returns them in an array group by type, each containing |
|
| 45 | + * the contents of theme.json. |
|
| 46 | + * |
|
| 47 | + * The themes are then cached for easy retrieval later. (I really hate unecessary DiskIO if something isn't changing...) |
|
| 48 | + * |
|
| 49 | + * @return array |
|
| 50 | + */ |
|
| 51 | + public function getThemes() |
|
| 52 | + {
|
|
| 53 | + $themes = Yii::app()->cache->get('settings_themes');
|
|
| 54 | 54 | |
| 55 | - if ($themes == false) |
|
| 56 | - {
|
|
| 57 | - $themes = array(); |
|
| 58 | - $currentTheme = Cii::getConfig('theme');
|
|
| 59 | - $themePath = Yii::getPathOfAlias('base.themes') . DS;
|
|
| 60 | - $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
| 55 | + if ($themes == false) |
|
| 56 | + {
|
|
| 57 | + $themes = array(); |
|
| 58 | + $currentTheme = Cii::getConfig('theme');
|
|
| 59 | + $themePath = Yii::getPathOfAlias('base.themes') . DS;
|
|
| 60 | + $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
| 61 | 61 | |
| 62 | - // Pushes the current theme onto the top of the list |
|
| 63 | - foreach ($directories as $k=>$dir) |
|
| 64 | - {
|
|
| 65 | - if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme)
|
|
| 66 | - {
|
|
| 67 | - unset($directories[$k]); |
|
| 68 | - break; |
|
| 69 | - } |
|
| 70 | - } |
|
| 62 | + // Pushes the current theme onto the top of the list |
|
| 63 | + foreach ($directories as $k=>$dir) |
|
| 64 | + {
|
|
| 65 | + if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme)
|
|
| 66 | + {
|
|
| 67 | + unset($directories[$k]); |
|
| 68 | + break; |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - array_unshift($directories, $themePath.$currentTheme); |
|
| 72 | + array_unshift($directories, $themePath.$currentTheme); |
|
| 73 | 73 | |
| 74 | - foreach($directories as $dir) |
|
| 75 | - {
|
|
| 76 | - $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
| 77 | - $name = $json['name']; |
|
| 78 | - $key = str_replace('ciims-themes/', '', $name);
|
|
| 74 | + foreach($directories as $dir) |
|
| 75 | + {
|
|
| 76 | + $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
| 77 | + $name = $json['name']; |
|
| 78 | + $key = str_replace('ciims-themes/', '', $name);
|
|
| 79 | 79 | |
| 80 | - $themes[$key] = array( |
|
| 81 | - 'path' => $dir, |
|
| 82 | - 'name' => $name, |
|
| 83 | - 'hidden' => isset($json['hidden']) ? $json['hidden'] : false |
|
| 84 | - ); |
|
| 85 | - } |
|
| 80 | + $themes[$key] = array( |
|
| 81 | + 'path' => $dir, |
|
| 82 | + 'name' => $name, |
|
| 83 | + 'hidden' => isset($json['hidden']) ? $json['hidden'] : false |
|
| 84 | + ); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - Yii::app()->cache->set('settings_themes', $themes);
|
|
| 88 | - return $themes; |
|
| 89 | - } |
|
| 87 | + Yii::app()->cache->set('settings_themes', $themes);
|
|
| 88 | + return $themes; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - return $themes; |
|
| 92 | - } |
|
| 91 | + return $themes; |
|
| 92 | + } |
|
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class ThemeSettings extends CiiSettingsModel |
|
| 4 | -{
|
|
| 3 | +class ThemeSettings extends CiiSettingsModel |
|
| 4 | +{ |
|
| 5 | 5 | /** |
| 6 | 6 | * The active theme |
| 7 | 7 | * @var string |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | * Validation rules for the theme |
| 13 | 13 | * @return array |
| 14 | 14 | */ |
| 15 | - public function rules() |
|
| 16 | - {
|
|
| 15 | + public function rules() |
|
| 16 | + { |
|
| 17 | 17 | return array( |
| 18 | 18 | array('theme', 'required'),
|
| 19 | 19 | array('theme', 'length', 'max' => 255)
|
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | * Attribute labels for themes |
| 25 | 25 | * @return array |
| 26 | 26 | */ |
| 27 | - public function attributeLabels() |
|
| 28 | - {
|
|
| 27 | + public function attributeLabels() |
|
| 28 | + { |
|
| 29 | 29 | return array( |
| 30 | 30 | 'theme' => Yii::t('ciims.models.theme', 'Theme'),
|
| 31 | 31 | ); |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | * Returns the active theme name |
| 36 | 36 | * @return string |
| 37 | 37 | */ |
| 38 | - public function getTheme() |
|
| 39 | - {
|
|
| 38 | + public function getTheme() |
|
| 39 | + { |
|
| 40 | 40 | return $this->theme; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | - public function getThemes() |
|
| 52 | - {
|
|
| 51 | + public function getThemes() |
|
| 52 | + { |
|
| 53 | 53 | $themes = Yii::app()->cache->get('settings_themes');
|
| 54 | 54 | |
| 55 | 55 | if ($themes == false) |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * Validation rules for the theme |
| 13 | 13 | * @return array |
| 14 | 14 | */ |
| 15 | - public function rules() |
|
| 15 | + public function rules () |
|
| 16 | 16 | {
|
| 17 | 17 | return array( |
| 18 | 18 | array('theme', 'required'),
|
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | * Attribute labels for themes |
| 25 | 25 | * @return array |
| 26 | 26 | */ |
| 27 | - public function attributeLabels() |
|
| 27 | + public function attributeLabels () |
|
| 28 | 28 | {
|
| 29 | 29 | return array( |
| 30 | - 'theme' => Yii::t('ciims.models.theme', 'Theme'),
|
|
| 30 | + 'theme' => Yii::t ('ciims.models.theme', 'Theme'),
|
|
| 31 | 31 | ); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * Returns the active theme name |
| 36 | 36 | * @return string |
| 37 | 37 | */ |
| 38 | - public function getTheme() |
|
| 38 | + public function getTheme () |
|
| 39 | 39 | {
|
| 40 | 40 | return $this->theme; |
| 41 | 41 | } |
@@ -48,34 +48,34 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return array |
| 50 | 50 | */ |
| 51 | - public function getThemes() |
|
| 51 | + public function getThemes () |
|
| 52 | 52 | {
|
| 53 | - $themes = Yii::app()->cache->get('settings_themes');
|
|
| 53 | + $themes = Yii::app ()->cache->get ('settings_themes');
|
|
| 54 | 54 | |
| 55 | 55 | if ($themes == false) |
| 56 | 56 | {
|
| 57 | 57 | $themes = array(); |
| 58 | - $currentTheme = Cii::getConfig('theme');
|
|
| 59 | - $themePath = Yii::getPathOfAlias('base.themes') . DS;
|
|
| 60 | - $directories = glob($themePath . "*", GLOB_ONLYDIR); |
|
| 58 | + $currentTheme = Cii::getConfig ('theme');
|
|
| 59 | + $themePath = Yii::getPathOfAlias ('base.themes').DS;
|
|
| 60 | + $directories = glob ($themePath."*", GLOB_ONLYDIR); |
|
| 61 | 61 | |
| 62 | 62 | // Pushes the current theme onto the top of the list |
| 63 | 63 | foreach ($directories as $k=>$dir) |
| 64 | 64 | {
|
| 65 | - if ($dir == Yii::getPathOfAlias('base.themes').DS.$currentTheme)
|
|
| 65 | + if ($dir == Yii::getPathOfAlias ('base.themes').DS.$currentTheme)
|
|
| 66 | 66 | {
|
| 67 | 67 | unset($directories[$k]); |
| 68 | 68 | break; |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - array_unshift($directories, $themePath.$currentTheme); |
|
| 72 | + array_unshift ($directories, $themePath.$currentTheme); |
|
| 73 | 73 | |
| 74 | - foreach($directories as $dir) |
|
| 74 | + foreach ($directories as $dir) |
|
| 75 | 75 | {
|
| 76 | - $json = CJSON::decode(file_get_contents($dir . DIRECTORY_SEPARATOR . 'composer.json')); |
|
| 76 | + $json = CJSON::decode (file_get_contents ($dir.DIRECTORY_SEPARATOR.'composer.json')); |
|
| 77 | 77 | $name = $json['name']; |
| 78 | - $key = str_replace('ciims-themes/', '', $name);
|
|
| 78 | + $key = str_replace ('ciims-themes/', '', $name);
|
|
| 79 | 79 | |
| 80 | 80 | $themes[$key] = array( |
| 81 | 81 | 'path' => $dir, |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - Yii::app()->cache->set('settings_themes', $themes);
|
|
| 87 | + Yii::app ()->cache->set ('settings_themes', $themes);
|
|
| 88 | 88 | return $themes; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -1,2 +1,2 @@ |
||
| 1 | -<h1><?php echo Yii::t('ciims.controllers.Site', 'Error {{code}}', array('{{code}}' => $error['code'])); ?></h1> |
|
| 1 | +<h1><?php echo Yii::t ('ciims.controllers.Site', 'Error {{code}}', array('{{code}}' => $error['code'])); ?></h1> |
|
| 2 | 2 | <p><?php echo $error['message']; ?></p> |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | <link><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
| 18 | 18 | <description> |
| 19 | 19 | <?php |
| 20 | - $md = new CMarkdownParser; |
|
| 21 | - echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
| 22 | - ?> |
|
| 20 | + $md = new CMarkdownParser; |
|
| 21 | + echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
| 22 | + ?> |
|
| 23 | 23 | </description> |
| 24 | 24 | <category><?php echo htmlspecialchars(Categories::model()->findByPk($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
| 25 | 25 | <author><?php echo Users::model()->findByPk($v['author_id'])->email; ?> (<?php echo Users::model()->findByPk($v['author_id'])->username; ?>)</author> |
@@ -1,32 +1,32 @@ |
||
| 1 | 1 | <?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?> |
| 2 | 2 | <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| 3 | 3 | <channel> |
| 4 | - <atom:link href="<?php echo $url.Yii::app()->request->requestUri; ?>" rel="self" type="application/rss+xml" /> |
|
| 5 | - <title><?php echo Cii::getConfig('name', Yii::app()->name); ?></title> |
|
| 4 | + <atom:link href="<?php echo $url.Yii::app ()->request->requestUri; ?>" rel="self" type="application/rss+xml" /> |
|
| 5 | + <title><?php echo Cii::getConfig ('name', Yii::app ()->name); ?></title> |
|
| 6 | 6 | <link><?php echo $url; ?></link> |
| 7 | - <description><?php echo Cii::getConfig('name', Yii::app()->name); ?> Blog</description> |
|
| 7 | + <description><?php echo Cii::getConfig ('name', Yii::app ()->name); ?> Blog</description> |
|
| 8 | 8 | <language>en-us</language> |
| 9 | - <pubDate><?php echo date('D, d M Y H:i:s T'); ?></pubDate> |
|
| 10 | - <lastBuildDate><?php echo date('D, d M Y H:i:s T'); ?></lastBuildDate> |
|
| 9 | + <pubDate><?php echo date ('D, d M Y H:i:s T'); ?></pubDate> |
|
| 10 | + <lastBuildDate><?php echo date ('D, d M Y H:i:s T'); ?></lastBuildDate> |
|
| 11 | 11 | <docs>http://blogs.law.harvard.edu/tech/rss</docs> |
| 12 | 12 | |
| 13 | 13 | <?php foreach ($data as $k=>$v): ?> |
| 14 | 14 | <?php if ($v->password != '') { continue; } ?> |
| 15 | 15 | <item> |
| 16 | - <title><?php echo htmlspecialchars(str_replace('/', '', $v['title']), ENT_QUOTES, "utf-8"); ?></title> |
|
| 17 | - <link><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
|
| 16 | + <title><?php echo htmlspecialchars (str_replace ('/', '', $v['title']), ENT_QUOTES, "utf-8"); ?></title> |
|
| 17 | + <link><?php echo $url.'/'.htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></link> |
|
| 18 | 18 | <description> |
| 19 | 19 | <?php |
| 20 | 20 | $md = new CMarkdownParser; |
| 21 | - echo htmlspecialchars(strip_tags($md->transform($v['extract'])), ENT_QUOTES, "utf-8"); |
|
| 21 | + echo htmlspecialchars (strip_tags ($md->transform ($v['extract'])), ENT_QUOTES, "utf-8"); |
|
| 22 | 22 | ?> |
| 23 | 23 | </description> |
| 24 | - <category><?php echo htmlspecialchars(Categories::model()->findByPk($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
|
| 25 | - <author><?php echo Users::model()->findByPk($v['author_id'])->email; ?> (<?php echo Users::model()->findByPk($v['author_id'])->username; ?>)</author> |
|
| 26 | - <pubDate><?php echo date('D, d M Y H:i:s T', strtotime($v['created'])); ?></pubDate> |
|
| 27 | - <guid><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></guid> |
|
| 24 | + <category><?php echo htmlspecialchars (Categories::model ()->findByPk ($v['category_id'])->name, ENT_QUOTES, "utf-8"); ?></category> |
|
| 25 | + <author><?php echo Users::model ()->findByPk ($v['author_id'])->email; ?> (<?php echo Users::model ()->findByPk ($v['author_id'])->username; ?>)</author> |
|
| 26 | + <pubDate><?php echo date ('D, d M Y H:i:s T', strtotime ($v['created'])); ?></pubDate> |
|
| 27 | + <guid><?php echo $url.'/'.htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></guid> |
|
| 28 | 28 | <?php if ($v['commentable']): ?> |
| 29 | - <comments><?php echo $url.'/'.htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8");; ?>#comments</comments> |
|
| 29 | + <comments><?php echo $url.'/'.htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ; ?>#comments</comments> |
|
| 30 | 30 | <?php endif; ?> |
| 31 | 31 | </item> |
| 32 | 32 | <?php endforeach; ?> |
@@ -2,18 +2,18 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | if ($_SERVER['SCRIPT_FILENAME'] == 'protected/yiic.php') |
| 4 | 4 | { |
| 5 | - echo "Use of `yiic.php` has been deprecated for CiiMS. Uses `index.php` instead\n"; |
|
| 6 | - die(); |
|
| 5 | + echo "Use of `yiic.php` has been deprecated for CiiMS. Uses `index.php` instead\n"; |
|
| 6 | + die(); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | if (getenv('CIIMS_INSTALL') == "true") |
| 10 | 10 | { |
| 11 | - if (!defined('CIIMS_INSTALL')) |
|
| 12 | - define('CIIMS_INSTALL', true); |
|
| 11 | + if (!defined('CIIMS_INSTALL')) |
|
| 12 | + define('CIIMS_INSTALL', true); |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | if (!defined('CIIMS_INSTALL')) |
| 16 | - define('CIIMS_INSTALL', false); |
|
| 16 | + define('CIIMS_INSTALL', false); |
|
| 17 | 17 | |
| 18 | 18 | error_reporting(-1); |
| 19 | 19 | ini_set('display_errors', 'true'); |
@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
| 30 | 30 | |
| 31 | 31 | if (!isset($_SERVER['CIIMS_ENV'])) |
| 32 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 32 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 33 | 33 | |
| 34 | 34 | $config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 35 | 35 | $defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
| 36 | 36 | |
| 37 | 37 | if (file_exists(__DIR__.DS.'/config/main.php')) |
| 38 | - $config = require $config; |
|
| 38 | + $config = require $config; |
|
| 39 | 39 | else |
| 40 | - $config = array(); |
|
| 40 | + $config = array(); |
|
| 41 | 41 | |
| 42 | 42 | if (CIIMS_INSTALL) |
| 43 | - $config = array(); |
|
| 43 | + $config = array(); |
|
| 44 | 44 | |
| 45 | 45 | $defaultConfig = require $defaultConfig; |
| 46 | 46 | |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | $env=@getenv('YII_CONSOLE_COMMANDS'); |
| 54 | 54 | |
| 55 | 55 | if(!empty($env)) |
| 56 | - $app->commandRunner->addCommands($env); |
|
| 56 | + $app->commandRunner->addCommands($env); |
|
| 57 | 57 | |
| 58 | 58 | $modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
| 59 | 59 | |
| 60 | 60 | foreach ($modules as $module) |
| 61 | 61 | { |
| 62 | - if (file_exists($module.'/commands')) |
|
| 63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
| 62 | + if (file_exists($module.'/commands')) |
|
| 63 | + $app->commandRunner->addCommands($module.'/commands'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $app->run(); |
@@ -8,12 +8,14 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | if (getenv('CIIMS_INSTALL') == "true") |
| 10 | 10 | { |
| 11 | - if (!defined('CIIMS_INSTALL')) |
|
| 12 | - define('CIIMS_INSTALL', true); |
|
| 13 | -} |
|
| 11 | + if (!defined('CIIMS_INSTALL')) { |
|
| 12 | + define('CIIMS_INSTALL', true); |
|
| 13 | + } |
|
| 14 | + } |
|
| 14 | 15 | |
| 15 | -if (!defined('CIIMS_INSTALL')) |
|
| 16 | +if (!defined('CIIMS_INSTALL')) { |
|
| 16 | 17 | define('CIIMS_INSTALL', false); |
| 18 | +} |
|
| 17 | 19 | |
| 18 | 20 | error_reporting(-1); |
| 19 | 21 | ini_set('display_errors', 'true'); |
@@ -28,19 +30,22 @@ discard block |
||
| 28 | 30 | |
| 29 | 31 | Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
| 30 | 32 | |
| 31 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
| 33 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
| 32 | 34 | $_SERVER['CIIMS_ENV'] = 'main'; |
| 35 | +} |
|
| 33 | 36 | |
| 34 | 37 | $config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 35 | 38 | $defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
| 36 | 39 | |
| 37 | -if (file_exists(__DIR__.DS.'/config/main.php')) |
|
| 40 | +if (file_exists(__DIR__.DS.'/config/main.php')) { |
|
| 38 | 41 | $config = require $config; |
| 39 | -else |
|
| 42 | +} else { |
|
| 40 | 43 | $config = array(); |
| 44 | +} |
|
| 41 | 45 | |
| 42 | -if (CIIMS_INSTALL) |
|
| 46 | +if (CIIMS_INSTALL) { |
|
| 43 | 47 | $config = array(); |
| 48 | +} |
|
| 44 | 49 | |
| 45 | 50 | $defaultConfig = require $defaultConfig; |
| 46 | 51 | |
@@ -52,15 +57,17 @@ discard block |
||
| 52 | 57 | $app->commandRunner->addCommands(YII_PATH.'/cli/commands'); |
| 53 | 58 | $env=@getenv('YII_CONSOLE_COMMANDS'); |
| 54 | 59 | |
| 55 | -if(!empty($env)) |
|
| 60 | +if(!empty($env)) { |
|
| 56 | 61 | $app->commandRunner->addCommands($env); |
| 62 | +} |
|
| 57 | 63 | |
| 58 | 64 | $modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
| 59 | 65 | |
| 60 | 66 | foreach ($modules as $module) |
| 61 | 67 | { |
| 62 | - if (file_exists($module.'/commands')) |
|
| 63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
| 64 | -} |
|
| 68 | + if (file_exists($module.'/commands')) { |
|
| 69 | + $app->commandRunner->addCommands($module.'/commands'); |
|
| 70 | + } |
|
| 71 | + } |
|
| 65 | 72 | |
| 66 | 73 | return $app->run(); |
@@ -6,35 +6,35 @@ discard block |
||
| 6 | 6 | die(); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if (getenv('CIIMS_INSTALL') == "true") |
|
| 9 | +if (getenv ('CIIMS_INSTALL') == "true") |
|
| 10 | 10 | { |
| 11 | - if (!defined('CIIMS_INSTALL')) |
|
| 12 | - define('CIIMS_INSTALL', true); |
|
| 11 | + if (!defined ('CIIMS_INSTALL')) |
|
| 12 | + define ('CIIMS_INSTALL', true); |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -if (!defined('CIIMS_INSTALL')) |
|
| 16 | - define('CIIMS_INSTALL', false); |
|
| 15 | +if (!defined ('CIIMS_INSTALL')) |
|
| 16 | + define ('CIIMS_INSTALL', false); |
|
| 17 | 17 | |
| 18 | -error_reporting(-1); |
|
| 19 | -ini_set('display_errors', 'true'); |
|
| 18 | +error_reporting (-1); |
|
| 19 | +ini_set ('display_errors', 'true'); |
|
| 20 | 20 | date_default_timezone_set ('UTC'); |
| 21 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
| 21 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
| 22 | 22 | |
| 23 | -defined('YII_DEBUG') or define('YII_DEBUG', true); |
|
| 23 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
| 24 | 24 | |
| 25 | 25 | // Include the composer dependencies |
| 26 | 26 | require(__DIR__.DS.'..'.DS.'vendor'.DS.'autoload.php'); |
| 27 | 27 | require(__DIR__.DS.'..'.DS.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yii.php'); |
| 28 | 28 | |
| 29 | -Yii::setPathOfAlias('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
|
| 29 | +Yii::setPathOfAlias ('vendor', __DIR__.DS.'..'.DS.'vendor'.DS); |
|
| 30 | 30 | |
| 31 | 31 | if (!isset($_SERVER['CIIMS_ENV'])) |
| 32 | 32 | $_SERVER['CIIMS_ENV'] = 'main'; |
| 33 | 33 | |
| 34 | 34 | $config = __DIR__.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 35 | -$defaultConfig=__DIR__.DS.'config'.DS.'main.default.php'; |
|
| 35 | +$defaultConfig = __DIR__.DS.'config'.DS.'main.default.php'; |
|
| 36 | 36 | |
| 37 | -if (file_exists(__DIR__.DS.'/config/main.php')) |
|
| 37 | +if (file_exists (__DIR__.DS.'/config/main.php')) |
|
| 38 | 38 | $config = require $config; |
| 39 | 39 | else |
| 40 | 40 | $config = array(); |
@@ -44,23 +44,23 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $defaultConfig = require $defaultConfig; |
| 46 | 46 | |
| 47 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
| 47 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
| 48 | 48 | |
| 49 | 49 | unset($config['components']['user']); |
| 50 | 50 | |
| 51 | -$app=Yii::createConsoleApplication($config); |
|
| 52 | -$app->commandRunner->addCommands(YII_PATH.'/cli/commands'); |
|
| 53 | -$env=@getenv('YII_CONSOLE_COMMANDS'); |
|
| 51 | +$app = Yii::createConsoleApplication ($config); |
|
| 52 | +$app->commandRunner->addCommands (YII_PATH.'/cli/commands'); |
|
| 53 | +$env = @getenv ('YII_CONSOLE_COMMANDS'); |
|
| 54 | 54 | |
| 55 | -if(!empty($env)) |
|
| 56 | - $app->commandRunner->addCommands($env); |
|
| 55 | +if (!empty($env)) |
|
| 56 | + $app->commandRunner->addCommands ($env); |
|
| 57 | 57 | |
| 58 | -$modules = array_filter(glob(__DIR__.'/modules/*', GLOB_ONLYDIR)); |
|
| 58 | +$modules = array_filter (glob (__DIR__.'/modules/*', GLOB_ONLYDIR)); |
|
| 59 | 59 | |
| 60 | 60 | foreach ($modules as $module) |
| 61 | 61 | { |
| 62 | - if (file_exists($module.'/commands')) |
|
| 63 | - $app->commandRunner->addCommands($module.'/commands'); |
|
| 62 | + if (file_exists ($module.'/commands')) |
|
| 63 | + $app->commandRunner->addCommands ($module.'/commands'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | -return $app->run(); |
|
| 66 | +return $app->run (); |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
| 14 | 14 | if (php_sapi_name() === 'cli') |
| 15 | - return require BASEDIR.'protected'.DS.'yiic.php'; |
|
| 15 | + return require BASEDIR.'protected'.DS.'yiic.php'; |
|
| 16 | 16 | |
| 17 | 17 | // Disable Error Reporting and set some constants |
| 18 | 18 | error_reporting(0); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | // This is the configuration file |
| 24 | 24 | if (!isset($_SERVER['CIIMS_ENV'])) |
| 25 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 25 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 26 | 26 | |
| 27 | 27 | $config = BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 28 | 28 | $defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | // If we don't have a configuration file, run the installer. |
| 31 | 31 | if (!file_exists($config) && file_exists('install.php')) |
| 32 | 32 | { |
| 33 | - require('install.php'); |
|
| 34 | - exit(); |
|
| 33 | + require('install.php'); |
|
| 34 | + exit(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $config = require($config); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Include the ClassMap for enhanced performance if we're not in debug mode |
| 56 | 56 | if (!YII_DEBUG) |
| 57 | - require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
|
| 57 | + require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
|
| 58 | 58 | |
| 59 | 59 | $config['components']['db']['enableProfiling'] = YII_DEBUG; |
| 60 | 60 | $config['components']['db']['enableParamLogging'] = YII_DEBUG; |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | // If debug mode is enabled, show us every possible error anywhere. |
| 63 | 63 | if (YII_DEBUG && YII_TRACE_LEVEL == 3) |
| 64 | 64 | { |
| 65 | - error_reporting(-1); |
|
| 66 | - ini_set('display_errors', 'true'); |
|
| 65 | + error_reporting(-1); |
|
| 66 | + ini_set('display_errors', 'true'); |
|
| 67 | 67 | |
| 68 | - // Enable WebLogRouteLogging |
|
| 69 | - $config['preload'][] = 'log'; |
|
| 68 | + // Enable WebLogRouteLogging |
|
| 69 | + $config['preload'][] = 'log'; |
|
| 70 | 70 | |
| 71 | - // Enable all the logging routes |
|
| 72 | - foreach ($config['components']['log']['routes'] as $k=>$v) |
|
| 73 | - $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
| 71 | + // Enable all the logging routes |
|
| 72 | + foreach ($config['components']['log']['routes'] as $k=>$v) |
|
| 73 | + $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Run the Yii application instance |
@@ -11,8 +11,9 @@ discard block |
||
| 11 | 11 | defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
| 12 | 12 | |
| 13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
| 14 | -if (php_sapi_name() === 'cli') |
|
| 14 | +if (php_sapi_name() === 'cli') { |
|
| 15 | 15 | return require BASEDIR.'protected'.DS.'yiic.php'; |
| 16 | +} |
|
| 16 | 17 | |
| 17 | 18 | // Disable Error Reporting and set some constants |
| 18 | 19 | error_reporting(0); |
@@ -21,8 +22,9 @@ discard block |
||
| 21 | 22 | |
| 22 | 23 | |
| 23 | 24 | // This is the configuration file |
| 24 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
| 25 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
| 25 | 26 | $_SERVER['CIIMS_ENV'] = 'main'; |
| 27 | +} |
|
| 26 | 28 | |
| 27 | 29 | $config = BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 28 | 30 | $defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -53,8 +55,9 @@ discard block |
||
| 53 | 55 | $config = CMap::mergeArray($defaultConfig, $config); |
| 54 | 56 | |
| 55 | 57 | // Include the ClassMap for enhanced performance if we're not in debug mode |
| 56 | -if (!YII_DEBUG) |
|
| 58 | +if (!YII_DEBUG) { |
|
| 57 | 59 | require_once BASEDIR.'protected'.DS.'config'.DS.'classmap.php'; |
| 60 | +} |
|
| 58 | 61 | |
| 59 | 62 | $config['components']['db']['enableProfiling'] = YII_DEBUG; |
| 60 | 63 | $config['components']['db']['enableParamLogging'] = YII_DEBUG; |
@@ -69,9 +72,10 @@ discard block |
||
| 69 | 72 | $config['preload'][] = 'log'; |
| 70 | 73 | |
| 71 | 74 | // Enable all the logging routes |
| 72 | - foreach ($config['components']['log']['routes'] as $k=>$v) |
|
| 73 | - $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
| 74 | -} |
|
| 75 | + foreach ($config['components']['log']['routes'] as $k=>$v) { |
|
| 76 | + $config['components']['log']['routes'][$k]['enabled'] = YII_DEBUG; |
|
| 77 | + } |
|
| 78 | + } |
|
| 75 | 79 | |
| 76 | 80 | // Run the Yii application instance |
| 77 | 81 | Yii::createWebApplication($config)->run(); |
@@ -7,17 +7,17 @@ discard block |
||
| 7 | 7 | * You should _never_ have to change _anything_ in this file _ever_ |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
| 11 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
| 10 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
| 11 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__.DS.'..'.DS); |
|
| 12 | 12 | |
| 13 | 13 | // Bypass Yiic entirely and use this instead as the cli bootstrapper |
| 14 | -if (php_sapi_name() === 'cli') |
|
| 14 | +if (php_sapi_name () === 'cli') |
|
| 15 | 15 | return require BASEDIR.'protected'.DS.'yiic.php'; |
| 16 | 16 | |
| 17 | 17 | // Disable Error Reporting and set some constants |
| 18 | -error_reporting(0); |
|
| 19 | -ini_set('display_errors', 'false'); |
|
| 20 | -date_default_timezone_set('UTC'); |
|
| 18 | +error_reporting (0); |
|
| 19 | +ini_set ('display_errors', 'false'); |
|
| 20 | +date_default_timezone_set ('UTC'); |
|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | // This is the configuration file |
@@ -28,15 +28,15 @@ discard block |
||
| 28 | 28 | $defaultConfig = BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
| 29 | 29 | |
| 30 | 30 | // If we don't have a configuration file, run the installer. |
| 31 | -if (!file_exists($config) && file_exists('install.php')) |
|
| 31 | +if (!file_exists ($config) && file_exists ('install.php')) |
|
| 32 | 32 | { |
| 33 | 33 | require('install.php'); |
| 34 | 34 | exit(); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $config = require($config); |
| 38 | -defined('YII_DEBUG') or define('YII_DEBUG',isset($config['params']['debug']) ? $config['params']['debug'] : false); |
|
| 39 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',isset($config['params']['trace']) ? $config['params']['trace'] : 0); |
|
| 38 | +defined ('YII_DEBUG') or define ('YII_DEBUG', isset($config['params']['debug']) ? $config['params']['debug'] : false); |
|
| 39 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', isset($config['params']['trace']) ? $config['params']['trace'] : 0); |
|
| 40 | 40 | |
| 41 | 41 | // Load the config file |
| 42 | 42 | $defaultConfig = require($defaultConfig); |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | require_once BASEDIR.'vendor'.DS.'autoload.php'; |
| 46 | 46 | require_once BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.(YII_DEBUG ? 'yii.php' : 'yiilite.php'); |
| 47 | 47 | |
| 48 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
| 49 | -Yii::setPathOfAlias('base', BASEDIR); |
|
| 50 | -Yii::setPathOfAlias('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
| 48 | +Yii::setPathOfAlias ('vendor', BASEDIR.'vendor'); |
|
| 49 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
| 50 | +Yii::setPathOfAlias ('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias ('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
| 51 | 51 | |
| 52 | 52 | // Merge it with our default config file |
| 53 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
| 53 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
| 54 | 54 | |
| 55 | 55 | // Include the ClassMap for enhanced performance if we're not in debug mode |
| 56 | 56 | if (!YII_DEBUG) |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | // If debug mode is enabled, show us every possible error anywhere. |
| 63 | 63 | if (YII_DEBUG && YII_TRACE_LEVEL == 3) |
| 64 | 64 | { |
| 65 | - error_reporting(-1); |
|
| 66 | - ini_set('display_errors', 'true'); |
|
| 65 | + error_reporting (-1); |
|
| 66 | + ini_set ('display_errors', 'true'); |
|
| 67 | 67 | |
| 68 | 68 | // Enable WebLogRouteLogging |
| 69 | 69 | $config['preload'][] = 'log'; |
@@ -74,4 +74,4 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Run the Yii application instance |
| 77 | -Yii::createWebApplication($config)->run(); |
|
| 77 | +Yii::createWebApplication ($config)->run (); |
|
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | defined('CIIMS_INSTALL') or define('CIIMS_INSTALL', true); |
| 27 | 27 | if (!file_exists($mainConfig) && !file_exists($yiiPath)) |
| 28 | 28 | { |
| 29 | - require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
| 30 | - exit(); |
|
| 29 | + require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
| 30 | + exit(); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | require_once($yiiPath); |
@@ -9,10 +9,10 @@ discard block |
||
| 9 | 9 | * Otherwise, this is a basic Yii App running only the install module |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
| 13 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
| 14 | -error_reporting(-1); |
|
| 15 | -ini_set('display_errors', 'true'); |
|
| 12 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
| 13 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__.DS.'..'.DS); |
|
| 14 | +error_reporting (-1); |
|
| 15 | +ini_set ('display_errors', 'true'); |
|
| 16 | 16 | |
| 17 | 17 | $yiiPath = BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yiilite.php'; |
| 18 | 18 | require_once BASEDIR.'vendor'.DS.'autoload.php'; |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | $mainConfig = BASEDIR.'protected'.DS.'config'.DS.'main.php'; |
| 22 | 22 | $ciimsConfig = require($config); |
| 23 | 23 | |
| 24 | -defined('YII_DEBUG') or define('YII_DEBUG',true); |
|
| 25 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
|
| 26 | -defined('CIIMS_INSTALL') or define('CIIMS_INSTALL', true); |
|
| 27 | -if (!file_exists($mainConfig) && !file_exists($yiiPath)) |
|
| 24 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
| 25 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', 3); |
|
| 26 | +defined ('CIIMS_INSTALL') or define ('CIIMS_INSTALL', true); |
|
| 27 | +if (!file_exists ($mainConfig) && !file_exists ($yiiPath)) |
|
| 28 | 28 | { |
| 29 | - require(dirname(__FILE__).'/protected/modules/install/init.php'); |
|
| 29 | + require(dirname (__FILE__).'/protected/modules/install/init.php'); |
|
| 30 | 30 | exit(); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | require_once($yiiPath); |
| 34 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
| 35 | -Yii::setPathOfAlias('base', BASEDIR); |
|
| 34 | +Yii::setPathOfAlias ('vendor', BASEDIR.'vendor'); |
|
| 35 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
| 36 | 36 | |
| 37 | -$app = Yii::createWebApplication($config); |
|
| 38 | -$app->run(); |
|
| 37 | +$app = Yii::createWebApplication ($config); |
|
| 38 | +$app->run (); |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
| 13 | 13 | |
| 14 | 14 | if (!isset($_SERVER['CIIMS_ENV'])) |
| 15 | - $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 15 | + $_SERVER['CIIMS_ENV'] = 'main'; |
|
| 16 | 16 | |
| 17 | 17 | $config = require BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 18 | 18 | $defaultConfig = require BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // Set the request component in the test script |
| 33 | 33 | $config['components']['request'] = array( |
| 34 | - 'class' => 'vendor.codeception.YiiBridge.web.CodeceptionHttpRequest' |
|
| 34 | + 'class' => 'vendor.codeception.YiiBridge.web.CodeceptionHttpRequest' |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | // Return for Codeception |
| 38 | 38 | return array( |
| 39 | - 'class' => 'CWebApplication', |
|
| 40 | - 'config' => $config |
|
| 39 | + 'class' => 'CWebApplication', |
|
| 40 | + 'config' => $config |
|
| 41 | 41 | ); |
@@ -11,8 +11,9 @@ |
||
| 11 | 11 | defined('YII_DEBUG') or define('YII_DEBUG',true); |
| 12 | 12 | defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
| 13 | 13 | |
| 14 | -if (!isset($_SERVER['CIIMS_ENV'])) |
|
| 14 | +if (!isset($_SERVER['CIIMS_ENV'])) { |
|
| 15 | 15 | $_SERVER['CIIMS_ENV'] = 'main'; |
| 16 | +} |
|
| 16 | 17 | |
| 17 | 18 | $config = require BASEDIR.'protected'.DS.'config'.DS.$_SERVER['CIIMS_ENV'].'.php'; |
| 18 | 19 | $defaultConfig = require BASEDIR.'protected'.DS.'config'.DS.'main.default.php'; |
@@ -1,15 +1,15 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Set Error Reporting Levels |
| 4 | -error_reporting(-1); |
|
| 5 | -ini_set('display_errors', 'true'); |
|
| 6 | -date_default_timezone_set('UTC'); |
|
| 4 | +error_reporting (-1); |
|
| 5 | +ini_set ('display_errors', 'true'); |
|
| 6 | +date_default_timezone_set ('UTC'); |
|
| 7 | 7 | |
| 8 | 8 | // Definitions |
| 9 | -defined('DS') or define('DS', DIRECTORY_SEPARATOR); |
|
| 10 | -defined('BASEDIR') or define('BASEDIR', __DIR__ . DS . '..' . DS); |
|
| 11 | -defined('YII_DEBUG') or define('YII_DEBUG',true); |
|
| 12 | -defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); |
|
| 9 | +defined ('DS') or define ('DS', DIRECTORY_SEPARATOR); |
|
| 10 | +defined ('BASEDIR') or define ('BASEDIR', __DIR__.DS.'..'.DS); |
|
| 11 | +defined ('YII_DEBUG') or define ('YII_DEBUG', true); |
|
| 12 | +defined ('YII_TRACE_LEVEL') or define ('YII_TRACE_LEVEL', 3); |
|
| 13 | 13 | |
| 14 | 14 | if (!isset($_SERVER['CIIMS_ENV'])) |
| 15 | 15 | $_SERVER['CIIMS_ENV'] = 'main'; |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | require_once BASEDIR.'vendor'.DS.'yiisoft'.DS.'yii'.DS.'framework'.DS.'yii.php'; |
| 22 | 22 | require_once BASEDIR.'vendor'.DS.'autoload.php'; |
| 23 | 23 | |
| 24 | -Yii::setPathOfAlias('vendor', BASEDIR.'vendor'); |
|
| 25 | -Yii::setPathOfAlias('base', BASEDIR); |
|
| 26 | -Yii::setPathOfAlias('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
| 24 | +Yii::setPathOfAlias ('vendor', BASEDIR.'vendor'); |
|
| 25 | +Yii::setPathOfAlias ('base', BASEDIR); |
|
| 26 | +Yii::setPathOfAlias ('ext.yiinfinite-scroll.YiinfiniteScroller', Yii::getPathOfAlias ('vendor.charlesportwoodii.ciinfinite-scroll.YiinfiniteScroller')); |
|
| 27 | 27 | |
| 28 | -$config = CMap::mergeArray($defaultConfig, $config); |
|
| 28 | +$config = CMap::mergeArray ($defaultConfig, $config); |
|
| 29 | 29 | |
| 30 | 30 | $_SERVER['SERVER_NAME'] = 'localhost'; |
| 31 | 31 | |
@@ -1,34 +1,34 @@ |
||
| 1 | 1 | <?php |
| 2 | -$basePath = dirname(__FILE__) . '/..'; |
|
| 2 | +$basePath = dirname (__FILE__).'/..'; |
|
| 3 | 3 | Yii::$classMap = array( |
| 4 | - 'YiinfiniteScroller' => $basePath . '/extensions/yiinfinite-scroll/YiinfiniteScroller.php', |
|
| 5 | - 'ContentMetadata' => $basePath . '/models/ContentMetadata.php', |
|
| 6 | - 'UserRoles' => $basePath . '/models/UserRoles.php', |
|
| 7 | - 'UserMetadata' => $basePath . '/models/UserMetadata.php', |
|
| 8 | - 'ContentTypes' => $basePath . '/models/ContentTypes.php', |
|
| 9 | - 'Events' => $basePath . '/models/Events.php', |
|
| 10 | - 'Comments' => $basePath . '/models/Comments.php', |
|
| 11 | - 'Content' => $basePath . '/models/Content.php', |
|
| 12 | - 'Configuration' => $basePath . '/models/Configuration.php', |
|
| 13 | - 'CategoriesMetadata' => $basePath . '/models/CategoriesMetadata.php', |
|
| 14 | - 'Users' => $basePath . '/models/Users.php', |
|
| 15 | - 'ActivationForm' => $basePath . '/models/forms/ActivationForm.php', |
|
| 16 | - 'LoginForm' => $basePath . '/models/forms/LoginForm.php', |
|
| 17 | - 'RegisterForm' => $basePath . '/models/forms/RegisterForm.php', |
|
| 18 | - 'InviteForm' => $basePath . '/models/forms/InviteForm.php', |
|
| 19 | - 'InvitationForm' => $basePath . '/models/forms/InvitationForm.php', |
|
| 20 | - 'ProfileForm' => $basePath . '/models/forms/ProfileForm.php', |
|
| 21 | - 'PasswordResetForm' => $basePath . '/models/forms/PasswordResetForm.php', |
|
| 22 | - 'EmailChangeForm' => $basePath . '/models/forms/EmailChangeForm.php', |
|
| 23 | - 'ForgotForm' => $basePath . '/models/forms/ForgotForm.php', |
|
| 24 | - 'SocialSettings' => $basePath . '/models/settings/SocialSettings.php', |
|
| 25 | - 'AnalyticsSettings' => $basePath . '/models/settings/AnalyticsSettings.php', |
|
| 26 | - 'GeneralSettings' => $basePath . '/models/settings/GeneralSettings.php', |
|
| 27 | - 'ThemeSettings' => $basePath . '/models/settings/ThemeSettings.php', |
|
| 28 | - 'EmailSettings' => $basePath . '/models/settings/EmailSettings.php', |
|
| 29 | - 'Categories' => $basePath . '/models/Categories.php', |
|
| 30 | - 'CategoriesController' => $basePath . '/controllers/CategoriesController.php', |
|
| 31 | - 'ProfileController' => $basePath . '/controllers/ProfileController.php', |
|
| 32 | - 'ContentController' => $basePath . '/controllers/ContentController.php', |
|
| 33 | - 'SiteController' => $basePath . '/controllers/SiteController.php', |
|
| 4 | + 'YiinfiniteScroller' => $basePath.'/extensions/yiinfinite-scroll/YiinfiniteScroller.php', |
|
| 5 | + 'ContentMetadata' => $basePath.'/models/ContentMetadata.php', |
|
| 6 | + 'UserRoles' => $basePath.'/models/UserRoles.php', |
|
| 7 | + 'UserMetadata' => $basePath.'/models/UserMetadata.php', |
|
| 8 | + 'ContentTypes' => $basePath.'/models/ContentTypes.php', |
|
| 9 | + 'Events' => $basePath.'/models/Events.php', |
|
| 10 | + 'Comments' => $basePath.'/models/Comments.php', |
|
| 11 | + 'Content' => $basePath.'/models/Content.php', |
|
| 12 | + 'Configuration' => $basePath.'/models/Configuration.php', |
|
| 13 | + 'CategoriesMetadata' => $basePath.'/models/CategoriesMetadata.php', |
|
| 14 | + 'Users' => $basePath.'/models/Users.php', |
|
| 15 | + 'ActivationForm' => $basePath.'/models/forms/ActivationForm.php', |
|
| 16 | + 'LoginForm' => $basePath.'/models/forms/LoginForm.php', |
|
| 17 | + 'RegisterForm' => $basePath.'/models/forms/RegisterForm.php', |
|
| 18 | + 'InviteForm' => $basePath.'/models/forms/InviteForm.php', |
|
| 19 | + 'InvitationForm' => $basePath.'/models/forms/InvitationForm.php', |
|
| 20 | + 'ProfileForm' => $basePath.'/models/forms/ProfileForm.php', |
|
| 21 | + 'PasswordResetForm' => $basePath.'/models/forms/PasswordResetForm.php', |
|
| 22 | + 'EmailChangeForm' => $basePath.'/models/forms/EmailChangeForm.php', |
|
| 23 | + 'ForgotForm' => $basePath.'/models/forms/ForgotForm.php', |
|
| 24 | + 'SocialSettings' => $basePath.'/models/settings/SocialSettings.php', |
|
| 25 | + 'AnalyticsSettings' => $basePath.'/models/settings/AnalyticsSettings.php', |
|
| 26 | + 'GeneralSettings' => $basePath.'/models/settings/GeneralSettings.php', |
|
| 27 | + 'ThemeSettings' => $basePath.'/models/settings/ThemeSettings.php', |
|
| 28 | + 'EmailSettings' => $basePath.'/models/settings/EmailSettings.php', |
|
| 29 | + 'Categories' => $basePath.'/models/Categories.php', |
|
| 30 | + 'CategoriesController' => $basePath.'/controllers/CategoriesController.php', |
|
| 31 | + 'ProfileController' => $basePath.'/controllers/ProfileController.php', |
|
| 32 | + 'ContentController' => $basePath.'/controllers/ContentController.php', |
|
| 33 | + 'SiteController' => $basePath.'/controllers/SiteController.php', |
|
| 34 | 34 | ); |
@@ -3,23 +3,23 @@ |
||
| 3 | 3 | <?php foreach ($content as $v): ?> |
| 4 | 4 | <?php if ($v['password'] != '') { continue; } ?>
|
| 5 | 5 | <url> |
| 6 | - <loc><?php echo $url .'/'. htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></loc>
|
|
| 7 | - <lastmod><?php echo date('c', $v['updated']);?></lastmod>
|
|
| 6 | + <loc><?php echo $url.'/'.htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></loc>
|
|
| 7 | + <lastmod><?php echo date ('c', $v['updated']); ?></lastmod>
|
|
| 8 | 8 | <changefreq>weekly</changefreq> |
| 9 | - <priority><?php echo $v['type_id'] == 1 ? '0.6': '0.8'; ?></priority> |
|
| 9 | + <priority><?php echo $v['type_id'] == 1 ? '0.6' : '0.8'; ?></priority> |
|
| 10 | 10 | </url> |
| 11 | 11 | <?php endforeach; ?> |
| 12 | 12 | <?php foreach ($categories as $v): ?> |
| 13 | 13 | <url> |
| 14 | - <loc><?php echo $url .'/'. htmlspecialchars(str_replace('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></loc>
|
|
| 15 | - <lastmod><?php echo date('c', $v['updated']);?></lastmod>
|
|
| 14 | + <loc><?php echo $url.'/'.htmlspecialchars (str_replace ('/', '', $v['slug']), ENT_QUOTES, "utf-8"); ?></loc>
|
|
| 15 | + <lastmod><?php echo date ('c', $v['updated']); ?></lastmod>
|
|
| 16 | 16 | <changefreq>weekly</changefreq> |
| 17 | 17 | <priority>0.7</priority> |
| 18 | 18 | </url> |
| 19 | 19 | <?php endforeach; ?> |
| 20 | 20 | <url> |
| 21 | - <loc><?php echo $url .'/projects'; ?></loc> |
|
| 22 | - <lastmod><?php echo date('c', strtotime('now'));?></lastmod>
|
|
| 21 | + <loc><?php echo $url.'/projects'; ?></loc> |
|
| 22 | + <lastmod><?php echo date ('c', strtotime ('now')); ?></lastmod>
|
|
| 23 | 23 | <changefreq>monthly</changefreq> |
| 24 | 24 | <priority>0.5</priority> |
| 25 | 25 | </url> |