Skip to content

Commit 377cac9

Browse files
authored
Merge pull request #5 from PHP-DI/v0.3
v0.3: replacing Puli with Composer Locator
2 parents e77adf3 + 434fe25 commit 377cac9

File tree

12 files changed

+102
-408
lines changed

12 files changed

+102
-408
lines changed

.coveralls.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/vendor/
22
/composer.lock
3-
/.puli/

.travis.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
language: php
22

33
php:
4-
- 5.5
5-
- 5.6
64
- 7.0
75
- 7.1
8-
- hhvm
96

107
matrix:
118
include:
12-
- php: 5.5
9+
- php: 7.0
1310
env: dependencies=lowest
1411

1512
before_script:
16-
- composer selfupdate -n
17-
- if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then composer require satooshi/php-coveralls:dev-master -n ; fi
18-
- if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then composer install -n ; fi
13+
- composer install -n
1914
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable -n; fi;
2015

2116
script:
22-
- if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
23-
- if [[ "$TRAVIS_PHP_VERSION" != '5.6' ]]; then vendor/bin/phpunit ; fi
24-
25-
after_script:
26-
- if [[ "$TRAVIS_PHP_VERSION" == '5.6' ]]; then php vendor/bin/coveralls -v ; fi
17+
- vendor/bin/phpunit

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
# PHP-DI application kernel
22

3-
Kernel for applications built with [PHP-DI](http://php-di.org) and [Puli](http://puli.io) with built-in support for PHP-DI modules.
3+
Kernel for building modules with [PHP-DI](http://php-di.org) and [Composer-Locator](https://github.com/mindplay-dk/composer-locator).
44

55
[![Build Status](https://img.shields.io/travis/PHP-DI/Kernel.svg?style=flat-square)](https://travis-ci.org/PHP-DI/Kernel)
66
[![Coverage Status](https://img.shields.io/coveralls/PHP-DI/Kernel/master.svg?style=flat-square)](https://coveralls.io/r/PHP-DI/Kernel?branch=master)
77

88
## Introduction
99

10-
TODO
10+
The Kernel let's you build an application based on PHP-DI modules.
1111

1212
## Installation
1313

1414
```
1515
composer require php-di/kernel
1616
```
1717

18-
Requirements:
19-
20-
- PHP 5.5 or greater
21-
- [Puli CLI tool](http://docs.puli.io/en/latest/installation.html#installing-the-puli-cli)
22-
2318
## Usage
2419

2520
The kernel's role is to create the container. It does so by registering all the configuration files of the modules we ask it to load:
2621

2722
```php
2823
$kernel = new Kernel([
29-
'twig',
30-
'doctrine',
31-
'app',
24+
'twig/twig',
25+
'doctrine/dbal',
26+
'vendor/app',
3227
]);
3328

3429
$container = $kernel->createContainer();
@@ -55,15 +50,14 @@ To install a 3rd party module:
5550

5651
```php
5752
$kernel = new Kernel([
58-
'twig',
53+
'twig/twig',
5954
]);
6055
```
6156

6257
### Creating a module
6358

64-
1. choose a module name, usually `app` when writing an application, or anything else when writing a reusable module
59+
1. the Composer package name is the module name
6560
1. create a resource directory in your package, usually `res/`
66-
1. map it with Puli, for example `puli map /app res`
6761
1. create as many PHP-DI configuration files as needed in `res/config/`
6862

6963
That's it. Here is what your package should look like:
@@ -76,18 +70,17 @@ res/
7670
src/
7771
...
7872
composer.json
79-
puli.json
8073
```
8174
8275
When the module is registered in the kernel like this:
8376
8477
```php
8578
$kernel = new Kernel([
86-
'app',
79+
'foo/bar',
8780
]);
8881
```
8982

90-
all the files matching the Puli path `/blogpress/config/*.php` (i.e. `vendor/johndoe/blogpress/res/config/*.php` on the filesystem) will be loaded.
83+
all the files in `vendor/foo/bar/res/config/*.php` will be loaded.
9184

9285
### Environments
9386

composer.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@
1616
}
1717
},
1818
"require": {
19-
"php": "^5.5|^7.0",
20-
"php-di/php-di": "^5.2",
21-
"doctrine/cache": "^1.4",
22-
"puli/repository": "^1.0.0-beta8",
23-
"puli/discovery": "^1.0.0-beta8",
24-
"puli/composer-plugin": "^1.0.0-beta8"
19+
"php": "^7.0",
20+
"php-di/php-di": "^5.4",
21+
"doctrine/cache": "^1.6",
22+
"mindplay/composer-locator": "^2.1.1"
2523
},
2624
"require-dev": {
27-
"phpunit/phpunit": "^4.8",
28-
"puli/cli": "^1.0"
29-
},
30-
"minimum-stability": "beta",
31-
"prefer-stable": true
25+
"phpunit/phpunit": "^5.7"
26+
}
3227
}

puli.json

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)