Skip to content

[Composer paths] Updated paths that are now created/managed by composer #1165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ better software than with flat PHP, you'll see for yourself.
In this chapter, you'll write a simple application in flat PHP, and then
refactor it to be more organized. You'll travel through time, seeing the
decisions behind why web development has evolved over the past several years
to where it is now.
to where it is now.

By the end, you'll see how Symfony2 can rescue you from mundane tasks and
let you take back control of your code.
Expand Down Expand Up @@ -132,7 +132,7 @@ to the area of *your* code that processes user input and prepares the response.
In this case, our controller prepares data from the database and then includes
a template to present that data. With the controller isolated, you could
easily change *just* the template file if you needed to render the blog
entries in some other format (e.g. ``list.json.php`` for JSON format).
entries in some other format (e.g. ``list.json.php`` for JSON format).

Isolating the Application (Domain) Logic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -424,7 +424,7 @@ an autoloader that Symfony provides. An autoloader is a tool that makes it
possible to start using PHP classes without explicitly including the file
containing the class.

First, `download symfony`_ and place it into a ``vendor/symfony/`` directory.
First, `download symfony`_ and place it into a ``vendor/symfony/symfony/`` directory.
Next, create an ``app/bootstrap.php`` file. Use it to ``require`` the two
files in the application and to configure the autoloader:

Expand All @@ -434,11 +434,11 @@ files in the application and to configure the autoloader:
// bootstrap.php
require_once 'model.php';
require_once 'controllers.php';
require_once 'vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once 'vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';

$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => __DIR__.'/../vendor/symfony/src',
'Symfony' => __DIR__.'/../vendor/symfony/symfony/src',
));

$loader->register();
Expand Down Expand Up @@ -564,7 +564,7 @@ them for you. Here's the same sample application, now built in Symfony2:
->getEntityManager()
->getRepository('AcmeBlogBundle:Post')
->find($id);

if (!$post) {
// cause the 404 page not found to be displayed
throw $this->createNotFoundException();
Expand All @@ -581,7 +581,7 @@ now quite a bit simpler:

.. code-block:: html+php

<!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
<!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
<?php $view->extend('::layout.html.php') ?>

<?php $view['slots']->set('title', 'List of Posts') ?>
Expand Down
2 changes: 1 addition & 1 deletion book/performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ To use this class loader, simply adapt your ``autoloader.php`` as follows:
.. code-block:: php

// app/autoload.php
require __DIR__.'/../vendor/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';
require __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php';

use Symfony\Component\ClassLoader\ApcUniversalClassLoader;

Expand Down
20 changes: 10 additions & 10 deletions components/class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ or
:method:`Symfony\\Component\\ClassLoader\\UniversalClassLoader::registerNamespaces`
methods::

$loader->registerNamespace('Symfony', __DIR__.'/vendor/symfony/src');
$loader->registerNamespace('Symfony', __DIR__.'/vendor/symfony/symfony/src');

$loader->registerNamespaces(array(
'Symfony' => __DIR__.'/../vendor/symfony/src',
'Monolog' => __DIR__.'/../vendor/monolog/src',
'Symfony' => __DIR__.'/../vendor/symfony/symfony/src',
'Monolog' => __DIR__.'/../vendor/monolog/monolog/src',
));

$loader->register();
Expand All @@ -89,11 +89,11 @@ or
:method:`Symfony\\Component\\ClassLoader\\UniversalClassLoader::registerPrefixes`
methods::

$loader->registerPrefix('Twig_', __DIR__.'/vendor/twig/lib');
$loader->registerPrefix('Twig_', __DIR__.'/vendor/twig/twig/lib');

$loader->registerPrefixes(array(
'Swift_' => __DIR__.'/vendor/swiftmailer/lib/classes',
'Twig_' => __DIR__.'/vendor/twig/lib',
'Swift_' => __DIR__.'/vendor/swiftmailer/swiftmailer/lib/classes',
'Twig_' => __DIR__.'/vendor/twig/twig/lib',
));

$loader->register();
Expand All @@ -108,10 +108,10 @@ for in a location list to ease the vendoring of a sub-set of classes for large
projects::

$loader->registerNamespaces(array(
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
'Doctrine\\DBAL\\Migrations' => __DIR__.'/vendor/doctrine-migrations/lib',
'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
'Doctrine\\Common' => __DIR__.'/vendor/doctrine/common/lib',
'Doctrine\\DBAL\\Migrations' => __DIR__.'/vendor/doctrine/migrations/lib',
'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine/dbal/lib',
'Doctrine' => __DIR__.'/vendor/doctrine/orm/lib',
));

$loader->register();
Expand Down
2 changes: 1 addition & 1 deletion cookbook/controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Symfony uses the following algorithm to determine which template to use:
To see the full list of default error templates, see the
``Resources/views/Exception`` directory of the ``TwigBundle``. In a
standard Symfony2 installation, the ``TwigBundle`` can be found at
``vendor/symfony/src/Symfony/Bundle/TwigBundle``. Often, the easiest way
``vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle``. Often, the easiest way
to customize an error page is to copy it from the ``TwigBundle`` into
``app/Resources/TwigBundle/views/Exception`` and then modify it.

Expand Down
2 changes: 1 addition & 1 deletion cookbook/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ below::
// ...

// require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__.'/../app/autoload.php';
require_once __DIR__.'/../app/AppKernel.php';

Expand Down
14 changes: 7 additions & 7 deletions cookbook/symfony1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ example::
// ...

The file itself lives at
``vendor/bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php``.
``vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php``.
As you can see, the location of the file follows the namespace of the class.
Specifically, the namespace, ``Sensio\Bundle\FrameworkExtraBundle``, spells out
the directory that the file should live in
(``vendor/bundle/Sensio/Bundle/FrameworkExtraBundle``). This is because, in the
``app/autoload.php`` file, you'll configure Symfony to look for the ``Sensio``
namespace in the ``vendor/bundle`` directory:
the directory that the file should live in
(``vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/``).
This is because, in the ``app/autoload.php`` file, you'll configure Symfony to
look for the ``Sensio`` namespace in the ``vendor/sension`` directory:

.. code-block:: php

Expand All @@ -155,7 +155,7 @@ contains a different class). In order for a class to be autoloaded, you

As mentioned before, for the autoloader to work, it needs to know that the
``Sensio`` namespace lives in the ``vendor/bundles`` directory and that, for
example, the ``Doctrine`` namespace lives in the ``vendor/doctrine/lib/``
example, the ``Doctrine`` namespace lives in the ``vendor/doctrine/orm/lib/``
directory. This mapping is entirely controlled by you via the
``app/autoload.php`` file.

Expand Down Expand Up @@ -247,7 +247,7 @@ In Symfony2, the bundles are activated inside the application kernel::
// ...
new Acme\DemoBundle\AcmeDemoBundle(),
);

return $bundles;
}

Expand Down
8 changes: 4 additions & 4 deletions cookbook/testing/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ How to test Doctrine Repositories
=================================

Unit testing Doctrine repositories in a Symfony project is not a straightforward
task. Indeed, to load a repository you need to load your entities, an entity
task. Indeed, to load a repository you need to load your entities, an entity
manager, and some other stuff like a connection.

To test your repository, you have two different options:
Expand All @@ -22,7 +22,7 @@ To test your repository, you have two different options:
Unit Testing
------------

As Symfony and Doctrine share the same testing framework, it's quite easy to
As Symfony and Doctrine share the same testing framework, it's quite easy to
implement unit tests in your Symfony project. The ORM comes with its own set
of tools to ease the unit testing and mocking of everything you need, such as
a connection, an entity manager, etc. By using the testing components provided
Expand All @@ -41,7 +41,7 @@ First, you need to add the ``Doctrine\Tests`` namespace to your autoloader::
// app/autoload.php
$loader->registerNamespaces(array(
//...
'Doctrine\\Tests' => __DIR__.'/../vendor/doctrine/tests',
'Doctrine\\Tests' => __DIR__.'/../vendor/doctrine/orm/tests',
));

Next, you will need to setup an entity manager in each test so that Doctrine
Expand Down Expand Up @@ -70,7 +70,7 @@ and load the entities::
$reader->setEnableParsePhpImports(true);

$metadataDriver = new AnnotationDriver(
$reader,
$reader,
// provide the namespace of the entities you want to tests
'Acme\\ProductBundle\\Entity'
);
Expand Down
20 changes: 10 additions & 10 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ PHP autoloading can be configured via ``app/autoload.php``::

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
'Symfony' => array(__DIR__.'/../vendor/symfony/symfony/src', __DIR__.'/../vendor/bundles'),
'Sensio' => __DIR__.'/../vendor/bundles',
'JMS' => __DIR__.'/../vendor/bundles',
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
'Monolog' => __DIR__.'/../vendor/monolog/src',
'Assetic' => __DIR__.'/../vendor/assetic/src',
'Metadata' => __DIR__.'/../vendor/metadata/src',
'JMS' => __DIR__.'/../vendor/jms/',
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine/common/lib',
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine/dbal/lib',
'Doctrine' => __DIR__.'/../vendor/doctrine/orm/lib',
'Monolog' => __DIR__.'/../vendor/monolog/monolog/src',
'Assetic' => __DIR__.'/../vendor/kriswallsmith/assetic/src',
'Metadata' => __DIR__.'/../vendor/jms/metadata/src',
));
$loader->registerPrefixes(array(
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
'Twig_' => __DIR__.'/../vendor/twig/lib',
'Twig_Extensions_' => __DIR__.'/../vendor/twig/extensions/lib',
'Twig_' => __DIR__.'/../vendor/twig/twig/lib',
));

// ...
Expand Down