Permalink
Browse files

rm sf classloader, recommend composer, test against 5.4

  • Loading branch information...
1 parent de6425f commit e209fc586b8709d35303ba1fee32d7e6ef7ece4e @igorw committed Jan 1, 2012
Showing with 80 additions and 23 deletions.
  1. +2 −0 .gitignore
  2. +0 −3 .gitmodules
  3. +9 −2 .travis.yml
  4. +48 −8 README.md
  5. +21 −9 tests/bootstrap.php
  6. +0 −1 vendor/symfony/Component/ClassLoader
View
@@ -0,0 +1,2 @@
+composer.lock
+vendor
View
@@ -1,3 +0,0 @@
-[submodule "vendor/symfony/Component/ClassLoader"]
- path = vendor/symfony/Component/ClassLoader
- url = https://github.com/symfony/ClassLoader.git
View
@@ -1,4 +1,11 @@
language: php
-php: 5.3.8
-before_script: git submodule update --init
+
+php:
+ - 5.3
+ - 5.4
+
+before_script:
+ - wget http://getcomposer.org/composer.phar
+ - php composer.phar install
+
script: phpunit
View
@@ -1,5 +1,4 @@
-Événement
-=========
+# Événement
Événement is a very simple event dispatching library for PHP 5.3.
@@ -12,17 +11,43 @@ It is very strongly inspired by the EventEmitter API found in
[![Build Status](https://secure.travis-ci.org/igorw/evenement.png)](http://travis-ci.org/igorw/evenement)
-Creating an Emitter
--------------------
+## Fetch
+
+The recommended way to install Événement is [through composer](http://packagist.org).
+
+Just create a composer.json file for your project:
+
+```JSON
+{
+ "require": {
+ "evenement/evenement": "*"
+ }
+}
+```
+
+And run these two commands to install it:
+
+ $ wget http://getcomposer.org/composer.phar
+ $ php composer.phar install
+
+Now you can add the autoloader, and you will have access to the library:
+
+```php
+<?php
+require 'vendor/.composer/autoload.php';
+```
+
+## Usage
+
+### Creating an Emitter
```php
<?php
require __DIR__.'/vendor/evenement/src/Evenement/EventEmitter.php';
$emitter = new Evenement\EventEmitter();
```
-Adding Listeners
-----------------
+### Adding Listeners
```php
<?php
@@ -31,10 +56,25 @@ $emitter->on('user.create', function (User $user) use ($logger) {
});
```
-Emitting Events
----------------
+### Emitting Events
```php
<?php
$emitter->emit('user.create', array($user));
```
+
+Tests
+-----
+
+Before running the tests you need to have composer set up an autoloader:
+
+ $ wget http://getcomposer.org/composer.phar
+ $ php composer.phar install
+
+Now you can run the unit tests.
+
+ $ phpunit
+
+License
+-------
+MIT, see LICENSE.
View
@@ -1,17 +1,29 @@
<?php
/*
- * This file is part of the Silex framework.
+ * This file is part of Evenement.
*
- * (c) Fabien Potencier <fabien@symfony.com>
+ * Copyright (c) 2011 Igor Wiedler
*
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
+ * 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.
*/
-require_once __DIR__.'/../vendor/symfony/Component/ClassLoader/UniversalClassLoader.php';
-
-$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
-$loader->registerNamespace('Evenement', __DIR__.'/../src');
-$loader->registerNamespace('Evenement\Tests', __DIR__);
+$loader = require __DIR__.'/../vendor/.composer/autoload.php';
+$loader->add('Evenement\Tests', __DIR__);
$loader->register();
Submodule ClassLoader deleted from 33066c

0 comments on commit e209fc5

Please sign in to comment.