8000 Merge branch '2.8' · symfony/symfony-docs@ee7f14f · GitHub
[go: up one dir, main page]

Skip to content

Commit ee7f14f

Browse files
committed
Merge branch '2.8'
* 2.8: Ensure that the entity is updated. Update lazy_services.rst Update templating.rst Additional little check to show how we're assumign the User object is the User entity Moved mongodb article and cleanup Fixing remaining reference of old emplacement of pdo_session_storage page due to the rebase Move some articles from wrong sections, updated indexs Move some articles from wrong sections [#5374] Add deprecation notice in 2.7 fix YAML syntax highlighting Improve and simplify the contributing instructions about tests Some fixes for bundle best practices Fix Major upgrade article for 2.7.1 changes [#5413] Backporting changes to 2.3 Added caution notes about the deprecation of container scopes
2 parents fceaa9f + eafdb8c commit ee7f14f

File tree

27 files changed

+116
-108
lines changed
  • session
  • upgrade
  • reference
  • 27 files changed

    +116
    -108
    lines changed

    book/templating.rst

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1224,7 +1224,7 @@ automatically:
    12241224

    12251225
    .. versionadded:: 2.6
    12261226
    The global ``app.security`` variable (or the ``$app->getSecurity()``
    1227-
    method in PHP templates) is deprecated as of Symfony 2.6. Use ``app.user``
    1227+
    method in PHP templates) is deprecated as of Symfony 2.6. Use ``app.user``
    12281228
    (``$app->getUser()``) and ``is_granted()`` (``$view['security']->isGranted()``)
    12291229
    instead.
    12301230

    @@ -1595,16 +1595,16 @@ is ``true``. By default this means that the variables will be dumped in the
    15951595
    Syntax Checking
    15961596
    ---------------
    15971597

    1598-
    You can check for syntax errors in Twig templates using the ``twig:lint``
    1598+
    You can check for syntax errors in Twig templates using the ``lint:twig``
    15991599
    console command:
    16001600

    16011601
    .. code-block:: bash
    16021602
    16031603
    # You can check by filename:
    1604-
    $ php app/console twig:lint app/Resources/views/article/recent_list.html.twig
    1604+
    $ php app/console lint:twig app/Resources/views/article/recent_list.html.twig
    16051605
    16061606
    # or by directory:
    1607-
    $ php app/console twig:lint app/Resources/views
    1607+
    $ php app/console lint:twig app/Resources/views
    16081608
    16091609
    .. _template-formats:
    16101610

    components/dependency_injection/lazy_services.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -40,7 +40,7 @@ the `ProxyManager bridge`_:
    4040

    4141
    .. code-block:: bash
    4242
    43-
    $ php composer.phar require ocramius/proxy-manager:~1.0
    43+
    $ composer require ocramius/proxy-manager:~1.0
    4444
    4545
    Afterwards compile your container and check to make sure that you get
    4646
    a proxy for your lazy services.

    contributing/code/tests.rst

    Lines changed: 22 additions & 67 deletions
    Original file line numberDiff line numberDiff line change
    @@ -3,54 +3,32 @@
    33
    Running Symfony Tests
    44
    =====================
    55

    6-
    Before submitting a :doc:`patch <patches>` for inclusion, you need to run the
    7-
    Symfony test suite to check that you have not broken anything.
    6+
    The Symfony project uses a third-party service which automatically runs tests
    7+
    for any submitted :doc:`patch <patches>`. If the new code breaks any test,
    8+
    the pull request will show an error message with a link to the full error details.
    89

    9-
    PHPUnit
    10-
    -------
    10+
    In any case, it's a good practice to run tests locally before submitting a
    11+
    :doc:`patch <patches>` for inclusion, to check that you have not broken anything.
    1112

    12-
    To run the Symfony test suite, `install PHPUnit`_ 4.2 (or later) first.
    13+
    .. _phpunit:
    14+
    .. _dependencies_optional:
    1315

    14-
    Dependencies (optional)
    15-
    -----------------------
    16+
    Before Running the Tests
    17+
    ------------------------
    1618

    17-
    To run the entire test suite, including tests that depend on external
    18-
    dependencies, Symfony needs to be able to autoload them. By default, they are
    19-
    autoloaded from ``vendor/`` under the main root directory (see
    20-
    ``autoload.php.dist``).
    21-
    22-
    The test suite needs the following third-party libraries:
    23-
    24-
    * Doctrine
    25-
    * Swift Mailer
    26-
    * Twig
    27-
    * Monolog
    28-
    29-
    To install them all, use `Composer`_:
    30-
    31-
    Step 1: :doc:`Install Composer globally </cookbook/composer>`
    32-
    33-
    Step 2: Install vendors.
    19+
    To run the Symfony test suite, `install PHPUnit`_ 4.2 (or later) first. Then,
    20+
    install the external dependencies used during the tests, such as Doctrine, Twig
    21+
    and Monolog. To do so, :doc:`install Composer </cookbook/composer>` and execute
    22+
    the following:
    3423

    3524
    .. code-block:: bash
    3625
    3726
    $ composer install
    3827
    39-
    .. note::
    40-
    41-
    Note that the script takes some time to finish.
    28+
    .. _running:
    4229

    43-
    After installation, you can update the vendors to their latest version with
    44-
    the follow command:
    45-
    46-
    .. code-block:: bash
    47-
    48-
    $ composer update
    49-
    50-
    Running
    51-
    -------
    52-
    53-
    First, update the vendors (see above).
    30+
    Running the Tests
    31+
    -----------------
    5432

    5533
    Then, run the test suite from the Symfony root directory with the following
    5634
    command:
    @@ -59,40 +37,17 @@ command:
    5937
    6038
    $ phpunit
    6139
    62-
    The output should display ``OK``. If not, you need to figure out what's going on
    63-
    and if the tests are broken because of your modifications.
    40+
    The output should display ``OK``. If not, read the reported errors to figure out
    41+
    what's going on and if the tests are broken because of the new code.
    6442

    6543
    .. tip::
    6644

    67-
    If you want to test a single component type its path after the ``phpunit``
    68-
    command, e.g.:
    45+
    The entire Symfony suite can take up to several minutes to complete. If you
    46+
    want to test a single component, type its path after the ``phpunit`` command,
    47+
    e.g.:
    6948

    7049
    .. code-block:: bash
    7150
    7251
    $ phpunit src/Symfony/Component/Finder/
    7352
    74-
    .. tip::
    75-
    76-
    Run the test suite before applying your modifications to check that they
    77-
    run fine on your configuration.
    78-
    79-
    Code Coverage
    80-
    -------------
    81-
    82-
    If you add a new feature, you also need to check the code coverage by using
    83-
    the ``coverage-html`` option:
    84-
    85-
    .. code-block:: bash
    86-
    87-
    $ phpunit --coverage-html=cov/
    88-
    89-
    Check the code coverage by opening the generated ``cov/index.html`` page in a
    90-
    browser.
    91-
    92-
    .. tip::
    93-
    94-
    The code coverage only works if you have Xdebug enabled and all
    95-
    dependencies installed.
    96-
    97-
    .. _install PHPUnit: https://phpunit.de/manual/current/en/installation.html
    98-
    .. _`Composer`: https://getcomposer.org/
    53+
    .. _`install PHPUnit`: https://phpunit.de/manual/current/en/installation.html

    cookbook/bundles/best_practices.rst

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -146,7 +146,7 @@ class name is ``Acme\BlogBundle\Controller\ContentController``.
    146146
    All classes and files must follow the :doc:`Symfony coding standards </contributing/code/standards>`.
    147147

    148148
    Some classes should be seen as facades and should be as short as possible, like
    149-
    Commands, Helpers, Listeners, and Controllers.
    149+
    Commands, Helpers, Listeners and Controllers.
    150150

    151151
    Classes that connect to the event dispatcher should be suffixed with
    152152
    ``Listener``.
    @@ -159,7 +159,7 @@ Vendors
    159159
    A bundle must not embed third-party PHP libraries. It should rely on the
    160160
    standard Symfony autoloading instead.
    161161

    162-
    A bundle should not embed third-party libraries written in JavaScript, CSS, or
    162+
    A bundle should not embed third-party libraries written in JavaScript, CSS or
    163163
    any other language.
    164164

    165165
    Tests
    @@ -175,6 +175,7 @@ the ``Tests/`` directory. Tests should follow the following principles:
    175175
    * The tests should cover at least 95% of the code base.
    176176

    177177
    .. note::
    178+
    178179
    A test suite must not contain ``AllTests.php`` scripts, but must rely on the
    179180
    existence of a ``phpunit.xml.dist`` file.
    180181

    cookbook/configuration/index.rst

    Lines changed: 0 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -9,8 +9,6 @@ Configuration
    99
    using_parameters_in_dic
    1010
    front_controllers_and_kernel
    1111
    external_parameters
    12-
    pdo_session_storage
    1312
    apache_router
    1413
    web_server_configuration
    1514
    configuration_organization
    16-
    mongodb_session_storage

    cookbook/console/console_command.rst

    Lines changed: 5 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -82,6 +82,11 @@ for details.
    8282
    Getting Services from the Service Container
    8383
    -------------------------------------------
    8484

    85+
    .. caution::
    86+
    87+
    The "container scopes" concept explained in this section has been deprecated
    88+
    in Symfony 2.8 and it will be removed in Symfony 3.0.
    89+
    8590
    By using :class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand`
    8691
    as the base class for the command (instead of the more basic
    8792
    :class:`Symfony\\Component\\Console\\Command\\Command`), you have access to the

    cookbook/controller/error_pages.rst

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -302,7 +302,7 @@ before, but also requires a thorough understanding of Symfony internals. Suppose
    302302
    that your code throws specialized exceptions with a particular meaning to your
    303303
    application domain.
    304304

    305-
    :doc:`Writing your own event listener </cookbook/service_container/event_listener>`
    305+
    :doc:`Writing your own event listener </cookbook/event_dispatcher/event_listener>`
    306306
    for the ``kernel.exception`` event allows you to have a closer look at the exception
    307307
    and take different actions depending on it. Those actions might include logging
    308308
    the exception, redirecting the user to another page or rendering specialized

    cookbook/doctrine/file_uploads.rst

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -494,6 +494,7 @@ property, instead of the actual filename::
    494494
    if (is_file($this->getAbsolutePath())) {
    495495
    // store the old name to delete after the update
    496496
    $this->temp = $this->getAbsolutePath();
    497+
    $this->path = null;
    497498
    } else {
    498499
    $this->path = 'initial';
    499500
    }

    cookbook/doctrine/index.rst

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -14,4 +14,6 @@ Doctrine
    1414
    resolve_target_entity
    1515
    mapping_model_classes
    1616
    registration_form
    17+
    pdo_session_storage
    18+
    mongodb_session_storage
    1719
    console

    cookbook/configuration/mongodb_session_storage.rst renamed to cookbook/doctrine/mongodb_session_storage.rst

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -30,12 +30,12 @@ need to change/add some parameters in the main configuration file:
    3030
    mongo_client:
    3131
    class: MongoClient
    3232
    # if using a username and password
    33-
    arguments: [mongodb://%mongodb_username%:%mongodb_password%@%mongodb_host%:27017]
    33+
    arguments: ["mongodb://%mongodb_username%:%mongodb_password%@%mongodb_host%:27017"]
    3434
    # if not using a username and password
    35-
    arguments: [mongodb://%mongodb_host%:27017]
    35+
    arguments: ["mongodb://%mongodb_host%:27017"]
    3636
    session.handler.mongo:
    3737
    class: Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler
    38-
    arguments: [@mongo_client, %mongo.session.options%]
    38+
    arguments: ["@mongo_client", "%mongo.session.options%"]
    3939
    4040
    .. code-block:: xml
    4141
    @@ -168,4 +168,4 @@ From the `MongoDB shell`_:
    168168
    db.session.ensureIndex( { "expireAt": 1 }, { expireAfterSeconds: 0 } )
    169169
    170170
    .. _installed and configured a MongoDB server: http://docs.mongodb.org/manual/installation/
    171-
    .. _MongoDB shell: http://docs.mongodb.org/v2.2/tutorial/getting-started-with-the-mongo-shell/
    171+
    .. _MongoDB shell: http://docs.mongodb.org/v2.2/tutorial/getting-started-with-the-mongo-shell/

    0 commit comments

    Comments
     (0)
    0