1. 12 Jan, 2018 2 commits
  2. 10 Jan, 2018 1 commit
  3. 14 Dec, 2017 10 commits
    • Fabien Potencier's avatar
      bumped version to 2.2.2-DEV · 014ac54a
      Fabien Potencier authored
      014ac54a
    • Fabien Potencier's avatar
      prepared the 2.2.1 release · a70863fd
      Fabien Potencier authored
      a70863fd
    • Fabien Potencier's avatar
      updated CHANGELOG · 1d219edf
      Fabien Potencier authored
      1d219edf
    • Fabien Potencier's avatar
      fixed CS · 0cc7d382
      Fabien Potencier authored
      0cc7d382
    • Fabien Potencier's avatar
      bug #1576 Namespaces for Twig paths (Adrien) · 15b098d8
      Fabien Potencier authored
      This PR was merged into the 2.2.x-dev branch.
      
      Discussion
      ----------
      
      Namespaces for Twig paths
      
      Hello,
      
      Recently, I had to use Symfony project's pieces of code in a Silex project, extending parent templates through submodules. These submodules, on which I had no control, used namespaced templates in their Twig files, such as:
      ```twig
      {% import "@FooModule/macros.html.twig" as macros %}
      ```
      
      ____
      
      ### Problem
      Silex cannot resolve namespaces by default, since you have to register paths as following:
      ```php
      $app->register(new TwigServiceProvider(), array(
          'twig.path' => [
              '../app/Resources/views',
              '../common/foo-module/Resources/views'
          ]
      ));
      ```
      
      ### Temporary solution
      What I had to do in order to get it working in the project was to "hack" the `\Twig_Loader_Filesystem` class (*PHP 7+*):
      ```php
      $paths = [
          '../app/Resources/views',
          'FooModule' => '../common/foo-module/Resources/views',
      ];
      $app->register(new TwigServiceProvider());
      $app['twig.loader.filesystem'] = (function() use (&$paths): \Twig_Loader_Filesystem {
          $fileSystem = new \Twig_Loader_Filesystem();
          foreach ($paths as $namespace => $path) {
              if (is_string($namespace)) {
                  $fileSystem->addPath($path, $namespace);
              } else {
                  $fileSystem->addPath($path);
              }
          }
      
           return $fileSystem;
      })();
      ```
      This works fine. Other solutions crossed my minds, but this was one of the best alternatives I figured in order to use Twig namespaces in Silex.
      
      ### Code modification
      Though this solution works, it may seem a bit dirty to have to do this in the project's code and not having the `TwigServiceProvider` providing this possibility. So I added this little piece of algorithm directly at the `\Twig_Loader_Filesystem` instanciation, which now looks like this as you will see in changes:
      ```php
      $app['twig.loader.filesystem'] = function ($app) {
          if (!is_array($app['twig.path'])) {
              $app['twig.path'] = array($app['twig.path']);
          }
      
          $fileSystem = new \Twig_Loader_Filesystem();
          foreach ($app['twig.path'] as $namespace => $path) {
              if (is_string($namespace)) {
                  $fileSystem->addPath($path, $namespace);
              } else {
                  $fileSystem->addPath($path);
              }
          }
      
          return $fileSystem;
      };
      ```
      So you can simply register your `TwigServiceProvider` as following:
      ```php
      $app->register(new TwigServiceProvider(), [
          'twig.path' => [
              '../app/Resources/views',
              'FooModule' => '../common/foo-module/Resources/views',
          ]
      ]);
      ```
      
      ___
      
      English not being my native language, I hope I was clear enough. I stay around to answer any question about this potential contribution. (:
      
      A
      
      Commits
      -------
      
      d1f29680 [change] Namespaces for Twig paths
      15b098d8
    • Fabien Potencier's avatar
      minor #1580 Refactoring tests (carusogabriel) · bc3eec7b
      Fabien Potencier authored
      This PR was merged into the 2.2.x-dev branch.
      
      Discussion
      ----------
      
      Refactoring tests
      
      I've refactored some tests, using:
      - `assertCount` instead of `count` function;
      - `assertFalse` instead of strict comparison with `false` keyword;
      - `assertArrayHasKey` instead of `isset` function.
      
      Commits
      -------
      
      b163e443 Refactoring tests
      bc3eec7b
    • Fabien Potencier's avatar
      minor #1584 Test against PHP 7.2 (danielmadu) · 4e7fa229
      Fabien Potencier authored
      This PR was merged into the 2.2.x-dev branch.
      
      Discussion
      ----------
      
      Test against PHP 7.2
      
      Commits
      -------
      
      9853996c Test against PHP 7.2
      4e7fa229
    • Fabien Potencier's avatar
      feature #1583 Swiftmailer SSL stream_context_options cannot be set #1582 : (leClaude) · 6435678e
      Fabien Potencier authored
      This PR was merged into the 2.2.x-dev branch.
      
      Discussion
      ----------
      
      Swiftmailer SSL stream_context_options cannot be set #1582 :
      
      Adding stream_context_options to the $app['swiftmailer.options']
      
      Commits
      -------
      
      d622daa3 Swiftmailer SSL stream_context_options cannot be set #1582 : Adding stream_context_options to the $app['swiftmailer.options']
      6435678e
    • Daniel Madureira's avatar
      Test against PHP 7.2 · 9853996c
      Daniel Madureira authored
      9853996c
    • leClaude's avatar
      Swiftmailer SSL stream_context_options cannot be set #1582 : · d622daa3
      leClaude authored
      Adding stream_context_options to the $app['swiftmailer.options']
      d622daa3
  4. 10 Dec, 2017 1 commit
  5. 27 Nov, 2017 1 commit
  6. 23 Nov, 2017 1 commit
    • Fabien Potencier's avatar
      minor #1575 A minor typo (amitmerchant1990) · c62cfba1
      Fabien Potencier authored
      This PR was merged into the 2.2.x-dev branch.
      
      Discussion
      ----------
      
      A minor typo
      
      Hi,
      
      I found a minor typo in this particular file. Kindly please check it and merge the pull request if you find it valid.
      
      Thanks!
      
      Commits
      -------
      
      8fd2b2bf Update organizing_controllers.rst
      c62cfba1
  7. 22 Nov, 2017 1 commit
  8. 07 Nov, 2017 1 commit
  9. 29 Aug, 2017 3 commits
  10. 25 Aug, 2017 1 commit
  11. 22 Aug, 2017 3 commits
  12. 18 Aug, 2017 1 commit
  13. 17 Aug, 2017 1 commit
  14. 23 Jul, 2017 4 commits
  15. 20 Jul, 2017 2 commits
  16. 15 Jun, 2017 7 commits