@@ -23,27 +23,26 @@ public function getConfigSchema(): Nette\Schema\Schema
23
23
}
24
24
25
25
26
- public function afterCompile ( Nette \ PhpGenerator \ ClassType $ class )
26
+ public function loadConfiguration ( )
27
27
{
28
- $ initialize = $ class ->getMethod ('initialize ' );
29
28
foreach ($ this ->getConfig () as $ name => $ value ) {
30
29
if ($ value === null ) {
31
30
continue ;
32
31
33
32
} elseif ($ name === 'include_path ' ) {
34
- $ initialize ->addBody ('set_include_path(?); ' , [str_replace ('; ' , PATH_SEPARATOR , $ value )]);
33
+ $ this -> initialization ->addBody ('set_include_path(?); ' , [str_replace ('; ' , PATH_SEPARATOR , $ value )]);
35
34
36
35
} elseif ($ name === 'ignore_user_abort ' ) {
37
- $ initialize ->addBody ('ignore_user_abort(?); ' , [$ value ]);
36
+ $ this -> initialization ->addBody ('ignore_user_abort(?); ' , [$ value ]);
38
37
39
38
} elseif ($ name === 'max_execution_time ' ) {
40
- $ initialize ->addBody ('set_time_limit(?); ' , [$ value ]);
39
+ $ this -> initialization ->addBody ('set_time_limit(?); ' , [$ value ]);
41
40
42
41
} elseif ($ name === 'date.timezone ' ) {
43
- $ initialize ->addBody ('date_default_timezone_set(?); ' , [$ value ]);
42
+ $ this -> initialization ->addBody ('date_default_timezone_set(?); ' , [$ value ]);
44
43
45
44
} elseif (function_exists ('ini_set ' )) {
46
- $ initialize ->addBody ('ini_set(?, ?); ' , [$ name , $ value === false ? '0 ' : (string ) $ value ]);
45
+ $ this -> initialization ->addBody ('ini_set(?, ?); ' , [$ name , $ value === false ? '0 ' : (string ) $ value ]);
47
46
48
47
} elseif (ini_get ($ name ) != $ value ) { // intentionally ==
49
48
throw new Nette \NotSupportedException ('Required function ini_set() is disabled. ' );
0 commit comments