Hi,
How i can re-use the same connection of "main.php" in "console.php" without need change "console.php" everytime that i change "main.php" ?
Hi,
How i can re-use the same connection of "main.php" in "console.php" without need change "console.php" everytime that i change "main.php" ?
I can think of three approaches
arrayMerge, just like in test.php (will include irrelevant parts of main.php)
‘db’=>require ‘db.php’, // db.php returns an connection array
something like this
$webConfig = require 'main.php';
...
return array {
...
'components'=>array(
'db'=>$webConfig['components']['db'],
),
),
/Tommy
Hi, thanks man, your third solution is the best.
My problem was solved:
$mainConfig = require(dirname(__FILE__) . '/main.php');
return CMap::mergeArray(
array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Auction Platform - Console Application',
'components'=>array(
'db' => $mainConfig['components']['db'],
),
)
);