Skip to content

Commit

Permalink
Fix CS and remove useless config
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrech committed Nov 5, 2019
1 parent 1234c34 commit 6568a93
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 30 deletions.
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ return PhpCsFixer\Config::create()
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__ . '/config')
->in(__DIR__ . '/public')
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
Expand Down
9 changes: 9 additions & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Secret Santa project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Expand Down
58 changes: 30 additions & 28 deletions config/packages/assets_version.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<?php

/*
* This file is part of the Secret Santa project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$rootDirectory = sprintf("%s/../../", __DIR__);
$assetsDirectory = realpath(sprintf("%s/public", $rootDirectory));

$finder = new Symfony\Component\Finder\Finder();
$files = $finder->in($assetsDirectory)->files();

$hashes = hash_init('crc32b');

foreach($files as $file) {
hash_update_file($hashes, $file);
}

$hash = hash_final($hashes);

$container->loadFromExtension('framework', [
'assets' => [
'version' => $hash
]
]);
/*
* This file is part of the Secret Santa project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\Finder\Finder;

$rootDirectory = sprintf('%s/../../', __DIR__);
$assetsDirectory = realpath(sprintf('%s/public', $rootDirectory));

$finder = new Finder();
$files = $finder->in($assetsDirectory)->files();

$hashes = hash_init('crc32b');

foreach ($files as $file) {
hash_update_file($hashes, $file);
}

$hash = hash_final($hashes);

$container->loadFromExtension('framework', [
'assets' => [
'version' => $hash,
],
]);
9 changes: 9 additions & 0 deletions config/packages/dev/monolog.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Secret Santa project.
*
* (c) JoliCode <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Symfony\Component\Config\Resource\ClassExistenceResource;
use Symfony\Component\Console\Application;

Expand Down
2 changes: 0 additions & 2 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ framework:
#fragments: ~
php_errors:
log: true
assets:
version: 'v14'

0 comments on commit 6568a93

Please sign in to comment.