From 7f1ec8a69a7c29d11ff8bdc291830af8f7ede7f7 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 11 Jun 2015 17:13:47 +0200 Subject: [PATCH] Added a note about the need to require Composer's autoload file --- components/class_loader/introduction.rst | 2 ++ components/config/introduction.rst | 2 ++ components/console/introduction.rst | 2 ++ components/css_selector.rst | 2 ++ components/debug.rst | 2 ++ components/dependency_injection/introduction.rst | 2 ++ components/dom_crawler.rst | 2 ++ components/event_dispatcher/introduction.rst | 2 ++ components/filesystem.rst | 2 ++ components/finder.rst | 4 +++- components/form/introduction.rst | 2 ++ components/http_foundation/introduction.rst | 2 ++ components/http_kernel/introduction.rst | 2 ++ components/options_resolver.rst | 2 ++ components/process.rst | 2 ++ components/property_access/introduction.rst | 2 ++ components/require_autoload.rst.inc | 3 +++ components/routing/introduction.rst | 2 ++ components/security/introduction.rst | 2 ++ components/serializer.rst | 2 ++ components/stopwatch.rst | 2 ++ components/templating/introduction.rst | 2 ++ components/translation/introduction.rst | 2 ++ components/yaml/introduction.rst | 2 ++ 24 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 components/require_autoload.rst.inc diff --git a/components/class_loader/introduction.rst b/components/class_loader/introduction.rst index ab8f1566a6e..9ba98db987d 100644 --- a/components/class_loader/introduction.rst +++ b/components/class_loader/introduction.rst @@ -36,5 +36,7 @@ You can install the component in 2 different ways: on `Packagist`_); * Use the official Git repository (https://github.com/symfony/ClassLoader). +.. include:: /components/require_autoload.rst.inc + .. _`autoloading mechanism`: http://php.net/manual/en/language.oop5.autoload.php .. _Packagist: https://packagist.org/packages/symfony/class-loader diff --git a/components/config/introduction.rst b/components/config/introduction.rst index b4d075c3b58..70f74c2072f 100644 --- a/components/config/introduction.rst +++ b/components/config/introduction.rst @@ -17,6 +17,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/config`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Config). +.. include:: /components/require_autoload.rst.inc + Sections -------- diff --git a/components/console/introduction.rst b/components/console/introduction.rst index eda67260924..4868d70e069 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -20,6 +20,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/console`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Console). +.. include:: /components/require_autoload.rst.inc + Creating a basic Command ------------------------ diff --git a/components/css_selector.rst b/components/css_selector.rst index 2eaf063169c..833c8c04205 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -15,6 +15,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/css-selector`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/CssSelector). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/debug.rst b/components/debug.rst index cd4146a58eb..ecbccb16db7 100644 --- a/components/debug.rst +++ b/components/debug.rst @@ -19,6 +19,8 @@ You can install the component in many different ways: * :doc:`Install it via Composer ` (``symfony/debug`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Debug). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/dependency_injection/introduction.rst b/components/dependency_injection/introduction.rst index e58e6409726..58fe212780d 100644 --- a/components/dependency_injection/introduction.rst +++ b/components/dependency_injection/introduction.rst @@ -19,6 +19,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/dependency-injection`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/DependencyInjection). +.. include:: /components/require_autoload.rst.inc + Basic Usage ----------- diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 4a4da289d4f..0ef224d9a9c 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -20,6 +20,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/dom-crawler`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/DomCrawler). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/event_dispatcher/introduction.rst b/components/event_dispatcher/introduction.rst index 5ed56cc3e05..49036aba7a1 100644 --- a/components/event_dispatcher/introduction.rst +++ b/components/event_dispatcher/introduction.rst @@ -56,6 +56,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/event-dispatcher`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/EventDispatcher). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/filesystem.rst b/components/filesystem.rst index e3948d4f3ea..3f7fe387397 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -18,6 +18,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/filesystem`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Filesystem). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/finder.rst b/components/finder.rst index d1e00d91c68..972f5ae7bcb 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -16,6 +16,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/finder`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Finder). +.. include:: /components/require_autoload.rst.inc + Usage ----- @@ -308,7 +310,7 @@ The contents of returned files can be read with foreach ($finder as $file) { $contents = $file->getContents(); - + // ... } diff --git a/components/form/introduction.rst b/components/form/introduction.rst index fa73636d293..01511f2de83 100644 --- a/components/form/introduction.rst +++ b/components/form/introduction.rst @@ -22,6 +22,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/form`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Form). +.. include:: /components/require_autoload.rst.inc + Configuration ------------- diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index 57f4ba479cf..9f931553a96 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -24,6 +24,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/http-foundation`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/HttpFoundation). +.. include:: /components/require_autoload.rst.inc + .. _component-http-foundation-request: Request diff --git a/components/http_kernel/introduction.rst b/components/http_kernel/introduction.rst index d97571ebcb8..a75ff31aeb6 100644 --- a/components/http_kernel/introduction.rst +++ b/components/http_kernel/introduction.rst @@ -19,6 +19,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/http-kernel`` on Packagist_); * Use the official Git repository (https://github.com/symfony/HttpKernel). +.. include:: /components/require_autoload.rst.inc + The Workflow of a Request ------------------------- diff --git a/components/options_resolver.rst b/components/options_resolver.rst index 52ba3c647dc..b536c1c04e8 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -16,6 +16,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/options-resolver`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/OptionsResolver). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/process.rst b/components/process.rst index e3e0550068d..559fa88e6a7 100644 --- a/components/process.rst +++ b/components/process.rst @@ -15,6 +15,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/process`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Process). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/property_access/introduction.rst b/components/property_access/introduction.rst index 21d007545dd..8d559948418 100644 --- a/components/property_access/introduction.rst +++ b/components/property_access/introduction.rst @@ -20,6 +20,8 @@ You can install the component in two different ways: * :doc:`Install it via Composer` (``symfony/property-access`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/PropertyAccess). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/require_autoload.rst.inc b/components/require_autoload.rst.inc new file mode 100644 index 00000000000..568562507c1 --- /dev/null +++ b/components/require_autoload.rst.inc @@ -0,0 +1,3 @@ +Then, require the ``vendor/autoload.php`` file to enable the autoloading mechanism +provided by Composer. Otherwise, your application won't be able to find the classes +of this Symfony component. diff --git a/components/routing/introduction.rst b/components/routing/introduction.rst index 07c764d5b73..024f9ca2576 100644 --- a/components/routing/introduction.rst +++ b/components/routing/introduction.rst @@ -16,6 +16,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/routing`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Routing). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/security/introduction.rst b/components/security/introduction.rst index 15a688086ce..982834e6ab6 100644 --- a/components/security/introduction.rst +++ b/components/security/introduction.rst @@ -19,6 +19,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/security`` on Packagist_); * Use the official Git repository (https://github.com/symfony/Security). +.. include:: /components/require_autoload.rst.inc + Sections -------- diff --git a/components/serializer.rst b/components/serializer.rst index e2bda4d5ff9..64929ea753f 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -33,6 +33,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/serializer`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Serializer). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 3bc315a0eb8..73512080e71 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -20,6 +20,8 @@ You can install the component in two different ways: * :doc:`Install it via Composer` (``symfony/stopwatch`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Stopwatch). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/templating/introduction.rst b/components/templating/introduction.rst index 52c1cee65dc..00539d1ed98 100644 --- a/components/templating/introduction.rst +++ b/components/templating/introduction.rst @@ -21,6 +21,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/templating`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Templating). +.. include:: /components/require_autoload.rst.inc + Usage ----- diff --git a/components/translation/introduction.rst b/components/translation/introduction.rst index 21ef071c21f..bcc40ced071 100644 --- a/components/translation/introduction.rst +++ b/components/translation/introduction.rst @@ -16,6 +16,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/translation`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Translation). +.. include:: /components/require_autoload.rst.inc + Constructing the Translator --------------------------- diff --git a/components/yaml/introduction.rst b/components/yaml/introduction.rst index e7e92270493..66910de0450 100644 --- a/components/yaml/introduction.rst +++ b/components/yaml/introduction.rst @@ -34,6 +34,8 @@ You can install the component in 2 different ways: * :doc:`Install it via Composer ` (``symfony/yaml`` on `Packagist`_); * Use the official Git repository (https://github.com/symfony/Yaml). +.. include:: /components/require_autoload.rst.inc + Why? ----