Skip to content

Commit

Permalink
Dev: New feature #12011 for console too
Browse files Browse the repository at this point in the history
Dev: better system in develop, then quick fix
  • Loading branch information
Shnoulle committed Feb 20, 2017
1 parent 22253b8 commit 9b45ea9
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions application/commands/console.php
Expand Up @@ -26,23 +26,24 @@
$loader->addNamespace('ls\\pluginmanager', __DIR__ . '/../libraries/PluginManager');
$loader->addNamespace('ls\\pluginmanager', __DIR__ . '/../libraries/PluginManager/Storage');
require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'yii.php');
// Load configuration.
$sCurrentDir=dirname(__FILE__);
$settings=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config-defaults.php');
$config=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'internal.php');
$core = dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR;
if(isset($config['config'])){
$settings=array_merge($settings,$config['config']);
}
unset ($config['defaultController']);
unset ($config['config']);
/* fix runtime path, unsure you can lauch function anywhere (if you use php /var/www/limesurvey/... : can be /root/ for config */
$runtimePath=$settings['tempdir'].'/runtime';
if(!is_dir($runtimePath) || !is_writable($runtimePath)){
$runtimePath=str_replace($settings['rootdir'],dirname(dirname(dirname(__FILE__))),$runtimePath);
}
$config['runtimePath']=$runtimePath;

// Load configuration.
$sCurrentDir=dirname(__FILE__);
$settings=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config-defaults.php');
$config=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'internal.php');
$core = dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR;
if(isset($config['config'])){
$settings=array_merge($settings,$config['config']);
}
unset ($config['defaultController']);
unset ($config['config']);
/* fix runtime path, unsure you can lauch function anywhere (if you use php /var/www/limesurvey/... : can be /root/ for config */
if(!isset($config['runtimePath'])){
$runtimePath=$settings['tempdir'].'/runtime';
if(!is_dir($runtimePath) || !is_writable($runtimePath)){
$runtimePath=str_replace($settings['rootdir'],dirname(dirname(dirname(__FILE__))),$runtimePath);
}
$config['runtimePath']=$runtimePath;
}
// fix for fcgi
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

Expand Down

0 comments on commit 9b45ea9

Please sign in to comment.