Skip to content

Commit

Permalink
The extension is now autoloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jubianchi committed Sep 27, 2016
1 parent 2c61716 commit 5c987f9
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 24 deletions.
7 changes: 0 additions & 7 deletions .atoum.php

This file was deleted.

8 changes: 0 additions & 8 deletions .bootstrap.atoum.php

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# `dev-master`

* []() The extension is now autoloaded ([@jubianchi])

# 1.0.1 - 2015-02-21

* Fixed autoloader
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,22 @@ Install extension using [composer](https://getcomposer.org):
```json
{
"require-dev": {
"atoum/visibility-extension": "~1.0"
"atoum/visibility-extension": "~2.0"
},
}

```

Enable the extension using atoum configuration file:
The extension will be automatically loaded. If you ever want to unload it, you can add this to your configuration file:

```php
<?php

// .atoum.php

require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

use mageekguy\atoum\visibility;

$extension = new visibility\extension($script);

$extension->addToRunner($runner);
$runner->removeExtension(visibility\extension::class);
```

## Use it
Expand Down
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@
"email": "[email protected]"
}
],
"repositories": [
{
"type": "vcs",
"url": "/Users/julien.bianchi/repositories/atoum/atoum"
}
],
"require-dev": {
"atoum/atoum": "<3.0"
"atoum/atoum": "dev-runner-auto-conf@dev"
},
"autoload": {
"psr-4": {
"mageekguy\\atoum\\visibility\\": "classes"
},
"files": ["autoloader.php"]
"files": [
"autoloader.php",
"configuration.php"
]
}
}
12 changes: 12 additions & 0 deletions configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use mageekguy\atoum;
use mageekguy\atoum\scripts;

if (defined('mageekguy\atoum\scripts\runner') === true) {
scripts\runner::addConfigurationCallable(function(atoum\configurator $script, atoum\runner $runner) {
$extension = new atoum\visibility\extension($script);

$extension->addToRunner($runner);
});
}

0 comments on commit 5c987f9

Please sign in to comment.