Skip to content

Commit

Permalink
Change agents configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Nov 14, 2017
1 parent 3cc9e0e commit 85aa81b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG

5.0.0-alpha2.pre
---------------
* Change agents configuration
* Use skeeks/cms-toolbar
* Removed skeeks/cms/components/CmsToolbar
* Fixed filters
Expand Down
20 changes: 10 additions & 10 deletions app-console.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@

\Yii::beginProfile('Load config app');

if (YII_ENV == 'dev') {
\Yii::beginProfile('Rebuild config');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}
if (YII_ENV == 'dev') {
\Yii::beginProfile('Rebuild config');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}

$configFile = \skeeks\cms\composer\config\Builder::path('console-' . YII_ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('console');
}
$configFile = \skeeks\cms\composer\config\Builder::path('console-' . YII_ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('console');
}

$config = (array) require $configFile;
$config = (array)require $configFile;

\Yii::endProfile('Load config app');

Expand Down
20 changes: 10 additions & 10 deletions app-web.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

\Yii::beginProfile('Load config app');

if (YII_ENV == 'dev') {
\Yii::beginProfile('Rebuild config');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}
if (YII_ENV == 'dev') {
\Yii::beginProfile('Rebuild config');
\skeeks\cms\composer\config\Builder::rebuild();
\Yii::endProfile('Rebuild config');
}

$configFile = \skeeks\cms\composer\config\Builder::path('web-' . YII_ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('web');
}
$config = (array) require $configFile;
$configFile = \skeeks\cms\composer\config\Builder::path('web-' . YII_ENV);
if (!file_exists($configFile)) {
$configFile = \skeeks\cms\composer\config\Builder::path('web');
}
$config = (array)require $configFile;

\Yii::endProfile('Load config app');

Expand Down
4 changes: 2 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
require(VENDOR_DIR . '/autoload.php');
require(VENDOR_DIR . '/yiisoft/yii2/Yii.php');

\Yii::setAlias('@root', ROOT_DIR);
\Yii::setAlias('@vendor', VENDOR_DIR);
\Yii::setAlias('@root', ROOT_DIR);
\Yii::setAlias('@vendor', VENDOR_DIR);
15 changes: 5 additions & 10 deletions global.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,20 @@

//Проверка файла который создается скриптом в момент установки проекта, если он создан, то прочитаются его настройки.
$globalFileInited = APP_ENV_GLOBAL_FILE;
if (file_exists($globalFileInited))
{
if (file_exists($globalFileInited)) {
require $globalFileInited;
}

//Если Yii окружение не определено раньше в index.php или @app/config/global.php
if (!defined('YII_ENV'))
{
if (!defined('YII_ENV')) {
define('YII_ENV', 'dev');
}

//А мы все равно ее определим
if (!defined('YII_DEBUG'))
{
if (YII_ENV == 'prod')
{
if (!defined('YII_DEBUG')) {
if (YII_ENV == 'prod') {
defined('YII_DEBUG') or define('YII_DEBUG', false);
} else
{
} else {
defined('YII_DEBUG') or define('YII_DEBUG', true);
}
}
12 changes: 5 additions & 7 deletions requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
// you may need to adjust this path to the correct Yii framework path

define("ROOT_DIR", dirname(dirname(__DIR__)));
define("ROOT_DIR", dirname(dirname(__DIR__)));

$frameworkPath = ROOT_DIR . '/vendor/yiisoft/yii2';
if (!is_dir($frameworkPath)) {
Expand Down Expand Up @@ -51,24 +51,22 @@ function wriatableCheck()
'frontend/web/assets',
];

foreach ($dirs as $dirPath)
{
foreach ($dirs as $dirPath) {
$dirPath = ROOT_DIR . "/" . $dirPath;
if (!is_dir($dirPath))
{
if (!is_dir($dirPath)) {
return 0;
break;
}

if (!is_writable($dirPath))
{
if (!is_writable($dirPath)) {
return 0;
break;
}
}

return 1;
}

/**
* Adjust requirements according to your application specifics.
*/
Expand Down
12 changes: 8 additions & 4 deletions src/config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,21 @@
'cmsAgent' =>
[
'commands' => [

'cms/cache/flush-all' =>
[
'description' => 'Чистка кэша',
'agent_interval' => 3600*24,
'class' => \skeeks\cms\agent\CmsAgent::class,
'name' => ['skeeks/cms', 'Clearing the cache'],
'interval' => 3600*24,
],

'ajaxfileupload/cleanup' =>
[
'description' => 'Чистка временно загружаемых файлов',
'agent_interval' => 3600*24,
'class' => \skeeks\cms\agent\CmsAgent::class,
'name' => ['skeeks/cms', 'Cleaning temporarily downloaded files'],
'interval' => 3600*24,
],

]
],
],
Expand Down
2 changes: 2 additions & 0 deletions src/messages/ru/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"Loading" => "Загрузка",
"Users" => "Пользователи",

"Cleaning temporarily downloaded files" => "Чистка временно загружаемых файлов",
"Clearing the cache" => "Очистка кэша",
"First name" => "Имя",
"Last name" => "Фамилия",
"Patronymic" => "Отчество",
Expand Down

0 comments on commit 85aa81b

Please sign in to comment.