Skip to content

Some updates to Quick Tour #46

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

Closed
wants to merge 2 commits into from
Closed
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
66 changes: 27 additions & 39 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ The Web Directory

The web root directory is the home of all public and static files like images,
stylesheets, and JavaScript files. It is also where the front controllers
live:

.. code-block:: html+php

<!-- web/app.php -->
<?php
live::

// web/app.php
require_once __DIR__.'/../app/AppKernel.php';

use Symfony\Component\HttpFoundation\Request;

$kernel = new AppKernel('prod', false);
$kernel->handle()->send();
$kernel->handle(new Request())->send();

Like any front controller, ``app.php`` uses a Kernel Class, ``AppKernel``, to
bootstrap the application.
Expand Down Expand Up @@ -89,15 +87,16 @@ stored in the ``src/`` directory::

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => $vendorDir.'/symfony/src',
'Application' => __DIR__,
'Bundle' => __DIR__,
'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib',
'Doctrine\\DBAL\\Migrations' => $vendorDir.'/doctrine-migrations/lib',
'Doctrine\\ODM\\MongoDB' => $vendorDir.'/doctrine-mongodb/lib',
'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib',
'Doctrine' => $vendorDir.'/doctrine/lib',
'Zend' => $vendorDir.'/zend/library',
'Symfony' => $vendorDir.'/symfony/src',
'Application' => __DIR__,
'Bundle' => __DIR__,
'Doctrine\\Common\\DataFixtures' => $vendorDir.'/doctrine-data-fixtures/lib',
'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib',
'Doctrine\\DBAL\\Migrations' => $vendorDir.'/doctrine-migrations/lib',
'Doctrine\\ODM\\MongoDB' => $vendorDir.'/doctrine-mongodb/lib',
'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib',
'Doctrine' => $vendorDir.'/doctrine/lib',
'Zend' => $vendorDir.'/zend/library',
));
$loader->registerPrefixes(array(
'Swift_' => $vendorDir.'/swiftmailer/lib/classes',
Expand Down Expand Up @@ -147,7 +146,7 @@ method of the ``AppKernel`` class::
//new Symfony\Bundle\TwigBundle\TwigBundle(),

// register your bundles
new Application\AppBundle\AppBundle(),
new Application\HelloBundle\HelloBundle(),
);

if ($this->isDebug()) {
Expand Down Expand Up @@ -179,12 +178,9 @@ PHP. Have a look at the default configuration:
templating:
escaping: htmlspecialchars
#assets_version: SomeVersionScheme
#user:
# default_locale: fr
# session:
# name: SYMFONY
# type: Native
# lifetime: 3600
session:
default_locale: en
lifetime: 3600

## Twig Configuration
#twig.config:
Expand Down Expand Up @@ -213,11 +209,7 @@ PHP. Have a look at the default configuration:
<app:router resource="%kernel.root_dir%/config/routing.xml" />
<app:validation enabled="true" annotations="true" />
<app:templating escaping="htmlspecialchars" />
<!--
<app:user default-locale="fr">
<app:session name="SYMFONY" type="Native" lifetime="3600" />
</app:user>
//-->
<app:session default-locale="en" lifetime="3600" />
</app:config>

<!-- Twig Configuration -->
Expand Down Expand Up @@ -255,14 +247,10 @@ PHP. Have a look at the default configuration:
'escaping' => 'htmlspecialchars'
#'assets_version' => "SomeVersionScheme",
),
#'user' => array(
# 'default_locale' => "fr",
# 'session' => array(
# 'name' => "SYMFONY",
# 'type' => "Native",
# 'lifetime' => "3600",
# )
#),
'session' => array(
'default_locale' => "en",
'lifetime' => "3600",
),
));

// Twig Configuration
Expand Down Expand Up @@ -316,7 +304,7 @@ specific configuration file:
zend.config:
logger:
priority: debug
path: %kernel.root_dir%/logs/%kernel.environment%.log
path: %kernel.logs_dir%/%kernel.environment%.log

.. code-block:: xml

Expand Down Expand Up @@ -390,8 +378,8 @@ Using Vendors

Odds are your application will depend on third-party libraries. Those should
be stored in the ``src/vendor/`` directory. It already contains the Symfony2
libraries, the SwiftMailer library, the Doctrine ORM, the Propel ORM, the Twig
templating system, and a selection of the Zend Framework classes.
libraries, the SwiftMailer library, the Doctrine ORM, the Twig templating
system, and a selection of the Zend Framework classes.

.. index::
single: Configuration Cache
Expand Down
1 change: 0 additions & 1 deletion quick_tour/the_big_picture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ The controller is responsible for returning a representation of the resource
}
}


The code is pretty straightforward but let's explain this code line by line:

* *line 3*: Symfony2 takes advantage of new PHP 5.3 features and as such, all
Expand Down