Skip to content

Commit 92ad31c

Browse files
davidfuhrvitorbrandao
authored andcommitted
Release 2.0: Support Symfony 3.0 (#57)
* Drop support for old versions * Add phpunit-bridge to find deprecations * Replace security.context by security.authentication_checker * Migrate to assets component * Document changes to Security and Asset Extension * Add support for symfony 3 * Composer is the only supported install method * Update CHANGELOG * Remove Symfony\Component\HttpKernel\Log\LoggerInterface * Update installation and intro chapters of documentation * Remove Symfony 2.1 stuff, remove class parameters * Fix copyright year * Asset name generation in different before 1.1.3 * Tests pass with assetic 1.1.3 * Clean up assetic documentation * Boolean referenceType is not supported anymore * Add missing use statements and doc comments * Update documentation * Fix some phpdoc issues * form.csrf_provider is deprecated since sf 2.4 * Enabling the controllers throws an error about MopaBootstrapBundle * Fix code style * Add missing dev packages * Remove deprecated CsrfProviderInterface * Smarty_Internal_Function_Call_Handler is not available after 3.1.27 * Avoid deprecated services
1 parent 62af97d commit 92ad31c

78 files changed

Lines changed: 671 additions & 685 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ git:
66
depth: 1
77

88
php:
9-
- 5.3
10-
- 5.4
119
- 5.5
1210
- 5.6
1311
- 7.0
@@ -16,10 +14,8 @@ php:
1614
matrix:
1715
fast_finish: true
1816
include:
19-
- php: 5.3
17+
- php: 5.5
2018
env: COMPOSER_FLAGS="--prefer-lowest"
21-
- php: 5.6
22-
env: SYMFONY_VERSION=2.3.*
2319
- php: 5.6
2420
env: SYMFONY_VERSION=2.7.*
2521
- php: 5.6

Assetic/SmartyFormulaLoader.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
*/
2626

2727
namespace NoiseLabs\Bundle\SmartyBundle\Assetic;
2828

29+
use Assetic\Factory\AssetFactory;
2930
use Assetic\Factory\Loader\FormulaLoaderInterface;
3031
use Assetic\Factory\Resource\ResourceInterface;
3132
use NoiseLabs\Bundle\SmartyBundle\Extension\AsseticExtension;
@@ -38,9 +39,24 @@
3839
*/
3940
class SmartyFormulaLoader implements FormulaLoaderInterface
4041
{
42+
/**
43+
* @var SmartyEngine
44+
*/
4145
protected $engine;
46+
47+
/**
48+
* @var AsseticExtension
49+
*/
4250
protected $extension;
51+
52+
/**
53+
* @var AssetFactory
54+
*/
4355
protected $factory;
56+
57+
/**
58+
* @var array
59+
*/
4460
protected $tags = array();
4561

4662
public function __construct(SmartyEngine $engine)

Bootstrap/Extension/InitializrExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/

Bootstrap/Extension/NavbarExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/

Bootstrap/Navbar/Renderer/NavbarRenderer.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/
@@ -64,8 +64,11 @@ public function renderNavbar($name, array $options = array())
6464
$template = $options['template'];
6565
}
6666

67-
$html = $this->getSmartyEngine()->fetchTemplateFunction($template, $function,
68-
array('navbar' => $navbar));
67+
$html = $this->getSmartyEngine()->fetchTemplateFunction(
68+
$template,
69+
$function,
70+
array('navbar' => $navbar)
71+
);
6972

7073
return $html;
7174
}

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
This project adheres to [Semantic Versioning](http://semver.org/).
5+
6+
## [2.0.0] Unreleased
7+
8+
### Added
9+
- Compatibility with Symfony 3.0
10+
11+
### Changed
12+
- AssetsExtension now uses the new [Asset Component](http://symfony.com/doc/current/components/asset/introduction.html)
13+
- SecurityExtension now uses `security.authorization_checker` instead of `security.context`
14+
15+
### Removed
16+
- Drop Support for Symfony < 2.8
17+
- `Symfony\Component\HttpKernel\Log\LoggerInterface` as been replaced by `Psr\Log\LoggerInterface`
18+
- Drop Support for PHP < 5.5
19+
20+
## [1.3.0] - 2016-03-24
21+
22+
### Added
23+
- Compatibility with Symfony 2.8
24+
25+
### Removed
26+
- [#50](https://github.com/noiselabs/SmartyBundle/pull/50) Removed support for unsupported versions of Symfony
27+
28+
### Fixed
29+
- [#51](https://github.com/noiselabs/SmartyBundle/pull/51) fix problem with "plugin tag are already registered" debug messages
30+

CacheWarmer/SmartyCacheWarmer.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/
2727

2828
namespace NoiseLabs\Bundle\SmartyBundle\CacheWarmer;
2929

3030
use NoiseLabs\Bundle\SmartyBundle\Exception\RuntimeException as SmartyBundleRuntimeException;
31-
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
32-
use Symfony\Component\DependencyInjection\ContainerInterface;
3331
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
32+
use Symfony\Component\DependencyInjection\ContainerInterface;
33+
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
3434

3535
/**
3636
* Generates the Smarty cache for all templates.
@@ -40,8 +40,15 @@
4040
*/
4141
class SmartyCacheWarmer implements CacheWarmerInterface
4242
{
43+
/**
44+
* @var ContainerInterface
45+
*/
4346
protected $container;
44-
protected $warmer;
47+
48+
/**
49+
* @var TemplateFinderInterface
50+
*/
51+
protected $finder;
4552

4653
/**
4754
* Constructor.
@@ -67,7 +74,6 @@ public function __construct(ContainerInterface $container, TemplateFinderInterfa
6774
public function warmUp($cacheDir)
6875
{
6976
$engine = $this->container->get('templating.engine.smarty');
70-
$smarty = $engine->getSmarty();
7177
$logger = $this->container->has('logger') ? $this->container->get('logger') : null;
7278

7379
foreach ($this->finder->findAllTemplates() as $template) {

CacheWarmer/SmartyTemplateFinder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/
2727

2828
namespace NoiseLabs\Bundle\SmartyBundle\CacheWarmer;
2929

30-
use Symfony\Component\HttpKernel\KernelInterface;
30+
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
3131
use Symfony\Component\Finder\Finder;
32-
use Symfony\Component\Templating\TemplateNameParserInterface;
3332
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
34-
use Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface;
33+
use Symfony\Component\HttpKernel\KernelInterface;
34+
use Symfony\Component\Templating\TemplateNameParserInterface;
3535

3636
/**
3737
* Finds all the templates.

Command/CompileCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/
@@ -51,12 +51,6 @@ protected function configure()
5151
InputArgument::OPTIONAL,
5252
'A bundle name'
5353
)
54-
->addOption(
55-
'force',
56-
null,
57-
InputOption::VALUE_NONE,
58-
'Force the compilation of all templates even if they weren\'t modified'
59-
)
6054
->setHelp(<<<EOF
6155
The following command finds all known Smarty templates and compiles them:
6256
@@ -75,10 +69,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7569
{
7670
$finder = $this->getContainer()->get('smarty.templating.finder');
7771
$engine = $this->getContainer()->get('templating.engine.smarty');
78-
$smarty = $engine->getSmarty();
7972

8073
$bundleName = $input->getArgument('bundle');
81-
$force = (boolean) $input->getOption('force');
8274
$verbose = $input->getOption('verbose');
8375

8476
if ($bundleName && (0 === strpos($bundleName, '@'))) {

DependencyInjection/Compiler/MopaBootstrapPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* License along with NoiseLabs-SmartyBundle; if not, see
1717
* <http://www.gnu.org/licenses/>.
1818
*
19-
* Copyright (C) 2011-2015 Vítor Brandão
19+
* Copyright (C) 2011-2016 Vítor Brandão
2020
*
2121
* @category NoiseLabs
2222
* @package SmartyBundle
23-
* @copyright (C) 2011-2014 Vítor Brandão <vitor@noiselabs.org>
23+
* @copyright (C) 2011-2016 Vítor Brandão <vitor@noiselabs.org>
2424
* @license http://www.gnu.org/licenses/lgpl-3.0-standalone.html LGPL-3
2525
* @link http://www.noiselabs.org
2626
*/

0 commit comments

Comments
 (0)