Permalink
Browse files

Added vendors as git submodules.

  • Loading branch information...
umpirsky committed Jul 20, 2011
1 parent 91dbdaf commit dd8a8eceffb8b585019f264c70a97b0833834952
Showing 2,997 changed files with 19 additions and 207,780 deletions.
View
@@ -0,0 +1,12 @@
+[submodule "vendor/Silex"]
+ path = vendor/Silex
+ url = https://github.com/fabpot/Silex.git
+[submodule "vendor/symfony"]
+ path = vendor/symfony
+ url = https://github.com/symfony/symfony.git
+[submodule "vendor/Twig"]
+ path = vendor/Twig
+ url = https://github.com/fabpot/Twig.git
+[submodule "vendor/swiftmailer"]
+ path = vendor/swiftmailer
+ url = https://github.com/swiftmailer/swiftmailer.git
View
@@ -6,7 +6,7 @@
* (c) Saša Stamenković <umpirsky@gmail.com>
*/
-include __DIR__ . '/../vendor/silex/autoload.php';
+include __DIR__ . '/../vendor/Silex/autoload.php';
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -17,7 +17,7 @@
// Register extensions
$app->register(new Silex\Extension\TwigExtension(), array(
'twig.path' => __DIR__ . '/../views',
- 'twig.class_path' => __DIR__ . '/../vendor/twig/lib',
+ 'twig.class_path' => __DIR__ . '/../vendor/Twig/lib',
));
$app->register(new Silex\Extension\UrlGeneratorExtension());
@@ -103,4 +103,4 @@ function (\Exception $e) use ($app) {
// Run
-$app->run();
+$app->run();
Submodule Silex added at b6dca0
Submodule Twig added at e44ea9
View
Binary file not shown.
View
@@ -1,19 +0,0 @@
-Copyright (c) 2010 Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
@@ -1,38 +0,0 @@
-Silex, a simple Web Framework
-=============================
-
-Silex is a simple web framework to develop simple websites based on
-[Symfony2][1] components:
-
-
-```php
-<?php
-require_once __DIR__.'/silex.phar';
-
-$app = new Silex\Application();
-
-$app->get('/hello/{name}', function ($name) use ($app) {
- return 'Hello '.$app->escape($name);
-});
-
-$app->run();
-```
-
-Silex works with PHP 5.3.2 or later.
-
-## Installation
-
-Installing Silex is as easy as it can get. Download the [`silex.phar`][2] file
-and you're done!
-
-## More Information
-
-Read the [documentation][3] for more information.
-
-## License
-
-Silex is licensed under the MIT license.
-
-[1]: http://symfony.com
-[2]: http://silex-project.org/get/silex.phar
-[3]: http://silex-project.org/documentation
View
@@ -1,17 +0,0 @@
-<?php
-
-if (false === class_exists('Symfony\Component\ClassLoader\UniversalClassLoader', false)) {
- require_once __DIR__.'/../../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-}
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array(
- 'Symfony' => __DIR__.'/../../vendor/symfony/src',
- 'Silex' => __DIR__.'/src',
-));
-$loader->registerPrefixes(array(
- 'Pimple' => __DIR__.'/vendor/pimple/lib',
-));
-$loader->register();
View
@@ -1,9 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-require_once __DIR__.'/autoload.php';
-
-use Silex\Compiler;
-
-$compiler = new Compiler();
-$compiler->compile();
View
@@ -1,17 +0,0 @@
-import sys, os
-from sphinx.highlighting import lexers
-from pygments.lexers.web import PhpLexer
-
-sys.path.append(os.path.abspath('_exts'))
-
-extensions = []
-master_doc = 'index'
-highlight_language = 'php'
-
-project = u'Silex'
-copyright = u'2010 Fabien Potencier'
-
-version = '0'
-release = '0.0.0'
-
-lexers['php'] = PhpLexer(startinline=True)
@@ -1,24 +0,0 @@
-Contributing
-============
-
-We are open to contributions to the Silex code. If you find
-a bug or want to contribute an extension, just follow these
-steps.
-
-* Fork `the Silex repository <https://github.com/fabpot/Silex>`_
- on github.
-
-* Make your feature addition or bug fix.
-
-* Add tests for it. This is important so we don't break it in a future version unintentionally.
-
-* Send a pull request. Bonus points for topic branches.
-
-If you have a big change or would like to discuss something,
-please join us on the `mailing list
-<http://groups.google.com/group/silex-php>`_.
-
-.. note::
-
- Any code you contribute must be licensed under the MIT
- License.
@@ -1,172 +0,0 @@
-Extensions
-==========
-
-Silex provides a common interface for extensions. These
-define services on the application.
-
-Loading extensions
-------------------
-
-In order to load and use an extension, you must register it
-on the application. ::
-
- $app = new Silex\Application();
-
- $app->register(new Acme\DatabaseExtension());
-
-You can also provide some parameters as a second argument. These
-will be set **before** the extension is registered.
-
-::
-
- $app->register(new Acme\DatabaseExtension(), array(
- 'database.dsn' => 'mysql:host=localhost;dbname=myapp',
- 'database.user' => 'root',
- 'database.password' => 'secret_root_password',
- ));
-
-Conventions
------------
-
-You need to watch out in what order you do certain things when
-interacting with extensions. Just keep to these rules:
-
-* Class paths (for the autoloader) must be defined **before**
- the extension is registered. Passing it as a second argument
- to ``Application::register`` qualifies too, because it sets
- the passed parameters first.
-
- *Reason: The extension will set up the autoloader at
- extension register time. If the class path is not set
- at that point, no autoloader can be registered.*
-
-* Overriding existing services must occur **after** the
- extension is registered.
-
- *Reason: If the services already exist, the extension
- will overwrite it.*
-
-* You can set parameters any time before the service is
- accessed.
-
-Make sure to stick to this behavior when creating your
-own extensions.
-
-Included extensions
--------------------
-
-There are a few extensions that you get out of the box.
-All of these are within the ``Silex\Extension`` namespace.
-
-* :doc:`DoctrineExtension <extensions/doctrine>`
-* :doc:`MonologExtension <extensions/monolog>`
-* :doc:`SessionExtension <extensions/session>`
-* :doc:`TwigExtension <extensions/twig>`
-* :doc:`TranslationExtension <extensions/translation>`
-* :doc:`UrlGeneratorExtension <extensions/url_generator>`
-* :doc:`ValidatorExtension <extensions/validator>`
-* :doc:`HttpCacheExtension <extensions/http_cache>`
-
-Creating an extension
----------------------
-
-Extensions must implement the ``Silex\ExtensionInterface``.
-
-::
-
- interface ExtensionInterface
- {
- function register(Application $app);
- }
-
-This is very straight forward, just create a new class that
-implements the ``register`` method. In this method you must
-define services on the application which then may make use
-of other services and parameters.
-
-Here is an example of such an extension::
-
- namespace Acme;
-
- use Silex\Application;
- use Silex\ExtensionInterface;
-
- class HelloExtension implements ExtensionInterface
- {
- public function register(Application $app)
- {
- $app['hello'] = $app->protect(function ($name) use ($app) {
- $default = $app['hello.default_name'] ? $app['hello.default_name'] : '';
- $name = $name ?: $default;
-
- return 'Hello '.$app->escape($name);
- });
- }
- }
-
-This class provides a ``hello`` service which is a protected
-closure. It takes a name argument and will return
-``hello.default_name`` if no name is given. If the default
-is also missing, it will use an empty string.
-
-You can now use this extension as follows::
-
- $app = new Silex\Application();
-
- $app->register(new Acme\HelloExtension(), array(
- 'hello.default_name' => 'Igor',
- ));
-
- $app->get('/hello', function () use ($app) {
- $name = $app['request']->get('name');
-
- return $app['hello']($name);
- });
-
-In this example we are getting the ``name`` parameter from the
-query string, so the request path would have to be ``/hello?name=Fabien``.
-
-Class loading
-~~~~~~~~~~~~~
-
-Extensions are great for tying in external libraries as you
-can see by looking at the ``MonologExtension`` and
-``TwigExtension``. If the library is decent and follows the
-`PSR-0 Naming Standard <http://groups.google.com/group/php-standards/web/psr-0-final-proposal>`_
-or the PEAR Naming Convention, it is possible to autoload
-classes using the ``UniversalClassLoader``.
-
-As described in the *Services* chapter, there is an
-*autoloader* service which can be used for this.
-
-Here is an example of how to use it (based on `Buzz <https://github.com/kriswallsmith/Buzz>`_)::
-
- namespace Acme;
-
- use Silex\Application;
- use Silex\ExtensionInterface;
-
- class BuzzExtension implements ExtensionInterface
- {
- public function register(Application $app)
- {
- $app['buzz'] = $app->share(function () { ... });
-
- if (isset($app['buzz.class_path'])) {
- $app['autoloader']->registerNamespace('Buzz', $app['buzz.class_path']);
- }
- }
- }
-
-This allows you to simply provide the class path as an
-option when registering the extension::
-
- $app->register(new BuzzExtension(), array(
- 'buzz.class_path' => __DIR__.'/vendor/buzz/lib',
- ));
-
-.. note::
-
- For libraries that do not use PHP 5.3 namespaces you can use ``registerPrefix``
- instead of ``registerNamespace``, which will use an underscore as directory
- delimiter.
Oops, something went wrong.

0 comments on commit dd8a8ec

Please sign in to comment.