├── .gitignore
├── src
├── Exception
│ ├── Exception.php
│ ├── FilterException.php
│ └── ResourceException.php
├── Contract
│ ├── FilterInterface.php
│ └── ResourceInterface.php
├── Resource
│ ├── UnknownResource.php
│ ├── NullResource.php
│ ├── NumericResource.php
│ ├── BooleanResource.php
│ ├── AbstractResource.php
│ ├── JsonResource.php
│ ├── Resource.php
│ └── ArrayResource.php
├── env.php
├── Filter
│ ├── ValueRegexFilter.php
│ └── KeyRegexFilter.php
├── Environment.php
└── EnvironmentVariable.php
├── test
├── Resource
│ ├── AbstractResourceTest.php
│ ├── ResourceInterfaceTest.php
│ ├── UnknownResourceTest.php
│ ├── NullResourceTest.php
│ ├── BooleanResourceTest.php
│ ├── NumericResourceTest.php
│ ├── JsonResourceTest.php
│ └── ArrayResourceTest.php
├── Filter
│ ├── KeyRegexFilterTest.php
│ └── ValueRegexFilterTest.php
├── EnvTest.php
├── EnvFunctionTest.php
├── EnvironmentTest.php
└── EnvironmentTestCase.php
├── .codeclimate.yml
├── .travis.yml
├── phpunit.xml.dist
├── composer.json
├── LICENSE
├── README.md
└── composer.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | composer.phar
2 | /vendor
3 | /build
4 | *.lock
5 | !composer.lock
6 |
--------------------------------------------------------------------------------
/src/Exception/Exception.php:
--------------------------------------------------------------------------------
1 | getResource();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/env.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->implementsInterface(
14 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
15 | ));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.codeclimate.yml:
--------------------------------------------------------------------------------
1 | languages:
2 | PHP: true
3 | engines:
4 | duplication:
5 | enabled: true
6 | config:
7 | languages:
8 | - php
9 | fixme:
10 | enabled: true
11 | phpcodesniffer:
12 | enabled: true
13 | phpmd:
14 | enabled: true
15 | ratings:
16 | paths:
17 | - src/**/*.php
18 | exclude_paths:
19 | - build/
20 | - test/
21 | - vendor/
22 | - .codeclimate.yml
23 | - .gitignore
24 | - .travis.yml
25 | - composer.json
26 | - composer.lock
27 | - LICENCE.md
28 | - phpunit.xml.dist
29 | - README.md
30 |
--------------------------------------------------------------------------------
/src/Contract/ResourceInterface.php:
--------------------------------------------------------------------------------
1 | regex;
16 |
17 | $callback = function ($value) use ($regex) {
18 | if (is_string($value)) {
19 | return preg_match($regex, $value);
20 | }
21 | };
22 |
23 | return array_filter($data, $callback);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Resource/NullResource.php:
--------------------------------------------------------------------------------
1 | getResource());
17 |
18 | if ($resource !== 'null') {
19 | throw new ResourceException('The resource type is not a null value.');
20 | }
21 |
22 | return null;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Resource/NumericResource.php:
--------------------------------------------------------------------------------
1 | getResource();
17 |
18 | if (!is_numeric($resource)) {
19 | throw new ResourceException('The resource type is not a numeric value.');
20 | }
21 |
22 | return $resource + 0;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Resource/BooleanResource.php:
--------------------------------------------------------------------------------
1 | getResource()),
18 | FILTER_VALIDATE_BOOLEAN,
19 | FILTER_NULL_ON_FAILURE
20 | );
21 |
22 | if (is_null($resource)) {
23 | throw new ResourceException('The resource type is not a boolean value.');
24 | }
25 |
26 | return $resource;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/test/Resource/ResourceInterfaceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isInterface());
14 | }
15 |
16 | public function testHasMethods()
17 | {
18 | $reflection = new \ReflectionClass(
19 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
20 | );
21 |
22 | $this->assertTrue($reflection->hasMethod('setResource'));
23 |
24 | $this->assertTrue($reflection->hasMethod('getResource'));
25 |
26 | $this->assertTrue($reflection->hasMethod('process'));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/test/Resource/UnknownResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
14 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
15 | ));
16 | }
17 |
18 | public function testImplementsResourceInterface()
19 | {
20 | $reflection = new \ReflectionClass(
21 | '\\Cekurte\\Environment\\Resource\\UnknownResource'
22 | );
23 |
24 | $this->assertTrue($reflection->implementsInterface(
25 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
26 | ));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | sudo: false
4 |
5 | php:
6 | - 5.4
7 | - 5.5
8 | - 5.6
9 | - 7.0
10 |
11 | matrix:
12 | fast_finish: true
13 |
14 | cache:
15 | directories:
16 | - $HOME/.composer/cache
17 |
18 | before_install:
19 | - composer self-update
20 | - composer require --dev codeclimate/php-test-reporter:dev-master
21 |
22 | install:
23 | - composer install --prefer-source --no-interaction --dev
24 |
25 | before_script:
26 | - mkdir -p build/logs
27 |
28 | script:
29 | - phpunit --configuration phpunit.xml.dist
30 |
31 | after_script:
32 | - wget https://scrutinizer-ci.com/ocular.phar
33 | - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then vendor/bin/test-reporter; fi;'
34 | - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;'
35 | - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi;'
36 |
--------------------------------------------------------------------------------
/src/Resource/AbstractResource.php:
--------------------------------------------------------------------------------
1 | setResource($resource);
21 | }
22 |
23 | /**
24 | * {@inheritdoc}
25 | */
26 | public function setResource($resource)
27 | {
28 | if (!is_string($resource)) {
29 | throw new ResourceException('The resource value must be a string.');
30 | }
31 |
32 | $this->resource = trim($resource);
33 |
34 | return $this;
35 | }
36 |
37 | /**
38 | * {@inheritdoc}
39 | */
40 | public function getResource()
41 | {
42 | return $this->resource;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ./test/Filter
7 | ./test/Resource
8 | ./test/EnvFunctionTest.php
9 | ./test/EnvironmentTest.php
10 | ./test/EnvTest.php
11 |
12 |
13 |
14 |
15 |
16 | ./src/
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cekurte/environment",
3 | "description": "A library to get the values from environment variables and process to php data types",
4 | "keywords": ["env", "environment", "config", "process", "variables", "data", "types"],
5 | "type": "library",
6 | "license": "MIT",
7 | "minimum-stability": "stable",
8 | "require": {
9 | "php": ">=5.4"
10 | },
11 | "require-dev": {
12 | "phpunit/phpunit": "^4.8",
13 | "cekurte/tdd": "^1.0.1",
14 | "sensiolabs/security-checker": "^3.0",
15 | "squizlabs/php_codesniffer": "^2.3"
16 | },
17 | "authors": [
18 | {
19 | "name": "João Paulo Cercal",
20 | "email": "jpcercal@gmail.com"
21 | }
22 | ],
23 | "autoload": {
24 | "psr-4": {
25 | "Cekurte\\Environment\\": "src/"
26 | },
27 | "files": [
28 | "src/env.php"
29 | ]
30 | },
31 | "autoload-dev": {
32 | "psr-4": {
33 | "Cekurte\\Environment\\Test\\": "test/"
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015 João Paulo Cercal
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/src/Resource/JsonResource.php:
--------------------------------------------------------------------------------
1 | getResource();
17 |
18 | if (!is_string($resource) ||
19 | !isset($resource[0]) ||
20 | $resource[0] !== '{' ||
21 | substr($resource, strlen($resource) - 1) !== '}') {
22 | throw new ResourceException('The resource type is not a json value.');
23 | }
24 |
25 | $resource = json_decode($resource, true);
26 |
27 | if (json_last_error() !== JSON_ERROR_NONE) {
28 | throw new ResourceException(sprintf(
29 | 'Error occurred while decoding the json string #%d',
30 | json_last_error()
31 | ));
32 | }
33 |
34 | return $resource;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/test/Filter/KeyRegexFilterTest.php:
--------------------------------------------------------------------------------
1 | assertEquals('/fake/', $this->propertyGetValue($key, 'regex'));
15 | }
16 |
17 | /**
18 | * @expectedException \Cekurte\Environment\Exception\FilterException
19 | */
20 | public function testConstructorFilterException()
21 | {
22 | new KeyRegexFilter('fake');
23 | }
24 |
25 | public function testFilter()
26 | {
27 | $data = [
28 | '_ENV_BOOLEAN_TRUE' => 'true',
29 | '_ENV_BOOLEAN_FALSE' => 'false',
30 | 'FAKE' => 'fake',
31 | ];
32 |
33 | $key = new KeyRegexFilter('/^_ENV/');
34 |
35 | $result = $key->filter($data);
36 |
37 | $this->assertTrue(count($result) === 2);
38 |
39 | $this->assertEquals('true', $result['_ENV_BOOLEAN_TRUE']);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/test/Resource/NullResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
16 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
17 | ));
18 | }
19 |
20 | public function testImplementsResourceInterface()
21 | {
22 | $reflection = new \ReflectionClass(
23 | '\\Cekurte\\Environment\\Resource\\NullResource'
24 | );
25 |
26 | $this->assertTrue($reflection->implementsInterface(
27 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
28 | ));
29 | }
30 |
31 | /**
32 | * @expectedException \Cekurte\Environment\Exception\ResourceException
33 | */
34 | public function testProcessRuntimeException()
35 | {
36 | (new NullResource('fake'))->process();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/test/Filter/ValueRegexFilterTest.php:
--------------------------------------------------------------------------------
1 | assertEquals('/fake/', $this->propertyGetValue($value, 'regex'));
15 | }
16 |
17 | /**
18 | * @expectedException \Cekurte\Environment\Exception\FilterException
19 | */
20 | public function testConstructorFilterException()
21 | {
22 | new ValueRegexFilter('fake');
23 | }
24 |
25 | public function testFilter()
26 | {
27 | $data = [
28 | '_ENV_BOOLEAN_TRUE' => 'true',
29 | '_ENV_BOOLEAN_FALSE' => 'false',
30 | 'FAKE' => 'fake',
31 | ];
32 |
33 | $value = new ValueRegexFilter('/^true$/');
34 |
35 | $result = $value->filter($data);
36 |
37 | $this->assertTrue(count($result) === 1);
38 |
39 | $this->assertEquals('true', $result['_ENV_BOOLEAN_TRUE']);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/test/Resource/BooleanResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
16 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
17 | ));
18 | }
19 |
20 | public function testImplementsResourceInterface()
21 | {
22 | $reflection = new \ReflectionClass(
23 | '\\Cekurte\\Environment\\Resource\\BooleanResource'
24 | );
25 |
26 | $this->assertTrue($reflection->implementsInterface(
27 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
28 | ));
29 | }
30 |
31 | /**
32 | * @expectedException \Cekurte\Environment\Exception\ResourceException
33 | */
34 | public function testProcessRuntimeException()
35 | {
36 | (new BooleanResource('fake'))->process();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/test/Resource/NumericResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
16 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
17 | ));
18 | }
19 |
20 | public function testImplementsResourceInterface()
21 | {
22 | $reflection = new \ReflectionClass(
23 | '\\Cekurte\\Environment\\Resource\\NumericResource'
24 | );
25 |
26 | $this->assertTrue($reflection->implementsInterface(
27 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
28 | ));
29 | }
30 |
31 | /**
32 | * @expectedException \Cekurte\Environment\Exception\ResourceException
33 | */
34 | public function testProcessRuntimeException()
35 | {
36 | (new NumericResource('fake'))->process();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/test/EnvTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($value, \Cekurte\Environment\env($key, $value));
29 | }
30 |
31 | public function testGetEnvIgnoringDefaultData()
32 | {
33 | $this->assertTrue(is_null(\Cekurte\Environment\env('FAKE_ENV_KEY_FUNCTION')));
34 |
35 | putenv('FAKE_ENV_KEY_FUNCTION=1');
36 |
37 | $this->assertTrue(is_int(\Cekurte\Environment\env('FAKE_ENV_KEY_FUNCTION', 2)));
38 |
39 | $this->assertEquals(1, \Cekurte\Environment\env('FAKE_ENV_KEY_FUNCTION', 2));
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Environment.php:
--------------------------------------------------------------------------------
1 | get($name, $defaultValue);
39 | }
40 |
41 | /**
42 | * Get all environment variables from $_ENV and $_SERVER.
43 | *
44 | * @static
45 | *
46 | * @param array $filters an array of filters or an empty array
47 | *
48 | * @throws \Cekurte\Environment\Exception\FilterException
49 | *
50 | * @return array
51 | */
52 | public static function getAll(array $filters = [])
53 | {
54 | return self::getInstance()->getAll($filters);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/Filter/KeyRegexFilter.php:
--------------------------------------------------------------------------------
1 | regex = $regex;
37 | }
38 |
39 | /**
40 | * {@inheritdoc}
41 | */
42 | public function filter($data)
43 | {
44 | $regex = $this->regex;
45 |
46 | $callback = function ($item, $key) use ($regex, &$data) {
47 | if (!preg_match($regex, $key)) {
48 | unset($data[$key]);
49 | }
50 | };
51 |
52 | array_walk($data, $callback);
53 |
54 | return $data;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/test/Resource/JsonResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
16 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
17 | ));
18 | }
19 |
20 | public function testImplementsResourceInterface()
21 | {
22 | $reflection = new \ReflectionClass(
23 | '\\Cekurte\\Environment\\Resource\\JsonResource'
24 | );
25 |
26 | $this->assertTrue($reflection->implementsInterface(
27 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
28 | ));
29 | }
30 |
31 | /**
32 | * @expectedException \Cekurte\Environment\Exception\ResourceException
33 | */
34 | public function testProcessRuntimeException()
35 | {
36 | (new JsonResource('fake'))->process();
37 | }
38 |
39 | /**
40 | * @expectedException \Cekurte\Environment\Exception\ResourceException
41 | */
42 | public function testProcessJsonErrorRuntimeException()
43 | {
44 | (new JsonResource('{["fake"]}'))->process();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Resource/Resource.php:
--------------------------------------------------------------------------------
1 | getResource();
16 | $rawResourceLower = strtolower($rawResource);
17 |
18 | $resource = new UnknownResource($rawResource);
19 |
20 | if (in_array($rawResourceLower, ['false', 'true', 'yes', 'no', 'on', 'off'])) {
21 | $resource = new BooleanResource($rawResource);
22 | } elseif ($rawResourceLower === 'null') {
23 | $resource = new NullResource($rawResource);
24 | } elseif (is_numeric($rawResource)) {
25 | $resource = new NumericResource($rawResource);
26 | } elseif (is_string($rawResource) && isset($rawResource[0])) {
27 | if ($rawResource[0] === '[' && substr($rawResource, strlen($rawResource) - 1) === ']') {
28 | $resource = new ArrayResource($rawResource);
29 | } elseif ($rawResource[0] === '{' && substr($rawResource, strlen($rawResource) - 1) === '}') {
30 | $resource = new JsonResource($rawResource);
31 | }
32 | }
33 |
34 | return $resource->process();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/EnvironmentVariable.php:
--------------------------------------------------------------------------------
1 | process();
59 | } catch (Exception $e) {
60 | // ...
61 | }
62 | }
63 |
64 | /**
65 | * Get value from environment.
66 | *
67 | * @param string $key
68 | * @param mixed $defaultValue
69 | *
70 | * @return mixed
71 | */
72 | public function get($key, $defaultValue = null)
73 | {
74 | $rawValue = $this->getEnvironmentVariable($key);
75 |
76 | return $this->getValue($rawValue, $defaultValue);
77 | }
78 |
79 | /**
80 | * Get all environment variables from $_ENV and $_SERVER.
81 | *
82 | * @param array $filters an array of filters or an empty array
83 | *
84 | * @throws \Cekurte\Environment\Exception\FilterException
85 | *
86 | * @return array
87 | */
88 | public function getAll(array $filters = [])
89 | {
90 | $vars = $this->getEnvironmentVariables();
91 |
92 | foreach ($filters as $filter) {
93 | if (!$filter instanceof FilterInterface) {
94 | throw new FilterException(sprintf(
95 | '%s %s %s',
96 | 'The $filters param must be an array',
97 | 'and your values must be an instance of',
98 | '\Cekurte\Environment\Contract\FilterInterface'
99 | ));
100 | }
101 |
102 | $vars = $filter->filter($vars);
103 | }
104 |
105 | $callback = function ($rawValue) {
106 | return $this->getValue($rawValue);
107 | };
108 |
109 | return array_map($callback, $vars);
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/src/Resource/ArrayResource.php:
--------------------------------------------------------------------------------
1 | removeChar($item, '[', ']');
102 |
103 | if ($this->itemIsSerialized($item)) {
104 | $data[] = unserialize($item);
105 | continue;
106 | }
107 |
108 | if (strpos($item, '=>') !== false) {
109 | $element = explode('=>', $item);
110 | $element[0] = trim($element[0]);
111 | $element[1] = trim($element[1]);
112 |
113 | $key = $this->removeChar($element[0], ['"', "'"], ['"', "'"]);
114 | $val = $this->removeChar($element[1], ['"', "'"], ['"', "'"]);
115 |
116 | $data[$key] = $val;
117 | } else {
118 | $data[] = $this->removeChar($item, ['"', "'"], ['"', "'"]);
119 | }
120 | }
121 |
122 | return $data;
123 | }
124 |
125 | /**
126 | * Parse a string that represents an array statement to create an array data.
127 | *
128 | * @param string $data
129 | *
130 | * @return array
131 | */
132 | protected function parseArray($data)
133 | {
134 | $pattern = '/(\[[^\[\]]*\])/';
135 |
136 | set_error_handler([__CLASS__, 'handleError']);
137 |
138 | while (true) {
139 | if (!preg_match($pattern, $data, $matches) > 0) {
140 | break;
141 | }
142 |
143 | $stringMatches = trim($matches[0]);
144 |
145 | $items = explode(',', $stringMatches);
146 |
147 | $currentData = $this->filterItems($items);
148 |
149 |
150 | $data = str_replace($stringMatches, serialize($currentData), $data);
151 | }
152 |
153 | $result = unserialize($data);
154 |
155 | restore_error_handler();
156 |
157 | return $result;
158 | }
159 |
160 | /**
161 | * {@inheritdoc}
162 | */
163 | public function process()
164 | {
165 | $resource = $this->getResource();
166 |
167 | if (!is_string($resource) ||
168 | !isset($resource[0]) ||
169 | $resource[0] !== '[' ||
170 | substr($resource, strlen($resource) - 1) !== ']') {
171 | throw new ResourceException('The resource type is not an array value.');
172 | }
173 |
174 | $data = $this->parseArray($resource);
175 |
176 | array_walk_recursive($data, function (&$item) {
177 | $item = (new Resource($item))->process();
178 | });
179 |
180 | return $data;
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/test/EnvFunctionTest.php:
--------------------------------------------------------------------------------
1 | assertNull(env($key));
18 | }
19 |
20 | /**
21 | * @dataProvider getDataProviderResourceTypeBooleanTrue
22 | */
23 | public function testGetBooleanTrue($key, $value)
24 | {
25 | putenv(sprintf('%s=%s', $key, $value));
26 |
27 | $this->assertTrue(env($key));
28 | }
29 |
30 | /**
31 | * @dataProvider getDataProviderResourceTypeBooleanYes
32 | */
33 | public function testGetBooleanYes($key, $value)
34 | {
35 | putenv(sprintf('%s=%s', $key, $value));
36 |
37 | $this->assertTrue(env($key));
38 | }
39 |
40 | /**
41 | * @dataProvider getDataProviderResourceTypeBooleanOn
42 | */
43 | public function testGetBooleanOn($key, $value)
44 | {
45 | putenv(sprintf('%s=%s', $key, $value));
46 |
47 | $this->assertTrue(env($key));
48 | }
49 |
50 | /**
51 | * @dataProvider getDataProviderResourceTypeBooleanFalse
52 | */
53 | public function testGetBooleanFalse($key, $value)
54 | {
55 | putenv(sprintf('%s=%s', $key, $value));
56 |
57 | $this->assertFalse(env($key));
58 | }
59 |
60 | /**
61 | * @dataProvider getDataProviderResourceTypeBooleanNo
62 | */
63 | public function testGetBooleanNo($key, $value)
64 | {
65 | putenv(sprintf('%s=%s', $key, $value));
66 |
67 | $this->assertFalse(env($key));
68 | }
69 |
70 | /**
71 | * @dataProvider getDataProviderResourceTypeBooleanOff
72 | */
73 | public function testGetBooleanOff($key, $value)
74 | {
75 | putenv(sprintf('%s=%s', $key, $value));
76 |
77 | $this->assertFalse(env($key));
78 | }
79 |
80 | /**
81 | * @dataProvider getDataProviderResourceTypeNumericInt
82 | */
83 | public function testGetNumericInt($key, $value)
84 | {
85 | putenv(sprintf('%s=%s', $key, $value));
86 |
87 | $this->assertTrue(is_int(env($key)));
88 | }
89 |
90 | /**
91 | * @dataProvider getDataProviderResourceTypeNumericFloat
92 | */
93 | public function testGetNumericFloat($key, $value)
94 | {
95 | putenv(sprintf('%s=%s', $key, $value));
96 |
97 | $this->assertTrue(is_float(env($key)));
98 | }
99 |
100 | /**
101 | * @dataProvider getDataProviderResourceTypeArray
102 | */
103 | public function testGetArray($key, $value)
104 | {
105 | putenv(sprintf('%s=%s', $key, $value));
106 |
107 | $this->assertTrue(is_array(env($key)));
108 | }
109 |
110 | /**
111 | * @dataProvider getDataProviderResourceTypeArrayMulti
112 | */
113 | public function testGetArrayMulti($key, $value)
114 | {
115 | putenv(sprintf('%s=%s', $key, $value));
116 |
117 | $this->assertTrue(is_array(env($key)));
118 | }
119 |
120 | /**
121 | * @dataProvider getDataProviderResourceTypeArrayMultiBoolean
122 | */
123 | public function testGetArrayMultiBoolean($key, $value)
124 | {
125 | putenv(sprintf('%s=%s', $key, $value));
126 |
127 | $data = env($key);
128 |
129 | foreach ($data[0] as $item) {
130 | $this->assertTrue(is_bool($item));
131 | }
132 | }
133 |
134 | /**
135 | * @dataProvider getDataProviderResourceTypeArrayMultiInt
136 | */
137 | public function testGetArrayMultiInt($key, $value)
138 | {
139 | putenv(sprintf('%s=%s', $key, $value));
140 |
141 | $data = env($key);
142 |
143 | foreach ($data[0] as $item) {
144 | $this->assertTrue(is_int($item));
145 | }
146 | }
147 |
148 | /**
149 | * @dataProvider getDataProviderResourceTypeArrayMultiFloat
150 | */
151 | public function testGetArrayMultiFloat($key, $value)
152 | {
153 | putenv(sprintf('%s=%s', $key, $value));
154 |
155 | $data = env($key);
156 |
157 | foreach ($data[0] as $item) {
158 | $this->assertTrue(is_float($item));
159 | }
160 | }
161 |
162 | /**
163 | * @dataProvider getDataProviderResourceTypeJson
164 | */
165 | public function testGetJson($key, $value)
166 | {
167 | putenv(sprintf('%s=%s', $key, $value));
168 |
169 | $this->assertTrue(is_array(env($key)));
170 | }
171 |
172 | /**
173 | * @dataProvider getDataProviderResourceTypeUnknown
174 | */
175 | public function testGetUnknown($key, $value)
176 | {
177 | putenv(sprintf('%s=%s', $key, $value));
178 |
179 | $this->assertEquals($value, env($key));
180 | }
181 |
182 | /**
183 | * @dataProvider getDataProviderResourceTypesReturnDefault
184 | */
185 | public function testGetEnvDefaultData($key, $value)
186 | {
187 | $this->assertEquals($value, env($key . 'ENVIRONMENT_FUNCTION_TEST', $value));
188 | }
189 |
190 | public function testGetEnvIgnoringDefaultData()
191 | {
192 | $this->assertTrue(is_null(env('ENVIRONMENT_FUNCTION_TEST')));
193 |
194 | putenv('ENVIRONMENT_FUNCTION_TEST=1');
195 |
196 | $this->assertTrue(is_int(env('ENVIRONMENT_FUNCTION_TEST', 2)));
197 |
198 | $this->assertEquals(1, env('ENVIRONMENT_FUNCTION_TEST', 2));
199 | }
200 |
201 | public function testGetEnvironmentVariable()
202 | {
203 | putenv('putenv=true');
204 | $this->assertEquals(true, env('putenv'));
205 |
206 | $_ENV['_ENV'] = 'true';
207 | $this->assertEquals(true, env('_ENV'));
208 |
209 | $_SERVER['_SERVER'] = 'true';
210 | $this->assertEquals(true, env('_SERVER'));
211 | }
212 | }
213 |
--------------------------------------------------------------------------------
/test/Resource/ArrayResourceTest.php:
--------------------------------------------------------------------------------
1 | assertTrue($reflection->isSubclassOf(
17 | '\\Cekurte\\Environment\\Resource\\AbstractResource'
18 | ));
19 | }
20 |
21 | public function testImplementsResourceInterface()
22 | {
23 | $reflection = new \ReflectionClass(
24 | '\\Cekurte\\Environment\\Resource\\ArrayResource'
25 | );
26 |
27 | $this->assertTrue($reflection->implementsInterface(
28 | '\\Cekurte\\Environment\\Contract\\ResourceInterface'
29 | ));
30 | }
31 |
32 | /**
33 | * @expectedException \Cekurte\Environment\Exception\ResourceException
34 | */
35 | public function testProcessRuntimeException()
36 | {
37 | (new ArrayResource('fake'))->process();
38 | }
39 |
40 | public function testRemoveChar()
41 | {
42 | $mock = $this
43 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
44 | ->disableOriginalConstructor()
45 | ->getMock()
46 | ;
47 |
48 | $this->assertEquals('[fake]', $this->invokeMethod($mock, 'removeChar', [
49 | '[fake]'
50 | ]));
51 |
52 | $this->assertEquals('fake]', $this->invokeMethod($mock, 'removeChar', [
53 | '[fake]', '['
54 | ]));
55 |
56 | $this->assertEquals('[fake', $this->invokeMethod($mock, 'removeChar', [
57 | '[fake]', null, ']'
58 | ]));
59 |
60 | $this->assertEquals('fake', $this->invokeMethod($mock, 'removeChar', [
61 | '[fake]', '[', ']'
62 | ]));
63 |
64 | $this->assertEquals('fake]', $this->invokeMethod($mock, 'removeChar', [
65 | '[fake]', ['[', 'other']
66 | ]));
67 |
68 | $this->assertEquals('[fake', $this->invokeMethod($mock, 'removeChar', [
69 | '[fake]', null, [']', 'other']
70 | ]));
71 |
72 | $this->assertEquals('fake', $this->invokeMethod($mock, 'removeChar', [
73 | '[fake]', ['other', '['], ['other', ']']
74 | ]));
75 | }
76 |
77 | /**
78 | * @expectedException \Cekurte\Environment\Exception\ResourceException
79 | * @expectedExceptionMessage 1: "message" in file on line 0
80 | */
81 | public function testHandleError()
82 | {
83 | $mock = $this
84 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
85 | ->disableOriginalConstructor()
86 | ->getMock()
87 | ;
88 |
89 | $this->invokeMethod($mock, 'handleError', [1, 'message', 'file', 0]);
90 | }
91 |
92 | public function testItemIsSerialized()
93 | {
94 | $mock = $this
95 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
96 | ->disableOriginalConstructor()
97 | ->getMock()
98 | ;
99 |
100 | $this->assertTrue($this->invokeMethod($mock, 'itemIsSerialized', [serialize(['fake'])]));
101 | $this->assertTrue($this->invokeMethod($mock, 'itemIsSerialized', [serialize('fake')]));
102 | $this->assertFalse($this->invokeMethod($mock, 'itemIsSerialized', [serialize(1)]));
103 | $this->assertFalse($this->invokeMethod($mock, 'itemIsSerialized', [' a:']));
104 | $this->assertFalse($this->invokeMethod($mock, 'itemIsSerialized', [' s:']));
105 | }
106 |
107 | public function testFilterItemsEmpty()
108 | {
109 | $mock = $this
110 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
111 | ->disableOriginalConstructor()
112 | ->getMock()
113 | ;
114 |
115 | $result = $this->invokeMethod($mock, 'filterItems', [[' ']]);
116 |
117 | $this->assertTrue(count($result) === 0);
118 | }
119 |
120 | public function testFilterItemsUnserialize()
121 | {
122 | $mock = $this
123 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
124 | ->disableOriginalConstructor()
125 | ->setMethods(['removeChar', 'itemIsSerialized'])
126 | ->getMock()
127 | ;
128 |
129 | $mock
130 | ->expects($this->once())
131 | ->method('removeChar')
132 | ->will($this->returnValue(serialize('fake')))
133 | ;
134 |
135 | $mock
136 | ->expects($this->once())
137 | ->method('itemIsSerialized')
138 | ->will($this->returnValue(true))
139 | ;
140 |
141 | $result = $this->invokeMethod($mock, 'filterItems', [[1]]);
142 |
143 | $this->assertEquals('fake', $result[0]);
144 | }
145 |
146 | public function testFilterItem()
147 | {
148 | $mock = $this
149 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
150 | ->disableOriginalConstructor()
151 | ->setMethods(['removeChar', 'itemIsSerialized'])
152 | ->getMock()
153 | ;
154 |
155 | $mock
156 | ->expects($this->exactly(2))
157 | ->method('removeChar')
158 | ->will($this->returnValue('123'))
159 | ;
160 |
161 | $mock
162 | ->expects($this->once())
163 | ->method('itemIsSerialized')
164 | ->will($this->returnValue(false))
165 | ;
166 |
167 | $result = $this->invokeMethod($mock, 'filterItems', [[1]]);
168 |
169 | $this->assertEquals('123', $result[0]);
170 | }
171 |
172 | public function testFilterItemWithKey()
173 | {
174 | $mock = $this
175 | ->getMockBuilder('\\Cekurte\\Environment\\Resource\\ArrayResource')
176 | ->disableOriginalConstructor()
177 | ->setMethods(['itemIsSerialized'])
178 | ->getMock()
179 | ;
180 |
181 | $mock
182 | ->expects($this->once())
183 | ->method('itemIsSerialized')
184 | ->will($this->returnValue(false))
185 | ;
186 |
187 | $result = $this->invokeMethod($mock, 'filterItems', [['"key" => "value"']]);
188 |
189 | $this->assertEquals('value', $result['key']);
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/test/EnvironmentTest.php:
--------------------------------------------------------------------------------
1 | assertNull(Environment::get($key));
20 | }
21 |
22 | /**
23 | * @dataProvider getDataProviderResourceTypeBooleanTrue
24 | */
25 | public function testGetBooleanTrue($key, $value)
26 | {
27 | putenv(sprintf('%s=%s', $key, $value));
28 |
29 | $this->assertTrue(Environment::get($key));
30 | }
31 |
32 | /**
33 | * @dataProvider getDataProviderResourceTypeBooleanYes
34 | */
35 | public function testGetBooleanYes($key, $value)
36 | {
37 | putenv(sprintf('%s=%s', $key, $value));
38 |
39 | $this->assertTrue(Environment::get($key));
40 | }
41 |
42 | /**
43 | * @dataProvider getDataProviderResourceTypeBooleanOn
44 | */
45 | public function testGetBooleanOn($key, $value)
46 | {
47 | putenv(sprintf('%s=%s', $key, $value));
48 |
49 | $this->assertTrue(Environment::get($key));
50 | }
51 |
52 | /**
53 | * @dataProvider getDataProviderResourceTypeBooleanFalse
54 | */
55 | public function testGetBooleanFalse($key, $value)
56 | {
57 | putenv(sprintf('%s=%s', $key, $value));
58 |
59 | $this->assertFalse(Environment::get($key));
60 | }
61 |
62 | /**
63 | * @dataProvider getDataProviderResourceTypeBooleanNo
64 | */
65 | public function testGetBooleanNo($key, $value)
66 | {
67 | putenv(sprintf('%s=%s', $key, $value));
68 |
69 | $this->assertFalse(Environment::get($key));
70 | }
71 |
72 | /**
73 | * @dataProvider getDataProviderResourceTypeBooleanOff
74 | */
75 | public function testGetBooleanOff($key, $value)
76 | {
77 | putenv(sprintf('%s=%s', $key, $value));
78 |
79 | $this->assertFalse(Environment::get($key));
80 | }
81 |
82 | /**
83 | * @dataProvider getDataProviderResourceTypeNumericInt
84 | */
85 | public function testGetNumericInt($key, $value)
86 | {
87 | putenv(sprintf('%s=%s', $key, $value));
88 |
89 | $this->assertTrue(is_int(Environment::get($key)));
90 | }
91 |
92 | /**
93 | * @dataProvider getDataProviderResourceTypeNumericFloat
94 | */
95 | public function testGetNumericFloat($key, $value)
96 | {
97 | putenv(sprintf('%s=%s', $key, $value));
98 |
99 | $this->assertTrue(is_float(Environment::get($key)));
100 | }
101 |
102 | /**
103 | * @dataProvider getDataProviderResourceTypeArray
104 | */
105 | public function testGetArray($key, $value)
106 | {
107 | putenv(sprintf('%s=%s', $key, $value));
108 |
109 | $this->assertTrue(is_array(Environment::get($key)));
110 | }
111 |
112 | /**
113 | * @dataProvider getDataProviderResourceTypeArrayMulti
114 | */
115 | public function testGetArrayMulti($key, $value)
116 | {
117 | putenv(sprintf('%s=%s', $key, $value));
118 |
119 | $this->assertTrue(is_array(Environment::get($key)));
120 | }
121 |
122 | /**
123 | * @dataProvider getDataProviderResourceTypeArrayMultiBoolean
124 | */
125 | public function testGetArrayMultiBoolean($key, $value)
126 | {
127 | putenv(sprintf('%s=%s', $key, $value));
128 |
129 | $data = Environment::get($key);
130 |
131 | foreach ($data[0] as $item) {
132 | $this->assertTrue(is_bool($item));
133 | }
134 | }
135 |
136 | /**
137 | * @dataProvider getDataProviderResourceTypeArrayMultiInt
138 | */
139 | public function testGetArrayMultiInt($key, $value)
140 | {
141 | putenv(sprintf('%s=%s', $key, $value));
142 |
143 | $data = Environment::get($key);
144 |
145 | foreach ($data[0] as $item) {
146 | $this->assertTrue(is_int($item));
147 | }
148 | }
149 |
150 | /**
151 | * @dataProvider getDataProviderResourceTypeArrayMultiFloat
152 | */
153 | public function testGetArrayMultiFloat($key, $value)
154 | {
155 | putenv(sprintf('%s=%s', $key, $value));
156 |
157 | $data = Environment::get($key);
158 |
159 | foreach ($data[0] as $item) {
160 | $this->assertTrue(is_float($item));
161 | }
162 | }
163 |
164 | /**
165 | * @dataProvider getDataProviderResourceTypeJson
166 | */
167 | public function testGetJson($key, $value)
168 | {
169 | putenv(sprintf('%s=%s', $key, $value));
170 |
171 | $this->assertTrue(is_array(Environment::get($key)));
172 | }
173 |
174 | /**
175 | * @dataProvider getDataProviderResourceTypeUnknown
176 | */
177 | public function testGetUnknown($key, $value)
178 | {
179 | putenv(sprintf('%s=%s', $key, $value));
180 |
181 | $this->assertEquals($value, Environment::get($key));
182 | }
183 |
184 | /**
185 | * @dataProvider getDataProviderResourceTypesReturnDefault
186 | */
187 | public function testGetEnvDefaultData($key, $value)
188 | {
189 | $this->assertEquals($value, Environment::get($key . 'ENVIRONMENT_TEST', $value));
190 | }
191 |
192 | public function testGetEnvIgnoringDefaultData()
193 | {
194 | $this->assertTrue(is_null(Environment::get('ENVIRONMENT_TEST')));
195 |
196 | putenv('ENVIRONMENT_TEST=1');
197 |
198 | $this->assertTrue(is_int(Environment::get('ENVIRONMENT_TEST', 2)));
199 |
200 | $this->assertEquals(1, Environment::get('ENVIRONMENT_TEST', 2));
201 | }
202 |
203 | public function testGetEnvironmentVariable()
204 | {
205 | putenv('putenv=true');
206 | $this->assertEquals(true, Environment::get('putenv'));
207 |
208 | $_ENV['_ENV'] = 'true';
209 | $this->assertEquals(true, Environment::get('_ENV'));
210 |
211 | $_SERVER['_SERVER'] = 'true';
212 | $this->assertEquals(true, Environment::get('_SERVER'));
213 | }
214 |
215 | public function testGetAll()
216 | {
217 | $_ENV['_ENV'] = 'true';
218 | $_SERVER['_SERVER'] = 'true';
219 |
220 | $this->assertTrue(is_array(Environment::getAll()));
221 | }
222 |
223 | public function testGetAllWithKeyRegexFilter()
224 | {
225 | $_ENV['_ENV'] = 'true';
226 | $_ENV['FAKE'] = 'fake';
227 | $_SERVER['_SERVER'] = 'true';
228 |
229 | $result = Environment::getAll([
230 | new KeyRegexFilter('/_ENV/'),
231 | ]);
232 |
233 | $this->assertTrue(is_array($result));
234 |
235 | $this->assertEquals(true, $result['_ENV']);
236 | }
237 |
238 | public function testGetAllWithValueRegexFilter()
239 | {
240 | $_ENV['_ENV'] = 'true';
241 | $_ENV['FAKE'] = 'fake';
242 | $_SERVER['_SERVER'] = 'true';
243 |
244 | $result = Environment::getAll([
245 | new ValueRegexFilter('/true/'),
246 | ]);
247 |
248 | $this->assertTrue(is_array($result));
249 |
250 | $this->assertEquals(true, $result['_ENV']);
251 | $this->assertEquals(true, $result['_SERVER']);
252 | }
253 |
254 | public function testGetAllWithKeyAndValueRegexFilter()
255 | {
256 | $_ENV['_ENV'] = 'true';
257 | $_ENV['FAKE'] = 'fake';
258 | $_SERVER['_SERVER'] = 'true';
259 |
260 | $result = Environment::getAll([
261 | new KeyRegexFilter('/FAKE/'),
262 | new ValueRegexFilter('/fake/'),
263 | ]);
264 |
265 | $this->assertTrue(is_array($result));
266 |
267 | $this->assertEquals('fake', $result['FAKE']);
268 | }
269 |
270 | /**
271 | * @expectedException \Cekurte\Environment\Exception\FilterException
272 | */
273 | public function testGetAllFilterException()
274 | {
275 | Environment::getAll([
276 | new \ArrayObject(),
277 | ]);
278 | }
279 | }
280 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Environment
2 |
3 | [](http://travis-ci.org/jpcercal/environment)
4 | [](https://codeclimate.com/github/jpcercal/environment)
5 | [](https://coveralls.io/github/jpcercal/environment?branch=master)
6 | [](https://packagist.org/packages/cekurte/environment)
7 | [](https://packagist.org/packages/cekurte/environment)
8 | [](https://insight.sensiolabs.com/projects/69cde579-31fa-4b64-a2de-cbd6db49bb75)
9 |
10 | - A simple library (with all methods covered by php unit tests) to increase the power of your environment variables, **contribute with this project**!
11 |
12 | ## Installation
13 |
14 | - The package is available on [Packagist](http://packagist.org/packages/cekurte/environment).
15 | - The source files is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) compatible.
16 | - Autoloading is [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) compatible.
17 |
18 | ```shell
19 | composer require cekurte/environment
20 | ```
21 |
22 | ## Documentation
23 |
24 | Setup your variables to PHP with `putenv("KEY=VALUE")` or put your environment variables into OS directly. Additionally you can use this library to perform this task [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) (we recommend that you use this library).
25 |
26 | And now, use our library to get values and increase the power of your environment variables.
27 |
28 | ```php
29 | =5.6)
32 | use Cekurte\Environment\Environment; // To get values using a static class
33 | use Cekurte\Environment\EnvironmentVariable; // To get values using a object
34 |
35 | // ...
36 |
37 | $data = Environment::get("YOUR_ENVIRONMENT_KEY");
38 |
39 | // Getting default data if your environment variable not exists or not is loaded.
40 | $data = Environment::get("APP_DEBUG", true);
41 |
42 | // ...
43 | // Other ways to get the values of environment variables.
44 |
45 | // Using a object...
46 | $data = (new EnvironmentVariable())->get("YOUR_ENVIRONMENT_KEY", "defaultValue");
47 |
48 | // Using a function... @deprecated
49 | $data = env("YOUR_ENVIRONMENT_KEY", "defaultValue");
50 |
51 | // Note that if the second parameter is omitted
52 | // then the return value (if your key not exists) will be null.
53 |
54 | // A new way was added to you get all environment variables as an array.
55 | $data = Environment::getAll();
56 |
57 | // You can use a filter to get only the environment variables that you need.
58 | $data = Environment::getAll([
59 | new Cekurte\Environment\Filter\KeyRegexFilter('/PROCESSOR/'),
60 | new Cekurte\Environment\Filter\ValueRegexFilter('/6/'),
61 | ]);
62 |
63 | // The method above will get all environment variables, where:
64 | // the environment variable name has the word PROCESSOR AND
65 | // the environment variable value has the number six.
66 |
67 | // And you can develop your own filters, contribute with this project!
68 | ```
69 |
70 | This command will get the value of the environment variable and will convert values to respective php data type.
71 |
72 | Actually are available the following resources to process your environment variables:
73 |
74 | - [ArrayResource](https://github.com/jpcercal/environment/blob/master/src/Resource/ArrayResource.php)
75 | - [BooleanResource](https://github.com/jpcercal/environment/blob/master/src/Resource/BooleanResource.php)
76 | - [JsonResource](https://github.com/jpcercal/environment/blob/master/src/Resource/JsonResource.php)
77 | - [NullResource](https://github.com/jpcercal/environment/blob/master/src/Resource/NullResource.php)
78 | - [NumericResource](https://github.com/jpcercal/environment/blob/master/src/Resource/NumericResource.php)
79 | - [UnknownResource](https://github.com/jpcercal/environment/blob/master/src/Resource/UnknownResource.php)
80 |
81 | ### Examples
82 |
83 | In this section you can see the examples to all resource types.
84 |
85 | #### ArrayResource
86 |
87 | The array resource parse a value from environment variable that is a string to the array php data type. Supposing that there exists an environment variable named "ENV_ARRAY" with the following value **[1,2,3,"key"=>"value"]**.
88 |
89 | ```bash
90 | export ENV_ARRAY=[1,2,3,"key"=>"value"]
91 | ```
92 |
93 | When you read this environment variable with our library, then it will convert the data to the correct data type (in this case to array) using the [ArrayResource](https://github.com/jpcercal/environment/blob/master/src/Resource/ArrayResource.php) class.
94 |
95 | ```php
96 | int(1)
100 | // [1]=> int(2)
101 | // [2]=> int(3)
102 | // ["key"]=> string(5) "value"
103 | // }
104 | var_dump(Cekurte\Environment\Environment::get("ENV_ARRAY"));
105 |
106 | ```
107 |
108 | #### BooleanResource
109 |
110 | The boolean resource parse a value from environment variable that is a string to the boolean php data type. Supposing that there exists an environment variable named "ENV_BOOL" with the following value **true**.
111 |
112 | ```bash
113 | export ENV_BOOL=true
114 | ```
115 |
116 | When you read this environment variable with our library, then it will convert the data to the correct data type (in this case to boolean) using the [BooleanResource](https://github.com/jpcercal/environment/blob/master/src/Resource/BooleanResource.php) class.
117 |
118 | ```php
119 | string(5) "value"
141 | // }
142 | var_dump(Cekurte\Environment\Environment::get("ENV_JSON"));
143 |
144 | ```
145 |
146 | #### NullResource
147 |
148 | The null resource parse a value from environment variable that is a string to the null php data type. Supposing that there exists an environment variable named "ENV_NULL" with the following value **null**.
149 |
150 | ```bash
151 | export ENV_NULL=null
152 | ```
153 |
154 | When you read this environment variable with our library, then it will convert the data to the correct data type (in this case to null) using the [NullResource](https://github.com/jpcercal/environment/blob/master/src/Resource/NullResource.php) class.
155 |
156 | ```php
157 | "val1 ", -123.00002],'
148 | . ' [ ["val2"] , 2 ], [ [ [["val3",],]],true], "true"]'],
149 | ];
150 | }
151 |
152 | public function getDataProviderResourceTypeArrayMultiBoolean()
153 | {
154 | return [
155 | ['FAKE_ENV_KEY', '[["false"], [false], ["true"], [true]]'],
156 | ['FAKE_ENV_KEY', '[["FALSE"], [FALSE], ["TRUE"], [TRUE]]'],
157 | ['FAKE_ENV_KEY', '[["fALSe"], [fALSe], ["tRUe"], [tRUe]]'],
158 | ];
159 | }
160 |
161 | public function getDataProviderResourceTypeArrayMultiInt()
162 | {
163 | return [
164 | ['FAKE_ENV_KEY', '[["123"], [123], ["-123"], [-123]]'],
165 | ['FAKE_ENV_KEY', '[["0"], [10], ["20"], [30]]'],
166 | ];
167 | }
168 |
169 | public function getDataProviderResourceTypeArrayMultiFloat()
170 | {
171 | return [
172 | ['FAKE_ENV_KEY', '[["123.00002"], [123.00002], ["-123.00002"], [-123.00002]]'],
173 | ['FAKE_ENV_KEY', '[["0.1"], [10.2], ["20.3"], [30.4]]'],
174 | ];
175 | }
176 |
177 | public function getDataProviderResourceTypeJson()
178 | {
179 | return [
180 | ['FAKE_ENV_KEY', '{"key": "value"}'],
181 | ['FAKE_ENV_KEY', '{"numbers": [0,1,2,3,4,5,6,7,8,9]}'],
182 | ['FAKE_ENV_KEY', '{"values": ["val1", "val2", "val3"]}'],
183 | ['FAKE_ENV_KEY', '{"values": [["val1", "val2", "val3"], ["val4"]]}'],
184 | ];
185 | }
186 |
187 | public function getDataProviderResourceTypeUnknown()
188 | {
189 | return [
190 | ['FAKE_ENV_KEY', 'STRING'],
191 | ['FAKE_ENV_KEY', 'String'],
192 | ['FAKE_ENV_KEY', 'string'],
193 | ['FAKE_ENV_KEY', 'String 55'],
194 | ['FAKE_ENV_KEY', 'String False'],
195 | ['FAKE_ENV_KEY', 'String True'],
196 | ['FAKE_ENV_KEY', '123,21'],
197 |
198 | ['FAKE_ENV_KEY', '#'],
199 | ['FAKE_ENV_KEY', '$'],
200 | ['FAKE_ENV_KEY', '!'],
201 | ['FAKE_ENV_KEY', '?'],
202 | ['FAKE_ENV_KEY', '+'],
203 | ['FAKE_ENV_KEY', ':'],
204 | ['FAKE_ENV_KEY', '~'],
205 | ['FAKE_ENV_KEY', '^'],
206 | ['FAKE_ENV_KEY', '['],
207 | ['FAKE_ENV_KEY', '{'],
208 | ['FAKE_ENV_KEY', '('],
209 | ['FAKE_ENV_KEY', ']'],
210 | ['FAKE_ENV_KEY', '}'],
211 | ['FAKE_ENV_KEY', ')'],
212 | ['FAKE_ENV_KEY', '()'],
213 | ['FAKE_ENV_KEY', ''],
214 |
215 | ['FAKE_ENV_KEY', '#43'],
216 | ['FAKE_ENV_KEY', '#43.12'],
217 | ['FAKE_ENV_KEY', '#null'],
218 | ['FAKE_ENV_KEY', '#true'],
219 | ['FAKE_ENV_KEY', '#false'],
220 |
221 | ['FAKE_ENV_KEY', '$23'],
222 | ['FAKE_ENV_KEY', '$23.56'],
223 | ['FAKE_ENV_KEY', '$null'],
224 | ['FAKE_ENV_KEY', '$true'],
225 | ['FAKE_ENV_KEY', '$false'],
226 |
227 | ['FAKE_ENV_KEY', '!23'],
228 | ['FAKE_ENV_KEY', '!43.12'],
229 | ['FAKE_ENV_KEY', '!null'],
230 | ['FAKE_ENV_KEY', '!true'],
231 | ['FAKE_ENV_KEY', '!false'],
232 |
233 | ['FAKE_ENV_KEY', '?23'],
234 | ['FAKE_ENV_KEY', '?43.12'],
235 | ['FAKE_ENV_KEY', '?null'],
236 | ['FAKE_ENV_KEY', '?true'],
237 | ['FAKE_ENV_KEY', '?false'],
238 |
239 | ['FAKE_ENV_KEY', '+23'],
240 | ['FAKE_ENV_KEY', '+43.12'],
241 | ['FAKE_ENV_KEY', '+null'],
242 | ['FAKE_ENV_KEY', '+true'],
243 | ['FAKE_ENV_KEY', '+false'],
244 |
245 | ['FAKE_ENV_KEY', ':23'],
246 | ['FAKE_ENV_KEY', ':43.12'],
247 | ['FAKE_ENV_KEY', ':null'],
248 | ['FAKE_ENV_KEY', ':true'],
249 | ['FAKE_ENV_KEY', ':false'],
250 |
251 | ['FAKE_ENV_KEY', '~23'],
252 | ['FAKE_ENV_KEY', '~43.12'],
253 | ['FAKE_ENV_KEY', '~null'],
254 | ['FAKE_ENV_KEY', '~true'],
255 | ['FAKE_ENV_KEY', '~false'],
256 |
257 | ['FAKE_ENV_KEY', '^23'],
258 | ['FAKE_ENV_KEY', '^43.12'],
259 | ['FAKE_ENV_KEY', '^null'],
260 | ['FAKE_ENV_KEY', '^true'],
261 | ['FAKE_ENV_KEY', '^false'],
262 |
263 | ['FAKE_ENV_KEY', '[23'],
264 | ['FAKE_ENV_KEY', '[43.12'],
265 | ['FAKE_ENV_KEY', '[null'],
266 | ['FAKE_ENV_KEY', '[true'],
267 | ['FAKE_ENV_KEY', '[false'],
268 |
269 | ['FAKE_ENV_KEY', '{23'],
270 | ['FAKE_ENV_KEY', '{43.12'],
271 | ['FAKE_ENV_KEY', '{null'],
272 | ['FAKE_ENV_KEY', '{true'],
273 | ['FAKE_ENV_KEY', '{false'],
274 |
275 | ['FAKE_ENV_KEY', '(23'],
276 | ['FAKE_ENV_KEY', '(43.12'],
277 | ['FAKE_ENV_KEY', '(null'],
278 | ['FAKE_ENV_KEY', '(true'],
279 | ['FAKE_ENV_KEY', '(false'],
280 |
281 | ['FAKE_ENV_KEY', '23]'],
282 | ['FAKE_ENV_KEY', '43.12]'],
283 | ['FAKE_ENV_KEY', 'null]'],
284 | ['FAKE_ENV_KEY', 'true]'],
285 | ['FAKE_ENV_KEY', 'false]'],
286 |
287 | ['FAKE_ENV_KEY', '23}'],
288 | ['FAKE_ENV_KEY', '43.12}'],
289 | ['FAKE_ENV_KEY', 'null}'],
290 | ['FAKE_ENV_KEY', 'true}'],
291 | ['FAKE_ENV_KEY', 'false}'],
292 |
293 | ['FAKE_ENV_KEY', '23)'],
294 | ['FAKE_ENV_KEY', '43.12)'],
295 | ['FAKE_ENV_KEY', 'null)'],
296 | ['FAKE_ENV_KEY', 'true)'],
297 | ['FAKE_ENV_KEY', 'false)'],
298 |
299 | ['FAKE_ENV_KEY', '(23)'],
300 | ['FAKE_ENV_KEY', '(43.12)'],
301 | ['FAKE_ENV_KEY', '(null)'],
302 | ['FAKE_ENV_KEY', '(true)'],
303 | ['FAKE_ENV_KEY', '(false)'],
304 | ];
305 | }
306 | }
307 |
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "hash": "581ff25107e3cabf9050ce4fe15ed140",
8 | "content-hash": "8befd0d978a4d647ac3922086418f066",
9 | "packages": [],
10 | "packages-dev": [
11 | {
12 | "name": "cekurte/tdd",
13 | "version": "v1.0.2",
14 | "source": {
15 | "type": "git",
16 | "url": "https://github.com/cekurte/tdd.git",
17 | "reference": "5b05af6a687d8918aff6a5a6c0acf2138cd476da"
18 | },
19 | "dist": {
20 | "type": "zip",
21 | "url": "https://api.github.com/repos/cekurte/tdd/zipball/5b05af6a687d8918aff6a5a6c0acf2138cd476da",
22 | "reference": "5b05af6a687d8918aff6a5a6c0acf2138cd476da",
23 | "shasum": ""
24 | },
25 | "require": {
26 | "php": ">=5.3"
27 | },
28 | "require-dev": {
29 | "fabpot/php-cs-fixer": "^1.10",
30 | "phpunit/phpunit": "^4.8"
31 | },
32 | "type": "library",
33 | "autoload": {
34 | "psr-4": {
35 | "Cekurte\\Tdd\\": "src/"
36 | }
37 | },
38 | "notification-url": "https://packagist.org/downloads/",
39 | "license": [
40 | "MIT"
41 | ],
42 | "authors": [
43 | {
44 | "name": "João Paulo Cercal",
45 | "email": "jpcercal@gmail.com"
46 | }
47 | ],
48 | "description": "PHPUnit TestCase",
49 | "time": "2016-01-05 19:02:52"
50 | },
51 | {
52 | "name": "doctrine/instantiator",
53 | "version": "1.0.5",
54 | "source": {
55 | "type": "git",
56 | "url": "https://github.com/doctrine/instantiator.git",
57 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
58 | },
59 | "dist": {
60 | "type": "zip",
61 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
62 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
63 | "shasum": ""
64 | },
65 | "require": {
66 | "php": ">=5.3,<8.0-DEV"
67 | },
68 | "require-dev": {
69 | "athletic/athletic": "~0.1.8",
70 | "ext-pdo": "*",
71 | "ext-phar": "*",
72 | "phpunit/phpunit": "~4.0",
73 | "squizlabs/php_codesniffer": "~2.0"
74 | },
75 | "type": "library",
76 | "extra": {
77 | "branch-alias": {
78 | "dev-master": "1.0.x-dev"
79 | }
80 | },
81 | "autoload": {
82 | "psr-4": {
83 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
84 | }
85 | },
86 | "notification-url": "https://packagist.org/downloads/",
87 | "license": [
88 | "MIT"
89 | ],
90 | "authors": [
91 | {
92 | "name": "Marco Pivetta",
93 | "email": "ocramius@gmail.com",
94 | "homepage": "http://ocramius.github.com/"
95 | }
96 | ],
97 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
98 | "homepage": "https://github.com/doctrine/instantiator",
99 | "keywords": [
100 | "constructor",
101 | "instantiate"
102 | ],
103 | "time": "2015-06-14 21:17:01"
104 | },
105 | {
106 | "name": "phpdocumentor/reflection-docblock",
107 | "version": "2.0.4",
108 | "source": {
109 | "type": "git",
110 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
111 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
112 | },
113 | "dist": {
114 | "type": "zip",
115 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
116 | "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
117 | "shasum": ""
118 | },
119 | "require": {
120 | "php": ">=5.3.3"
121 | },
122 | "require-dev": {
123 | "phpunit/phpunit": "~4.0"
124 | },
125 | "suggest": {
126 | "dflydev/markdown": "~1.0",
127 | "erusev/parsedown": "~1.0"
128 | },
129 | "type": "library",
130 | "extra": {
131 | "branch-alias": {
132 | "dev-master": "2.0.x-dev"
133 | }
134 | },
135 | "autoload": {
136 | "psr-0": {
137 | "phpDocumentor": [
138 | "src/"
139 | ]
140 | }
141 | },
142 | "notification-url": "https://packagist.org/downloads/",
143 | "license": [
144 | "MIT"
145 | ],
146 | "authors": [
147 | {
148 | "name": "Mike van Riel",
149 | "email": "mike.vanriel@naenius.com"
150 | }
151 | ],
152 | "time": "2015-02-03 12:10:50"
153 | },
154 | {
155 | "name": "phpspec/prophecy",
156 | "version": "v1.6.0",
157 | "source": {
158 | "type": "git",
159 | "url": "https://github.com/phpspec/prophecy.git",
160 | "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972"
161 | },
162 | "dist": {
163 | "type": "zip",
164 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972",
165 | "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972",
166 | "shasum": ""
167 | },
168 | "require": {
169 | "doctrine/instantiator": "^1.0.2",
170 | "php": "^5.3|^7.0",
171 | "phpdocumentor/reflection-docblock": "~2.0",
172 | "sebastian/comparator": "~1.1",
173 | "sebastian/recursion-context": "~1.0"
174 | },
175 | "require-dev": {
176 | "phpspec/phpspec": "~2.0"
177 | },
178 | "type": "library",
179 | "extra": {
180 | "branch-alias": {
181 | "dev-master": "1.5.x-dev"
182 | }
183 | },
184 | "autoload": {
185 | "psr-0": {
186 | "Prophecy\\": "src/"
187 | }
188 | },
189 | "notification-url": "https://packagist.org/downloads/",
190 | "license": [
191 | "MIT"
192 | ],
193 | "authors": [
194 | {
195 | "name": "Konstantin Kudryashov",
196 | "email": "ever.zet@gmail.com",
197 | "homepage": "http://everzet.com"
198 | },
199 | {
200 | "name": "Marcello Duarte",
201 | "email": "marcello.duarte@gmail.com"
202 | }
203 | ],
204 | "description": "Highly opinionated mocking framework for PHP 5.3+",
205 | "homepage": "https://github.com/phpspec/prophecy",
206 | "keywords": [
207 | "Double",
208 | "Dummy",
209 | "fake",
210 | "mock",
211 | "spy",
212 | "stub"
213 | ],
214 | "time": "2016-02-15 07:46:21"
215 | },
216 | {
217 | "name": "phpunit/php-code-coverage",
218 | "version": "2.2.4",
219 | "source": {
220 | "type": "git",
221 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
222 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
223 | },
224 | "dist": {
225 | "type": "zip",
226 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
227 | "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
228 | "shasum": ""
229 | },
230 | "require": {
231 | "php": ">=5.3.3",
232 | "phpunit/php-file-iterator": "~1.3",
233 | "phpunit/php-text-template": "~1.2",
234 | "phpunit/php-token-stream": "~1.3",
235 | "sebastian/environment": "^1.3.2",
236 | "sebastian/version": "~1.0"
237 | },
238 | "require-dev": {
239 | "ext-xdebug": ">=2.1.4",
240 | "phpunit/phpunit": "~4"
241 | },
242 | "suggest": {
243 | "ext-dom": "*",
244 | "ext-xdebug": ">=2.2.1",
245 | "ext-xmlwriter": "*"
246 | },
247 | "type": "library",
248 | "extra": {
249 | "branch-alias": {
250 | "dev-master": "2.2.x-dev"
251 | }
252 | },
253 | "autoload": {
254 | "classmap": [
255 | "src/"
256 | ]
257 | },
258 | "notification-url": "https://packagist.org/downloads/",
259 | "license": [
260 | "BSD-3-Clause"
261 | ],
262 | "authors": [
263 | {
264 | "name": "Sebastian Bergmann",
265 | "email": "sb@sebastian-bergmann.de",
266 | "role": "lead"
267 | }
268 | ],
269 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
270 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
271 | "keywords": [
272 | "coverage",
273 | "testing",
274 | "xunit"
275 | ],
276 | "time": "2015-10-06 15:47:00"
277 | },
278 | {
279 | "name": "phpunit/php-file-iterator",
280 | "version": "1.4.1",
281 | "source": {
282 | "type": "git",
283 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
284 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
285 | },
286 | "dist": {
287 | "type": "zip",
288 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
289 | "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
290 | "shasum": ""
291 | },
292 | "require": {
293 | "php": ">=5.3.3"
294 | },
295 | "type": "library",
296 | "extra": {
297 | "branch-alias": {
298 | "dev-master": "1.4.x-dev"
299 | }
300 | },
301 | "autoload": {
302 | "classmap": [
303 | "src/"
304 | ]
305 | },
306 | "notification-url": "https://packagist.org/downloads/",
307 | "license": [
308 | "BSD-3-Clause"
309 | ],
310 | "authors": [
311 | {
312 | "name": "Sebastian Bergmann",
313 | "email": "sb@sebastian-bergmann.de",
314 | "role": "lead"
315 | }
316 | ],
317 | "description": "FilterIterator implementation that filters files based on a list of suffixes.",
318 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
319 | "keywords": [
320 | "filesystem",
321 | "iterator"
322 | ],
323 | "time": "2015-06-21 13:08:43"
324 | },
325 | {
326 | "name": "phpunit/php-text-template",
327 | "version": "1.2.1",
328 | "source": {
329 | "type": "git",
330 | "url": "https://github.com/sebastianbergmann/php-text-template.git",
331 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
332 | },
333 | "dist": {
334 | "type": "zip",
335 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
336 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
337 | "shasum": ""
338 | },
339 | "require": {
340 | "php": ">=5.3.3"
341 | },
342 | "type": "library",
343 | "autoload": {
344 | "classmap": [
345 | "src/"
346 | ]
347 | },
348 | "notification-url": "https://packagist.org/downloads/",
349 | "license": [
350 | "BSD-3-Clause"
351 | ],
352 | "authors": [
353 | {
354 | "name": "Sebastian Bergmann",
355 | "email": "sebastian@phpunit.de",
356 | "role": "lead"
357 | }
358 | ],
359 | "description": "Simple template engine.",
360 | "homepage": "https://github.com/sebastianbergmann/php-text-template/",
361 | "keywords": [
362 | "template"
363 | ],
364 | "time": "2015-06-21 13:50:34"
365 | },
366 | {
367 | "name": "phpunit/php-timer",
368 | "version": "1.0.7",
369 | "source": {
370 | "type": "git",
371 | "url": "https://github.com/sebastianbergmann/php-timer.git",
372 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
373 | },
374 | "dist": {
375 | "type": "zip",
376 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
377 | "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
378 | "shasum": ""
379 | },
380 | "require": {
381 | "php": ">=5.3.3"
382 | },
383 | "type": "library",
384 | "autoload": {
385 | "classmap": [
386 | "src/"
387 | ]
388 | },
389 | "notification-url": "https://packagist.org/downloads/",
390 | "license": [
391 | "BSD-3-Clause"
392 | ],
393 | "authors": [
394 | {
395 | "name": "Sebastian Bergmann",
396 | "email": "sb@sebastian-bergmann.de",
397 | "role": "lead"
398 | }
399 | ],
400 | "description": "Utility class for timing",
401 | "homepage": "https://github.com/sebastianbergmann/php-timer/",
402 | "keywords": [
403 | "timer"
404 | ],
405 | "time": "2015-06-21 08:01:12"
406 | },
407 | {
408 | "name": "phpunit/php-token-stream",
409 | "version": "1.4.8",
410 | "source": {
411 | "type": "git",
412 | "url": "https://github.com/sebastianbergmann/php-token-stream.git",
413 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
414 | },
415 | "dist": {
416 | "type": "zip",
417 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
418 | "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
419 | "shasum": ""
420 | },
421 | "require": {
422 | "ext-tokenizer": "*",
423 | "php": ">=5.3.3"
424 | },
425 | "require-dev": {
426 | "phpunit/phpunit": "~4.2"
427 | },
428 | "type": "library",
429 | "extra": {
430 | "branch-alias": {
431 | "dev-master": "1.4-dev"
432 | }
433 | },
434 | "autoload": {
435 | "classmap": [
436 | "src/"
437 | ]
438 | },
439 | "notification-url": "https://packagist.org/downloads/",
440 | "license": [
441 | "BSD-3-Clause"
442 | ],
443 | "authors": [
444 | {
445 | "name": "Sebastian Bergmann",
446 | "email": "sebastian@phpunit.de"
447 | }
448 | ],
449 | "description": "Wrapper around PHP's tokenizer extension.",
450 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
451 | "keywords": [
452 | "tokenizer"
453 | ],
454 | "time": "2015-09-15 10:49:45"
455 | },
456 | {
457 | "name": "phpunit/phpunit",
458 | "version": "4.8.24",
459 | "source": {
460 | "type": "git",
461 | "url": "https://github.com/sebastianbergmann/phpunit.git",
462 | "reference": "a1066c562c52900a142a0e2bbf0582994671385e"
463 | },
464 | "dist": {
465 | "type": "zip",
466 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e",
467 | "reference": "a1066c562c52900a142a0e2bbf0582994671385e",
468 | "shasum": ""
469 | },
470 | "require": {
471 | "ext-dom": "*",
472 | "ext-json": "*",
473 | "ext-pcre": "*",
474 | "ext-reflection": "*",
475 | "ext-spl": "*",
476 | "php": ">=5.3.3",
477 | "phpspec/prophecy": "^1.3.1",
478 | "phpunit/php-code-coverage": "~2.1",
479 | "phpunit/php-file-iterator": "~1.4",
480 | "phpunit/php-text-template": "~1.2",
481 | "phpunit/php-timer": ">=1.0.6",
482 | "phpunit/phpunit-mock-objects": "~2.3",
483 | "sebastian/comparator": "~1.1",
484 | "sebastian/diff": "~1.2",
485 | "sebastian/environment": "~1.3",
486 | "sebastian/exporter": "~1.2",
487 | "sebastian/global-state": "~1.0",
488 | "sebastian/version": "~1.0",
489 | "symfony/yaml": "~2.1|~3.0"
490 | },
491 | "suggest": {
492 | "phpunit/php-invoker": "~1.1"
493 | },
494 | "bin": [
495 | "phpunit"
496 | ],
497 | "type": "library",
498 | "extra": {
499 | "branch-alias": {
500 | "dev-master": "4.8.x-dev"
501 | }
502 | },
503 | "autoload": {
504 | "classmap": [
505 | "src/"
506 | ]
507 | },
508 | "notification-url": "https://packagist.org/downloads/",
509 | "license": [
510 | "BSD-3-Clause"
511 | ],
512 | "authors": [
513 | {
514 | "name": "Sebastian Bergmann",
515 | "email": "sebastian@phpunit.de",
516 | "role": "lead"
517 | }
518 | ],
519 | "description": "The PHP Unit Testing framework.",
520 | "homepage": "https://phpunit.de/",
521 | "keywords": [
522 | "phpunit",
523 | "testing",
524 | "xunit"
525 | ],
526 | "time": "2016-03-14 06:16:08"
527 | },
528 | {
529 | "name": "phpunit/phpunit-mock-objects",
530 | "version": "2.3.8",
531 | "source": {
532 | "type": "git",
533 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
534 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
535 | },
536 | "dist": {
537 | "type": "zip",
538 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
539 | "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
540 | "shasum": ""
541 | },
542 | "require": {
543 | "doctrine/instantiator": "^1.0.2",
544 | "php": ">=5.3.3",
545 | "phpunit/php-text-template": "~1.2",
546 | "sebastian/exporter": "~1.2"
547 | },
548 | "require-dev": {
549 | "phpunit/phpunit": "~4.4"
550 | },
551 | "suggest": {
552 | "ext-soap": "*"
553 | },
554 | "type": "library",
555 | "extra": {
556 | "branch-alias": {
557 | "dev-master": "2.3.x-dev"
558 | }
559 | },
560 | "autoload": {
561 | "classmap": [
562 | "src/"
563 | ]
564 | },
565 | "notification-url": "https://packagist.org/downloads/",
566 | "license": [
567 | "BSD-3-Clause"
568 | ],
569 | "authors": [
570 | {
571 | "name": "Sebastian Bergmann",
572 | "email": "sb@sebastian-bergmann.de",
573 | "role": "lead"
574 | }
575 | ],
576 | "description": "Mock Object library for PHPUnit",
577 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
578 | "keywords": [
579 | "mock",
580 | "xunit"
581 | ],
582 | "time": "2015-10-02 06:51:40"
583 | },
584 | {
585 | "name": "sebastian/comparator",
586 | "version": "1.2.0",
587 | "source": {
588 | "type": "git",
589 | "url": "https://github.com/sebastianbergmann/comparator.git",
590 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
591 | },
592 | "dist": {
593 | "type": "zip",
594 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
595 | "reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
596 | "shasum": ""
597 | },
598 | "require": {
599 | "php": ">=5.3.3",
600 | "sebastian/diff": "~1.2",
601 | "sebastian/exporter": "~1.2"
602 | },
603 | "require-dev": {
604 | "phpunit/phpunit": "~4.4"
605 | },
606 | "type": "library",
607 | "extra": {
608 | "branch-alias": {
609 | "dev-master": "1.2.x-dev"
610 | }
611 | },
612 | "autoload": {
613 | "classmap": [
614 | "src/"
615 | ]
616 | },
617 | "notification-url": "https://packagist.org/downloads/",
618 | "license": [
619 | "BSD-3-Clause"
620 | ],
621 | "authors": [
622 | {
623 | "name": "Jeff Welch",
624 | "email": "whatthejeff@gmail.com"
625 | },
626 | {
627 | "name": "Volker Dusch",
628 | "email": "github@wallbash.com"
629 | },
630 | {
631 | "name": "Bernhard Schussek",
632 | "email": "bschussek@2bepublished.at"
633 | },
634 | {
635 | "name": "Sebastian Bergmann",
636 | "email": "sebastian@phpunit.de"
637 | }
638 | ],
639 | "description": "Provides the functionality to compare PHP values for equality",
640 | "homepage": "http://www.github.com/sebastianbergmann/comparator",
641 | "keywords": [
642 | "comparator",
643 | "compare",
644 | "equality"
645 | ],
646 | "time": "2015-07-26 15:48:44"
647 | },
648 | {
649 | "name": "sebastian/diff",
650 | "version": "1.4.1",
651 | "source": {
652 | "type": "git",
653 | "url": "https://github.com/sebastianbergmann/diff.git",
654 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
655 | },
656 | "dist": {
657 | "type": "zip",
658 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
659 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
660 | "shasum": ""
661 | },
662 | "require": {
663 | "php": ">=5.3.3"
664 | },
665 | "require-dev": {
666 | "phpunit/phpunit": "~4.8"
667 | },
668 | "type": "library",
669 | "extra": {
670 | "branch-alias": {
671 | "dev-master": "1.4-dev"
672 | }
673 | },
674 | "autoload": {
675 | "classmap": [
676 | "src/"
677 | ]
678 | },
679 | "notification-url": "https://packagist.org/downloads/",
680 | "license": [
681 | "BSD-3-Clause"
682 | ],
683 | "authors": [
684 | {
685 | "name": "Kore Nordmann",
686 | "email": "mail@kore-nordmann.de"
687 | },
688 | {
689 | "name": "Sebastian Bergmann",
690 | "email": "sebastian@phpunit.de"
691 | }
692 | ],
693 | "description": "Diff implementation",
694 | "homepage": "https://github.com/sebastianbergmann/diff",
695 | "keywords": [
696 | "diff"
697 | ],
698 | "time": "2015-12-08 07:14:41"
699 | },
700 | {
701 | "name": "sebastian/environment",
702 | "version": "1.3.5",
703 | "source": {
704 | "type": "git",
705 | "url": "https://github.com/sebastianbergmann/environment.git",
706 | "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
707 | },
708 | "dist": {
709 | "type": "zip",
710 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
711 | "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
712 | "shasum": ""
713 | },
714 | "require": {
715 | "php": ">=5.3.3"
716 | },
717 | "require-dev": {
718 | "phpunit/phpunit": "~4.4"
719 | },
720 | "type": "library",
721 | "extra": {
722 | "branch-alias": {
723 | "dev-master": "1.3.x-dev"
724 | }
725 | },
726 | "autoload": {
727 | "classmap": [
728 | "src/"
729 | ]
730 | },
731 | "notification-url": "https://packagist.org/downloads/",
732 | "license": [
733 | "BSD-3-Clause"
734 | ],
735 | "authors": [
736 | {
737 | "name": "Sebastian Bergmann",
738 | "email": "sebastian@phpunit.de"
739 | }
740 | ],
741 | "description": "Provides functionality to handle HHVM/PHP environments",
742 | "homepage": "http://www.github.com/sebastianbergmann/environment",
743 | "keywords": [
744 | "Xdebug",
745 | "environment",
746 | "hhvm"
747 | ],
748 | "time": "2016-02-26 18:40:46"
749 | },
750 | {
751 | "name": "sebastian/exporter",
752 | "version": "1.2.1",
753 | "source": {
754 | "type": "git",
755 | "url": "https://github.com/sebastianbergmann/exporter.git",
756 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e"
757 | },
758 | "dist": {
759 | "type": "zip",
760 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
761 | "reference": "7ae5513327cb536431847bcc0c10edba2701064e",
762 | "shasum": ""
763 | },
764 | "require": {
765 | "php": ">=5.3.3",
766 | "sebastian/recursion-context": "~1.0"
767 | },
768 | "require-dev": {
769 | "phpunit/phpunit": "~4.4"
770 | },
771 | "type": "library",
772 | "extra": {
773 | "branch-alias": {
774 | "dev-master": "1.2.x-dev"
775 | }
776 | },
777 | "autoload": {
778 | "classmap": [
779 | "src/"
780 | ]
781 | },
782 | "notification-url": "https://packagist.org/downloads/",
783 | "license": [
784 | "BSD-3-Clause"
785 | ],
786 | "authors": [
787 | {
788 | "name": "Jeff Welch",
789 | "email": "whatthejeff@gmail.com"
790 | },
791 | {
792 | "name": "Volker Dusch",
793 | "email": "github@wallbash.com"
794 | },
795 | {
796 | "name": "Bernhard Schussek",
797 | "email": "bschussek@2bepublished.at"
798 | },
799 | {
800 | "name": "Sebastian Bergmann",
801 | "email": "sebastian@phpunit.de"
802 | },
803 | {
804 | "name": "Adam Harvey",
805 | "email": "aharvey@php.net"
806 | }
807 | ],
808 | "description": "Provides the functionality to export PHP variables for visualization",
809 | "homepage": "http://www.github.com/sebastianbergmann/exporter",
810 | "keywords": [
811 | "export",
812 | "exporter"
813 | ],
814 | "time": "2015-06-21 07:55:53"
815 | },
816 | {
817 | "name": "sebastian/global-state",
818 | "version": "1.1.1",
819 | "source": {
820 | "type": "git",
821 | "url": "https://github.com/sebastianbergmann/global-state.git",
822 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
823 | },
824 | "dist": {
825 | "type": "zip",
826 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
827 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
828 | "shasum": ""
829 | },
830 | "require": {
831 | "php": ">=5.3.3"
832 | },
833 | "require-dev": {
834 | "phpunit/phpunit": "~4.2"
835 | },
836 | "suggest": {
837 | "ext-uopz": "*"
838 | },
839 | "type": "library",
840 | "extra": {
841 | "branch-alias": {
842 | "dev-master": "1.0-dev"
843 | }
844 | },
845 | "autoload": {
846 | "classmap": [
847 | "src/"
848 | ]
849 | },
850 | "notification-url": "https://packagist.org/downloads/",
851 | "license": [
852 | "BSD-3-Clause"
853 | ],
854 | "authors": [
855 | {
856 | "name": "Sebastian Bergmann",
857 | "email": "sebastian@phpunit.de"
858 | }
859 | ],
860 | "description": "Snapshotting of global state",
861 | "homepage": "http://www.github.com/sebastianbergmann/global-state",
862 | "keywords": [
863 | "global state"
864 | ],
865 | "time": "2015-10-12 03:26:01"
866 | },
867 | {
868 | "name": "sebastian/recursion-context",
869 | "version": "1.0.2",
870 | "source": {
871 | "type": "git",
872 | "url": "https://github.com/sebastianbergmann/recursion-context.git",
873 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791"
874 | },
875 | "dist": {
876 | "type": "zip",
877 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
878 | "reference": "913401df809e99e4f47b27cdd781f4a258d58791",
879 | "shasum": ""
880 | },
881 | "require": {
882 | "php": ">=5.3.3"
883 | },
884 | "require-dev": {
885 | "phpunit/phpunit": "~4.4"
886 | },
887 | "type": "library",
888 | "extra": {
889 | "branch-alias": {
890 | "dev-master": "1.0.x-dev"
891 | }
892 | },
893 | "autoload": {
894 | "classmap": [
895 | "src/"
896 | ]
897 | },
898 | "notification-url": "https://packagist.org/downloads/",
899 | "license": [
900 | "BSD-3-Clause"
901 | ],
902 | "authors": [
903 | {
904 | "name": "Jeff Welch",
905 | "email": "whatthejeff@gmail.com"
906 | },
907 | {
908 | "name": "Sebastian Bergmann",
909 | "email": "sebastian@phpunit.de"
910 | },
911 | {
912 | "name": "Adam Harvey",
913 | "email": "aharvey@php.net"
914 | }
915 | ],
916 | "description": "Provides functionality to recursively process PHP variables",
917 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
918 | "time": "2015-11-11 19:50:13"
919 | },
920 | {
921 | "name": "sebastian/version",
922 | "version": "1.0.6",
923 | "source": {
924 | "type": "git",
925 | "url": "https://github.com/sebastianbergmann/version.git",
926 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
927 | },
928 | "dist": {
929 | "type": "zip",
930 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
931 | "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
932 | "shasum": ""
933 | },
934 | "type": "library",
935 | "autoload": {
936 | "classmap": [
937 | "src/"
938 | ]
939 | },
940 | "notification-url": "https://packagist.org/downloads/",
941 | "license": [
942 | "BSD-3-Clause"
943 | ],
944 | "authors": [
945 | {
946 | "name": "Sebastian Bergmann",
947 | "email": "sebastian@phpunit.de",
948 | "role": "lead"
949 | }
950 | ],
951 | "description": "Library that helps with managing the version number of Git-hosted PHP projects",
952 | "homepage": "https://github.com/sebastianbergmann/version",
953 | "time": "2015-06-21 13:59:46"
954 | },
955 | {
956 | "name": "sensiolabs/security-checker",
957 | "version": "v3.0.2",
958 | "source": {
959 | "type": "git",
960 | "url": "https://github.com/sensiolabs/security-checker.git",
961 | "reference": "21696b0daa731064c23cfb694c60a2584a7b6e93"
962 | },
963 | "dist": {
964 | "type": "zip",
965 | "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/21696b0daa731064c23cfb694c60a2584a7b6e93",
966 | "reference": "21696b0daa731064c23cfb694c60a2584a7b6e93",
967 | "shasum": ""
968 | },
969 | "require": {
970 | "symfony/console": "~2.0|~3.0"
971 | },
972 | "bin": [
973 | "security-checker"
974 | ],
975 | "type": "library",
976 | "extra": {
977 | "branch-alias": {
978 | "dev-master": "3.0-dev"
979 | }
980 | },
981 | "autoload": {
982 | "psr-0": {
983 | "SensioLabs\\Security": ""
984 | }
985 | },
986 | "notification-url": "https://packagist.org/downloads/",
987 | "license": [
988 | "MIT"
989 | ],
990 | "authors": [
991 | {
992 | "name": "Fabien Potencier",
993 | "email": "fabien.potencier@gmail.com"
994 | }
995 | ],
996 | "description": "A security checker for your composer.lock",
997 | "time": "2015-11-07 08:07:40"
998 | },
999 | {
1000 | "name": "squizlabs/php_codesniffer",
1001 | "version": "2.5.1",
1002 | "source": {
1003 | "type": "git",
1004 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1005 | "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8"
1006 | },
1007 | "dist": {
1008 | "type": "zip",
1009 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
1010 | "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
1011 | "shasum": ""
1012 | },
1013 | "require": {
1014 | "ext-tokenizer": "*",
1015 | "ext-xmlwriter": "*",
1016 | "php": ">=5.1.2"
1017 | },
1018 | "require-dev": {
1019 | "phpunit/phpunit": "~4.0"
1020 | },
1021 | "bin": [
1022 | "scripts/phpcs",
1023 | "scripts/phpcbf"
1024 | ],
1025 | "type": "library",
1026 | "extra": {
1027 | "branch-alias": {
1028 | "dev-master": "2.x-dev"
1029 | }
1030 | },
1031 | "autoload": {
1032 | "classmap": [
1033 | "CodeSniffer.php",
1034 | "CodeSniffer/CLI.php",
1035 | "CodeSniffer/Exception.php",
1036 | "CodeSniffer/File.php",
1037 | "CodeSniffer/Fixer.php",
1038 | "CodeSniffer/Report.php",
1039 | "CodeSniffer/Reporting.php",
1040 | "CodeSniffer/Sniff.php",
1041 | "CodeSniffer/Tokens.php",
1042 | "CodeSniffer/Reports/",
1043 | "CodeSniffer/Tokenizers/",
1044 | "CodeSniffer/DocGenerators/",
1045 | "CodeSniffer/Standards/AbstractPatternSniff.php",
1046 | "CodeSniffer/Standards/AbstractScopeSniff.php",
1047 | "CodeSniffer/Standards/AbstractVariableSniff.php",
1048 | "CodeSniffer/Standards/IncorrectPatternException.php",
1049 | "CodeSniffer/Standards/Generic/Sniffs/",
1050 | "CodeSniffer/Standards/MySource/Sniffs/",
1051 | "CodeSniffer/Standards/PEAR/Sniffs/",
1052 | "CodeSniffer/Standards/PSR1/Sniffs/",
1053 | "CodeSniffer/Standards/PSR2/Sniffs/",
1054 | "CodeSniffer/Standards/Squiz/Sniffs/",
1055 | "CodeSniffer/Standards/Zend/Sniffs/"
1056 | ]
1057 | },
1058 | "notification-url": "https://packagist.org/downloads/",
1059 | "license": [
1060 | "BSD-3-Clause"
1061 | ],
1062 | "authors": [
1063 | {
1064 | "name": "Greg Sherwood",
1065 | "role": "lead"
1066 | }
1067 | ],
1068 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
1069 | "homepage": "http://www.squizlabs.com/php-codesniffer",
1070 | "keywords": [
1071 | "phpcs",
1072 | "standards"
1073 | ],
1074 | "time": "2016-01-19 23:39:10"
1075 | },
1076 | {
1077 | "name": "symfony/console",
1078 | "version": "v2.8.4",
1079 | "source": {
1080 | "type": "git",
1081 | "url": "https://github.com/symfony/console.git",
1082 | "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154"
1083 | },
1084 | "dist": {
1085 | "type": "zip",
1086 | "url": "https://api.github.com/repos/symfony/console/zipball/9a5aef5fc0d4eff86853d44202b02be8d5a20154",
1087 | "reference": "9a5aef5fc0d4eff86853d44202b02be8d5a20154",
1088 | "shasum": ""
1089 | },
1090 | "require": {
1091 | "php": ">=5.3.9",
1092 | "symfony/polyfill-mbstring": "~1.0"
1093 | },
1094 | "require-dev": {
1095 | "psr/log": "~1.0",
1096 | "symfony/event-dispatcher": "~2.1|~3.0.0",
1097 | "symfony/process": "~2.1|~3.0.0"
1098 | },
1099 | "suggest": {
1100 | "psr/log": "For using the console logger",
1101 | "symfony/event-dispatcher": "",
1102 | "symfony/process": ""
1103 | },
1104 | "type": "library",
1105 | "extra": {
1106 | "branch-alias": {
1107 | "dev-master": "2.8-dev"
1108 | }
1109 | },
1110 | "autoload": {
1111 | "psr-4": {
1112 | "Symfony\\Component\\Console\\": ""
1113 | },
1114 | "exclude-from-classmap": [
1115 | "/Tests/"
1116 | ]
1117 | },
1118 | "notification-url": "https://packagist.org/downloads/",
1119 | "license": [
1120 | "MIT"
1121 | ],
1122 | "authors": [
1123 | {
1124 | "name": "Fabien Potencier",
1125 | "email": "fabien@symfony.com"
1126 | },
1127 | {
1128 | "name": "Symfony Community",
1129 | "homepage": "https://symfony.com/contributors"
1130 | }
1131 | ],
1132 | "description": "Symfony Console Component",
1133 | "homepage": "https://symfony.com",
1134 | "time": "2016-03-17 09:19:04"
1135 | },
1136 | {
1137 | "name": "symfony/polyfill-mbstring",
1138 | "version": "v1.1.1",
1139 | "source": {
1140 | "type": "git",
1141 | "url": "https://github.com/symfony/polyfill-mbstring.git",
1142 | "reference": "1289d16209491b584839022f29257ad859b8532d"
1143 | },
1144 | "dist": {
1145 | "type": "zip",
1146 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
1147 | "reference": "1289d16209491b584839022f29257ad859b8532d",
1148 | "shasum": ""
1149 | },
1150 | "require": {
1151 | "php": ">=5.3.3"
1152 | },
1153 | "suggest": {
1154 | "ext-mbstring": "For best performance"
1155 | },
1156 | "type": "library",
1157 | "extra": {
1158 | "branch-alias": {
1159 | "dev-master": "1.1-dev"
1160 | }
1161 | },
1162 | "autoload": {
1163 | "psr-4": {
1164 | "Symfony\\Polyfill\\Mbstring\\": ""
1165 | },
1166 | "files": [
1167 | "bootstrap.php"
1168 | ]
1169 | },
1170 | "notification-url": "https://packagist.org/downloads/",
1171 | "license": [
1172 | "MIT"
1173 | ],
1174 | "authors": [
1175 | {
1176 | "name": "Nicolas Grekas",
1177 | "email": "p@tchwork.com"
1178 | },
1179 | {
1180 | "name": "Symfony Community",
1181 | "homepage": "https://symfony.com/contributors"
1182 | }
1183 | ],
1184 | "description": "Symfony polyfill for the Mbstring extension",
1185 | "homepage": "https://symfony.com",
1186 | "keywords": [
1187 | "compatibility",
1188 | "mbstring",
1189 | "polyfill",
1190 | "portable",
1191 | "shim"
1192 | ],
1193 | "time": "2016-01-20 09:13:37"
1194 | },
1195 | {
1196 | "name": "symfony/yaml",
1197 | "version": "v2.8.4",
1198 | "source": {
1199 | "type": "git",
1200 | "url": "https://github.com/symfony/yaml.git",
1201 | "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb"
1202 | },
1203 | "dist": {
1204 | "type": "zip",
1205 | "url": "https://api.github.com/repos/symfony/yaml/zipball/584e52cb8f788a887553ba82db6caacb1d6260bb",
1206 | "reference": "584e52cb8f788a887553ba82db6caacb1d6260bb",
1207 | "shasum": ""
1208 | },
1209 | "require": {
1210 | "php": ">=5.3.9"
1211 | },
1212 | "type": "library",
1213 | "extra": {
1214 | "branch-alias": {
1215 | "dev-master": "2.8-dev"
1216 | }
1217 | },
1218 | "autoload": {
1219 | "psr-4": {
1220 | "Symfony\\Component\\Yaml\\": ""
1221 | },
1222 | "exclude-from-classmap": [
1223 | "/Tests/"
1224 | ]
1225 | },
1226 | "notification-url": "https://packagist.org/downloads/",
1227 | "license": [
1228 | "MIT"
1229 | ],
1230 | "authors": [
1231 | {
1232 | "name": "Fabien Potencier",
1233 | "email": "fabien@symfony.com"
1234 | },
1235 | {
1236 | "name": "Symfony Community",
1237 | "homepage": "https://symfony.com/contributors"
1238 | }
1239 | ],
1240 | "description": "Symfony Yaml Component",
1241 | "homepage": "https://symfony.com",
1242 | "time": "2016-03-04 07:54:35"
1243 | }
1244 | ],
1245 | "aliases": [],
1246 | "minimum-stability": "stable",
1247 | "stability-flags": [],
1248 | "prefer-stable": false,
1249 | "prefer-lowest": false,
1250 | "platform": {
1251 | "php": ">=5.4"
1252 | },
1253 | "platform-dev": []
1254 | }
1255 |
--------------------------------------------------------------------------------