Skip to content

Commit dbd6ae6

Browse files
committed
Add php-ini set in composer.json
1 parent a63687f commit dbd6ae6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/orange/cfhelper/CfHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class CfHelper
1818
private function __construct()
1919
{
2020
$this->beanLoader = \Arhframe\IocArt\BeanLoader::getInstance();
21-
if (!is_file(__DIR__ . '/../../../../../context/main.yml')) {
21+
if (!is_file(__DIR__ . '/../../../../../../context/main.yml')) {
2222
$yaml = Yaml::parse(__DIR__ . '/../../../context/main.yml');
2323
unset($yaml['@import']);
2424
$yaml = Yaml::dump($yaml);
2525
file_put_contents(__DIR__ . '/../../../context/main.yml', $yaml);
2626
$this->beanLoader->loadContext(__DIR__ . '/../../../context/main.yml');
2727
} else {
2828
$yaml = Yaml::parse(__DIR__ . '/context/main.yml');
29-
$yaml['@import'] = array('../../../context/main.yml');
29+
$yaml['@import'] = array('../../../../context/main.yml');
3030
$yaml = Yaml::dump($yaml);
3131
file_put_contents(__DIR__ . '/../../../context/main.yml', $yaml);
3232
$this->beanLoader->loadContext(__DIR__ . '/../../../context/main.yml');

src/orange/cfhelper/configuration/PhpIniConfigurator.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@ function __construct()
2525

2626
public function loadIniConfig()
2727
{
28+
$arrayValues = array();
2829
try {
29-
$servicePhpIni = null;
30+
3031
$servicePhpIni = $this->serviceManager->getService(PhpIniConfigurator::$servicePhpIniName . '-' . $this->applicationInfo->getName());
32+
$arrayValues = $servicePhpIni->getValues();
3133
} catch (\Exception $e) {
32-
return;
34+
35+
}
36+
if (is_file(__DIR__ . '/../../../../../../../composer.json')) {
37+
$composerJson = json_decode(file_get_contents(__DIR__ . '/../../../../../../../composer.json'), true);
38+
$arrayValues = array_merge($arrayValues, $composerJson['php-ini']);
3339
}
34-
foreach ($servicePhpIni->getValues() as $key => $value) {
40+
foreach ($arrayValues as $key => $value) {
3541
ini_set($key, $value);
42+
var_dump($key . '=' . $value);
3643
}
3744

3845
}

0 commit comments

Comments
 (0)