1. 17 Apr, 2012 1 commit
  2. 02 Apr, 2012 2 commits
    • Fabien Potencier's avatar
      merged branch stof/patch-1 (PR #298) · c3fd3464
      Fabien Potencier authored
      Commits
      -------
      
      0a74dcda Removed the Symfony2 tests from the phar archive
      
      Discussion
      ----------
      
      Removed the Symfony2 tests from the phar archive
      
      Components' tests are now distributed with the code, making the
      archive far bigger if we don't exclude them.
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-04-02T06:31:10Z
      
      Was about to do this. 👍
      c3fd3464
    • Christophe Coevoet's avatar
      Removed the Symfony2 tests from the phar archive · 0a74dcda
      Christophe Coevoet authored
      Components' tests are now distributed with the code, making the
      archive far bigger if we don't exclude them.
      0a74dcda
  3. 30 Mar, 2012 1 commit
  4. 29 Mar, 2012 1 commit
    • Fabien Potencier's avatar
      merged branch pete-otaqui/compile_with_autoload_classmap (PR #295) · 86d19fcf
      Fabien Potencier authored
      Commits
      -------
      
      3f22ac3c added autoload_classmap.php to the list of .composer files to include
      
      Discussion
      ----------
      
      added autoload_classmap.php to the list of .composer files to include
      
      Hi,
      
      I suspect this is my own stupidity since no-one else has reported it, but for me the silex.phar dies when required because it doesn't contain a file that it tries to require: "vendor/.composer/autoload_classmap.php".
      
      I've tried the silex.phar from the project homepage, and also compiled my own from the source code with the same result.  Unpacking either shows indeed that there is no autoload_classmap.php file.
      
      Had a quick look and saw that some other vendor/.composer/*.php files were listed in the Compiler.php class, added in the missing classmap file, and everything seemed to work fine.
      
      As I said, I think I must be missing something, because otherwise silex would be completely broken for just about everybody! using the phar!
      
      ---------------------------------------------------------------------------
      
      by chanmix51 at 2012-03-28T12:50:23Z
      
      Hi,
      
      Afaik, the .phar archive does not work with composer as it has not been managed by it. Hence composer does not know anything about phars you could use. I may be wrong but If you use the phar you should use Silex's autoloader or add silex to your dependencies in your `composer.json` instead.
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-28T13:54:31Z
      
      @pete-otaqui This should indeed fix the issue 👍
      
      ---------------------------------------------------------------------------
      
      by pete-otaqui at 2012-03-28T14:19:44Z
      
      I think you misunderstand me.  I'm not using composer, I just tried the example _from the Silex homepage_:
      
      ```php
      <?php
      require_once __DIR__.'/silex.phar';
      
      $app = new Silex\Application();
      
      $app->get('/hello/{name}', function ($name) use ($app) {
        return 'Hello '.$app->escape($name);
      });
      
      $app->run();
      ```
      
      For me this throws the following error:
      
      ```
      Warning: require(phar:///var/www/silex/silex.phar/vendor/.composer/autoload_classmap.php): failed to open stream: phar error: "vendor/.composer/autoload_classmap.php" is not a file in phar "/var/www/silex/silex.phar" in phar:///var/www/silex/silex.phar/vendor/.composer/autoload.php on line 17
      
      Fatal error: require(): Failed opening required 'phar:///var/www/silex/silex.phar/vendor/.composer/autoload_classmap.php' (include_path='.:/usr/share/php:/usr/share/pear') in phar:///var/www/silex/silex.phar/vendor/.composer/autoload.php on line 17
      ```
      
      If you look at the commit I made, you'll see that the Compiler class (which creates the silex.phar) does indeed include some stuff from vendor/.composer/ ... it's just that it doesn't include "autoload_classmap.php".
      
      Possibly this file is supposed to be automatically generated by something inside silex.phar, and for some reason mine isn't writeable, but in that case I ought really to get a different error.
      
      ---------------------------------------------------------------------------
      
      by chanmix51 at 2012-03-28T14:23:02Z
      
      Oh sorry, didn't get what the problem was.
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-28T18:41:33Z
      
      Fix confirmed 👍 @fabpot please merge asap
      
      ---------------------------------------------------------------------------
      
      by simensen at 2012-03-29T15:43:54Z
      
      I was just going to open a PR on this. Good thing I checked first. :)
      86d19fcf
  5. 28 Mar, 2012 1 commit
  6. 26 Mar, 2012 3 commits
    • Fabien Potencier's avatar
      merged branch GromNaN/patch-2 (PR #287) · 3fe1e25b
      Fabien Potencier authored
      Commits
      -------
      
      0676cd2a Use the application charset as default charset for `$app->escape()` method.
      
      Discussion
      ----------
      
      Use the application charset as default charset for $app->escape() method
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-21T11:47:47Z
      
      👍
      
      I'm curious, are you using something other than UTF-8?
      
      ---------------------------------------------------------------------------
      
      by GromNaN at 2012-03-21T12:04:21Z
      
      @igorw The database is encoded in ISO-8859-15. With this patch, I'll only have to change the app charset once the database converted to UTF-8.
      3fe1e25b
    • Fabien Potencier's avatar
      merged branch guillaumepotier/master (PR #290) · 5eac61f3
      Fabien Potencier authored
      Commits
      -------
      
      96b0db50 [docs] fixed typo
      142143af [docs] fixed typos
      32c96a4c [docs] added cookbook recipe on how to disable CSRF Protection using FormExtension
      
      Discussion
      ----------
      
      [docs] added cookbook recipe on how to disable CSRF Protection using FormExtension
      
      Followed @igorw advice here: https://twitter.com/#!/igorwesome/status/183237649811783682
      
      It also could be awesome to add the FormExtension doc (PR #77) ;)
      5eac61f3
    • Fabien Potencier's avatar
      merged branch jalliot/patch-1 (PR #292) · b8eb2d1a
      Fabien Potencier authored
      Commits
      -------
      
      c9bbcc0a Use new json function in doc
      
      Discussion
      ----------
      
      Use new json function in doc
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-24T16:53:00Z
      
      Missed that one, thanks. 👍
      b8eb2d1a
  7. 24 Mar, 2012 2 commits
  8. 23 Mar, 2012 2 commits
  9. 21 Mar, 2012 1 commit
  10. 20 Mar, 2012 9 commits
    • Fabien Potencier's avatar
      merged branch igorw/json (PR #286) · 1d62671c
      Fabien Potencier authored
      Commits
      -------
      
      a3275875 [json] add changelog entry
      
      Discussion
      ----------
      
      [json] add changelog entry
      1d62671c
    • Igor Wiedler's avatar
      [json] add changelog entry · a3275875
      Igor Wiedler authored
      a3275875
    • Fabien Potencier's avatar
      merged branch Seldaek/patch-1 (PR #281) · 19b7503d
      Fabien Potencier authored
      Commits
      -------
      
      570f475d Improve phar compression
      
      Discussion
      ----------
      
      Improve phar compression
      
      Just did those changes for composer, with this patch added I only get a 4% size increase from the fully stripped version. Without I had a 33% size increase by adding the "stripComments" method from Silex which kinda sucked. As far as I can tell it doesn't break anything.
      19b7503d
    • Fabien Potencier's avatar
      merged branch igorw/json (PR #285) · b35806a7
      Fabien Potencier authored
      Commits
      -------
      
      aee65e34 [json] add docs to the usage page
      b2566895 [json] adjust json request body recipe
      4ce8998a [json] add JSON helper
      
      Discussion
      ----------
      
      Json
      b35806a7
    • Fabien Potencier's avatar
      merged branch davedevelopment/symfony-session-refactoring (PR #284) · f781d911
      Fabien Potencier authored
      Commits
      -------
      
      537b8088 Updated docs to reflect session refactoring
      d1bd57d1 Updated to reflect symfony refactoring - needs doc updates
      
      Discussion
      ----------
      
      Updated Session Provider to reflect symfony refactoring - needs doc updates
      
      I'm not really sure what's required here, but here's what I had to do to get my app working again…
      
      ---------------------------------------------------------------------------
      
      by Koin at 2012-03-19T14:12:57Z
      
      omg, thanks davedevelopment.
      I'm not the only one to have this problem.
      
      ---------------------------------------------------------------------------
      
      by spantaleev at 2012-03-19T20:53:02Z
      
      Good. I just saw this myself and was about to fix it, but you're already ahead.
      Can we get the necessary doc updates and have this merged in?
      
      ---------------------------------------------------------------------------
      
      by dguyon at 2012-03-20T09:06:32Z
      
      @davedevelopment do you have time to add some docs that reflects your changes ?
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-20T09:18:11Z
      
      Looks good to me, please update the docs.
      
      ---------------------------------------------------------------------------
      
      by davedevelopment at 2012-03-20T09:26:17Z
      
      Will get the docs updated today
      On Mar 20, 2012 9:18 AM, "Igor Wiedler" <
      reply@reply.github.com>
      wrote:
      
      > Looks good to me, please update the docs.
      >
      > ---
      > Reply to this email directly or view it on GitHub:
      > https://github.com/fabpot/Silex/pull/284#issuecomment-4591304
      >
      
      ---------------------------------------------------------------------------
      
      by davedevelopment at 2012-03-20T13:29:09Z
      
      I did a quick test of the above with rst2html and it seem to render ok. The docs at api.symfony.com don't seem to have been updated yet (tried the master branch), so I left out hyperlinks for now.
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-20T13:47:20Z
      
      👍
      
      ---------------------------------------------------------------------------
      
      by dguyon at 2012-03-20T13:49:38Z
      
      Thanks for this quick patch !
      f781d911
    • Igor Wiedler's avatar
      [json] add docs to the usage page · aee65e34
      Igor Wiedler authored
      aee65e34
    • Igor Wiedler's avatar
      [json] adjust json request body recipe · b2566895
      Igor Wiedler authored
      b2566895
    • Igor Wiedler's avatar
      [json] add JSON helper · 4ce8998a
      Igor Wiedler authored
      4ce8998a
    • Dave Marshall's avatar
      537b8088
  11. 18 Mar, 2012 1 commit
  12. 14 Mar, 2012 3 commits
  13. 11 Mar, 2012 5 commits
    • Fabien Potencier's avatar
      updated CHANGELOG · 39184eb5
      Fabien Potencier authored
      39184eb5
    • Fabien Potencier's avatar
      tweaked doc · 755c201c
      Fabien Potencier authored
      755c201c
    • Fabien Potencier's avatar
      merged branch GromNaN/doc-alternative-session-storage (PR #275) · 75c5efd8
      Fabien Potencier authored
      Commits
      -------
      
      4a5c10e1 Grammar
      e1264470 Fix URL to Symfony API doc
      7a176af4 Cookbook recipe on how to use PdoSessionStorage
      
      Discussion
      ----------
      
      Cookbook recipe on how to use PdoSessionStorage
      
      Related to this issue #254
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-09T16:23:11Z
      
      👍
      75c5efd8
    • Fabien Potencier's avatar
      tweaked documentation · 52c5bd4b
      Fabien Potencier authored
      52c5bd4b
    • Fabien Potencier's avatar
      merged branch DrBenton/after-on-controllers (PR #272) · 3e6fe5e9
      Fabien Potencier authored
      Commits
      -------
      
      6445b9e9 Add Routes Middlewares
      
      Discussion
      ----------
      
      add "after($callback)" to Controller in order to mimic a "Route Middleware" feature in Silex
      
      Hi !
      
      As discussed in #262 and in my previous similar PR (https://github.com/fabpot/Silex/pull/270) with @GromNaN, here is another implementation of the Routes Middlewares feature, shipped with its Unit Test.
      
      The feature addition is still 100% backward compatible, but this time it may be more "Silex style" compliant - and it's "100% no performance loss" :-)
      
      With this PR the Silex ```Controller``` class has a new ```before()``` method, which registers a callback to trigger when the Route is matched, just before the route callback itself.
      This ```before()``` method can be called more than one time on a single Route definition, allowing multiple secondary callbacks (a.k.a. "Routes Middlewares") to be executed before the Route main callback.
      
      Would this feature be eligible for Silex integration, like this ?
      
      Olivier
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-01T22:16:05Z
      
      * The method is now named ```addMiddleware```, which may be more explicit for people used to "a la Sinatra" framewoks like _Node.js Express_  or _Slim_.
      * I no longer use the Silex ControllerResolver, but a dedicated Application protected service instead, fired just before the Application "before" process (I could have added a new listener on the ```Kernel```, but since we already have one for the right event for the "before" process, I used this one for simpler code).
      * I also added some checks on the ```$request``` in the Unit Test.
      
      ---------------------------------------------------------------------------
      
      by fabpot at 2012-03-02T11:40:30Z
      
      Can you add some information about this new feature in the documentation (with some typical usages)? Thanks for your work on this feature.
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-02T12:35:44Z
      
      **Done !** (the method is now named ```middleware```, and I've removed the useless comment)
      
      I've tried my best for the feature documentation, but unfortunately my english is fairly poor... :-/
      
      At this point, the Middlewares have access to the Request, but if I'm not wrong it can't be used for redirecting, for instance. Should I handle ```Response``` returns from middlewares, as in ```before``` filter ?
      
      ---------------------------------------------------------------------------
      
      by GromNaN at 2012-03-02T12:39:00Z
      
      I guess you can throw an exception (access denied for example) and manage this exception with the error handlers.
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-02T12:44:38Z
      
      Yes, in the sample usage of the documentation I've used exactly that ```Exception``` process.
      But I don't know if this is ok for everyone ?
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-02T15:08:29Z
      
      Very nice feature. But it should really be possible to return a response from the handler, like you can do with before() filters.
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-02T21:15:41Z
      
      All right, I think I know how to handle Responses, thanks to the code of the before() filter ; I'll push soon a new commit with the last code syle fixes and this feature !
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-03T11:34:44Z
      
      Ok, I've fixed the code style problems, and handled the Responses from middlewares.
      What do you think of it ?
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-05T13:11:56Z
      
      So... Are we OK for this feature, gentlemen ? :-)
      Do you want me to push a squashed commit ?
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-05T22:24:53Z
      
      Apart from the minor comments I made I am quite happy with the implementation as it is. I guess when those are fixed it can be merged.
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-05T22:58:23Z
      
      Sorry for all these "code style" errors, I'm still not enough used to Symfony 2 coding standards - but I'll get them ! :-)
      
      Well, all these errors should be fixed now. I also swapped  the order of execution with the Silex global ```before``` filters, as you asked it: the global filters are now triggered **before** the middlewares of the matched route.
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-05T23:10:35Z
      
      I'm not so sure about checking for `instanceof Response`. Maybe we should enforce a middleware to return either null or a Response to prevent unexpected behaviour.
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-06T14:37:42Z
      
      Well, I just copied the behaviour of the ```before``` filter :
      ```
      if ($ret instanceof Response) {
          $event->setResponse($ret);
      }```
      (in Application.php, line 237)
      
      Since route middlewares act as this ```before``` filter (in a "specific for each route" way), I thought we could copy the code of this ```before``` functionnality ?
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-08T14:34:13Z
      
      So ? Do you want me to change the ```instanceof Response```, or can we keep the current "copy of before filter" implementation ?
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-08T15:57:00Z
      
      IMO we should add something like this:
      
          if ($response instanceof Response) {
              ...
          } elseif (null !== $response) {
              throw new \RuntimeException('Before filter (or middleware for route foo) returned an invalid response value. Must return null or an instance of Response.');
          }
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-08T16:26:54Z
      
      Hum, I see. Sounds good to me, I'll push it soon with the documentation fixes :-)
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-08T16:42:48Z
      
      And tests please ;-)
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-08T22:15:11Z
      
      Here it is, sir ! :-)
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-10T19:45:59Z
      
      Shall I push in a new PR these 13 commits in a single squashed one ?
      
      ---------------------------------------------------------------------------
      
      by igorw at 2012-03-10T19:51:53Z
      
      👍
      
      ---------------------------------------------------------------------------
      
      by stof at 2012-03-10T19:52:43Z
      
      No need to create a new PR for this. Simply squash your commits and force the push to the branch
      
      ---------------------------------------------------------------------------
      
      by DrBenton at 2012-03-10T21:59:12Z
      
      All right, here is the squashed commit ! :-)
      3e6fe5e9
  14. 10 Mar, 2012 1 commit
  15. 09 Mar, 2012 3 commits
  16. 02 Mar, 2012 4 commits