Commit Graph

11282 Commits

Author SHA1 Message Date
Tobias Schultze
5fbed361c2 extended phpdoc of ConfigurableRequirementsInterface 2012-10-03 21:00:23 +02:00
Tobias Schultze
1964d43823 [Routing] added test for disabled requirements check 2012-10-03 21:00:22 +02:00
Tobias Schultze
98fb915bfb [Routing] allow disabling the requirements check on URL generation 2012-10-03 21:00:21 +02:00
Fabien Potencier
7276b2d0b8 merged branch Tobion/strictrequirements2 (PR #5445)
This PR was merged into the master branch.

Commits
-------

e22823b [Routing] context params should have higher priority than defaults
16c1b01 [Routing] fixed 4 bugs in the UrlGenerator

Discussion
----------

[Routing] UrlGenerator: fixed missing query param and some ignored requirements

reopened version of #5181 (cherry-picked)

On top of that I fixed #5437 in my code and added test case.

---------------------------------------------------------------------------

by Tobion at 2012-10-03T18:41:45Z

@fabpot ping

---------------------------------------------------------------------------

by fabpot at 2012-10-03T18:43:43Z

IIUC, #5437 is a regression in 2.1 and should be done in 2.1, no?

---------------------------------------------------------------------------

by Tobion at 2012-10-03T18:46:42Z

It's not in 2.1 anymore as you reverted the PR.  #5437 is not valid currently and can be closed.
So this can either be merged in master or 2.1 whatever you prefer.
2012-10-03 20:51:18 +02:00
Fabien Potencier
c77d326157 merged branch Tobion/patch-2 (PR #5663)
This PR was merged into the master branch.

Commits
-------

94f2fb9 added info to routing changelog

Discussion
----------

added info to routing changelog
2012-10-03 19:07:09 +02:00
Tobias Schultze
94f2fb91d7 added info to routing changelog 2012-10-03 19:28:37 +03:00
Tobias Schultze
4eee88f22b [Routing] improve matching performance by using possesive quantifiers when possible (closes #5471)
My benchmarks showed a performance improvement of 20% when matching routes that make use of possesive quantifiers because it prevents backtracking when it's not needed
2012-10-03 16:41:15 +02:00
Tobias Schultze
a3147e9f13 [Routing] default requirement of variable should not disallow previous char, but the slash '/' (closes #5469) 2012-10-03 16:37:44 +02:00
Tobias Schultze
4868bec46c [Routing] fix Compiler when previous char of placeholder is no real separator (closes #5423) 2012-10-03 16:33:06 +02:00
Fabien Potencier
190ccf8dbe merged branch Tobion/compiler (PR #4225)
This PR was merged into the master branch.

Commits
-------

005a9a3 [Routing] fixed RouteCompiler for adjacent and nested placeholders

Discussion
----------

[2.2] [Routing] fixed RouteCompiler for adjacent placeholders

Tests pass: yes
Feature addition: no
Fixes: #4215
BC break: no

- Nesting placeholders works now properly, e.g. `/{foo{bar}}`. Only `bar` is a variable, the rest is static text.
- Variables without separator work now correctly too, e.g. `/{w}{x}{y}{z}.{_format}`. All variables will have the correct default regex in the current manner, that is exclude the previous static char and the next static char (which means disregarding the placeholder in between that have no seperator).

As you can see, I have not modified any tests, only added some. So this change is BC. The compiler now works under all conditions and does not fail for such patterns.

---------------------------------------------------------------------------

by Tobion at 2012-05-08T22:34:58Z

ready for review / merging
Thanks @snc for giving a helpful tip.

---------------------------------------------------------------------------

by Tobion at 2012-06-12T23:22:54Z

fabpot told me, he doesn't like PRs that both fix and enhance stuff. So I reworked this PR so that it only contains the bug fixes.
The new PR #4563 contains the feature addition.

---------------------------------------------------------------------------

by Tobion at 2012-06-26T12:33:43Z

ping @fabpot

---------------------------------------------------------------------------

by Tobion at 2012-08-14T16:29:27Z

Why wait for 2.2? It's a bugfix only, without BC break.

---------------------------------------------------------------------------

by Tobion at 2012-08-31T17:04:37Z

@fabpot I think this should go into 2.1
2012-10-03 16:28:55 +02:00
Fabien Potencier
b2dd04df93 [Process] fixed previous merge 2012-10-03 16:02:00 +02:00
Fabien Potencier
edf694badc merged branch fabpot/moved_process_1 (PR #5658)
This PR was merged into the master branch.

Commits
-------

46d358f Fluent interface

Discussion
----------

Fluent interface

This PR was submitted on the symfony/Process read-only repository and moved automatically to the main Symfony repository (closes symfony/Process#1).
2012-10-03 15:59:31 +02:00
Fabien Potencier
717297eec1 merged branch bamarni/patch-8 (PR #5659)
This PR was merged into the master branch.

Commits
-------

ba517db removed manual locale stub autoload

Discussion
----------

removed manual locale stub autoload

---------------------------------------------------------------------------

by igorw at 2012-10-03T11:16:07Z

To add some context to this PR: On the master branch, this is now done through composer.
2012-10-03 13:47:40 +02:00
Bilal Amarni
ba517db1b6 removed manual locale stub autoload 2012-10-03 13:58:05 +03:00
BilgeXA
46d358f348 Fluent interface 2012-10-03 12:27:59 +02:00
Fabien Potencier
0bfa86ce8a Merge branch '2.1'
* 2.1:
  [2.1] Fix SessionHandlerInterface autoloading
  Remove executable bit from HttpKernel/DependencyInjection/ConfigurableExtension.php
  [2.0][http-foundation] Fix Response::getDate method
  [DoctrineBridge] Require class option for DoctrineType
  [HttpFoundation] fixed the path to the SensioHandlerInterface class in composer.json
  Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842
  fixed undefined variable
  hasColorSupport does not take an argument
  Improve FilterResponseEvent docblocks Response ref
2012-10-02 12:23:35 +02:00
Fabien Potencier
49ca648245 Merge branch '2.0' into 2.1
* 2.0:
  [2.0][http-foundation] Fix Response::getDate method
  Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842
  fixed undefined variable
  hasColorSupport does not take an argument
  Improve FilterResponseEvent docblocks Response ref

Conflicts:
	tests/Symfony/Tests/Component/HttpFoundation/ResponseTest.php
2012-10-02 12:22:56 +02:00
Fabien Potencier
2f5a4d7dbc merged branch igorw/patch-1 (PR #5640)
This PR was merged into the 2.1 branch.

Commits
-------

47d7531 [2.1] Fix SessionHandlerInterface autoloading

Discussion
----------

[2.1] Fix SessionHandlerInterface autoloading

The path for 2.1 is also incorrect. For master, this was fixed in 3b47088c58. This patch adds the `target-dir` prefix to the autoloading base directory of the HttpFoundation stubs.

Note: Issue only affects 2.1, but it probably means `symfony/http-foundation` never worked on PHP 5.3.

---------------------------------------------------------------------------

by stof at 2012-10-01T14:33:18Z

@igorw Can you fix the Locale component too ?

---------------------------------------------------------------------------

by igorw at 2012-10-01T14:42:50Z

As per IRC, locale does not have autoloading for 2.1.
2012-10-01 20:40:45 +02:00
Igor Wiedler
47d7531112 [2.1] Fix SessionHandlerInterface autoloading
The path for 2.1 is also incorrect. For master, this was fixed in 3b4708. This patch adds the `target-dir` prefix to the autoloading base directory of the HttpFoundation stubs.
2012-10-01 17:30:10 +03:00
Fabien Potencier
7b22da693c merged branch jmikola/2.1-doctrine-type-option (PR #5632)
This PR was merged into the 2.1 branch.

Commits
-------

3cc3c67 [DoctrineBridge] Require class option for DoctrineType

Discussion
----------

[DoctrineBridge] Require class option for DoctrineType

This is a resubmission of #5289 against the 2.1 branch.

```
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -
```

---------------------------------------------------------------------------

by stof at 2012-10-01T11:28:39Z

👍
2012-10-01 13:42:36 +02:00
Fabien Potencier
cab4f164f2 merged branch rybakit/permissions (PR #5637)
This PR was merged into the 2.1 branch.

Commits
-------

315ffc7 Remove executable bit from HttpKernel/DependencyInjection/ConfigurableExtension.php

Discussion
----------

[HttpKernel] Remove executable bit from ConfigurableExtension.php

See #5636
2012-10-01 12:59:10 +02:00
Eugene Leonovich
315ffc7f69 Remove executable bit from HttpKernel/DependencyInjection/ConfigurableExtension.php 2012-10-01 11:23:15 +02:00
Fabien Potencier
7a661d5a60 merged branch fabpot/data-collector (PR #5619)
This PR was merged into the master branch.

Commits
-------

2a673d8 Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher

Discussion
----------

Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher

The ContainerAwareTraceableEventDispatcher class was tied to both the
Symfony container and the HttpKernel profiler. It made it non reusable
in another context.

The new TraceableEventDispatcher only keeps the HttpKernel profiler
integration and is able to wrap any other event dispatcher. It makes it
reusable in frameworks using the Symfony HttpKernel component like
Silex.

The only drawback is that we don't have access to the listener
priorities in the collected data anymore (but the listeners are still
ordered correctly). The change is still worth it I think.

---------------------------------------------------------------------------

by stof at 2012-09-27T13:38:24Z

You should add some tests for your new TraceableDispatcher
2012-10-01 01:47:45 +02:00
Fabien Potencier
2a673d8626 Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher
The ContainerAwareTraceableEventDispatcher class was tied to both the
Symfony container and the HttpKernel profiler. It made it non reusable
in another context.

The new TraceableEventDispatcher only keeps the HttpKernel profiler
integration and is able to wrap any other event dispatcher. It makes it
reusable in frameworks using the Symfony HttpKernel component like
Silex.

The only drawback is that we don't have access to the listener
priorities in the collected data anymore (but the listeners are still
ordered correctly). The change is still worth it I think.
2012-10-01 01:46:38 +02:00
Fabien Potencier
93b084c73d Revert "merged branch fabpot/data-collector (PR #5619)"
This reverts commit 3f0a370e3b, reversing
changes made to bf1ab93130.
2012-10-01 01:26:03 +02:00
Fabien Potencier
3f0a370e3b merged branch fabpot/data-collector (PR #5619)
This PR was merged into the master branch.

Commits
-------

7ef2e9d Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher

Discussion
----------

Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher

The ContainerAwareTraceableEventDispatcher class was tied to both the
Symfony container and the HttpKernel profiler. It made it non reusable
in another context.

The new TraceableEventDispatcher only keeps the HttpKernel profiler
integration and is able to wrap any other event dispatcher. It makes it
reusable in frameworks using the Symfony HttpKernel component like
Silex.

The only drawback is that we don't have access to the listener
priorities in the collected data anymore (but the listeners are still
ordered correctly). The change is still worth it I think.

---------------------------------------------------------------------------

by stof at 2012-09-27T13:38:24Z

You should add some tests for your new TraceableDispatcher
2012-10-01 01:06:00 +02:00
Fabien Potencier
7ef2e9d240 Replaced ContainerAwareTraceableEventDispatcher with TraceableEventDispatcher
The ContainerAwareTraceableEventDispatcher class was tied to both the
Symfony container and the HttpKernel profiler. It made it non reusable
in another context.

The new TraceableEventDispatcher only keeps the HttpKernel profiler
integration and is able to wrap any other event dispatcher. It makes it
reusable in frameworks using the Symfony HttpKernel component like
Silex.

The only drawback is that we don't have access to the listener
priorities in the collected data anymore (but the listeners are still
ordered correctly). The change is still worth it I think.
2012-09-30 20:11:37 +02:00
Fabien Potencier
bf1ab93130 [Console] fixed typo 2012-09-30 16:27:49 +02:00
Fabien Potencier
302c0e4647 merged branch benja-M-1/hotfix-response (PR #5633)
This PR was squashed before being merged into the 2.0 branch (closes #5633).

Commits
-------

5c60a65 [2.0][http-foundation] Update phpdoc
c17462f [2.0][http-foundation] Fix response getDate method

Discussion
----------

[2.0][http-foundation] Fix Response::getDate method

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

Reference #5588, #5629
2012-09-30 16:03:58 +02:00
Benjamin Grandfond
1a53b121aa [2.0][http-foundation] Fix Response::getDate method 2012-09-30 16:03:57 +02:00
Fabien Potencier
9bdad739ef merged branch bamarni/classmap-paths (PR #5634)
This PR was merged into the master branch.

Commits
-------

3b47088 fixed some classmap paths

Discussion
----------

fixed some classmap paths

Since #5213, an error occurs when requiring the locale or http-foundation package with composer, because it doesn't automatically prepend the target-dir to the classmaps.

Cf. here for example : https://travis-ci.org/#!/doctrine/DoctrineMongoDBBundle/jobs/2608238

cc @jalliot
2012-09-30 16:02:34 +02:00
Bilal Amarni
3b47088c58 fixed some classmap paths 2012-09-30 14:29:13 +02:00
Fabien Potencier
649fd5b3d2 Merge branch 'progress-helper'
* progress-helper:
  [Console] added some basic tests for the ProgressHelper class
  [Console] converted options to proper setters in ProgressHelper
  [2.2][Console] Add ProgressHelper
2012-09-30 02:51:51 +02:00
Jeremy Mikola
3cc3c67e5a [DoctrineBridge] Require class option for DoctrineType 2012-09-29 16:16:47 -07:00
Fabien Potencier
7b3297621a [Console] added some basic tests for the ProgressHelper class 2012-09-30 00:37:08 +02:00
Fabien Potencier
264a5ccc0c merged branch simensen/framework-secret (PR #5631)
This PR was merged into the master branch.

Commits
-------

8bc9f75 Make secret not be required

Discussion
----------

[FrameworkBundle] Make secret not be required

Bug fix: no
Feature addition: yes
Backwards compatibility break: no (questionable)
Symfony2 tests pass: yes
License of the code: MIT
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

Framework bundle currently requires that the `secret` key under `framework` be set. The end result is that `kernel.secret` is made available. This is, as far as I can tell, the only required configuration for Framework bundle.

The only thing that currently uses `kernel.secret` is the Form component and then only if CSRF protection is enabled.

In the spirit of making Framework more decoupled and not requiring things in the case you don't need them I would like to make framework secret optional.

I followed the pattern used by CSRF support for when Session is disabled to throw a `LogicException` stating that if CSRF support is enabled then the secret should be set.

For anyone who currently depends on `kernel.secret`, if someone ends up *not* defining `kernel.secret` there will be a dependency error on kernel configuration as `kernel.secret` will not be made available. The biggest downside to this that I could see is that the error message may be slightly confusing; it will complain that there is a dependency on `kernel.secret` when that is generally set by way of adding the Framework secret to the configuration.

As this relates to Symfony Standard Edition, there should be no changes as there is a default secret set there already anyway.
2012-09-29 23:33:07 +02:00
Fabien Potencier
729e3bfcaf [Console] converted options to proper setters in ProgressHelper 2012-09-29 22:11:59 +02:00
Fabien Potencier
2598323632 merged branch leek/feature/progress-helper (PR #3501)
This PR was squashed before being merged into the master branch (closes #3501).

Commits
-------

4f3ded7 Actually this is worse
72a1c65 * Coding standards fixes * Changed `started` to `startTime` * Other fixes/edits
8249928 * Weeks/months/years is probably unrealistic * Set some sensible padding defaults * Use isset() instead of is_array()
37b62bf Fixing bug for elapsed time between 1 and 2 seconds
8fe4568 Special formatting for when there is no maximum set
75f532f Minor docblock updates
e436e1a Adding ProgressHelper for Console Component

Discussion
----------

[2.2][Console] Add ProgressHelper

[![Build Status](https://secure.travis-ci.org/leek/symfony.png?branch=feature/progress-helper)](http://travis-ci.org/leek/symfony)

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: Yes
Fixes the following tickets: -
Todo:
- Add unit tests
- Add documentation

--

I find myself needing some sort of progress indicator in most of my Console applications.
If this is something that could possibly be apart of Symfony, that would be great.

**Example:**
![Progress Example](http://i.imgur.com/a0wGQ.gif)

---------------------------------------------------------------------------

by jmikola at 2012-03-05T03:08:24Z

Do you have an example of this being used within a console command?

I'd be curious what the performance overhead is. My earliest console commands (nearly 2 years ago) would print status during each iteration (for a database migration) and I found the impact noticeable. After some time, I revised it to only print each X iterations, which often matched up with the batch size inserts/updates.

But for the last year, I've been using [declare(ticks=X)](http://php.net/manual/en/control-structures.declare.php) and have been quite happy with the results. By tuning the tick interrupt, the performance overhead is very small. It's especially helpful when dealing with processing code that is difficult to interrupt with a manual call to update the progress display, as PHP takes care of invoking the tick handler for me. I've thought about making such a console component helper for it, but I think the implementation is too invasive to abstract into a helper.

Here's an example of it being used in OrnicarMessageBundle's [MongoDBMigrateMetadataCommand](https://github.com/ornicar/OrnicarMessageBundle/blob/master/Command/MongoDBMigrateMetadataCommand.php).

---------------------------------------------------------------------------

by leek at 2012-03-05T04:05:29Z

@jmikola: Here is a simple example:

```php
<?php
// ...
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $progress = $this->getHelperSet()->get('progress');
        $progress->start($output, 50);

        $i = 0;
        while ($i++ < 50) {
            usleep(mt_rand(20000, 200000));
            $progress->advance();
        }

        $progress->finish();
    }
```

The performance overhead shouldn't be much more than a standard `$output->write()` call. When used with a loop doing 1000's of iterations, you can set the `redrawFreq` option to something more appropriate to control how often the progress indicator is redrawn to the console.

---------------------------------------------------------------------------

by leek at 2012-03-10T10:05:32Z

Added some minor updates along with an example GIF of 2 of the progress bars (see edited PR).

---------------------------------------------------------------------------

by jmikola at 2012-03-10T15:22:29Z

Why does `1 sec` flash over to `1 secs` before `2 secs` is rendered?

---------------------------------------------------------------------------

by henrikbjorn at 2012-03-10T15:26:08Z

👍

---------------------------------------------------------------------------

by leek at 2012-03-10T16:07:08Z

@jmikola: Thanks! I didn't even notice that. Fixed.

---------------------------------------------------------------------------

by drak at 2012-03-11T09:04:58Z

What an amazing PR.  I feel like I just have to write some code that uses this feature just because it's there!

---------------------------------------------------------------------------

by henrikbjorn at 2012-03-11T09:55:50Z

This is needed a lot, we have a bunch of import scripts where this is useful.

@fabpot what are your thoughts on this?

---------------------------------------------------------------------------

by francoispluchino at 2012-03-14T12:34:38Z

👍

---------------------------------------------------------------------------

by vicb at 2012-03-14T13:00:42Z

could you please order the properties & methods by visibility according to the Sf2 CS.

---------------------------------------------------------------------------

by leek at 2012-03-14T19:08:52Z

No problem - I'll make the requested changes tonight.

---------------------------------------------------------------------------

by stof at 2012-04-03T22:48:45Z

@fabpot ping

---------------------------------------------------------------------------

by stloyd at 2012-04-14T09:46:31Z

@fabpot Any hope to get this in 2.1 ?

---------------------------------------------------------------------------

by mvriel at 2012-05-15T19:28:34Z

👍

Tried it out by manually including it in my project and works like a charm

---------------------------------------------------------------------------

by blaugueux at 2012-05-23T18:46:15Z

Up ! It will be great to have this feature in the next release.

@fabpot ping

---------------------------------------------------------------------------

by guilhermeblanco at 2012-05-28T22:58:35Z

@fabpot tried on my app and everything works fine.
Any plans to merge this one into 2.1?

---------------------------------------------------------------------------

by damonjones at 2012-05-29T02:31:39Z

+1
This would be a very nice feature to have in 2.1.

---------------------------------------------------------------------------

by fabpot at 2012-05-29T06:18:57Z

This is scheduled for 2.2.

---------------------------------------------------------------------------

by Burgov at 2012-08-16T13:04:34Z

I have a service which downloads a file using wget though the console component, and reads the progress from stderr. Rather than advancing in steps, i'd like to be able to set the current progress. Something like this method might be a nice addition:

```php
    public function setCurrent($value, $redraw = false)
    {
        $this->advance($value - $this->current, $redraw);
    }
```
2012-09-29 21:39:42 +02:00
leek
4b89aae98c [2.2][Console] Add ProgressHelper 2012-09-29 21:39:40 +02:00
Beau Simensen
8bc9f75642 Make secret not be required 2012-09-29 12:17:16 -07:00
Fabien Potencier
4e3ea22736 [HttpFoundation] fixed the path to the SensioHandlerInterface class in composer.json 2012-09-29 18:56:30 +02:00
Fabien Potencier
dda2f7cdb3 merged branch jalliot/autoloader-update (PR #5213)
This PR was merged into the master branch.

Commits
-------

92e10a8 Updated HttpFoundation and Locale for proper Composer autoloading

Discussion
----------

Updated HttpFoundation and Locale for proper Composer autoloading

This PR uses better Composer autoloading strategy for the stubs in HttpFoundation and Locale.

It also fixes a bug inside HttpFoundation's composer.json file where the path for SessionHandlerInterface was wrong.

[![Build Status](https://secure.travis-ci.org/jalliot/symfony.png?branch=autoloader-update)](http://travis-ci.org/jalliot/symfony)

After merging this PR and updating the vendors of the SE, you can also merge symfony/symfony-standard#387

---------------------------------------------------------------------------

by datiecher at 2012-09-05T11:15:39Z

Any updates on this issue?

---------------------------------------------------------------------------

by jalliot at 2012-09-05T16:43:46Z

Well I guess it is up to @fabpot to decide now :)

---------------------------------------------------------------------------

by drak at 2012-09-07T11:59:22Z

> It also fixes a bug inside HttpFoundation's composer.json file where the path for SessionHandlerInterface was wrong.

If so should be part of a separate PR imo.
2012-09-29 18:51:40 +02:00
Fabien Potencier
5984dee719 merged branch sasezaki/ZF-4491 (PR #5222)
This PR was submitted for the master branch but it was merged into the 2.0 branch instead (closes #5222).

Commits
-------

60cd7c0 [HttpFoundation] Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842

Discussion
----------

[HttpFoundation] Support the new Microsoft URL Rewrite Module for IIS 7.0

@see http://framework.zend.com/issues/browse/ZF-4491
@see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842
feel free, merge this or not.

---------------------------------------------------------------------------

by stloyd at 2012-08-09T09:41:18Z

Also this PR should be made against `2.0` branch.

---------------------------------------------------------------------------

by fabpot at 2012-09-18T17:24:26Z

@sasezaki Can you open a PR for the 2.0 branch? Thanks.
2012-09-28 21:25:17 +02:00
sasezaki
7444cb9725 Support the new Microsoft URL Rewrite Module for IIS 7.0. @see http://framework.zend.com/issues/browse/ZF-4491 @see http://framework.zend.com/code/revision.php?repname=Zend+Framework&rev=24842 2012-09-28 21:25:17 +02:00
Fabien Potencier
2c4ed86197 merged branch dlsniper/wpb-improvements (PR #5518)
This PR was squashed before being merged into the master branch (closes #5518).

Commits
-------

3303ca2 WPB and WDT improvements
be194cb Changed icons to be a bit more consistent
08241b8 Added minimize option to Web Profiler panels

Discussion
----------

[2.2][WebProfilerBundle] Added minimize option to Web Profiler panels

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

I've added a minimize option to the profiler bundle so that you can have more space to work with on the panels.
You can view it in action here:http://sf2demo.rodb.ro/app_dev.php/

Feedback is welcomed!

Thanks!

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T13:36:51Z

I could add a remember option via a cookie if you think this would help, I know I'd want one, but I'm not sure about the general opinion about this. Let me know if I should do it.

---------------------------------------------------------------------------

by stof at 2012-09-15T17:05:58Z

The profiler is totally broken when minimizing the menu in your demo.

---------------------------------------------------------------------------

by lennerd at 2012-09-15T17:10:54Z

I would not make it disappear completely. So I think a combination of Cookie and a small visual for open it again would be great to have.

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T17:15:06Z

@stof I've only enabled a few panels to work in the demo, rest defaults to DB panel. If this is what you mean then it's not broken, it's designed to do so. I've tested the thing on Opera, FF and Chrome (on Linux) before uploading the demo/PR so I'm not sure what's broken. Can you please provide a screenshot?

@lennerd I could be doing something like only display it in the upper left corner and appear on mouse over as an overlay. Would that be better?

---------------------------------------------------------------------------

by stof at 2012-09-15T17:21:22Z

@dlsniper what I mean is that the text of the menu does not disappear. It simply goes over the panel itself as the menu becomes smaller. And this appears for all panels I tried.

---------------------------------------------------------------------------

by stof at 2012-09-15T17:22:32Z

hmm, sorry. It is a browser cache issue. It seems like your server was sending cache headers for the assets, and as I already looked at the demo previously (for your DoctrineBundle PR), it kept the old CSS

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T17:25:09Z

@stof no problem, the server is configured a bit more on caching side in order to speed it up and save bandwidth ;)

---------------------------------------------------------------------------

by lennerd at 2012-09-15T17:38:41Z

@dlsniper I would use the close button changing to maybe an arrow in the bottom right. So it's more intuitive and you can simply show and hide it if you only want to take a quick look at a small detail behind it.

---------------------------------------------------------------------------

by henrikbjorn at 2012-09-15T18:08:02Z

What about making this the default, the icons are self explanatory already. The title would then be the "link" text instead.

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T20:30:51Z

@henrikbjorn I wouldn't make this by default as new people might find it a bit confusing. Hence the suggestion to use the cookie to remember the preference.

---

Also I'm trying not to break the current format of the menu too much as hiding all that stuff by hand is pain but if I'm allowed to break the current way of displaying the left menu then this is going to be easy.

What I didn't understood so far is why is the toolbar displayed on the top as well since we have it on the left side already so I've remove it from my current changes (will be up soonish).

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T21:10:03Z

@lennerd what exactly do you mean by 'I would use the close button' there's no close button on the profiler page, only on the toolbar.

---------------------------------------------------------------------------

by lennerd at 2012-09-15T21:21:20Z

That was the button I was talking about. So that there is a little close button at the bottom right for toggling the toolbar.

---------------------------------------------------------------------------

by dlsniper at 2012-09-15T23:14:06Z

I've changed the way the menu minimizes now, it hides in the top left corner and it maintains its state on refresh. I'll do something similar for the toolbar tomorrow.

You can view it on the same URL.

Please do leave feedback. Thanks!

---------------------------------------------------------------------------

by lennerd at 2012-09-16T01:02:27Z

Sorry. I misunderstand your PR.

---------------------------------------------------------------------------

by stof at 2012-09-16T03:01:06Z

@dlsniper The toolbar is displayed at the top because it gives a quick overview without having to go in each panel. So removing it is a bad idea IMO.

And hiding everything is a bad idea IMO. It means navigating is impossible, making it usable when minimizing it (and btw, this would make the cookie a non-sense as it would hide the menu for subsequent pages)

---------------------------------------------------------------------------

by fabpot at 2012-09-16T06:38:08Z

-1 for removing the toolbar at the top

I prefer the first version where you only hide the menu text but leave the icons. Keeping the state in a cookie is also a must (that cookie might be used to store some other states in the profiler too).

---------------------------------------------------------------------------

by Partugal at 2012-09-16T08:14:11Z

i'm not see first version but show icons without text is more useful.
imho minimize trigger should be always placed on top as it showns in minized state

---------------------------------------------------------------------------

by Partugal at 2012-09-16T08:24:49Z

http://s14.postimage.org/qkdcr8d4h/image.png

---------------------------------------------------------------------------

by dlsniper at 2012-09-16T09:06:50Z

@fabpot I've just had a look on how the timeline stores the selected value and it's using the local storage capabilities. Should I drop the cookie and use the local storage as well to have some sort of uniformity?
Also is there any reason why no generic JS library is used? I'm thinking now about jQuery mostly but any other should do just fine I think. I'm not saying that we should use a library when displaying the WDT as it might bump into issues with the frontend but for the rest of the profiler I guess it wouldn't be a problem to use a library, no?

---------------------------------------------------------------------------

by fabpot at 2012-09-16T09:15:37Z

Let's use the local storage for better consistency. I don't want to embed a JS library as we only need basic JS scripts.

---------------------------------------------------------------------------

by lennerd at 2012-09-16T10:29:20Z

@dlsniper Do we need the up and down arrows any longer?

---------------------------------------------------------------------------

by dlsniper at 2012-09-16T14:24:27Z

I've added a minimize mode to the toolbar but the 'design' isn't the best all around, I'll try to improve it in the future.
It also remembers the state of the toolbar so that you don't need to hide it every time.

@lennerd we don't need the up/down arrows for now, I've removed on the last commit. Thank you for the new icons ;)

L.E.
I've made some sort of rounded corner/gradient background in for the minimized toolbar

---------------------------------------------------------------------------

by dlsniper at 2012-09-18T22:02:35Z

@pborreli thanks for the idea regarding to auto-minimize on window resize, I'll implement it soon, I don't really have time right now to add the event handling part to Sfjs.

L. E.
I'm not going to implement the auto-resize as it proved not to be that useful given the fixed width of the panel. If it proves to be a requested thing then I'll improve it if no one else does it before me :)

---------------------------------------------------------------------------

by dlsniper at 2012-09-19T20:52:43Z

If there's nothing else left to be changed/improved/added, I'll lift the WIP tag of this PR so that it can be merged if you consider it.

@fabpot, if this gets its way to the repository, should I rebase this before merging so that it catches the next Symfony 2.1 release as it doesn't break anything? I don't mean the very next release which I've read that it would be done when Doctrine will release their new version but the version after that.

---------------------------------------------------------------------------

by fabpot at 2012-09-19T20:56:45Z

This is a new feature, so it can only be included in the master branch.

---------------------------------------------------------------------------

by dlsniper at 2012-09-23T12:27:41Z

As soon as this feature goes in master I'll start working on adding AJAX requests to the toolbar to make it even more useful.

Let me know if this change is good to merge or needs more work.

Thanks @stof for all the input and @lennerd for the icons.

---------------------------------------------------------------------------

by stof at 2012-09-23T13:40:38Z

Adding which ajax requests to the toolbar ?

---------------------------------------------------------------------------

by dlsniper at 2012-09-23T13:49:43Z

'Userland' AJAX requests, so that one could access the information from an AJAX request more straight forward
2012-09-28 21:16:51 +02:00
Florin Patan
310c2f98a9 [2.2][WebProfilerBundle] Added minimize option to Web Profiler panels 2012-09-28 21:16:50 +02:00
Fabien Potencier
33abe78e6c merged branch h4ck3rm1k3/Undefined_Security_Http_Firewall_ContextListener3 (PR #5622)
This PR was submitted for the master branch but it was merged into the 2.0 branch instead (closes #5622).

Commits
-------

538f8c7 fixed undefined variable

Discussion
----------

Undefined security http firewall context listener3

Updated minimal patch,
First patch from static code analysis, $value should be $token I guess. please check.

---------------------------------------------------------------------------

by h4ck3rm1k3 at 2012-09-27T18:00:18Z

I have reverted the admin, i could create a new branch if needed. you can just cherrypick 	 e9bb5a8 that would be easier.

---------------------------------------------------------------------------

by h4ck3rm1k3 at 2012-09-27T18:29:36Z

I squashed it down to one commit. thanks for your patience and help.
2012-09-28 21:09:10 +02:00
James Michael DuPont
b3d06dda44 fixed undefined variable 2012-09-28 21:09:10 +02:00
Fabien Potencier
926dd1dcd6 merged branch rrehbeindoi/error-error (PR #5539)
This PR was merged into the master branch.

Commits
-------

7fe44da Whitespace corrections
6d30f20 Switched to using a method to get original class name that did not require string parsing
3c8d607 Changed test to use a longer form, complete check of the contents of the trace
de77c88 Whitespace correction
03a7bb9 Added a unit test to verify incomplete classes do not cause flatten exception to throw
e562418 Added a bit to convert incomplete objects in the error message

Discussion
----------

[HttpKernel] Added a bit to convert incomplete objects in the error message

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes*

\* no - errors in MongoDbSessionHandlerTest attempting to access private property, however running just src/Symfony/Component/HttpKernel does pass.

Objects of class __PHP_Incomplete_Class are only sometimes an object.

```
$object = unserialize('O:14:"BogusTestClass":0:{}');
$object instanceof __PHP_Incomplete_Class; // true
is_object($object); // false
gettype($object); // "object"
```

Since it is "not an object", the flatter attempts to turn it into a string, it triggers:
```
__PHP_Incomplete_Class could not be converted to string.
```
Which then hides the root error message.

---------------------------------------------------------------------------

by pborreli at 2012-09-18T16:16:33Z

have you seen that http://stackoverflow.com/questions/965611/forcing-access-to-php-incomplete-class-object-properties looks like you can still access the object even if it's a __PHP_Incomplete_Class with foreach

---------------------------------------------------------------------------

by rrehbeindoi at 2012-09-18T16:38:38Z

Thank you for the tip re: foreach.
2012-09-28 21:03:48 +02:00
Ray
ef18e00283 [HttpKernel] Added a bit to convert incomplete objects in the error message 2012-09-28 21:03:47 +02:00