Commit Graph

16816 Commits

Author SHA1 Message Date
florianv
623d149cad Added a ConcreteDumper 2014-03-03 18:10:14 +01:00
florianv
84f09024b4 [Translation] Added template for relative file paths 2014-03-03 18:10:14 +01:00
Fabien Potencier
887e6ff64d feature #10017 [FrameworkBundle] Add HHVM support for built-in web server (RickySu)
This PR was squashed before being merged into the 2.5-dev branch (closes #10017).

Discussion
----------

[FrameworkBundle] Add HHVM support for built-in web server

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | no
| License       | MIT

Using HHVM as built-in web server for development from console.

```
hhvm app/console server:run
```

Commits
-------

66798ba9 [FrameworkBundle] Add HHVM support for built-in web server
2014-03-03 17:50:00 +01:00
Ricky Su
66798ba904 [FrameworkBundle] Add HHVM support for built-in web server 2014-03-03 17:49:59 +01:00
florianv
597a3107bc Added a translation:debug command 2014-03-03 17:12:20 +01:00
Fabien Potencier
2a1592383d feature #10100 [ClassLoader] A PSR-4 compatible class loader (derrabus)
This PR was squashed before being merged into the 2.5-dev branch (closes #10100).

Discussion
----------

[ClassLoader] A PSR-4 compatible class loader

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This is a PSR-4 compatible class loader that I'd like to contribute to the ClassLoader component. Since PSR-4 is the most recent FIG standard for an autoloader, I thought a compatible loader should be part of a feature-complete ClassLoader component.

See: http://www.php-fig.org/psr/psr-4/

PSR-4 does neither replace PSR-0, nor are those standards 100% compatible. This is why I implemented the standard as a new class.

If you decide that my PR is worth merging, I would also provide a PR for symfony-docs with a documentation.

Commits
-------

6837df3 [ClassLoader] A PSR-4 compatible class loader
2014-03-03 17:01:36 +01:00
Alexander M. Turek
6837df3e14 [ClassLoader] A PSR-4 compatible class loader 2014-03-03 17:01:35 +01:00
Fabien Potencier
725f7abc87 bug #10367 [HttpKernel] fixed serialization of the request data collector (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[HttpKernel] fixed serialization of the request data collector

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10361
| License       | MIT
| Doc PR        | n/a

This fixes a regression introduced in #10352.

Commits
-------

6102f99 [HttpKernel] fixed serialization of the request data collector
2014-03-03 16:55:29 +01:00
Fabien Potencier
4a1639acc7 feature #10314 [Serializer] added support for is.* methods in GetSetMethodNormalizer (tiraeth)
This PR was squashed before being merged into the 2.5-dev branch (closes #10314).

Discussion
----------

[Serializer] added support for is.* methods in GetSetMethodNormalizer

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10297
| License       | MIT
| Doc PR        | N/A

Using ``is`` prefix for boolean variables is considered a standard, not only in PHP but also in Java (from which Symfony2 derives lot standards).

I was not sure if this is BCB but answered "no". Was not sure if I should update ``CHANGELOG`` file and did so, but if you find it irrelevant, go ahead and merge without it. I don't know if I should create a PR for docs because it does not explicitly say that the normalizer supports only ``get.*`` methods as getters.

_Note: Objects that contain behaviour also can use other prefixes like ``can``, ``has``, ``should``, but their presence in ``GetSetMethodNormalizer`` is relevant as they do not provide state (``has`` is debatable)._

Commits
-------

480219f [Serializer] added support for is.* methods in GetSetMethodNormalizer
2014-03-03 16:53:45 +01:00
Marcin Chwedziak
480219f1d3 [Serializer] added support for is.* methods in GetSetMethodNormalizer 2014-03-03 16:52:29 +01:00
Fabien Potencier
6102f994bc [HttpKernel] fixed serialization of the request data collector 2014-03-03 16:26:22 +01:00
Fabien Potencier
98c3fe7ef3 feature #10365 [Console] deprecated TableHelper in favor of Table (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Console] deprecated TableHelper in favor of Table

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #9788, #9680, #9325
| License       | MIT
| Doc PR        | symfony/symfony-docs#3627

This PR makes the Table helper stateless. It also adds a way to define global styles and to change/tweak existing styles easily.

The second commit adds the possibility to add a separator anywhere in the table output.

Commits
-------

21784ce [Console] make it possible to pass a style directly to Table::setStyle()
14caaec [Console] added the possibility to insert a table separator anywhere in a table output
39c495f [Console] deprecated TableHelper in favor of Table
2014-03-03 14:53:19 +01:00
Fabien Potencier
7e1bdd73c5 [FrameworkBundle] set a default value for gc_probability 2014-03-03 14:18:29 +01:00
Fabien Potencier
21784ced7a [Console] make it possible to pass a style directly to Table::setStyle() 2014-03-03 14:12:10 +01:00
Fabien Potencier
14caaec5f6 [Console] added the possibility to insert a table separator anywhere in a table output 2014-03-03 14:12:09 +01:00
Fabien Potencier
39c495f814 [Console] deprecated TableHelper in favor of Table 2014-03-03 14:12:09 +01:00
Fabien Potencier
77bfac719c Merge branch '2.4'
* 2.4:
  [Form][2.3] Fixes empty file-inputs getting treated as extra field.
  changed some PHPUnit assertions to more specific ones
  fixed Kernel::stripComments() normalizing new-lines
  added a BC comment
  Update FileLoader to fix issue #10339
  bumped Symfony version to 2.3.12
  updated VERSION for 2.3.11
  update CONTRIBUTORS for 2.3.11
  updated CHANGELOG for 2.3.11
  Throw exception when unable to normalize embedded object
  Fixed evaluation of short circuit operators
  Follow-up to #10312: Fixed minor performance related issues in Yaml\Inline.
  [2.4][HttpKernel] Fix issue #10209 When the profiler has `only_exception` option activated and a subrequest throw an exception, the parent profile cannot be found.
2014-03-03 13:53:01 +01:00
Fabien Potencier
09b0a40953 Merge branch '2.3' into 2.4
* 2.3:
  [Form][2.3] Fixes empty file-inputs getting treated as extra field.
2014-03-03 13:52:50 +01:00
Fabien Potencier
485efad0bb bug #10251 [Form][2.3] Fixes empty file-inputs getting treated as extra field. (jenkoian)
This PR was squashed before being merged into the 2.3 branch (closes #10251).

Discussion
----------

[Form][2.3] Fixes empty file-inputs getting treated as extra field.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #8575 (https://github.com/symfony/symfony/pull/8575#issuecomment-34867485)
| License       | MIT

Re-applies 968fe23 (PR #8575).

The test for this already exists, it was just this line that got overwritten by eb9f76d5ba (diff-ca5e25b47f3ecc94cd557946aeb486c6L542)

To clarify, this is a PR into 2.3 branch - this already exists in 2.4 (and later from this PR: https://github.com/symfony/symfony/pull/9146)

Commits
-------

8d99d75 [Form][2.3] Fixes empty file-inputs getting treated as extra field.
2014-03-03 13:52:14 +01:00
Ian Jenkins
8d99d7561b [Form][2.3] Fixes empty file-inputs getting treated as extra field. 2014-03-03 13:52:14 +01:00
Fabien Potencier
aed7eab53c [Console] fixed some initializations in the ProgressBar class 2014-03-03 13:22:12 +01:00
Fabien Potencier
554b28d975 feature #10356 [Console] A better progress bar (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Console] A better progress bar

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9573, #9574, #10187, #9951, related to #9788
| License       | MIT
| Doc PR        | symfony/symfony-docs#3626

TODO:

 - [x] add some docs

See what this PR allows you to do easily:

![cwzpvk](https://f.cloud.github.com/assets/47313/2302190/30cd80e4-a170-11e3-8d88-80c4e4ca8b23.gif)

## New ProgressBar class

First, this PR deprecates `ProgressHelper` in favor of `ProgressBar`. The main difference is that the new `ProgressBar` class represents a single progress bar, which allows for more than one bar to be displayed at a time:

```php
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;

$output = new ConsoleOutput();

$bar1 = new ProgressBar($output, 10);
$bar2 = new ProgressBar($output, 20);
$bar2->setProgressCharacter('#');
$bar1->start();
print "\n";
$bar2->start();

for ($i = 1; $i <= 20; $i++) {
    // up one line
    $output->write("\033[1A");
    usleep(100000);
    if ($i <= 10) {
        $bar1->advance();
    }
    print "\n";
    $bar2->advance();
}
```

And here is how it looks like when run:

![progress-bars](https://f.cloud.github.com/assets/47313/2300612/4465889a-a0fd-11e3-8bc2-b1d2a0f5dc3d.gif)

## Format Placeholders

This pull request refactors the way placeholders in the progress bar are managed. It is now possible to add new placeholders or replace existing ones:

```php
// set a new placeholder
ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) {
    return $bar->getMaxSteps() - $bar->getStep();
});

// change the behavior of an existing placeholder
ProgressBar::setPlaceholderFormatterDefinition('max', function (ProgressBar $bar) {
    return $bar->getMaxSteps() ?: '~';
});
```

Several new built-in placeholders have also been added:

 * `%remaining%`: Display the remaining time
 * `%estimated%`: Display the estimated time of the whole "task"
 * `%memory%`: Display the memory usage

## Formats

Formats can also be added (or built-in ones modified):

```php
ProgressBar::setFormatDefinition('simple', '%current%');

$bar->setFormat('simple');
// is equivalent to
$bar->setFormat('%current%');
```

Built-in formats are:

 * `quiet`
 * `normal`
 * `verbose`
 * `quiet_nomax`
 * `normal_nomax`
 * `verbose_nomax`

## Format Messages

You can also set arbitrary messages that depends on the progression in the progress bar:

```php
$bar = new ProgressBar($output, 10);
$bar->setFormat("%message% %current%/%max% [%bar%]");

$bar->setMessage('started');
$bar->start();

$bar->setMessage('advancing');
$bar->advance();

$bar->setMessage('finish');
$bar->finish();
```

You are not limited to a single message (`message` being just the default one):

```php
$bar = new ProgressBar($output, 10);
$bar->setFormat("%message% %current%/%max% [%bar%] %end%");

$bar->setMessage('started');
$bar->setMessage('', 'end');
$bar->start();

$bar->setMessage('advancing');
$bar->advance();

$bar->setMessage('finish');
$bar->setMessage('ended...', 'end');
$bar->finish();
```

## Multiline Formats

A progress bar can now span more than one line:

```php
$bar->setFormat("%current%/%max% [%bar%]\n%message%");
```

## Flexible Format Definitions

The hardcoded formatting for some placeholders (like `%percent%` or `%elapsed%`) have been removed in favor of a `sprintf`-like format:

```php
$bar->setFormat("%current%/%max% [%bar%] %percent:3s%");
```

Notice the `%percent:3s%` placeholder. Here, `%3s` is going to be used when rendering the placeholder.

## ANSI colors and Emojis

The new progress bar output can now contain ANSI colors and.or Emojis (see the small video at the top of this PR).

Commits
-------

0d1a58c [Console] made formats even more flexible
8c0022b [Console] fixed progress bar when using ANSI colors and Emojis
38f7a6f [Console] fixed PHP comptability
244d3b8 [Console] added a way to globally add a progress bar format or modify a built-in one
a9d47eb [Console] added a way to add a custom message on a progress bar
7a30e50 [Console] added support for multiline formats in ProgressBar
1aa7b8c [Console] added more default placeholder formatters for the progress bar
2a78a09 [Console] refactored the progress bar to allow placeholder to be extensible
4e76aa3 [Console] added ProgressBar (to replace the stateful ProgressHelper class)
2014-03-03 10:45:47 +01:00
Fabien Potencier
0d1a58c469 [Console] made formats even more flexible 2014-03-03 10:38:06 +01:00
Fabien Potencier
8c0022b769 [Console] fixed progress bar when using ANSI colors and Emojis 2014-03-02 10:16:43 +01:00
Fabien Potencier
52f8dc7c1b Merge branch '2.3' into 2.4
* 2.3:
  changed some PHPUnit assertions to more specific ones
  fixed Kernel::stripComments() normalizing new-lines
  added a BC comment
  Update FileLoader to fix issue #10339
2014-03-01 18:35:04 +01:00
Fabien Potencier
0ccf5bcd7a minor #10358 PHPUnit more specific assertions (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

PHPUnit more specific assertions

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10357
| License       | MIT
| Doc PR        | n/a

Commits
-------

4927d0c changed some PHPUnit assertions to more specific ones
2014-03-01 18:34:45 +01:00
Fabien Potencier
4927d0c8a3 changed some PHPUnit assertions to more specific ones 2014-03-01 18:25:29 +01:00
Fabien Potencier
38f7a6f817 [Console] fixed PHP comptability 2014-03-01 18:12:37 +01:00
Fabien Potencier
244d3b81be [Console] added a way to globally add a progress bar format or modify a built-in one 2014-03-01 17:52:22 +01:00
Fabien Potencier
a9d47ebbf2 [Console] added a way to add a custom message on a progress bar 2014-03-01 10:21:47 +01:00
Fabien Potencier
7a30e50eee [Console] added support for multiline formats in ProgressBar 2014-03-01 10:21:46 +01:00
Fabien Potencier
1aa7b8c8b9 [Console] added more default placeholder formatters for the progress bar 2014-03-01 10:21:46 +01:00
Fabien Potencier
2a78a09f1b [Console] refactored the progress bar to allow placeholder to be extensible 2014-03-01 10:21:46 +01:00
Fabien Potencier
4e76aa3fbc [Console] added ProgressBar (to replace the stateful ProgressHelper class) 2014-03-01 07:33:14 +01:00
Fabien Potencier
65c9aca2e6 feature #10352 [DataCollector] Improves the readability of the collected arrays in the profiler (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[DataCollector] Improves the readability of the collected arrays in the profiler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

This PR is based on #10155.

Original description:

It simply improves the readability of the collected arrays in the profiler:

__before__:
```
Array(date => Array(year => , month => , day => ), time => Array(hour => ))
```

__after__:
```
[
  date => [
      year => ,
      month => ,
      day =>
  ],
  time => [
      hour =>
  ]
]
```

Commits
-------

dce66c9 removed double-stringification of values in the profiler
1cda2d4 [HttpKernel] tweaked value exporter
3f297ea Improves the readability of the collected arrays in the profiler.
2014-03-01 03:56:57 +01:00
Fabien Potencier
dce66c9d79 removed double-stringification of values in the profiler 2014-03-01 03:55:22 +01:00
Fabien Potencier
eede3303f3 feature #10354 removed as many usage of the request service as possible without breaking BC (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

removed as many usage of the request service as possible without breaking BC

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

d638369 removed as many usage of the request service as possible without breaking BC
2014-02-28 16:50:01 +01:00
Fabien Potencier
d638369e2a removed as many usage of the request service as possible without breaking BC 2014-02-28 16:35:07 +01:00
Fabien Potencier
681f14bce1 feature #10353 [Debug] ExceptionHandlerInterface to allow third party exception handlers to handle fatal errors caught by ErrorHandler (FineWolf)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Debug] ExceptionHandlerInterface to allow third party exception handlers to handle fatal errors caught by ErrorHandler

| Q             | A
| ------------- | ---
| Bug fix?      | yes (other project)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Related tickets | schmittjoh/JMSDebuggingBundle#68
| License       | MIT
| Doc PR        |

The current `ErrorHandler` is extremely strict on how it selects whether to run an `ExceptionHandler` when an `E_FATAL` occurs.

This modification allows any class that implements `ExceptionHandlerInterface` to handle a `FatalErrorException` created by the `ErrorHandler`.

Commits
-------

15d063b Create ExceptionHandlerInterface to allow third party exception handlers' to handle fatal errors
2014-02-28 16:05:29 +01:00
Andrew Moore
15d063b6f7 Create ExceptionHandlerInterface to allow third party exception handlers' to handle fatal errors 2014-02-28 09:48:11 -05:00
Fabien Potencier
dde2365de8 bug #10284 [2.4][HttpKernel] Fix issue #10209 (stephpy)
This PR was merged into the 2.4 branch.

Discussion
----------

[2.4][HttpKernel] Fix issue #10209

When the profiler has `only_exception` option activated and a subrequest which
throw an exception, the parent profile cannot be found.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Fix issue #10209

Commits
-------

b949c49 [2.4][HttpKernel] Fix issue #10209 When the profiler has `only_exception` option activated and a subrequest throw an exception, the parent profile cannot be found.
2014-02-28 15:10:50 +01:00
Fabien Potencier
a4f0f0cc98 bug #10351 [HttpKernel] fix stripComments() normalizing new-lines (sstok)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] fix stripComments() normalizing new-lines

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10227
| License       | MIT
| Doc PR        |

This makes normalizing new-lines less error-prone
when a string contains multiple new line-lines

Commits
-------

63032c7 fixed Kernel::stripComments() normalizing new-lines
2014-02-28 14:50:48 +01:00
Fabien Potencier
1cda2d43c4 [HttpKernel] tweaked value exporter 2014-02-28 14:42:14 +01:00
Sebastiaan Stok
63032c7c89 fixed Kernel::stripComments() normalizing new-lines
This makes normalizing new-lines less error-prone
when a string contains multiple new line-lines
2014-02-28 13:42:15 +01:00
Quentin Schuler
3f297eaa18 Improves the readability of the collected arrays in the profiler. 2014-02-28 13:12:58 +01:00
Fabien Potencier
e756686bb4 added a BC comment 2014-02-28 09:17:36 +01:00
Fabien Potencier
79999ffd5c bug #10348 Update FileLoader to fix issue #10339 (msumme)
This PR was merged into the 2.3 branch.

Discussion
----------

Update FileLoader to fix issue #10339

This fixes an issue in Symfony\Component\Config\Loader\FileLoader

| Q             | A
| ------------- | ---
| Bug fix?      |  yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |  #10339
| License       | MIT
| Doc PR        |  none

Commits
-------

3988728 Update FileLoader to fix issue #10339
2014-02-28 09:16:24 +01:00
Max Summe
3988728169 Update FileLoader to fix issue #10339
FileLoader now uses resolved FileLoader's (the one that explicitly
supports that resource) FileLocatorInterface instance before falling
back to its own when trying to load resources in import() method.
2014-02-27 21:56:34 -06:00
Fabien Potencier
cb4a9cc2eb Merge branch '2.3' into 2.4
* 2.3:
  bumped Symfony version to 2.3.12
  updated VERSION for 2.3.11
  update CONTRIBUTORS for 2.3.11
  updated CHANGELOG for 2.3.11
  Follow-up to #10312: Fixed minor performance related issues in Yaml\Inline.

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2014-02-27 18:04:59 +01:00
Fabien Potencier
1c0fcd0252 bumped Symfony version to 2.3.12 2014-02-27 17:33:40 +01:00