Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
merged branch lsmith77/component_readmes (PR #2561)
Browse files Browse the repository at this point in the history
Commits
-------

1e370d7 typo fix
93d8d44 added some more infos about Config
27efd59 added READMEs for the bridges
34fc866 cosmetic tweaks
d6af3f1 fixed README for Console
6a72b8c added basic README files for all components

Discussion
----------

added basic README files for all components and bridges

heavily based on http://fabien.potencier.org/article/49/what-is-symfony2 and the official Symfony2 documentation

---------------------------------------------------------------------------

by jmikola at 2011/11/03 13:36:07 -0700

Great work. For syntax highlighting on the PHP snippets, you could add "php" after the three backticks.

---------------------------------------------------------------------------

by lsmith77 at 2011/11/03 13:41:29 -0700

done

---------------------------------------------------------------------------

by stealth35 at 2011/11/03 13:49:31 -0700

Nice job, but you also need to add `<?php`

ex :

``` php
<?php
use Symfony\Component\DomCrawler\Crawler;

$crawler = new Crawler();
$crawler->addContent('<html><body><p>Hello World!</p></body></html>');

print $crawler->filter('body > p')->text();
```

---------------------------------------------------------------------------

by lsmith77 at 2011/11/03 13:56:57 -0700

done

---------------------------------------------------------------------------

by ericclemmons at 2011/11/03 19:57:57 -0700

@lsmith77 Well done!  This makes consumption of individual components that much easier, *especially* now that `composer.json` files have been added.

---------------------------------------------------------------------------

by lsmith77 at 2011/11/04 01:18:23 -0700

ok .. fixed the issues you mentioned @fabpot

---------------------------------------------------------------------------

by lsmith77 at 2011/11/11 15:00:27 -0800

@fabpot anything else left? seems like an easy merge .. and imho there is considerable benefit for our efforts to spread the word about the components with this PR merged.

---------------------------------------------------------------------------

by drak at 2011/11/11 18:54:13 -0800

You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com

---------------------------------------------------------------------------

by lsmith77 at 2011/11/12 00:59:14 -0800

i did that in some. but i might have missed a few places.
On 12.11.2011, at 03:54, Drak <reply@reply.github.com> wrote:

> You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com
>
> ---
> Reply to this email directly or view it on GitHub:
> symfony/symfony#2561 (comment)

---------------------------------------------------------------------------

by breerly at 2011/11/21 10:28:36 -0800

Pretty excited with this.

---------------------------------------------------------------------------

by dbu at 2011/11/24 00:02:50 -0800

is there anything we can help with to make this ready to be merged?

---------------------------------------------------------------------------

by lsmith77 at 2011/12/18 02:39:23 -0800

@fabpot: seriously .. if you are not going to deliver something "better" and don't provide a reason what is wrong with this .. then its beyond frustrating. i obviously do not claim that these README's are perfect (and certainly still no replacement for proper documentation), but I do claim that in their current form they are a radical step forward to potential users of the Symfony2 components.
  • Loading branch information
fabpot committed Dec 18, 2011
2 parents d6b1e57 + a0c2e07 commit 67f0ac3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,41 @@
ClassLoader Component
=====================

The ClassLoader component provides an autoloader that implements the PSR-0 standard
(which is a standard way to autoload namespaced classes as available in PHP 5.3).
It is also able to load classes that use the PEAR naming convention. It is really
flexible as it can look for classes in different directories based on a sub-namespace.
You can even give more than one directory for one namespace:

```
require_once __DIR__.'/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
'Doctrine\\DBAL' => __DIR__.'/vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
'Monolog' => __DIR__.'/vendor/monolog/src',
));
$loader->registerPrefixes(array(
'Twig_' => __DIR__.'/vendor/twig/lib',
));
$loader->register();
```

Most of the time, the Symfony2 ClassLoader is all you need to autoload all your project classes.
And for better performance, you can use an APC cached version of the universal class loader or
the map class loader.

Furthermore it provides tools to aggregate classes into a single file, which is especially
useful to improve performance on servers that do not provide byte caches.

Resources
---------

Unit tests:

https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/ClassLoader

0 comments on commit 67f0ac3

Please sign in to comment.