@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once dirname(__FILE__).'/SymfonyRequirements.php'; |
|
3 | +require_once dirname(__FILE__) . '/SymfonyRequirements.php'; |
|
4 | 4 | |
5 | 5 | $lineSize = 70; |
6 | 6 | $symfonyRequirements = new SymfonyRequirements(); |
@@ -8,16 +8,16 @@ discard block |
||
8 | 8 | |
9 | 9 | echo_title('Symfony Requirements Checker'); |
10 | 10 | |
11 | -echo '> PHP is using the following php.ini file:'.PHP_EOL; |
|
11 | +echo '> PHP is using the following php.ini file:' . PHP_EOL; |
|
12 | 12 | if ($iniPath) { |
13 | - echo_style('green', ' '.$iniPath); |
|
13 | + echo_style('green', ' ' . $iniPath); |
|
14 | 14 | } else { |
15 | 15 | echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!'); |
16 | 16 | } |
17 | 17 | |
18 | -echo PHP_EOL.PHP_EOL; |
|
18 | +echo PHP_EOL . PHP_EOL; |
|
19 | 19 | |
20 | -echo '> Checking Symfony requirements:'.PHP_EOL.' '; |
|
20 | +echo '> Checking Symfony requirements:' . PHP_EOL . ' '; |
|
21 | 21 | |
22 | 22 | $messages = array(); |
23 | 23 | foreach ($symfonyRequirements->getRequirements() as $req) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | echo_title('Fix the following mandatory requirements', 'red'); |
50 | 50 | |
51 | 51 | foreach ($messages['error'] as $helpText) { |
52 | - echo ' * '.$helpText.PHP_EOL; |
|
52 | + echo ' * ' . $helpText . PHP_EOL; |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | echo_title('Optional recommendations to improve your setup', 'yellow'); |
58 | 58 | |
59 | 59 | foreach ($messages['warning'] as $helpText) { |
60 | - echo ' * '.$helpText.PHP_EOL; |
|
60 | + echo ' * ' . $helpText . PHP_EOL; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | echo PHP_EOL; |
65 | 65 | echo_style('title', 'Note'); |
66 | -echo ' The command console could use a different php.ini file'.PHP_EOL; |
|
66 | +echo ' The command console could use a different php.ini file' . PHP_EOL; |
|
67 | 67 | echo_style('title', '~~~~'); |
68 | -echo ' than the one used with your web server. To be on the'.PHP_EOL; |
|
69 | -echo ' safe side, please check the requirements from your web'.PHP_EOL; |
|
68 | +echo ' than the one used with your web server. To be on the' . PHP_EOL; |
|
69 | +echo ' safe side, please check the requirements from your web' . PHP_EOL; |
|
70 | 70 | echo ' server using the '; |
71 | 71 | echo_style('yellow', 'web/config.php'); |
72 | -echo ' script.'.PHP_EOL; |
|
72 | +echo ' script.' . PHP_EOL; |
|
73 | 73 | echo PHP_EOL; |
74 | 74 | |
75 | 75 | exit($checkPassed ? 0 : 1); |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; |
|
84 | - $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL; |
|
83 | + $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL . ' ') . PHP_EOL; |
|
84 | + $errorMessage .= ' > ' . wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL . ' > ') . PHP_EOL; |
|
85 | 85 | |
86 | 86 | return $errorMessage; |
87 | 87 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | $style = $style ?: 'title'; |
92 | 92 | |
93 | 93 | echo PHP_EOL; |
94 | - echo_style($style, $title.PHP_EOL); |
|
95 | - echo_style($style, str_repeat('~', strlen($title)).PHP_EOL); |
|
94 | + echo_style($style, $title . PHP_EOL); |
|
95 | + echo_style($style, str_repeat('~', strlen($title)) . PHP_EOL); |
|
96 | 96 | echo PHP_EOL; |
97 | 97 | } |
98 | 98 | |
@@ -110,20 +110,20 @@ discard block |
||
110 | 110 | ); |
111 | 111 | $supports = has_color_support(); |
112 | 112 | |
113 | - echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); |
|
113 | + echo($supports ? $styles[$style] : '') . $message . ($supports ? $styles['reset'] : ''); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | function echo_block($style, $title, $message) |
117 | 117 | { |
118 | - $message = ' '.trim($message).' '; |
|
118 | + $message = ' ' . trim($message) . ' '; |
|
119 | 119 | $width = strlen($message); |
120 | 120 | |
121 | - echo PHP_EOL.PHP_EOL; |
|
121 | + echo PHP_EOL . PHP_EOL; |
|
122 | 122 | |
123 | - echo_style($style, str_repeat(' ', $width).PHP_EOL); |
|
124 | - echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL); |
|
125 | - echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL); |
|
126 | - echo_style($style, str_repeat(' ', $width).PHP_EOL); |
|
123 | + echo_style($style, str_repeat(' ', $width) . PHP_EOL); |
|
124 | + echo_style($style, str_pad(' [' . $title . ']', $width, ' ', STR_PAD_RIGHT) . PHP_EOL); |
|
125 | + echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT) . PHP_EOL); |
|
126 | + echo_style($style, str_repeat(' ', $width) . PHP_EOL); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | function has_color_support() |
@@ -403,13 +403,13 @@ discard block |
||
403 | 403 | ); |
404 | 404 | |
405 | 405 | $this->addRequirement( |
406 | - is_dir(__DIR__.'/../vendor/composer'), |
|
406 | + is_dir(__DIR__ . '/../vendor/composer'), |
|
407 | 407 | 'Vendor libraries must be installed', |
408 | - 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '. |
|
408 | + 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' . |
|
409 | 409 | 'Then run "<strong>php composer.phar install</strong>" to install them.' |
410 | 410 | ); |
411 | 411 | |
412 | - $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; |
|
412 | + $cacheDir = is_dir(__DIR__ . '/../var/cache') ? __DIR__ . '/../var/cache' : __DIR__ . '/cache'; |
|
413 | 413 | |
414 | 414 | $this->addRequirement( |
415 | 415 | is_writable($cacheDir), |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | 'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.' |
418 | 418 | ); |
419 | 419 | |
420 | - $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; |
|
420 | + $logsDir = is_dir(__DIR__ . '/../var/logs') ? __DIR__ . '/../var/logs' : __DIR__ . '/logs'; |
|
421 | 421 | |
422 | 422 | $this->addRequirement( |
423 | 423 | is_writable($logsDir), |
@@ -548,13 +548,13 @@ discard block |
||
548 | 548 | |
549 | 549 | /* optional recommendations follow */ |
550 | 550 | |
551 | - if (file_exists(__DIR__.'/../vendor/composer')) { |
|
552 | - require_once __DIR__.'/../vendor/autoload.php'; |
|
551 | + if (file_exists(__DIR__ . '/../vendor/composer')) { |
|
552 | + require_once __DIR__ . '/../vendor/autoload.php'; |
|
553 | 553 | |
554 | 554 | try { |
555 | 555 | $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); |
556 | 556 | |
557 | - $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); |
|
557 | + $contents = file_get_contents(dirname($r->getFileName()) . '/Resources/skeleton/app/SymfonyRequirements.php'); |
|
558 | 558 | } catch (ReflectionException $e) { |
559 | 559 | $contents = ''; |
560 | 560 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | /** |
7 | 7 | * @var ClassLoader $loader |
8 | 8 | */ |
9 | -$loader = require __DIR__.'/../vendor/autoload.php'; |
|
9 | +$loader = require __DIR__ . '/../vendor/autoload.php'; |
|
10 | 10 | |
11 | 11 | AnnotationRegistry::registerLoader(array($loader, 'loadClass')); |
12 | 12 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'/AppKernel.php'; |
|
3 | +require_once __DIR__ . '/AppKernel.php'; |
|
4 | 4 | |
5 | 5 | use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache; |
6 | 6 |
@@ -41,6 +41,6 @@ |
||
41 | 41 | |
42 | 42 | public function registerContainerConfiguration(LoaderInterface $loader) |
43 | 43 | { |
44 | - $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); |
|
44 | + $loader->load(__DIR__ . '/config/config_' . $this->getEnvironment() . '.yml'); |
|
45 | 45 | } |
46 | 46 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | exit('This script is only accessible from localhost.'); |
13 | 13 | } |
14 | 14 | |
15 | -require_once dirname(__FILE__).'/../app/SymfonyRequirements.php'; |
|
15 | +require_once dirname(__FILE__) . '/../app/SymfonyRequirements.php'; |
|
16 | 16 | |
17 | 17 | $symfonyRequirements = new SymfonyRequirements(); |
18 | 18 |
@@ -82,7 +82,10 @@ discard block |
||
82 | 82 | <?php if (count($minorProblems)): ?> |
83 | 83 | <h2>Recommendations</h2> |
84 | 84 | <p> |
85 | - <?php if (count($majorProblems)): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience, |
|
85 | + <?php if (count($majorProblems)): ?>Additionally, to<?php else { |
|
86 | + : ?>To<?php endif; |
|
87 | +} |
|
88 | +?> enhance your Symfony experience, |
|
86 | 89 | it’s recommended that you fix the following: |
87 | 90 | </p> |
88 | 91 | <ol> |
@@ -96,9 +99,12 @@ discard block |
||
96 | 99 | <p id="phpini">* |
97 | 100 | <?php if ($symfonyRequirements->getPhpIniConfigPath()): ?> |
98 | 101 | Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>". |
99 | - <?php else: ?> |
|
102 | + <?php else { |
|
103 | + : ?> |
|
100 | 104 | To change settings, create a "<strong>php.ini</strong>". |
101 | - <?php endif; ?> |
|
105 | + <?php endif; |
|
106 | +} |
|
107 | +?> |
|
102 | 108 | </p> |
103 | 109 | <?php endif; ?> |
104 | 110 |
@@ -16,10 +16,10 @@ |
||
16 | 16 | header('HTTP/1.0 403 Forbidden'); |
17 | 17 | exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
18 | 18 | }*/ |
19 | -$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; |
|
19 | +$loader = require_once __DIR__ . '/../app/bootstrap.php.cache'; |
|
20 | 20 | Debug::enable(); |
21 | 21 | |
22 | -require_once __DIR__.'/../app/AppKernel.php'; |
|
22 | +require_once __DIR__ . '/../app/AppKernel.php'; |
|
23 | 23 | |
24 | 24 | $kernel = new AppKernel('dev', true); |
25 | 25 | $kernel->loadClassCache(); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Symfony\Component\ClassLoader\ApcClassLoader; |
4 | 4 | use Symfony\Component\HttpFoundation\Request; |
5 | 5 | |
6 | -$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; |
|
6 | +$loader = require_once __DIR__ . '/../app/bootstrap.php.cache'; |
|
7 | 7 | |
8 | 8 | // Use APC for autoloading to improve performance. |
9 | 9 | // Change 'sf2' to a unique prefix in order to prevent cache key conflicts |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $apcLoader->register(true); |
15 | 15 | */ |
16 | 16 | |
17 | -require_once __DIR__.'/../app/AppKernel.php'; |
|
17 | +require_once __DIR__ . '/../app/AppKernel.php'; |
|
18 | 18 | //require_once __DIR__.'/../app/AppCache.php'; |
19 | 19 | |
20 | 20 | $kernel = new AppKernel('prod', false); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $config = $processor->processConfiguration($configuration, $configs); |
23 | 23 | |
24 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
24 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
25 | 25 | |
26 | 26 | $loaded = array(); |
27 | 27 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | if (!isset($loaded[$ext])) { |
115 | - $loader->load($ext.'.xml'); |
|
115 | + $loader->load($ext . '.xml'); |
|
116 | 116 | $loaded[$ext] = true; |
117 | 117 | } |
118 | 118 |