Skip to content

Updated all the README files #17997

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 4 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
9 changes: 4 additions & 5 deletions src/Symfony/Bridge/Doctrine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ various Symfony components.
Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Bridge/Doctrine/
$ composer install
$ phpunit
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
9 changes: 4 additions & 5 deletions src/Symfony/Bridge/Monolog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Provides integration for Monolog with various Symfony components.
Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Bridge/Monolog/
$ composer install
$ phpunit
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
9 changes: 4 additions & 5 deletions src/Symfony/Bridge/Propel1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ Provides integration for Propel with various Symfony components.
Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Bridge/Propel1/
$ composer install
$ phpunit
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
9 changes: 4 additions & 5 deletions src/Symfony/Bridge/ProxyManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ Provides integration for [ProxyManager][1] with various Symfony components.
Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Bridge/ProxyManager/
$ composer install
$ phpunit
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

[1]: https://github.com/Ocramius/ProxyManager
10 changes: 4 additions & 6 deletions src/Symfony/Bridge/Twig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ Symfony components.
Resources
---------

If you want to run the unit tests, install dev dependencies before
running PHPUnit:

$ cd path/to/Symfony/Bridge/Twig/
$ composer install
$ phpunit
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
23 changes: 7 additions & 16 deletions src/Symfony/Component/BrowserKit/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
BrowserKit Component
====================

BrowserKit simulates the behavior of a web browser.

The component only provides an abstract client and does not provide any
"default" backend for the HTTP layer.
The BrowserKit component simulates the behavior of a web browser, allowing you
to make requests, click on links and submit forms programmatically.

Resources
---------

For a simple implementation of a browser based on an HTTP layer, have a look
at [Goutte](https://github.com/FriendsOfPHP/Goutte).

For an implementation based on HttpKernelInterface, have a look at the
[Client](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Client.php)
provided by the HttpKernel component.

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/BrowserKit/
$ composer install
$ phpunit
* [Documentation](https://symfony.com/doc/current/components/browser_kit/introduction.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
85 changes: 7 additions & 78 deletions src/Symfony/Component/ClassLoader/README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,14 @@
ClassLoader Component
=====================

ClassLoader loads your project classes automatically if they follow some
standard PHP conventions.

The ClassLoader object is able to autoload classes that implement the PSR-0
standard or the PEAR naming convention.

First, register the autoloader:

```php
require_once __DIR__.'/src/Symfony/Component/ClassLoader/ClassLoader.php';

use Symfony\Component\ClassLoader\ClassLoader;

$loader = new ClassLoader();
$loader->register();
```

Then, register some namespaces with the `addPrefix()` method:

```php
$loader->addPrefix('Symfony', __DIR__.'/src');
$loader->addPrefix('Monolog', __DIR__.'/vendor/monolog/src');
```

The `addPrefix()` method takes a namespace prefix and a path where to
look for the classes as arguments.

You can also register a sub-namespaces:

```php
$loader->addPrefix('Doctrine\\Common', __DIR__.'/vendor/doctrine-common/lib');
```

The order of registration is significant and the first registered namespace
takes precedence over later registered one.

You can also register more than one path for a given namespace:

```php
$loader->addPrefix('Symfony', array(__DIR__.'/src', __DIR__.'/symfony/src'));
```

Alternatively, you can use the `addPrefixes()` method to register more
than one namespace at once:

```php
$loader->addPrefixes(array(
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
'Monolog' => __DIR__.'/vendor/monolog/src',
));
```

For better performance, you can use the APC class loader:

```php
require_once __DIR__.'/src/Symfony/Component/ClassLoader/ClassLoader.php';
require_once __DIR__.'/src/Symfony/Component/ClassLoader/ApcClassLoader.php';

use Symfony\Component\ClassLoader\ClassLoader;
use Symfony\Component\ClassLoader\ApcClassLoader;

$loader = new ClassLoader();
$loader->addPrefix('Symfony', __DIR__.'/src');

$loader = new ApcClassLoader('apc.prefix.', $loader);
$loader->register();
```

Furthermore, the component provides tools to aggregate classes into a single
file, which is especially useful to improve performance on servers that do not
provide byte caches.
The ClassLoader component provides tools to autoload your classes and cache
their locations for performance.

Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/ClassLoader/
$ composer install
$ phpunit
* [Documentation](https://symfony.com/doc/current/components/class_loader/index.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
18 changes: 8 additions & 10 deletions src/Symfony/Component/Config/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
Config Component
================

Config provides the infrastructure for loading configurations from different
data sources and optionally monitoring these data sources for changes. There
are additional tools for validating, normalizing and handling of defaults that
can optionally be used to convert from different formats to arrays.
The Config component provides several classes to help you find, load, combine,
autofill and validate configuration values of any kind, whatever their source
may be (YAML, XML, INI files, or for instance a database).

Resources
---------

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/Config/
$ composer install
$ phpunit

* [Documentation](https://symfony.com/doc/current/components/config/index.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)
69 changes: 11 additions & 58 deletions src/Symfony/Component/Console/README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,20 @@
Console Component
=================

Console eases the creation of beautiful and testable command line interfaces.
The Console component eases the creation of beautiful and testable command line
interfaces.

The Application object manages the CLI application:

```php
use Symfony\Component\Console\Application;

$console = new Application();
$console->run();
```

The ``run()`` method parses the arguments and options passed on the command
line and executes the right command.

Registering a new command can easily be done via the ``register()`` method,
which returns a ``Command`` instance:

```php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

$console
->register('ls')
->setDefinition(array(
new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'),
))
->setDescription('Displays the files in the given directory')
->setCode(function (InputInterface $input, OutputInterface $output) {
$dir = $input->getArgument('dir');

$output->writeln(sprintf('Dir listing for <info>%s</info>', $dir));
})
;
```

You can also register new commands via classes.

The component provides a lot of features like output coloring, input and
output abstractions (so that you can easily unit-test your commands),
validation, automatic help messages, ...

Tests
-----

You can run the unit tests with the following command:
Resources
---------

$ cd path/to/Symfony/Component/Console/
$ composer install
$ phpunit
* [Documentation](https://symfony.com/doc/current/components/console/index.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

Third Party
-----------
Credits
-------

`Resources/bin/hiddeninput.exe` is a third party binary provided within this
component. Find sources and license at https://github.com/Seldaek/hidden-input.

Resources
---------

[The Console Component](https://symfony.com/doc/current/components/console.html)

[How to create a Console Command](https://symfony.com/doc/current/cookbook/console/console_command.html)
47 changes: 10 additions & 37 deletions src/Symfony/Component/CssSelector/README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,20 @@
CssSelector Component
=====================

CssSelector converts CSS selectors to XPath expressions.

The component only goal is to convert CSS selectors to their XPath
equivalents:

```php
use Symfony\Component\CssSelector\CssSelector;

print CssSelector::toXPath('div.item > h4 > a');
```

HTML and XML are different
--------------------------

The `CssSelector` component comes with an `HTML` extension which is enabled by
default. If you need to use this component with `XML` documents, you have to
disable this `HTML` extension. That's because, `HTML` tag & attribute names
are always lower-cased, but case-sensitive in `XML`:

```php
// disable `HTML` extension:
CssSelector::disableHtmlExtension();

// re-enable `HTML` extension:
CssSelector::enableHtmlExtension();
```

When the `HTML` extension is enabled, tag names are lower-cased, attribute
names are lower-cased, the following extra pseudo-classes are supported:
`checked`, `link`, `disabled`, `enabled`, `selected`, `invalid`, `hover`,
`visited`, and the `lang()` function is also added.
The CssSelector component converts CSS selectors to XPath expressions.

Resources
---------

* [Documentation](https://symfony.com/doc/current/components/css_selector.html)
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)

Credits
-------

This component is a port of the Python cssselect library
[v0.7.1](https://github.com/SimonSapin/cssselect/releases/tag/v0.7.1),
which is distributed under the BSD license.

You can run the unit tests with the following command:

$ cd path/to/Symfony/Component/CssSelector/
$ composer install
$ phpunit
Loading