Skip to content

Commit 6eb14e2

Browse files
authored
Merge pull request #10 from activecollab/v1.0
V1.0
2 parents 51d24f3 + c256d63 commit 6eb14e2

File tree

73 files changed

+3535
-1008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3535
-1008
lines changed

.php_cs.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
'-print_to_echo',
4848
'-concat_without_spaces',
4949
'-empty_return',
50-
])->finder((new Symfony\CS\Finder\DefaultFinder())->in([__DIR__ . '/src']));
50+
])->finder((new Symfony\CS\Finder\DefaultFinder())->in([__DIR__ . '/src', __DIR__ . '/test/src']));

.travis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: php
2+
php:
3+
- 7.1
4+
before_install:
5+
- composer self-update
6+
install: composer install --dev
7+
script: phpunit

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Controller
22

3+
[![Build Status](https://travis-ci.org/activecollab/controller.svg?branch=v1.0)](https://travis-ci.org/activecollab/controller)
4+
35
Supported action responses:
46

57
1. `\ActiveCollab\Controller\Response\FileDownloadResponse` - streams a file download.
@@ -19,6 +21,28 @@ All of these methods accept three parameters:
1921
2. `$param_name` (string)
2022
3. `$default` (mixed, `NULL` by default)
2123

24+
## Configuration
25+
26+
Controllers can override protected `configure()` method to do additional setup after controller construction. This method is separated from constructor, so developer does not need to inherit and manage complicated controller constructor.
27+
28+
```php
29+
<?php
30+
31+
namespace App;
32+
33+
use ActiveCollab\Controller\Controller;
34+
35+
class TestController extends Controller
36+
{
37+
public $is_configured = false;
38+
39+
protected function configure(): void
40+
{
41+
$this->is_configured = true;
42+
}
43+
}
44+
```
45+
2246
## Exception Handling
2347

2448
When action fails due to an exception, system will return 500 HTTP error, with a message that does not expose any of the system details.

composer.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
"type": "library",
99
"min-stability": "stable",
1010
"require": {
11-
"php": ">=5.6.0",
11+
"php": ">=7.1",
1212
"activecollab/containeraccess": "^1.0",
1313
"activecollab/etag": "^1.0",
1414
"activecollab/templateengine": "^1.0",
15+
"activecollab/utils": "^1.0",
1516
"psr/http-message": "^1.0",
1617
"psr/log": "~1.0"
1718
},
1819
"require-dev": {
1920
"friendsofphp/php-cs-fixer": "^1.0",
21+
"monolog/monolog": "^1.0",
22+
"pimple/pimple": "^3.0",
2023
"phpunit/phpunit": "^5.0",
21-
"slim/http": "^0.1.0"
24+
"slim/http": "0.1.0"
2225
},
2326
"suggest": {
2427
"slim/http": "Allow using of chunked file download"
@@ -27,5 +30,10 @@
2730
"psr-4": {
2831
"ActiveCollab\\Controller\\": "src"
2932
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"ActiveCollab\\Controller\\Test\\": "test/src"
37+
}
3038
}
3139
}

0 commit comments

Comments
 (0)