@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @date 27.05.16 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | namespace IPub\Packages\DI; |
18 | 18 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | * @var array |
42 | 42 | */ |
43 | 43 | private $defaults = [ |
44 | - 'path' => NULL, // Paths where to search for packages |
|
45 | - 'dirs' => [ // Define path to folders |
|
46 | - 'configDir' => '%appDir%/config', // Path where is stored app configuration |
|
47 | - 'vendorDir' => '%appDir%/../vendor', // Path to composer vendor folder |
|
48 | - 'tempDir' => '%tempDir%', // Path to temporary folder |
|
44 | + 'path' => NULL, // Paths where to search for packages |
|
45 | + 'dirs' => [// Define path to folders |
|
46 | + 'configDir' => '%appDir%/config', // Path where is stored app configuration |
|
47 | + 'vendorDir' => '%appDir%/../vendor', // Path to composer vendor folder |
|
48 | + 'tempDir' => '%tempDir%', // Path to temporary folder |
|
49 | 49 | ], |
50 | - 'configFile' => 'config.neon', // Filename with enabled packages extensions |
|
50 | + 'configFile' => 'config.neon', // Filename with enabled packages extensions |
|
51 | 51 | 'loader' => [ |
52 | 52 | 'packageFiles' => [ |
53 | 53 | 'package.php', |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $builder->parameters['packages'] = []; |
74 | 74 | |
75 | - if (is_file($configuration['dirs']['configDir'] . DIRECTORY_SEPARATOR . 'packages.php')) { |
|
76 | - $packages = require $configuration['dirs']['configDir'] . DIRECTORY_SEPARATOR . 'packages.php'; |
|
75 | + if (is_file($configuration['dirs']['configDir'].DIRECTORY_SEPARATOR.'packages.php')) { |
|
76 | + $packages = require $configuration['dirs']['configDir'].DIRECTORY_SEPARATOR.'packages.php'; |
|
77 | 77 | |
78 | 78 | foreach ($packages as $name => $data) { |
79 | 79 | $builder->parameters['packages'][$name] = $data; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ]; |
133 | 133 | |
134 | 134 | foreach ($commands as $name => $cmd) { |
135 | - $builder->addDefinition($this->prefix('commands' . lcfirst($name))) |
|
135 | + $builder->addDefinition($this->prefix('commands'.lcfirst($name))) |
|
136 | 136 | ->setType($cmd); |
137 | 137 | } |
138 | 138 | } |
@@ -12,40 +12,40 @@ discard block |
||
12 | 12 | * @date 19.07.16 |
13 | 13 | */ |
14 | 14 | |
15 | -declare(strict_types = 1); |
|
15 | +declare(strict_types=1); |
|
16 | 16 | |
17 | 17 | use Contributte\Console; |
18 | 18 | |
19 | 19 | $rootDir = getcwd(); |
20 | -$libsDir = $rootDir . DIRECTORY_SEPARATOR . 'vendor'; |
|
21 | -$wwwDir = $rootDir . DIRECTORY_SEPARATOR . 'www'; |
|
22 | -$appDir = $rootDir . DIRECTORY_SEPARATOR . 'app'; |
|
23 | -$packagesDir = $appDir . DIRECTORY_SEPARATOR . 'config'; |
|
20 | +$libsDir = $rootDir.DIRECTORY_SEPARATOR.'vendor'; |
|
21 | +$wwwDir = $rootDir.DIRECTORY_SEPARATOR.'www'; |
|
22 | +$appDir = $rootDir.DIRECTORY_SEPARATOR.'app'; |
|
23 | +$packagesDir = $appDir.DIRECTORY_SEPARATOR.'config'; |
|
24 | 24 | |
25 | 25 | if (!file_exists($packagesDir)) { |
26 | 26 | if (is_writable(dirname($packagesDir))) { |
27 | 27 | mkdir($packagesDir); |
28 | 28 | |
29 | 29 | } else { |
30 | - die('Path "' . $packagesDir . '" does not exists.'); |
|
30 | + die('Path "'.$packagesDir.'" does not exists.'); |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | if (!is_writable($packagesDir)) { |
35 | - die('Path "' . $packagesDir . '" it not writable.'); |
|
35 | + die('Path "'.$packagesDir.'" it not writable.'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | foreach (['log', 'temp'] as $dir) { |
39 | - if (!is_dir($rootDir . DIRECTORY_SEPARATOR . $dir)) { |
|
40 | - mkdir($rootDir . DIRECTORY_SEPARATOR . $dir); |
|
39 | + if (!is_dir($rootDir.DIRECTORY_SEPARATOR.$dir)) { |
|
40 | + mkdir($rootDir.DIRECTORY_SEPARATOR.$dir); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if (!file_exists($libsDir . DIRECTORY_SEPARATOR . 'autoload.php')) { |
|
44 | +if (!file_exists($libsDir.DIRECTORY_SEPARATOR.'autoload.php')) { |
|
45 | 45 | die('autoload.php file can not be found.'); |
46 | 46 | } |
47 | 47 | |
48 | -require_once $libsDir . DIRECTORY_SEPARATOR . 'autoload.php'; |
|
48 | +require_once $libsDir.DIRECTORY_SEPARATOR.'autoload.php'; |
|
49 | 49 | |
50 | 50 | $configurator = new Nette\Configurator; |
51 | 51 | $configurator->addParameters([ |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | ]); |
55 | 55 | |
56 | 56 | //$configurator->setDebugMode(TRUE); // Debug mode HAVE TO BE enabled on production server |
57 | -$configurator->enableDebugger($packagesDir . DIRECTORY_SEPARATOR . 'log'); |
|
57 | +$configurator->enableDebugger($packagesDir.DIRECTORY_SEPARATOR.'log'); |
|
58 | 58 | |
59 | -$configurator->setTempDirectory($packagesDir . DIRECTORY_SEPARATOR . 'temp'); |
|
60 | -$configurator->addConfig(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.neon'); |
|
59 | +$configurator->setTempDirectory($packagesDir.DIRECTORY_SEPARATOR.'temp'); |
|
60 | +$configurator->addConfig(dirname(__DIR__).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.neon'); |
|
61 | 61 | |
62 | 62 | $container = $configurator->createContainer(); |
63 | 63 |