scratch
/vendor/aura/installer-default/LICENSE |
---|
@@ -0,0 +1,23 @@ |
Copyright (c) 2012, The Aura Project for PHP |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions are met: |
- Redistributions of source code must retain the above copyright notice, this |
list of conditions and the following disclaimer. |
- Redistributions in binary form must reproduce the above copyright notice, |
this list of conditions and the following disclaimer in the documentation |
and/or other materials provided with the distribution. |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
/vendor/aura/installer-default/README.md |
---|
@@ -0,0 +1,12 @@ |
Default Installer for Aura System |
================================= |
Using this installer, all [Composer][] packages of `"type" : "aura-package"` |
will be installed in the default location of |
`vendor/vendor_name/package_name`. |
Note that this is not an Aura package proper; it is designed for use directly |
with Composer, and as such will be placed in `vendor` not `package`. |
[Composer]: http://getcomposer.org/ |
[Aura system]: https://github.com/auraphp/system |
/vendor/aura/installer-default/composer.json |
---|
@@ -0,0 +1,23 @@ |
{ |
"name": "aura/installer-default", |
"version": "1.0.0", |
"type": "composer-installer", |
"license": "BSD-2-Clause", |
"description": "Installs Aura packages using the Composer defaults.", |
"keywords": ["aura", "installer"], |
"authors": [ |
{ |
"name": "Paul M. Jones", |
"email": "pmjones88@gmail.com", |
"homepage": "http://paul-m-jones.com" |
} |
], |
"autoload": { |
"psr-0": { |
"Aura\\Composer\\": "src/" |
} |
}, |
"extra" : { |
"class" : "Aura\\Composer\\DefaultInstaller" |
} |
} |
/vendor/aura/installer-default/src/Aura/Composer/DefaultInstaller.php |
---|
@@ -0,0 +1,22 @@ |
<?php |
namespace Aura\Composer; |
use Composer\Package\PackageInterface; |
use Composer\Installer\LibraryInstaller; |
/** |
* |
* Really, we do nothing here, other than recognize `"type" : "aura-package". |
* It installs like any other library package for Composer. |
* |
*/ |
class DefaultInstaller extends LibraryInstaller |
{ |
/** |
* {@inheritDoc} |
*/ |
public function supports($packageType) |
{ |
return $packageType == 'aura-package'; |
} |
} |
/vendor/aura/uri/.gitignore |
---|
@@ -0,0 +1 @@ |
tests/tmp |
/vendor/aura/uri/.travis.yml |
---|
@@ -0,0 +1,7 @@ |
language: php |
php: |
- 5.4 |
- 5.5 |
before_script: |
- cd tests |
script: phpunit |
/vendor/aura/uri/LICENSE |
---|
@@ -0,0 +1,23 @@ |
Copyright (c) 2011-2013, Aura for PHP |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions are met: |
- Redistributions of source code must retain the above copyright notice, this |
list of conditions and the following disclaimer. |
- Redistributions in binary form must reproduce the above copyright notice, |
this list of conditions and the following disclaimer in the documentation |
and/or other materials provided with the distribution. |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
/vendor/aura/uri/README.md |
---|
@@ -0,0 +1,162 @@ |
Aura.Uri |
======== |
[![Build Status](https://travis-ci.org/auraphp/Aura.Uri.png?branch=develop)](https://travis-ci.org/auraphp/Aura.Uri) |
The `Auri.Uri` package provides objects to help you create and manipulate URLs, |
including query strings and path elements. It does so by splitting up the pieces |
of the URL and allowing you modify them individually; you can then fetch |
them as a single URL string. This helps when building complex links, |
such as in a paged navigation system. |
This package is compliant with [PSR-0][], [PSR-1][], and [PSR-2][]. If you |
notice compliance oversights, please send a patch via pull request. |
[PSR-0]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md |
[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md |
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md |
Getting Started |
=============== |
Instantiation |
------------- |
The easiest way to instantiate a URL object is to use the factory instance |
script, like so: |
```php |
<?php |
$url_factory = require '/path/to/Aura.Uri/scripts/instance.php'; |
$url = $url_factory->newCurrent(); |
``` |
Alternatively, you can add the `src/` directory to your autoloader and |
instantiate a URL factory object: |
```php |
<?php |
use Aura\Uri\Url\Factory as UrlFactory; |
use Aura\Uri\PublicSuffixList; |
$psl = new PublicSuffixList(require '/path/to/Aura.Uri/data/public-suffix-list.php'); |
$url_factory = new UrlFactory($_SERVER, $psl); |
$url = $url_factory->newCurrent(); |
``` |
When using the factory, you can populate the URL properties from a URL |
string: |
```php |
<?php |
$string = 'http://anonymous:guest@example.com/path/to/index.php/foo/bar.xml?baz=dib#anchor'); |
$url = $url_factory->newInstance($string); |
// now the $url properties are ... |
// |
// $url->scheme => 'http' |
// $url->user => 'anonymous' |
// $url->pass => 'guest' |
// $url->host => Aura\Uri\Host, with these methods: |
// ->get() => 'example.com' |
// ->getSubdomain() => null |
// ->getRegisterableDomain() => 'example.com' |
// ->getPublicSuffix() => 'com' |
// $url->port => null |
// $url->path => Aura\Uri\Path, with these ArrayObject elements: |
// ['path', 'to', 'index.php', 'foo', 'bar'] |
// and this method: |
// ->getFormat() => '.xml' |
// $url->query => Aura\Uri\Query, with these ArrayObject elements: |
// ['baz' => 'dib'] |
// $url->fragment => 'anchor' |
``` |
Alternatively, you can use the factory to create a URL representing the |
current web request URI: |
```php |
<?php |
$url = $url_factory->newCurrent(); |
``` |
Manipulation |
------------ |
After we have created the URL object, we can modify the component parts, then |
fetch a new URL string from the modified object. |
```php |
<?php |
// start with a full URL |
$string = 'http://anonymous:guest@example.com/path/to/index.php/foo/bar.xml?baz=dib#anchor'; |
$url = $url_factory->newInstance($string); |
// change to 'https://' |
$url->setScheme('https'); |
// remove the username and password |
$url->setUser(null); |
$url->setPass(null); |
// change the value of 'baz' from 'dib' to 'zab' |
$url->query->baz = 'zab'; |
// add a new query element called 'zim' with a value of 'gir' |
$url->query->zim = 'gir'; |
// reset the path to something else entirely. |
// this will additionally set the format to '.php'. |
$url->path->setFromString('/something/else/entirely.php'); |
// add another path element |
$url->path[] = 'another'; |
// get the url as a string; this will be without the scheme, host, port, |
// user, or pass. |
$new_url = $url->get(); |
// the $new_url string is as follows; notice how the format |
// is always applied to the last path-element: |
// /something/else/entirely/another.php?baz=zab&zim=gir#anchor |
// get the full url string, including scheme, host, port, user, and pass. |
$full_url = $url->getFull(); |
// the $full_url string is as follows: |
// https://example.com/something/else/entirely/another.php?baz=zab&zim=gir#anchor |
``` |
Public Suffix List Host Parsing |
=============================== |
Host Component Parts |
-------------------- |
In addition to URL creation and manipulation, `Aura.Uri` is capable of parsing a |
host into its component parts, namely the host's subdomain, registerable domain, |
and public suffix. A host's component parts are available via properties on the |
Aura.Uri host object, as seen in the examples above. |
Public Suffix List |
------------------ |
This parsing capability is possible as a result of the [Public Suffix List][], a community |
resource and initiative of Mozilla. |
Updating the Public Suffix List |
------------------------------- |
As the Public Suffix List is both an external resource and a living document, it's |
important that you update your copy of the list from time to time. You can do this |
by executing the provided `update.php` script. |
`php /path/to/Aura.Uri/scripts/update.php` |
Executing `update.php` will retrieve the most current version of the Public Suffix |
List, parse it to an array, and store it in the `/path/to/Aura.Uri/data` directory. |
[Public Suffix List]: http://publicsuffix.org/ |
* * * |
/vendor/aura/uri/TODO.md |
---|
@@ -0,0 +1,3 @@ |
* Per Bahtiar Gadimov, we may eventually need an additional Parser |
class, but at this point that may be overkill. |
<https://bugs.php.net/bug.php?id=52923> |
/vendor/aura/uri/composer.json |
---|
@@ -0,0 +1,48 @@ |
{ |
"name": "aura/uri", |
"version": "1.2.0", |
"type": "aura-package", |
"description": "The Aura Uri package provides tools to build and manipulate URL strings.", |
"keywords": [ |
"uri", |
"url" |
], |
"homepage": "http://auraphp.com/Aura.Uri", |
"time": "2014-05-31", |
"license": "BSD-2-Clause", |
"authors": [ |
{ |
"name": "Aura.Uri Contributors", |
"homepage": "https://github.com/auraphp/Aura.Uri/contributors" |
}, |
{ |
"name": "Paul M. Jones", |
"email": "pmjones88@gmail.com", |
"homepage": "http://paul-m-jones.com" |
}, |
{ |
"name": "Jonathon Hill", |
"email": "jhill9693@gmail.com", |
"homepage": "http://jonathonhill.net" |
}, |
{ |
"name": "Hari KT", |
"email": "kthari85@gmail.com", |
"homepage": "http://harikt.com" |
}, |
{ |
"name": "Jeremy Kendall", |
"email": "jeremy@jeremykendall.net", |
"homepage": "http://www.jeremykendall.net" |
} |
], |
"require": { |
"php": ">=5.4.0", |
"aura/installer-default": "1.0.*" |
}, |
"autoload": { |
"psr-0": { |
"Aura\\Uri": "src/" |
} |
} |
} |
/vendor/aura/uri/config/default.php |
---|
@@ -0,0 +1,18 @@ |
<?php |
/** |
* Loader |
*/ |
$loader->add('Aura\Uri\\', dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src'); |
/** |
* Aura\Uri\PublicSuffixList |
*/ |
$di->params['Aura\Uri\PublicSuffixList']['list'] = $di->lazyRequire( |
dirname(__DIR__) . '/data/public-suffix-list.php' |
); |
/** |
* Aura\Uri\Url\Factory |
*/ |
$di->params['Aura\Uri\Url\Factory']['server'] = $_SERVER; |
$di->params['Aura\Uri\Url\Factory']['psl'] = $di->lazyNew('Aura\Uri\PublicSuffixList'); |
/vendor/aura/uri/config/test.php |
---|
@@ -0,0 +1,5 @@ |
<?php |
/** |
* Loader |
*/ |
$loader->add('Aura\Uri\\', dirname(__DIR__) . DIRECTORY_SEPARATOR . 'tests'); |
/vendor/aura/uri/data/public-suffix-list.php |
---|
@@ -0,0 +1,19885 @@ |
<?php |
return array ( |
'ac' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'mil' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'ad' => |
array ( |
'nom' => |
array ( |
), |
), |
'ae' => |
array ( |
'co' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sch' => |
array ( |
), |
'ac' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'aero' => |
array ( |
'accident-investigation' => |
array ( |
), |
'accident-prevention' => |
array ( |
), |
'aerobatic' => |
array ( |
), |
'aeroclub' => |
array ( |
), |
'aerodrome' => |
array ( |
), |
'agents' => |
array ( |
), |
'aircraft' => |
array ( |
), |
'airline' => |
array ( |
), |
'airport' => |
array ( |
), |
'air-surveillance' => |
array ( |
), |
'airtraffic' => |
array ( |
), |
'air-traffic-control' => |
array ( |
), |
'ambulance' => |
array ( |
), |
'amusement' => |
array ( |
), |
'association' => |
array ( |
), |
'author' => |
array ( |
), |
'ballooning' => |
array ( |
), |
'broker' => |
array ( |
), |
'caa' => |
array ( |
), |
'cargo' => |
array ( |
), |
'catering' => |
array ( |
), |
'certification' => |
array ( |
), |
'championship' => |
array ( |
), |
'charter' => |
array ( |
), |
'civilaviation' => |
array ( |
), |
'club' => |
array ( |
), |
'conference' => |
array ( |
), |
'consultant' => |
array ( |
), |
'consulting' => |
array ( |
), |
'control' => |
array ( |
), |
'council' => |
array ( |
), |
'crew' => |
array ( |
), |
'design' => |
array ( |
), |
'dgca' => |
array ( |
), |
'educator' => |
array ( |
), |
'emergency' => |
array ( |
), |
'engine' => |
array ( |
), |
'engineer' => |
array ( |
), |
'entertainment' => |
array ( |
), |
'equipment' => |
array ( |
), |
'exchange' => |
array ( |
), |
'express' => |
array ( |
), |
'federation' => |
array ( |
), |
'flight' => |
array ( |
), |
'freight' => |
array ( |
), |
'fuel' => |
array ( |
), |
'gliding' => |
array ( |
), |
'government' => |
array ( |
), |
'groundhandling' => |
array ( |
), |
'group' => |
array ( |
), |
'hanggliding' => |
array ( |
), |
'homebuilt' => |
array ( |
), |
'insurance' => |
array ( |
), |
'journal' => |
array ( |
), |
'journalist' => |
array ( |
), |
'leasing' => |
array ( |
), |
'logistics' => |
array ( |
), |
'magazine' => |
array ( |
), |
'maintenance' => |
array ( |
), |
'marketplace' => |
array ( |
), |
'media' => |
array ( |
), |
'microlight' => |
array ( |
), |
'modelling' => |
array ( |
), |
'navigation' => |
array ( |
), |
'parachuting' => |
array ( |
), |
'paragliding' => |
array ( |
), |
'passenger-association' => |
array ( |
), |
'pilot' => |
array ( |
), |
'press' => |
array ( |
), |
'production' => |
array ( |
), |
'recreation' => |
array ( |
), |
'repbody' => |
array ( |
), |
'res' => |
array ( |
), |
'research' => |
array ( |
), |
'rotorcraft' => |
array ( |
), |
'safety' => |
array ( |
), |
'scientist' => |
array ( |
), |
'services' => |
array ( |
), |
'show' => |
array ( |
), |
'skydiving' => |
array ( |
), |
'software' => |
array ( |
), |
'student' => |
array ( |
), |
'taxi' => |
array ( |
), |
'trader' => |
array ( |
), |
'trading' => |
array ( |
), |
'trainer' => |
array ( |
), |
'union' => |
array ( |
), |
'workinggroup' => |
array ( |
), |
'works' => |
array ( |
), |
), |
'af' => |
array ( |
'gov' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'ag' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'co' => |
array ( |
), |
'nom' => |
array ( |
), |
), |
'ai' => |
array ( |
'off' => |
array ( |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'al' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'am' => |
array ( |
), |
'an' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'ao' => |
array ( |
'ed' => |
array ( |
), |
'gv' => |
array ( |
), |
'og' => |
array ( |
), |
'co' => |
array ( |
), |
'pb' => |
array ( |
), |
'it' => |
array ( |
), |
), |
'aq' => |
array ( |
), |
'ar' => |
array ( |
'com' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'edu' => |
array ( |
), |
'gob' => |
array ( |
), |
'int' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'tur' => |
array ( |
), |
), |
'arpa' => |
array ( |
'e164' => |
array ( |
), |
'in-addr' => |
array ( |
), |
'ip6' => |
array ( |
), |
'iris' => |
array ( |
), |
'uri' => |
array ( |
), |
'urn' => |
array ( |
), |
), |
'as' => |
array ( |
'gov' => |
array ( |
), |
), |
'asia' => |
array ( |
), |
'at' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'gv' => |
array ( |
), |
'or' => |
array ( |
), |
'biz' => |
array ( |
), |
'info' => |
array ( |
), |
'priv' => |
array ( |
), |
), |
'au' => |
array ( |
'com' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
'act' => |
array ( |
), |
'nsw' => |
array ( |
), |
'nt' => |
array ( |
), |
'qld' => |
array ( |
), |
'sa' => |
array ( |
), |
'tas' => |
array ( |
), |
'vic' => |
array ( |
), |
'wa' => |
array ( |
), |
), |
'gov' => |
array ( |
'act' => |
array ( |
), |
'qld' => |
array ( |
), |
'sa' => |
array ( |
), |
'tas' => |
array ( |
), |
'vic' => |
array ( |
), |
'wa' => |
array ( |
), |
), |
'asn' => |
array ( |
), |
'id' => |
array ( |
), |
'csiro' => |
array ( |
), |
'info' => |
array ( |
), |
'conf' => |
array ( |
), |
'oz' => |
array ( |
), |
'act' => |
array ( |
), |
'nsw' => |
array ( |
), |
'nt' => |
array ( |
), |
'qld' => |
array ( |
), |
'sa' => |
array ( |
), |
'tas' => |
array ( |
), |
'vic' => |
array ( |
), |
'wa' => |
array ( |
), |
), |
'aw' => |
array ( |
'com' => |
array ( |
), |
), |
'ax' => |
array ( |
), |
'az' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'int' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'info' => |
array ( |
), |
'pp' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
'pro' => |
array ( |
), |
'biz' => |
array ( |
), |
), |
'ba' => |
array ( |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'unsa' => |
array ( |
), |
'unbi' => |
array ( |
), |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'rs' => |
array ( |
), |
), |
'bb' => |
array ( |
'biz' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'store' => |
array ( |
), |
), |
'bd' => |
array ( |
'*' => |
array ( |
), |
), |
'be' => |
array ( |
'ac' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'bf' => |
array ( |
'gov' => |
array ( |
), |
), |
'bg' => |
array ( |
'a' => |
array ( |
), |
'b' => |
array ( |
), |
'c' => |
array ( |
), |
'd' => |
array ( |
), |
'e' => |
array ( |
), |
'f' => |
array ( |
), |
'g' => |
array ( |
), |
'h' => |
array ( |
), |
'i' => |
array ( |
), |
'j' => |
array ( |
), |
'k' => |
array ( |
), |
'l' => |
array ( |
), |
'm' => |
array ( |
), |
'n' => |
array ( |
), |
'o' => |
array ( |
), |
'p' => |
array ( |
), |
'q' => |
array ( |
), |
'r' => |
array ( |
), |
's' => |
array ( |
), |
't' => |
array ( |
), |
'u' => |
array ( |
), |
'v' => |
array ( |
), |
'w' => |
array ( |
), |
'x' => |
array ( |
), |
'y' => |
array ( |
), |
'z' => |
array ( |
), |
0 => |
array ( |
), |
1 => |
array ( |
), |
2 => |
array ( |
), |
3 => |
array ( |
), |
4 => |
array ( |
), |
5 => |
array ( |
), |
6 => |
array ( |
), |
7 => |
array ( |
), |
8 => |
array ( |
), |
9 => |
array ( |
), |
), |
'bh' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'bi' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'or' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'biz' => |
array ( |
'dyndns' => |
array ( |
), |
'for-better' => |
array ( |
), |
'for-more' => |
array ( |
), |
'for-some' => |
array ( |
), |
'for-the' => |
array ( |
), |
'selfip' => |
array ( |
), |
'webhop' => |
array ( |
), |
), |
'bj' => |
array ( |
'asso' => |
array ( |
), |
'barreau' => |
array ( |
), |
'gouv' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'bm' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'bn' => |
array ( |
'*' => |
array ( |
), |
), |
'bo' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'gob' => |
array ( |
), |
'int' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'mil' => |
array ( |
), |
'tv' => |
array ( |
), |
), |
'br' => |
array ( |
'adm' => |
array ( |
), |
'adv' => |
array ( |
), |
'agr' => |
array ( |
), |
'am' => |
array ( |
), |
'arq' => |
array ( |
), |
'art' => |
array ( |
), |
'ato' => |
array ( |
), |
'b' => |
array ( |
), |
'bio' => |
array ( |
), |
'blog' => |
array ( |
), |
'bmd' => |
array ( |
), |
'cim' => |
array ( |
), |
'cng' => |
array ( |
), |
'cnt' => |
array ( |
), |
'com' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'coop' => |
array ( |
), |
'ecn' => |
array ( |
), |
'eco' => |
array ( |
), |
'edu' => |
array ( |
), |
'emp' => |
array ( |
), |
'eng' => |
array ( |
), |
'esp' => |
array ( |
), |
'etc' => |
array ( |
), |
'eti' => |
array ( |
), |
'far' => |
array ( |
), |
'flog' => |
array ( |
), |
'fm' => |
array ( |
), |
'fnd' => |
array ( |
), |
'fot' => |
array ( |
), |
'fst' => |
array ( |
), |
'g12' => |
array ( |
), |
'ggf' => |
array ( |
), |
'gov' => |
array ( |
), |
'imb' => |
array ( |
), |
'ind' => |
array ( |
), |
'inf' => |
array ( |
), |
'jor' => |
array ( |
), |
'jus' => |
array ( |
), |
'leg' => |
array ( |
), |
'lel' => |
array ( |
), |
'mat' => |
array ( |
), |
'med' => |
array ( |
), |
'mil' => |
array ( |
), |
'mp' => |
array ( |
), |
'mus' => |
array ( |
), |
'net' => |
array ( |
), |
'nom' => |
array ( |
), |
'not' => |
array ( |
), |
'ntr' => |
array ( |
), |
'odo' => |
array ( |
), |
'org' => |
array ( |
), |
'ppg' => |
array ( |
), |
'pro' => |
array ( |
), |
'psc' => |
array ( |
), |
'psi' => |
array ( |
), |
'qsl' => |
array ( |
), |
'radio' => |
array ( |
), |
'rec' => |
array ( |
), |
'slg' => |
array ( |
), |
'srv' => |
array ( |
), |
'taxi' => |
array ( |
), |
'teo' => |
array ( |
), |
'tmp' => |
array ( |
), |
'trd' => |
array ( |
), |
'tur' => |
array ( |
), |
'tv' => |
array ( |
), |
'vet' => |
array ( |
), |
'vlog' => |
array ( |
), |
'wiki' => |
array ( |
), |
'zlg' => |
array ( |
), |
), |
'bs' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'bt' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'bv' => |
array ( |
), |
'bw' => |
array ( |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'by' => |
array ( |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
'of' => |
array ( |
), |
), |
'bz' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'za' => |
array ( |
), |
), |
'ca' => |
array ( |
'ab' => |
array ( |
), |
'bc' => |
array ( |
), |
'mb' => |
array ( |
), |
'nb' => |
array ( |
), |
'nf' => |
array ( |
), |
'nl' => |
array ( |
), |
'ns' => |
array ( |
), |
'nt' => |
array ( |
), |
'nu' => |
array ( |
), |
'on' => |
array ( |
), |
'pe' => |
array ( |
), |
'qc' => |
array ( |
), |
'sk' => |
array ( |
), |
'yk' => |
array ( |
), |
'gc' => |
array ( |
), |
'co' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'cat' => |
array ( |
), |
'cc' => |
array ( |
'ftpaccess' => |
array ( |
), |
'game-server' => |
array ( |
), |
'myphotos' => |
array ( |
), |
'scrapping' => |
array ( |
), |
), |
'cd' => |
array ( |
'gov' => |
array ( |
), |
), |
'cf' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'cg' => |
array ( |
), |
'ch' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'ci' => |
array ( |
'org' => |
array ( |
), |
'or' => |
array ( |
), |
'com' => |
array ( |
), |
'co' => |
array ( |
), |
'edu' => |
array ( |
), |
'ed' => |
array ( |
), |
'ac' => |
array ( |
), |
'net' => |
array ( |
), |
'go' => |
array ( |
), |
'asso' => |
array ( |
), |
'aéroport' => |
array ( |
), |
'int' => |
array ( |
), |
'presse' => |
array ( |
), |
'md' => |
array ( |
), |
'gouv' => |
array ( |
), |
), |
'ck' => |
array ( |
'*' => |
array ( |
), |
'www' => |
array ( |
'!' => '', |
), |
), |
'cl' => |
array ( |
'gov' => |
array ( |
), |
'gob' => |
array ( |
), |
'co' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'cm' => |
array ( |
'gov' => |
array ( |
), |
), |
'cn' => |
array ( |
'ac' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'mil' => |
array ( |
), |
'公司' => |
array ( |
), |
'网络' => |
array ( |
), |
'網絡' => |
array ( |
), |
'ah' => |
array ( |
), |
'bj' => |
array ( |
), |
'cq' => |
array ( |
), |
'fj' => |
array ( |
), |
'gd' => |
array ( |
), |
'gs' => |
array ( |
), |
'gz' => |
array ( |
), |
'gx' => |
array ( |
), |
'ha' => |
array ( |
), |
'hb' => |
array ( |
), |
'he' => |
array ( |
), |
'hi' => |
array ( |
), |
'hl' => |
array ( |
), |
'hn' => |
array ( |
), |
'jl' => |
array ( |
), |
'js' => |
array ( |
), |
'jx' => |
array ( |
), |
'ln' => |
array ( |
), |
'nm' => |
array ( |
), |
'nx' => |
array ( |
), |
'qh' => |
array ( |
), |
'sc' => |
array ( |
), |
'sd' => |
array ( |
), |
'sh' => |
array ( |
), |
'sn' => |
array ( |
), |
'sx' => |
array ( |
), |
'tj' => |
array ( |
), |
'xj' => |
array ( |
), |
'xz' => |
array ( |
), |
'yn' => |
array ( |
), |
'zj' => |
array ( |
), |
'hk' => |
array ( |
), |
'mo' => |
array ( |
), |
'tw' => |
array ( |
), |
), |
'co' => |
array ( |
'arts' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'firm' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
'int' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'nom' => |
array ( |
), |
'org' => |
array ( |
), |
'rec' => |
array ( |
), |
'web' => |
array ( |
), |
), |
'com' => |
array ( |
'amazonaws' => |
array ( |
'compute' => |
array ( |
'ap-northeast-1' => |
array ( |
), |
'ap-southeast-1' => |
array ( |
), |
'ap-southeast-2' => |
array ( |
), |
'eu-west-1' => |
array ( |
), |
'sa-east-1' => |
array ( |
), |
'us-gov-west-1' => |
array ( |
), |
'us-west-1' => |
array ( |
), |
'us-west-2' => |
array ( |
), |
), |
'us-east-1' => |
array ( |
), |
'compute-1' => |
array ( |
'z-1' => |
array ( |
), |
'z-2' => |
array ( |
), |
), |
'elb' => |
array ( |
), |
's3' => |
array ( |
), |
's3-us-west-2' => |
array ( |
), |
's3-us-west-1' => |
array ( |
), |
's3-eu-west-1' => |
array ( |
), |
's3-ap-southeast-1' => |
array ( |
), |
's3-ap-southeast-2' => |
array ( |
), |
's3-ap-northeast-1' => |
array ( |
), |
's3-sa-east-1' => |
array ( |
), |
's3-us-gov-west-1' => |
array ( |
), |
's3-fips-us-gov-west-1' => |
array ( |
), |
's3-website-us-east-1' => |
array ( |
), |
's3-website-us-west-2' => |
array ( |
), |
's3-website-us-west-1' => |
array ( |
), |
's3-website-eu-west-1' => |
array ( |
), |
's3-website-ap-southeast-1' => |
array ( |
), |
's3-website-ap-southeast-2' => |
array ( |
), |
's3-website-ap-northeast-1' => |
array ( |
), |
's3-website-sa-east-1' => |
array ( |
), |
's3-website-us-gov-west-1' => |
array ( |
), |
), |
'elasticbeanstalk' => |
array ( |
), |
'betainabox' => |
array ( |
), |
'ar' => |
array ( |
), |
'br' => |
array ( |
), |
'cn' => |
array ( |
), |
'de' => |
array ( |
), |
'eu' => |
array ( |
), |
'gb' => |
array ( |
), |
'hu' => |
array ( |
), |
'jpn' => |
array ( |
), |
'kr' => |
array ( |
), |
'mex' => |
array ( |
), |
'no' => |
array ( |
), |
'qc' => |
array ( |
), |
'ru' => |
array ( |
), |
'sa' => |
array ( |
), |
'se' => |
array ( |
), |
'uk' => |
array ( |
), |
'us' => |
array ( |
), |
'uy' => |
array ( |
), |
'za' => |
array ( |
), |
'africa' => |
array ( |
), |
'gr' => |
array ( |
), |
'co' => |
array ( |
), |
'cloudcontrolled' => |
array ( |
), |
'cloudcontrolapp' => |
array ( |
), |
'dreamhosters' => |
array ( |
), |
'dyndns-at-home' => |
array ( |
), |
'dyndns-at-work' => |
array ( |
), |
'dyndns-blog' => |
array ( |
), |
'dyndns-free' => |
array ( |
), |
'dyndns-home' => |
array ( |
), |
'dyndns-ip' => |
array ( |
), |
'dyndns-mail' => |
array ( |
), |
'dyndns-office' => |
array ( |
), |
'dyndns-pics' => |
array ( |
), |
'dyndns-remote' => |
array ( |
), |
'dyndns-server' => |
array ( |
), |
'dyndns-web' => |
array ( |
), |
'dyndns-wiki' => |
array ( |
), |
'dyndns-work' => |
array ( |
), |
'blogdns' => |
array ( |
), |
'cechire' => |
array ( |
), |
'dnsalias' => |
array ( |
), |
'dnsdojo' => |
array ( |
), |
'doesntexist' => |
array ( |
), |
'dontexist' => |
array ( |
), |
'doomdns' => |
array ( |
), |
'dyn-o-saur' => |
array ( |
), |
'dynalias' => |
array ( |
), |
'est-a-la-maison' => |
array ( |
), |
'est-a-la-masion' => |
array ( |
), |
'est-le-patron' => |
array ( |
), |
'est-mon-blogueur' => |
array ( |
), |
'from-ak' => |
array ( |
), |
'from-al' => |
array ( |
), |
'from-ar' => |
array ( |
), |
'from-ca' => |
array ( |
), |
'from-ct' => |
array ( |
), |
'from-dc' => |
array ( |
), |
'from-de' => |
array ( |
), |
'from-fl' => |
array ( |
), |
'from-ga' => |
array ( |
), |
'from-hi' => |
array ( |
), |
'from-ia' => |
array ( |
), |
'from-id' => |
array ( |
), |
'from-il' => |
array ( |
), |
'from-in' => |
array ( |
), |
'from-ks' => |
array ( |
), |
'from-ky' => |
array ( |
), |
'from-ma' => |
array ( |
), |
'from-md' => |
array ( |
), |
'from-mi' => |
array ( |
), |
'from-mn' => |
array ( |
), |
'from-mo' => |
array ( |
), |
'from-ms' => |
array ( |
), |
'from-mt' => |
array ( |
), |
'from-nc' => |
array ( |
), |
'from-nd' => |
array ( |
), |
'from-ne' => |
array ( |
), |
'from-nh' => |
array ( |
), |
'from-nj' => |
array ( |
), |
'from-nm' => |
array ( |
), |
'from-nv' => |
array ( |
), |
'from-oh' => |
array ( |
), |
'from-ok' => |
array ( |
), |
'from-or' => |
array ( |
), |
'from-pa' => |
array ( |
), |
'from-pr' => |
array ( |
), |
'from-ri' => |
array ( |
), |
'from-sc' => |
array ( |
), |
'from-sd' => |
array ( |
), |
'from-tn' => |
array ( |
), |
'from-tx' => |
array ( |
), |
'from-ut' => |
array ( |
), |
'from-va' => |
array ( |
), |
'from-vt' => |
array ( |
), |
'from-wa' => |
array ( |
), |
'from-wi' => |
array ( |
), |
'from-wv' => |
array ( |
), |
'from-wy' => |
array ( |
), |
'getmyip' => |
array ( |
), |
'gotdns' => |
array ( |
), |
'hobby-site' => |
array ( |
), |
'homelinux' => |
array ( |
), |
'homeunix' => |
array ( |
), |
'iamallama' => |
array ( |
), |
'is-a-anarchist' => |
array ( |
), |
'is-a-blogger' => |
array ( |
), |
'is-a-bookkeeper' => |
array ( |
), |
'is-a-bulls-fan' => |
array ( |
), |
'is-a-caterer' => |
array ( |
), |
'is-a-chef' => |
array ( |
), |
'is-a-conservative' => |
array ( |
), |
'is-a-cpa' => |
array ( |
), |
'is-a-cubicle-slave' => |
array ( |
), |
'is-a-democrat' => |
array ( |
), |
'is-a-designer' => |
array ( |
), |
'is-a-doctor' => |
array ( |
), |
'is-a-financialadvisor' => |
array ( |
), |
'is-a-geek' => |
array ( |
), |
'is-a-green' => |
array ( |
), |
'is-a-guru' => |
array ( |
), |
'is-a-hard-worker' => |
array ( |
), |
'is-a-hunter' => |
array ( |
), |
'is-a-landscaper' => |
array ( |
), |
'is-a-lawyer' => |
array ( |
), |
'is-a-liberal' => |
array ( |
), |
'is-a-libertarian' => |
array ( |
), |
'is-a-llama' => |
array ( |
), |
'is-a-musician' => |
array ( |
), |
'is-a-nascarfan' => |
array ( |
), |
'is-a-nurse' => |
array ( |
), |
'is-a-painter' => |
array ( |
), |
'is-a-personaltrainer' => |
array ( |
), |
'is-a-photographer' => |
array ( |
), |
'is-a-player' => |
array ( |
), |
'is-a-republican' => |
array ( |
), |
'is-a-rockstar' => |
array ( |
), |
'is-a-socialist' => |
array ( |
), |
'is-a-student' => |
array ( |
), |
'is-a-teacher' => |
array ( |
), |
'is-a-techie' => |
array ( |
), |
'is-a-therapist' => |
array ( |
), |
'is-an-accountant' => |
array ( |
), |
'is-an-actor' => |
array ( |
), |
'is-an-actress' => |
array ( |
), |
'is-an-anarchist' => |
array ( |
), |
'is-an-artist' => |
array ( |
), |
'is-an-engineer' => |
array ( |
), |
'is-an-entertainer' => |
array ( |
), |
'is-certified' => |
array ( |
), |
'is-gone' => |
array ( |
), |
'is-into-anime' => |
array ( |
), |
'is-into-cars' => |
array ( |
), |
'is-into-cartoons' => |
array ( |
), |
'is-into-games' => |
array ( |
), |
'is-leet' => |
array ( |
), |
'is-not-certified' => |
array ( |
), |
'is-slick' => |
array ( |
), |
'is-uberleet' => |
array ( |
), |
'is-with-theband' => |
array ( |
), |
'isa-geek' => |
array ( |
), |
'isa-hockeynut' => |
array ( |
), |
'issmarterthanyou' => |
array ( |
), |
'likes-pie' => |
array ( |
), |
'likescandy' => |
array ( |
), |
'neat-url' => |
array ( |
), |
'saves-the-whales' => |
array ( |
), |
'selfip' => |
array ( |
), |
'sells-for-less' => |
array ( |
), |
'sells-for-u' => |
array ( |
), |
'servebbs' => |
array ( |
), |
'simple-url' => |
array ( |
), |
'space-to-rent' => |
array ( |
), |
'teaches-yoga' => |
array ( |
), |
'writesthisblog' => |
array ( |
), |
'githubusercontent' => |
array ( |
), |
'ro' => |
array ( |
), |
'appspot' => |
array ( |
), |
'blogspot' => |
array ( |
), |
'codespot' => |
array ( |
), |
'googleapis' => |
array ( |
), |
'googlecode' => |
array ( |
), |
'withgoogle' => |
array ( |
), |
'herokuapp' => |
array ( |
), |
'herokussl' => |
array ( |
), |
'operaunite' => |
array ( |
), |
'outsystemscloud' => |
array ( |
), |
'rhcloud' => |
array ( |
), |
), |
'coop' => |
array ( |
), |
'cr' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'ed' => |
array ( |
), |
'fi' => |
array ( |
), |
'go' => |
array ( |
), |
'or' => |
array ( |
), |
'sa' => |
array ( |
), |
), |
'cu' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'inf' => |
array ( |
), |
), |
'cv' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'cw' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'cx' => |
array ( |
'gov' => |
array ( |
), |
'ath' => |
array ( |
), |
), |
'cy' => |
array ( |
'*' => |
array ( |
), |
), |
'cz' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'de' => |
array ( |
'com' => |
array ( |
), |
'fuettertdasnetz' => |
array ( |
), |
'isteingeek' => |
array ( |
), |
'istmein' => |
array ( |
), |
'lebtimnetz' => |
array ( |
), |
'leitungsen' => |
array ( |
), |
'traeumtgerade' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'dj' => |
array ( |
), |
'dk' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'dm' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'do' => |
array ( |
'art' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gob' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sld' => |
array ( |
), |
'web' => |
array ( |
), |
), |
'dz' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'asso' => |
array ( |
), |
'pol' => |
array ( |
), |
'art' => |
array ( |
), |
), |
'ec' => |
array ( |
'com' => |
array ( |
), |
'info' => |
array ( |
), |
'net' => |
array ( |
), |
'fin' => |
array ( |
), |
'k12' => |
array ( |
), |
'med' => |
array ( |
), |
'pro' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'gob' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'edu' => |
array ( |
), |
'ee' => |
array ( |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'riik' => |
array ( |
), |
'lib' => |
array ( |
), |
'med' => |
array ( |
), |
'com' => |
array ( |
), |
'pri' => |
array ( |
), |
'aip' => |
array ( |
), |
'org' => |
array ( |
), |
'fie' => |
array ( |
), |
), |
'eg' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'eun' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sci' => |
array ( |
), |
), |
'er' => |
array ( |
'*' => |
array ( |
), |
), |
'es' => |
array ( |
'com' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'nom' => |
array ( |
), |
'org' => |
array ( |
), |
'gob' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'et' => |
array ( |
'*' => |
array ( |
), |
), |
'eu' => |
array ( |
), |
'fi' => |
array ( |
'aland' => |
array ( |
), |
'blogspot' => |
array ( |
), |
'iki' => |
array ( |
), |
), |
'fj' => |
array ( |
'*' => |
array ( |
), |
), |
'fk' => |
array ( |
'*' => |
array ( |
), |
), |
'fm' => |
array ( |
), |
'fo' => |
array ( |
), |
'fr' => |
array ( |
'com' => |
array ( |
), |
'asso' => |
array ( |
), |
'nom' => |
array ( |
), |
'prd' => |
array ( |
), |
'presse' => |
array ( |
), |
'tm' => |
array ( |
), |
'aeroport' => |
array ( |
), |
'assedic' => |
array ( |
), |
'avocat' => |
array ( |
), |
'avoues' => |
array ( |
), |
'cci' => |
array ( |
), |
'chambagri' => |
array ( |
), |
'chirurgiens-dentistes' => |
array ( |
), |
'experts-comptables' => |
array ( |
), |
'geometre-expert' => |
array ( |
), |
'gouv' => |
array ( |
), |
'greta' => |
array ( |
), |
'huissier-justice' => |
array ( |
), |
'medecin' => |
array ( |
), |
'notaires' => |
array ( |
), |
'pharmacien' => |
array ( |
), |
'port' => |
array ( |
), |
'veterinaire' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'ga' => |
array ( |
), |
'gb' => |
array ( |
), |
'gd' => |
array ( |
), |
'ge' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'pvt' => |
array ( |
), |
), |
'gf' => |
array ( |
), |
'gg' => |
array ( |
'co' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'gh' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'gi' => |
array ( |
'com' => |
array ( |
), |
'ltd' => |
array ( |
), |
'gov' => |
array ( |
), |
'mod' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'gl' => |
array ( |
), |
'gm' => |
array ( |
), |
'gn' => |
array ( |
'ac' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'gov' => |
array ( |
), |
'gp' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'mobi' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'asso' => |
array ( |
), |
), |
'gq' => |
array ( |
), |
'gr' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'gs' => |
array ( |
), |
'gt' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gob' => |
array ( |
), |
'ind' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'gu' => |
array ( |
'*' => |
array ( |
), |
), |
'gw' => |
array ( |
), |
'gy' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'hk' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'idv' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'公司' => |
array ( |
), |
'教育' => |
array ( |
), |
'敎育' => |
array ( |
), |
'政府' => |
array ( |
), |
'個人' => |
array ( |
), |
'个人' => |
array ( |
), |
'箇人' => |
array ( |
), |
'網络' => |
array ( |
), |
'网络' => |
array ( |
), |
'组織' => |
array ( |
), |
'網絡' => |
array ( |
), |
'网絡' => |
array ( |
), |
'组织' => |
array ( |
), |
'組織' => |
array ( |
), |
'組织' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'hm' => |
array ( |
), |
'hn' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'mil' => |
array ( |
), |
'gob' => |
array ( |
), |
), |
'hr' => |
array ( |
'iz' => |
array ( |
), |
'from' => |
array ( |
), |
'name' => |
array ( |
), |
'com' => |
array ( |
), |
), |
'ht' => |
array ( |
'com' => |
array ( |
), |
'shop' => |
array ( |
), |
'firm' => |
array ( |
), |
'info' => |
array ( |
), |
'adult' => |
array ( |
), |
'net' => |
array ( |
), |
'pro' => |
array ( |
), |
'org' => |
array ( |
), |
'med' => |
array ( |
), |
'art' => |
array ( |
), |
'coop' => |
array ( |
), |
'pol' => |
array ( |
), |
'asso' => |
array ( |
), |
'edu' => |
array ( |
), |
'rel' => |
array ( |
), |
'gouv' => |
array ( |
), |
'perso' => |
array ( |
), |
), |
'hu' => |
array ( |
'co' => |
array ( |
), |
'info' => |
array ( |
), |
'org' => |
array ( |
), |
'priv' => |
array ( |
), |
'sport' => |
array ( |
), |
'tm' => |
array ( |
), |
2000 => |
array ( |
), |
'agrar' => |
array ( |
), |
'bolt' => |
array ( |
), |
'casino' => |
array ( |
), |
'city' => |
array ( |
), |
'erotica' => |
array ( |
), |
'erotika' => |
array ( |
), |
'film' => |
array ( |
), |
'forum' => |
array ( |
), |
'games' => |
array ( |
), |
'hotel' => |
array ( |
), |
'ingatlan' => |
array ( |
), |
'jogasz' => |
array ( |
), |
'konyvelo' => |
array ( |
), |
'lakas' => |
array ( |
), |
'media' => |
array ( |
), |
'news' => |
array ( |
), |
'reklam' => |
array ( |
), |
'sex' => |
array ( |
), |
'shop' => |
array ( |
), |
'suli' => |
array ( |
), |
'szex' => |
array ( |
), |
'tozsde' => |
array ( |
), |
'utazas' => |
array ( |
), |
'video' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'id' => |
array ( |
'ac' => |
array ( |
), |
'biz' => |
array ( |
), |
'co' => |
array ( |
), |
'desa' => |
array ( |
), |
'go' => |
array ( |
), |
'mil' => |
array ( |
), |
'my' => |
array ( |
), |
'net' => |
array ( |
), |
'or' => |
array ( |
), |
'sch' => |
array ( |
), |
'web' => |
array ( |
), |
), |
'ie' => |
array ( |
'gov' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'il' => |
array ( |
'*' => |
array ( |
), |
'co' => |
array ( |
'blogspot' => |
array ( |
), |
), |
), |
'im' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
'ltd' => |
array ( |
), |
'plc' => |
array ( |
), |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'tt' => |
array ( |
), |
'tv' => |
array ( |
), |
), |
'in' => |
array ( |
'co' => |
array ( |
), |
'firm' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gen' => |
array ( |
), |
'ind' => |
array ( |
), |
'nic' => |
array ( |
), |
'ac' => |
array ( |
), |
'edu' => |
array ( |
), |
'res' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'info' => |
array ( |
'dyndns' => |
array ( |
), |
'barrel-of-knowledge' => |
array ( |
), |
'barrell-of-knowledge' => |
array ( |
), |
'for-our' => |
array ( |
), |
'groks-the' => |
array ( |
), |
'groks-this' => |
array ( |
), |
'here-for-more' => |
array ( |
), |
'knowsitall' => |
array ( |
), |
'selfip' => |
array ( |
), |
'webhop' => |
array ( |
), |
), |
'int' => |
array ( |
'eu' => |
array ( |
), |
), |
'io' => |
array ( |
'com' => |
array ( |
), |
'github' => |
array ( |
), |
), |
'iq' => |
array ( |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'ir' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'gov' => |
array ( |
), |
'id' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sch' => |
array ( |
), |
'ایران' => |
array ( |
), |
'ايران' => |
array ( |
), |
), |
'is' => |
array ( |
'net' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'int' => |
array ( |
), |
'cupcake' => |
array ( |
), |
), |
'it' => |
array ( |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'abr' => |
array ( |
), |
'abruzzo' => |
array ( |
), |
'aosta-valley' => |
array ( |
), |
'aostavalley' => |
array ( |
), |
'bas' => |
array ( |
), |
'basilicata' => |
array ( |
), |
'cal' => |
array ( |
), |
'calabria' => |
array ( |
), |
'cam' => |
array ( |
), |
'campania' => |
array ( |
), |
'emilia-romagna' => |
array ( |
), |
'emiliaromagna' => |
array ( |
), |
'emr' => |
array ( |
), |
'friuli-v-giulia' => |
array ( |
), |
'friuli-ve-giulia' => |
array ( |
), |
'friuli-vegiulia' => |
array ( |
), |
'friuli-venezia-giulia' => |
array ( |
), |
'friuli-veneziagiulia' => |
array ( |
), |
'friuli-vgiulia' => |
array ( |
), |
'friuliv-giulia' => |
array ( |
), |
'friulive-giulia' => |
array ( |
), |
'friulivegiulia' => |
array ( |
), |
'friulivenezia-giulia' => |
array ( |
), |
'friuliveneziagiulia' => |
array ( |
), |
'friulivgiulia' => |
array ( |
), |
'fvg' => |
array ( |
), |
'laz' => |
array ( |
), |
'lazio' => |
array ( |
), |
'lig' => |
array ( |
), |
'liguria' => |
array ( |
), |
'lom' => |
array ( |
), |
'lombardia' => |
array ( |
), |
'lombardy' => |
array ( |
), |
'lucania' => |
array ( |
), |
'mar' => |
array ( |
), |
'marche' => |
array ( |
), |
'mol' => |
array ( |
), |
'molise' => |
array ( |
), |
'piedmont' => |
array ( |
), |
'piemonte' => |
array ( |
), |
'pmn' => |
array ( |
), |
'pug' => |
array ( |
), |
'puglia' => |
array ( |
), |
'sar' => |
array ( |
), |
'sardegna' => |
array ( |
), |
'sardinia' => |
array ( |
), |
'sic' => |
array ( |
), |
'sicilia' => |
array ( |
), |
'sicily' => |
array ( |
), |
'taa' => |
array ( |
), |
'tos' => |
array ( |
), |
'toscana' => |
array ( |
), |
'trentino-a-adige' => |
array ( |
), |
'trentino-aadige' => |
array ( |
), |
'trentino-alto-adige' => |
array ( |
), |
'trentino-altoadige' => |
array ( |
), |
'trentino-s-tirol' => |
array ( |
), |
'trentino-stirol' => |
array ( |
), |
'trentino-sud-tirol' => |
array ( |
), |
'trentino-sudtirol' => |
array ( |
), |
'trentino-sued-tirol' => |
array ( |
), |
'trentino-suedtirol' => |
array ( |
), |
'trentinoa-adige' => |
array ( |
), |
'trentinoaadige' => |
array ( |
), |
'trentinoalto-adige' => |
array ( |
), |
'trentinoaltoadige' => |
array ( |
), |
'trentinos-tirol' => |
array ( |
), |
'trentinostirol' => |
array ( |
), |
'trentinosud-tirol' => |
array ( |
), |
'trentinosudtirol' => |
array ( |
), |
'trentinosued-tirol' => |
array ( |
), |
'trentinosuedtirol' => |
array ( |
), |
'tuscany' => |
array ( |
), |
'umb' => |
array ( |
), |
'umbria' => |
array ( |
), |
'val-d-aosta' => |
array ( |
), |
'val-daosta' => |
array ( |
), |
'vald-aosta' => |
array ( |
), |
'valdaosta' => |
array ( |
), |
'valle-aosta' => |
array ( |
), |
'valle-d-aosta' => |
array ( |
), |
'valle-daosta' => |
array ( |
), |
'valleaosta' => |
array ( |
), |
'valled-aosta' => |
array ( |
), |
'valledaosta' => |
array ( |
), |
'vallee-aoste' => |
array ( |
), |
'valleeaoste' => |
array ( |
), |
'vao' => |
array ( |
), |
'vda' => |
array ( |
), |
'ven' => |
array ( |
), |
'veneto' => |
array ( |
), |
'ag' => |
array ( |
), |
'agrigento' => |
array ( |
), |
'al' => |
array ( |
), |
'alessandria' => |
array ( |
), |
'alto-adige' => |
array ( |
), |
'altoadige' => |
array ( |
), |
'an' => |
array ( |
), |
'ancona' => |
array ( |
), |
'andria-barletta-trani' => |
array ( |
), |
'andria-trani-barletta' => |
array ( |
), |
'andriabarlettatrani' => |
array ( |
), |
'andriatranibarletta' => |
array ( |
), |
'ao' => |
array ( |
), |
'aosta' => |
array ( |
), |
'aoste' => |
array ( |
), |
'ap' => |
array ( |
), |
'aq' => |
array ( |
), |
'aquila' => |
array ( |
), |
'ar' => |
array ( |
), |
'arezzo' => |
array ( |
), |
'ascoli-piceno' => |
array ( |
), |
'ascolipiceno' => |
array ( |
), |
'asti' => |
array ( |
), |
'at' => |
array ( |
), |
'av' => |
array ( |
), |
'avellino' => |
array ( |
), |
'ba' => |
array ( |
), |
'balsan' => |
array ( |
), |
'bari' => |
array ( |
), |
'barletta-trani-andria' => |
array ( |
), |
'barlettatraniandria' => |
array ( |
), |
'belluno' => |
array ( |
), |
'benevento' => |
array ( |
), |
'bergamo' => |
array ( |
), |
'bg' => |
array ( |
), |
'bi' => |
array ( |
), |
'biella' => |
array ( |
), |
'bl' => |
array ( |
), |
'bn' => |
array ( |
), |
'bo' => |
array ( |
), |
'bologna' => |
array ( |
), |
'bolzano' => |
array ( |
), |
'bozen' => |
array ( |
), |
'br' => |
array ( |
), |
'brescia' => |
array ( |
), |
'brindisi' => |
array ( |
), |
'bs' => |
array ( |
), |
'bt' => |
array ( |
), |
'bz' => |
array ( |
), |
'ca' => |
array ( |
), |
'cagliari' => |
array ( |
), |
'caltanissetta' => |
array ( |
), |
'campidano-medio' => |
array ( |
), |
'campidanomedio' => |
array ( |
), |
'campobasso' => |
array ( |
), |
'carbonia-iglesias' => |
array ( |
), |
'carboniaiglesias' => |
array ( |
), |
'carrara-massa' => |
array ( |
), |
'carraramassa' => |
array ( |
), |
'caserta' => |
array ( |
), |
'catania' => |
array ( |
), |
'catanzaro' => |
array ( |
), |
'cb' => |
array ( |
), |
'ce' => |
array ( |
), |
'cesena-forli' => |
array ( |
), |
'cesenaforli' => |
array ( |
), |
'ch' => |
array ( |
), |
'chieti' => |
array ( |
), |
'ci' => |
array ( |
), |
'cl' => |
array ( |
), |
'cn' => |
array ( |
), |
'co' => |
array ( |
), |
'como' => |
array ( |
), |
'cosenza' => |
array ( |
), |
'cr' => |
array ( |
), |
'cremona' => |
array ( |
), |
'crotone' => |
array ( |
), |
'cs' => |
array ( |
), |
'ct' => |
array ( |
), |
'cuneo' => |
array ( |
), |
'cz' => |
array ( |
), |
'dell-ogliastra' => |
array ( |
), |
'dellogliastra' => |
array ( |
), |
'en' => |
array ( |
), |
'enna' => |
array ( |
), |
'fc' => |
array ( |
), |
'fe' => |
array ( |
), |
'fermo' => |
array ( |
), |
'ferrara' => |
array ( |
), |
'fg' => |
array ( |
), |
'fi' => |
array ( |
), |
'firenze' => |
array ( |
), |
'florence' => |
array ( |
), |
'fm' => |
array ( |
), |
'foggia' => |
array ( |
), |
'forli-cesena' => |
array ( |
), |
'forlicesena' => |
array ( |
), |
'fr' => |
array ( |
), |
'frosinone' => |
array ( |
), |
'ge' => |
array ( |
), |
'genoa' => |
array ( |
), |
'genova' => |
array ( |
), |
'go' => |
array ( |
), |
'gorizia' => |
array ( |
), |
'gr' => |
array ( |
), |
'grosseto' => |
array ( |
), |
'iglesias-carbonia' => |
array ( |
), |
'iglesiascarbonia' => |
array ( |
), |
'im' => |
array ( |
), |
'imperia' => |
array ( |
), |
'is' => |
array ( |
), |
'isernia' => |
array ( |
), |
'kr' => |
array ( |
), |
'la-spezia' => |
array ( |
), |
'laquila' => |
array ( |
), |
'laspezia' => |
array ( |
), |
'latina' => |
array ( |
), |
'lc' => |
array ( |
), |
'le' => |
array ( |
), |
'lecce' => |
array ( |
), |
'lecco' => |
array ( |
), |
'li' => |
array ( |
), |
'livorno' => |
array ( |
), |
'lo' => |
array ( |
), |
'lodi' => |
array ( |
), |
'lt' => |
array ( |
), |
'lu' => |
array ( |
), |
'lucca' => |
array ( |
), |
'macerata' => |
array ( |
), |
'mantova' => |
array ( |
), |
'massa-carrara' => |
array ( |
), |
'massacarrara' => |
array ( |
), |
'matera' => |
array ( |
), |
'mb' => |
array ( |
), |
'mc' => |
array ( |
), |
'me' => |
array ( |
), |
'medio-campidano' => |
array ( |
), |
'mediocampidano' => |
array ( |
), |
'messina' => |
array ( |
), |
'mi' => |
array ( |
), |
'milan' => |
array ( |
), |
'milano' => |
array ( |
), |
'mn' => |
array ( |
), |
'mo' => |
array ( |
), |
'modena' => |
array ( |
), |
'monza-brianza' => |
array ( |
), |
'monza-e-della-brianza' => |
array ( |
), |
'monza' => |
array ( |
), |
'monzabrianza' => |
array ( |
), |
'monzaebrianza' => |
array ( |
), |
'monzaedellabrianza' => |
array ( |
), |
'ms' => |
array ( |
), |
'mt' => |
array ( |
), |
'na' => |
array ( |
), |
'naples' => |
array ( |
), |
'napoli' => |
array ( |
), |
'no' => |
array ( |
), |
'novara' => |
array ( |
), |
'nu' => |
array ( |
), |
'nuoro' => |
array ( |
), |
'og' => |
array ( |
), |
'ogliastra' => |
array ( |
), |
'olbia-tempio' => |
array ( |
), |
'olbiatempio' => |
array ( |
), |
'or' => |
array ( |
), |
'oristano' => |
array ( |
), |
'ot' => |
array ( |
), |
'pa' => |
array ( |
), |
'padova' => |
array ( |
), |
'padua' => |
array ( |
), |
'palermo' => |
array ( |
), |
'parma' => |
array ( |
), |
'pavia' => |
array ( |
), |
'pc' => |
array ( |
), |
'pd' => |
array ( |
), |
'pe' => |
array ( |
), |
'perugia' => |
array ( |
), |
'pesaro-urbino' => |
array ( |
), |
'pesarourbino' => |
array ( |
), |
'pescara' => |
array ( |
), |
'pg' => |
array ( |
), |
'pi' => |
array ( |
), |
'piacenza' => |
array ( |
), |
'pisa' => |
array ( |
), |
'pistoia' => |
array ( |
), |
'pn' => |
array ( |
), |
'po' => |
array ( |
), |
'pordenone' => |
array ( |
), |
'potenza' => |
array ( |
), |
'pr' => |
array ( |
), |
'prato' => |
array ( |
), |
'pt' => |
array ( |
), |
'pu' => |
array ( |
), |
'pv' => |
array ( |
), |
'pz' => |
array ( |
), |
'ra' => |
array ( |
), |
'ragusa' => |
array ( |
), |
'ravenna' => |
array ( |
), |
'rc' => |
array ( |
), |
're' => |
array ( |
), |
'reggio-calabria' => |
array ( |
), |
'reggio-emilia' => |
array ( |
), |
'reggiocalabria' => |
array ( |
), |
'reggioemilia' => |
array ( |
), |
'rg' => |
array ( |
), |
'ri' => |
array ( |
), |
'rieti' => |
array ( |
), |
'rimini' => |
array ( |
), |
'rm' => |
array ( |
), |
'rn' => |
array ( |
), |
'ro' => |
array ( |
), |
'roma' => |
array ( |
), |
'rome' => |
array ( |
), |
'rovigo' => |
array ( |
), |
'sa' => |
array ( |
), |
'salerno' => |
array ( |
), |
'sassari' => |
array ( |
), |
'savona' => |
array ( |
), |
'si' => |
array ( |
), |
'siena' => |
array ( |
), |
'siracusa' => |
array ( |
), |
'so' => |
array ( |
), |
'sondrio' => |
array ( |
), |
'sp' => |
array ( |
), |
'sr' => |
array ( |
), |
'ss' => |
array ( |
), |
'suedtirol' => |
array ( |
), |
'sv' => |
array ( |
), |
'ta' => |
array ( |
), |
'taranto' => |
array ( |
), |
'te' => |
array ( |
), |
'tempio-olbia' => |
array ( |
), |
'tempioolbia' => |
array ( |
), |
'teramo' => |
array ( |
), |
'terni' => |
array ( |
), |
'tn' => |
array ( |
), |
'to' => |
array ( |
), |
'torino' => |
array ( |
), |
'tp' => |
array ( |
), |
'tr' => |
array ( |
), |
'trani-andria-barletta' => |
array ( |
), |
'trani-barletta-andria' => |
array ( |
), |
'traniandriabarletta' => |
array ( |
), |
'tranibarlettaandria' => |
array ( |
), |
'trapani' => |
array ( |
), |
'trentino' => |
array ( |
), |
'trento' => |
array ( |
), |
'treviso' => |
array ( |
), |
'trieste' => |
array ( |
), |
'ts' => |
array ( |
), |
'turin' => |
array ( |
), |
'tv' => |
array ( |
), |
'ud' => |
array ( |
), |
'udine' => |
array ( |
), |
'urbino-pesaro' => |
array ( |
), |
'urbinopesaro' => |
array ( |
), |
'va' => |
array ( |
), |
'varese' => |
array ( |
), |
'vb' => |
array ( |
), |
'vc' => |
array ( |
), |
've' => |
array ( |
), |
'venezia' => |
array ( |
), |
'venice' => |
array ( |
), |
'verbania' => |
array ( |
), |
'vercelli' => |
array ( |
), |
'verona' => |
array ( |
), |
'vi' => |
array ( |
), |
'vibo-valentia' => |
array ( |
), |
'vibovalentia' => |
array ( |
), |
'vicenza' => |
array ( |
), |
'viterbo' => |
array ( |
), |
'vr' => |
array ( |
), |
'vs' => |
array ( |
), |
'vt' => |
array ( |
), |
'vv' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'je' => |
array ( |
'co' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'jm' => |
array ( |
'*' => |
array ( |
), |
), |
'jo' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'sch' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
), |
'jobs' => |
array ( |
), |
'jp' => |
array ( |
'ac' => |
array ( |
), |
'ad' => |
array ( |
), |
'co' => |
array ( |
), |
'ed' => |
array ( |
), |
'go' => |
array ( |
), |
'gr' => |
array ( |
), |
'lg' => |
array ( |
), |
'ne' => |
array ( |
), |
'or' => |
array ( |
), |
'aichi' => |
array ( |
'aisai' => |
array ( |
), |
'ama' => |
array ( |
), |
'anjo' => |
array ( |
), |
'asuke' => |
array ( |
), |
'chiryu' => |
array ( |
), |
'chita' => |
array ( |
), |
'fuso' => |
array ( |
), |
'gamagori' => |
array ( |
), |
'handa' => |
array ( |
), |
'hazu' => |
array ( |
), |
'hekinan' => |
array ( |
), |
'higashiura' => |
array ( |
), |
'ichinomiya' => |
array ( |
), |
'inazawa' => |
array ( |
), |
'inuyama' => |
array ( |
), |
'isshiki' => |
array ( |
), |
'iwakura' => |
array ( |
), |
'kanie' => |
array ( |
), |
'kariya' => |
array ( |
), |
'kasugai' => |
array ( |
), |
'kira' => |
array ( |
), |
'kiyosu' => |
array ( |
), |
'komaki' => |
array ( |
), |
'konan' => |
array ( |
), |
'kota' => |
array ( |
), |
'mihama' => |
array ( |
), |
'miyoshi' => |
array ( |
), |
'nishio' => |
array ( |
), |
'nisshin' => |
array ( |
), |
'obu' => |
array ( |
), |
'oguchi' => |
array ( |
), |
'oharu' => |
array ( |
), |
'okazaki' => |
array ( |
), |
'owariasahi' => |
array ( |
), |
'seto' => |
array ( |
), |
'shikatsu' => |
array ( |
), |
'shinshiro' => |
array ( |
), |
'shitara' => |
array ( |
), |
'tahara' => |
array ( |
), |
'takahama' => |
array ( |
), |
'tobishima' => |
array ( |
), |
'toei' => |
array ( |
), |
'togo' => |
array ( |
), |
'tokai' => |
array ( |
), |
'tokoname' => |
array ( |
), |
'toyoake' => |
array ( |
), |
'toyohashi' => |
array ( |
), |
'toyokawa' => |
array ( |
), |
'toyone' => |
array ( |
), |
'toyota' => |
array ( |
), |
'tsushima' => |
array ( |
), |
'yatomi' => |
array ( |
), |
), |
'akita' => |
array ( |
'akita' => |
array ( |
), |
'daisen' => |
array ( |
), |
'fujisato' => |
array ( |
), |
'gojome' => |
array ( |
), |
'hachirogata' => |
array ( |
), |
'happou' => |
array ( |
), |
'higashinaruse' => |
array ( |
), |
'honjo' => |
array ( |
), |
'honjyo' => |
array ( |
), |
'ikawa' => |
array ( |
), |
'kamikoani' => |
array ( |
), |
'kamioka' => |
array ( |
), |
'katagami' => |
array ( |
), |
'kazuno' => |
array ( |
), |
'kitaakita' => |
array ( |
), |
'kosaka' => |
array ( |
), |
'kyowa' => |
array ( |
), |
'misato' => |
array ( |
), |
'mitane' => |
array ( |
), |
'moriyoshi' => |
array ( |
), |
'nikaho' => |
array ( |
), |
'noshiro' => |
array ( |
), |
'odate' => |
array ( |
), |
'oga' => |
array ( |
), |
'ogata' => |
array ( |
), |
'semboku' => |
array ( |
), |
'yokote' => |
array ( |
), |
'yurihonjo' => |
array ( |
), |
), |
'aomori' => |
array ( |
'aomori' => |
array ( |
), |
'gonohe' => |
array ( |
), |
'hachinohe' => |
array ( |
), |
'hashikami' => |
array ( |
), |
'hiranai' => |
array ( |
), |
'hirosaki' => |
array ( |
), |
'itayanagi' => |
array ( |
), |
'kuroishi' => |
array ( |
), |
'misawa' => |
array ( |
), |
'mutsu' => |
array ( |
), |
'nakadomari' => |
array ( |
), |
'noheji' => |
array ( |
), |
'oirase' => |
array ( |
), |
'owani' => |
array ( |
), |
'rokunohe' => |
array ( |
), |
'sannohe' => |
array ( |
), |
'shichinohe' => |
array ( |
), |
'shingo' => |
array ( |
), |
'takko' => |
array ( |
), |
'towada' => |
array ( |
), |
'tsugaru' => |
array ( |
), |
'tsuruta' => |
array ( |
), |
), |
'chiba' => |
array ( |
'abiko' => |
array ( |
), |
'asahi' => |
array ( |
), |
'chonan' => |
array ( |
), |
'chosei' => |
array ( |
), |
'choshi' => |
array ( |
), |
'chuo' => |
array ( |
), |
'funabashi' => |
array ( |
), |
'futtsu' => |
array ( |
), |
'hanamigawa' => |
array ( |
), |
'ichihara' => |
array ( |
), |
'ichikawa' => |
array ( |
), |
'ichinomiya' => |
array ( |
), |
'inzai' => |
array ( |
), |
'isumi' => |
array ( |
), |
'kamagaya' => |
array ( |
), |
'kamogawa' => |
array ( |
), |
'kashiwa' => |
array ( |
), |
'katori' => |
array ( |
), |
'katsuura' => |
array ( |
), |
'kimitsu' => |
array ( |
), |
'kisarazu' => |
array ( |
), |
'kozaki' => |
array ( |
), |
'kujukuri' => |
array ( |
), |
'kyonan' => |
array ( |
), |
'matsudo' => |
array ( |
), |
'midori' => |
array ( |
), |
'mihama' => |
array ( |
), |
'minamiboso' => |
array ( |
), |
'mobara' => |
array ( |
), |
'mutsuzawa' => |
array ( |
), |
'nagara' => |
array ( |
), |
'nagareyama' => |
array ( |
), |
'narashino' => |
array ( |
), |
'narita' => |
array ( |
), |
'noda' => |
array ( |
), |
'oamishirasato' => |
array ( |
), |
'omigawa' => |
array ( |
), |
'onjuku' => |
array ( |
), |
'otaki' => |
array ( |
), |
'sakae' => |
array ( |
), |
'sakura' => |
array ( |
), |
'shimofusa' => |
array ( |
), |
'shirako' => |
array ( |
), |
'shiroi' => |
array ( |
), |
'shisui' => |
array ( |
), |
'sodegaura' => |
array ( |
), |
'sosa' => |
array ( |
), |
'tako' => |
array ( |
), |
'tateyama' => |
array ( |
), |
'togane' => |
array ( |
), |
'tohnosho' => |
array ( |
), |
'tomisato' => |
array ( |
), |
'urayasu' => |
array ( |
), |
'yachimata' => |
array ( |
), |
'yachiyo' => |
array ( |
), |
'yokaichiba' => |
array ( |
), |
'yokoshibahikari' => |
array ( |
), |
'yotsukaido' => |
array ( |
), |
), |
'ehime' => |
array ( |
'ainan' => |
array ( |
), |
'honai' => |
array ( |
), |
'ikata' => |
array ( |
), |
'imabari' => |
array ( |
), |
'iyo' => |
array ( |
), |
'kamijima' => |
array ( |
), |
'kihoku' => |
array ( |
), |
'kumakogen' => |
array ( |
), |
'masaki' => |
array ( |
), |
'matsuno' => |
array ( |
), |
'matsuyama' => |
array ( |
), |
'namikata' => |
array ( |
), |
'niihama' => |
array ( |
), |
'ozu' => |
array ( |
), |
'saijo' => |
array ( |
), |
'seiyo' => |
array ( |
), |
'shikokuchuo' => |
array ( |
), |
'tobe' => |
array ( |
), |
'toon' => |
array ( |
), |
'uchiko' => |
array ( |
), |
'uwajima' => |
array ( |
), |
'yawatahama' => |
array ( |
), |
), |
'fukui' => |
array ( |
'echizen' => |
array ( |
), |
'eiheiji' => |
array ( |
), |
'fukui' => |
array ( |
), |
'ikeda' => |
array ( |
), |
'katsuyama' => |
array ( |
), |
'mihama' => |
array ( |
), |
'minamiechizen' => |
array ( |
), |
'obama' => |
array ( |
), |
'ohi' => |
array ( |
), |
'ono' => |
array ( |
), |
'sabae' => |
array ( |
), |
'sakai' => |
array ( |
), |
'takahama' => |
array ( |
), |
'tsuruga' => |
array ( |
), |
'wakasa' => |
array ( |
), |
), |
'fukuoka' => |
array ( |
'ashiya' => |
array ( |
), |
'buzen' => |
array ( |
), |
'chikugo' => |
array ( |
), |
'chikuho' => |
array ( |
), |
'chikujo' => |
array ( |
), |
'chikushino' => |
array ( |
), |
'chikuzen' => |
array ( |
), |
'chuo' => |
array ( |
), |
'dazaifu' => |
array ( |
), |
'fukuchi' => |
array ( |
), |
'hakata' => |
array ( |
), |
'higashi' => |
array ( |
), |
'hirokawa' => |
array ( |
), |
'hisayama' => |
array ( |
), |
'iizuka' => |
array ( |
), |
'inatsuki' => |
array ( |
), |
'kaho' => |
array ( |
), |
'kasuga' => |
array ( |
), |
'kasuya' => |
array ( |
), |
'kawara' => |
array ( |
), |
'keisen' => |
array ( |
), |
'koga' => |
array ( |
), |
'kurate' => |
array ( |
), |
'kurogi' => |
array ( |
), |
'kurume' => |
array ( |
), |
'minami' => |
array ( |
), |
'miyako' => |
array ( |
), |
'miyama' => |
array ( |
), |
'miyawaka' => |
array ( |
), |
'mizumaki' => |
array ( |
), |
'munakata' => |
array ( |
), |
'nakagawa' => |
array ( |
), |
'nakama' => |
array ( |
), |
'nishi' => |
array ( |
), |
'nogata' => |
array ( |
), |
'ogori' => |
array ( |
), |
'okagaki' => |
array ( |
), |
'okawa' => |
array ( |
), |
'oki' => |
array ( |
), |
'omuta' => |
array ( |
), |
'onga' => |
array ( |
), |
'onojo' => |
array ( |
), |
'oto' => |
array ( |
), |
'saigawa' => |
array ( |
), |
'sasaguri' => |
array ( |
), |
'shingu' => |
array ( |
), |
'shinyoshitomi' => |
array ( |
), |
'shonai' => |
array ( |
), |
'soeda' => |
array ( |
), |
'sue' => |
array ( |
), |
'tachiarai' => |
array ( |
), |
'tagawa' => |
array ( |
), |
'takata' => |
array ( |
), |
'toho' => |
array ( |
), |
'toyotsu' => |
array ( |
), |
'tsuiki' => |
array ( |
), |
'ukiha' => |
array ( |
), |
'umi' => |
array ( |
), |
'usui' => |
array ( |
), |
'yamada' => |
array ( |
), |
'yame' => |
array ( |
), |
'yanagawa' => |
array ( |
), |
'yukuhashi' => |
array ( |
), |
), |
'fukushima' => |
array ( |
'aizubange' => |
array ( |
), |
'aizumisato' => |
array ( |
), |
'aizuwakamatsu' => |
array ( |
), |
'asakawa' => |
array ( |
), |
'bandai' => |
array ( |
), |
'date' => |
array ( |
), |
'fukushima' => |
array ( |
), |
'furudono' => |
array ( |
), |
'futaba' => |
array ( |
), |
'hanawa' => |
array ( |
), |
'higashi' => |
array ( |
), |
'hirata' => |
array ( |
), |
'hirono' => |
array ( |
), |
'iitate' => |
array ( |
), |
'inawashiro' => |
array ( |
), |
'ishikawa' => |
array ( |
), |
'iwaki' => |
array ( |
), |
'izumizaki' => |
array ( |
), |
'kagamiishi' => |
array ( |
), |
'kaneyama' => |
array ( |
), |
'kawamata' => |
array ( |
), |
'kitakata' => |
array ( |
), |
'kitashiobara' => |
array ( |
), |
'koori' => |
array ( |
), |
'koriyama' => |
array ( |
), |
'kunimi' => |
array ( |
), |
'miharu' => |
array ( |
), |
'mishima' => |
array ( |
), |
'namie' => |
array ( |
), |
'nango' => |
array ( |
), |
'nishiaizu' => |
array ( |
), |
'nishigo' => |
array ( |
), |
'okuma' => |
array ( |
), |
'omotego' => |
array ( |
), |
'ono' => |
array ( |
), |
'otama' => |
array ( |
), |
'samegawa' => |
array ( |
), |
'shimogo' => |
array ( |
), |
'shirakawa' => |
array ( |
), |
'showa' => |
array ( |
), |
'soma' => |
array ( |
), |
'sukagawa' => |
array ( |
), |
'taishin' => |
array ( |
), |
'tamakawa' => |
array ( |
), |
'tanagura' => |
array ( |
), |
'tenei' => |
array ( |
), |
'yabuki' => |
array ( |
), |
'yamato' => |
array ( |
), |
'yamatsuri' => |
array ( |
), |
'yanaizu' => |
array ( |
), |
'yugawa' => |
array ( |
), |
), |
'gifu' => |
array ( |
'anpachi' => |
array ( |
), |
'ena' => |
array ( |
), |
'gifu' => |
array ( |
), |
'ginan' => |
array ( |
), |
'godo' => |
array ( |
), |
'gujo' => |
array ( |
), |
'hashima' => |
array ( |
), |
'hichiso' => |
array ( |
), |
'hida' => |
array ( |
), |
'higashishirakawa' => |
array ( |
), |
'ibigawa' => |
array ( |
), |
'ikeda' => |
array ( |
), |
'kakamigahara' => |
array ( |
), |
'kani' => |
array ( |
), |
'kasahara' => |
array ( |
), |
'kasamatsu' => |
array ( |
), |
'kawaue' => |
array ( |
), |
'kitagata' => |
array ( |
), |
'mino' => |
array ( |
), |
'minokamo' => |
array ( |
), |
'mitake' => |
array ( |
), |
'mizunami' => |
array ( |
), |
'motosu' => |
array ( |
), |
'nakatsugawa' => |
array ( |
), |
'ogaki' => |
array ( |
), |
'sakahogi' => |
array ( |
), |
'seki' => |
array ( |
), |
'sekigahara' => |
array ( |
), |
'shirakawa' => |
array ( |
), |
'tajimi' => |
array ( |
), |
'takayama' => |
array ( |
), |
'tarui' => |
array ( |
), |
'toki' => |
array ( |
), |
'tomika' => |
array ( |
), |
'wanouchi' => |
array ( |
), |
'yamagata' => |
array ( |
), |
'yaotsu' => |
array ( |
), |
'yoro' => |
array ( |
), |
), |
'gunma' => |
array ( |
'annaka' => |
array ( |
), |
'chiyoda' => |
array ( |
), |
'fujioka' => |
array ( |
), |
'higashiagatsuma' => |
array ( |
), |
'isesaki' => |
array ( |
), |
'itakura' => |
array ( |
), |
'kanna' => |
array ( |
), |
'kanra' => |
array ( |
), |
'katashina' => |
array ( |
), |
'kawaba' => |
array ( |
), |
'kiryu' => |
array ( |
), |
'kusatsu' => |
array ( |
), |
'maebashi' => |
array ( |
), |
'meiwa' => |
array ( |
), |
'midori' => |
array ( |
), |
'minakami' => |
array ( |
), |
'naganohara' => |
array ( |
), |
'nakanojo' => |
array ( |
), |
'nanmoku' => |
array ( |
), |
'numata' => |
array ( |
), |
'oizumi' => |
array ( |
), |
'ora' => |
array ( |
), |
'ota' => |
array ( |
), |
'shibukawa' => |
array ( |
), |
'shimonita' => |
array ( |
), |
'shinto' => |
array ( |
), |
'showa' => |
array ( |
), |
'takasaki' => |
array ( |
), |
'takayama' => |
array ( |
), |
'tamamura' => |
array ( |
), |
'tatebayashi' => |
array ( |
), |
'tomioka' => |
array ( |
), |
'tsukiyono' => |
array ( |
), |
'tsumagoi' => |
array ( |
), |
'ueno' => |
array ( |
), |
'yoshioka' => |
array ( |
), |
), |
'hiroshima' => |
array ( |
'asaminami' => |
array ( |
), |
'daiwa' => |
array ( |
), |
'etajima' => |
array ( |
), |
'fuchu' => |
array ( |
), |
'fukuyama' => |
array ( |
), |
'hatsukaichi' => |
array ( |
), |
'higashihiroshima' => |
array ( |
), |
'hongo' => |
array ( |
), |
'jinsekikogen' => |
array ( |
), |
'kaita' => |
array ( |
), |
'kui' => |
array ( |
), |
'kumano' => |
array ( |
), |
'kure' => |
array ( |
), |
'mihara' => |
array ( |
), |
'miyoshi' => |
array ( |
), |
'naka' => |
array ( |
), |
'onomichi' => |
array ( |
), |
'osakikamijima' => |
array ( |
), |
'otake' => |
array ( |
), |
'saka' => |
array ( |
), |
'sera' => |
array ( |
), |
'seranishi' => |
array ( |
), |
'shinichi' => |
array ( |
), |
'shobara' => |
array ( |
), |
'takehara' => |
array ( |
), |
), |
'hokkaido' => |
array ( |
'abashiri' => |
array ( |
), |
'abira' => |
array ( |
), |
'aibetsu' => |
array ( |
), |
'akabira' => |
array ( |
), |
'akkeshi' => |
array ( |
), |
'asahikawa' => |
array ( |
), |
'ashibetsu' => |
array ( |
), |
'ashoro' => |
array ( |
), |
'assabu' => |
array ( |
), |
'atsuma' => |
array ( |
), |
'bibai' => |
array ( |
), |
'biei' => |
array ( |
), |
'bifuka' => |
array ( |
), |
'bihoro' => |
array ( |
), |
'biratori' => |
array ( |
), |
'chippubetsu' => |
array ( |
), |
'chitose' => |
array ( |
), |
'date' => |
array ( |
), |
'ebetsu' => |
array ( |
), |
'embetsu' => |
array ( |
), |
'eniwa' => |
array ( |
), |
'erimo' => |
array ( |
), |
'esan' => |
array ( |
), |
'esashi' => |
array ( |
), |
'fukagawa' => |
array ( |
), |
'fukushima' => |
array ( |
), |
'furano' => |
array ( |
), |
'furubira' => |
array ( |
), |
'haboro' => |
array ( |
), |
'hakodate' => |
array ( |
), |
'hamatonbetsu' => |
array ( |
), |
'hidaka' => |
array ( |
), |
'higashikagura' => |
array ( |
), |
'higashikawa' => |
array ( |
), |
'hiroo' => |
array ( |
), |
'hokuryu' => |
array ( |
), |
'hokuto' => |
array ( |
), |
'honbetsu' => |
array ( |
), |
'horokanai' => |
array ( |
), |
'horonobe' => |
array ( |
), |
'ikeda' => |
array ( |
), |
'imakane' => |
array ( |
), |
'ishikari' => |
array ( |
), |
'iwamizawa' => |
array ( |
), |
'iwanai' => |
array ( |
), |
'kamifurano' => |
array ( |
), |
'kamikawa' => |
array ( |
), |
'kamishihoro' => |
array ( |
), |
'kamisunagawa' => |
array ( |
), |
'kamoenai' => |
array ( |
), |
'kayabe' => |
array ( |
), |
'kembuchi' => |
array ( |
), |
'kikonai' => |
array ( |
), |
'kimobetsu' => |
array ( |
), |
'kitahiroshima' => |
array ( |
), |
'kitami' => |
array ( |
), |
'kiyosato' => |
array ( |
), |
'koshimizu' => |
array ( |
), |
'kunneppu' => |
array ( |
), |
'kuriyama' => |
array ( |
), |
'kuromatsunai' => |
array ( |
), |
'kushiro' => |
array ( |
), |
'kutchan' => |
array ( |
), |
'kyowa' => |
array ( |
), |
'mashike' => |
array ( |
), |
'matsumae' => |
array ( |
), |
'mikasa' => |
array ( |
), |
'minamifurano' => |
array ( |
), |
'mombetsu' => |
array ( |
), |
'moseushi' => |
array ( |
), |
'mukawa' => |
array ( |
), |
'muroran' => |
array ( |
), |
'naie' => |
array ( |
), |
'nakagawa' => |
array ( |
), |
'nakasatsunai' => |
array ( |
), |
'nakatombetsu' => |
array ( |
), |
'nanae' => |
array ( |
), |
'nanporo' => |
array ( |
), |
'nayoro' => |
array ( |
), |
'nemuro' => |
array ( |
), |
'niikappu' => |
array ( |
), |
'niki' => |
array ( |
), |
'nishiokoppe' => |
array ( |
), |
'noboribetsu' => |
array ( |
), |
'numata' => |
array ( |
), |
'obihiro' => |
array ( |
), |
'obira' => |
array ( |
), |
'oketo' => |
array ( |
), |
'okoppe' => |
array ( |
), |
'otaru' => |
array ( |
), |
'otobe' => |
array ( |
), |
'otofuke' => |
array ( |
), |
'otoineppu' => |
array ( |
), |
'oumu' => |
array ( |
), |
'ozora' => |
array ( |
), |
'pippu' => |
array ( |
), |
'rankoshi' => |
array ( |
), |
'rebun' => |
array ( |
), |
'rikubetsu' => |
array ( |
), |
'rishiri' => |
array ( |
), |
'rishirifuji' => |
array ( |
), |
'saroma' => |
array ( |
), |
'sarufutsu' => |
array ( |
), |
'shakotan' => |
array ( |
), |
'shari' => |
array ( |
), |
'shibecha' => |
array ( |
), |
'shibetsu' => |
array ( |
), |
'shikabe' => |
array ( |
), |
'shikaoi' => |
array ( |
), |
'shimamaki' => |
array ( |
), |
'shimizu' => |
array ( |
), |
'shimokawa' => |
array ( |
), |
'shinshinotsu' => |
array ( |
), |
'shintoku' => |
array ( |
), |
'shiranuka' => |
array ( |
), |
'shiraoi' => |
array ( |
), |
'shiriuchi' => |
array ( |
), |
'sobetsu' => |
array ( |
), |
'sunagawa' => |
array ( |
), |
'taiki' => |
array ( |
), |
'takasu' => |
array ( |
), |
'takikawa' => |
array ( |
), |
'takinoue' => |
array ( |
), |
'teshikaga' => |
array ( |
), |
'tobetsu' => |
array ( |
), |
'tohma' => |
array ( |
), |
'tomakomai' => |
array ( |
), |
'tomari' => |
array ( |
), |
'toya' => |
array ( |
), |
'toyako' => |
array ( |
), |
'toyotomi' => |
array ( |
), |
'toyoura' => |
array ( |
), |
'tsubetsu' => |
array ( |
), |
'tsukigata' => |
array ( |
), |
'urakawa' => |
array ( |
), |
'urausu' => |
array ( |
), |
'uryu' => |
array ( |
), |
'utashinai' => |
array ( |
), |
'wakkanai' => |
array ( |
), |
'wassamu' => |
array ( |
), |
'yakumo' => |
array ( |
), |
'yoichi' => |
array ( |
), |
), |
'hyogo' => |
array ( |
'aioi' => |
array ( |
), |
'akashi' => |
array ( |
), |
'ako' => |
array ( |
), |
'amagasaki' => |
array ( |
), |
'aogaki' => |
array ( |
), |
'asago' => |
array ( |
), |
'ashiya' => |
array ( |
), |
'awaji' => |
array ( |
), |
'fukusaki' => |
array ( |
), |
'goshiki' => |
array ( |
), |
'harima' => |
array ( |
), |
'himeji' => |
array ( |
), |
'ichikawa' => |
array ( |
), |
'inagawa' => |
array ( |
), |
'itami' => |
array ( |
), |
'kakogawa' => |
array ( |
), |
'kamigori' => |
array ( |
), |
'kamikawa' => |
array ( |
), |
'kasai' => |
array ( |
), |
'kasuga' => |
array ( |
), |
'kawanishi' => |
array ( |
), |
'miki' => |
array ( |
), |
'minamiawaji' => |
array ( |
), |
'nishinomiya' => |
array ( |
), |
'nishiwaki' => |
array ( |
), |
'ono' => |
array ( |
), |
'sanda' => |
array ( |
), |
'sannan' => |
array ( |
), |
'sasayama' => |
array ( |
), |
'sayo' => |
array ( |
), |
'shingu' => |
array ( |
), |
'shinonsen' => |
array ( |
), |
'shiso' => |
array ( |
), |
'sumoto' => |
array ( |
), |
'taishi' => |
array ( |
), |
'taka' => |
array ( |
), |
'takarazuka' => |
array ( |
), |
'takasago' => |
array ( |
), |
'takino' => |
array ( |
), |
'tamba' => |
array ( |
), |
'tatsuno' => |
array ( |
), |
'toyooka' => |
array ( |
), |
'yabu' => |
array ( |
), |
'yashiro' => |
array ( |
), |
'yoka' => |
array ( |
), |
'yokawa' => |
array ( |
), |
), |
'ibaraki' => |
array ( |
'ami' => |
array ( |
), |
'asahi' => |
array ( |
), |
'bando' => |
array ( |
), |
'chikusei' => |
array ( |
), |
'daigo' => |
array ( |
), |
'fujishiro' => |
array ( |
), |
'hitachi' => |
array ( |
), |
'hitachinaka' => |
array ( |
), |
'hitachiomiya' => |
array ( |
), |
'hitachiota' => |
array ( |
), |
'ibaraki' => |
array ( |
), |
'ina' => |
array ( |
), |
'inashiki' => |
array ( |
), |
'itako' => |
array ( |
), |
'iwama' => |
array ( |
), |
'joso' => |
array ( |
), |
'kamisu' => |
array ( |
), |
'kasama' => |
array ( |
), |
'kashima' => |
array ( |
), |
'kasumigaura' => |
array ( |
), |
'koga' => |
array ( |
), |
'miho' => |
array ( |
), |
'mito' => |
array ( |
), |
'moriya' => |
array ( |
), |
'naka' => |
array ( |
), |
'namegata' => |
array ( |
), |
'oarai' => |
array ( |
), |
'ogawa' => |
array ( |
), |
'omitama' => |
array ( |
), |
'ryugasaki' => |
array ( |
), |
'sakai' => |
array ( |
), |
'sakuragawa' => |
array ( |
), |
'shimodate' => |
array ( |
), |
'shimotsuma' => |
array ( |
), |
'shirosato' => |
array ( |
), |
'sowa' => |
array ( |
), |
'suifu' => |
array ( |
), |
'takahagi' => |
array ( |
), |
'tamatsukuri' => |
array ( |
), |
'tokai' => |
array ( |
), |
'tomobe' => |
array ( |
), |
'tone' => |
array ( |
), |
'toride' => |
array ( |
), |
'tsuchiura' => |
array ( |
), |
'tsukuba' => |
array ( |
), |
'uchihara' => |
array ( |
), |
'ushiku' => |
array ( |
), |
'yachiyo' => |
array ( |
), |
'yamagata' => |
array ( |
), |
'yawara' => |
array ( |
), |
'yuki' => |
array ( |
), |
), |
'ishikawa' => |
array ( |
'anamizu' => |
array ( |
), |
'hakui' => |
array ( |
), |
'hakusan' => |
array ( |
), |
'kaga' => |
array ( |
), |
'kahoku' => |
array ( |
), |
'kanazawa' => |
array ( |
), |
'kawakita' => |
array ( |
), |
'komatsu' => |
array ( |
), |
'nakanoto' => |
array ( |
), |
'nanao' => |
array ( |
), |
'nomi' => |
array ( |
), |
'nonoichi' => |
array ( |
), |
'noto' => |
array ( |
), |
'shika' => |
array ( |
), |
'suzu' => |
array ( |
), |
'tsubata' => |
array ( |
), |
'tsurugi' => |
array ( |
), |
'uchinada' => |
array ( |
), |
'wajima' => |
array ( |
), |
), |
'iwate' => |
array ( |
'fudai' => |
array ( |
), |
'fujisawa' => |
array ( |
), |
'hanamaki' => |
array ( |
), |
'hiraizumi' => |
array ( |
), |
'hirono' => |
array ( |
), |
'ichinohe' => |
array ( |
), |
'ichinoseki' => |
array ( |
), |
'iwaizumi' => |
array ( |
), |
'iwate' => |
array ( |
), |
'joboji' => |
array ( |
), |
'kamaishi' => |
array ( |
), |
'kanegasaki' => |
array ( |
), |
'karumai' => |
array ( |
), |
'kawai' => |
array ( |
), |
'kitakami' => |
array ( |
), |
'kuji' => |
array ( |
), |
'kunohe' => |
array ( |
), |
'kuzumaki' => |
array ( |
), |
'miyako' => |
array ( |
), |
'mizusawa' => |
array ( |
), |
'morioka' => |
array ( |
), |
'ninohe' => |
array ( |
), |
'noda' => |
array ( |
), |
'ofunato' => |
array ( |
), |
'oshu' => |
array ( |
), |
'otsuchi' => |
array ( |
), |
'rikuzentakata' => |
array ( |
), |
'shiwa' => |
array ( |
), |
'shizukuishi' => |
array ( |
), |
'sumita' => |
array ( |
), |
'tanohata' => |
array ( |
), |
'tono' => |
array ( |
), |
'yahaba' => |
array ( |
), |
'yamada' => |
array ( |
), |
), |
'kagawa' => |
array ( |
'ayagawa' => |
array ( |
), |
'higashikagawa' => |
array ( |
), |
'kanonji' => |
array ( |
), |
'kotohira' => |
array ( |
), |
'manno' => |
array ( |
), |
'marugame' => |
array ( |
), |
'mitoyo' => |
array ( |
), |
'naoshima' => |
array ( |
), |
'sanuki' => |
array ( |
), |
'tadotsu' => |
array ( |
), |
'takamatsu' => |
array ( |
), |
'tonosho' => |
array ( |
), |
'uchinomi' => |
array ( |
), |
'utazu' => |
array ( |
), |
'zentsuji' => |
array ( |
), |
), |
'kagoshima' => |
array ( |
'akune' => |
array ( |
), |
'amami' => |
array ( |
), |
'hioki' => |
array ( |
), |
'isa' => |
array ( |
), |
'isen' => |
array ( |
), |
'izumi' => |
array ( |
), |
'kagoshima' => |
array ( |
), |
'kanoya' => |
array ( |
), |
'kawanabe' => |
array ( |
), |
'kinko' => |
array ( |
), |
'kouyama' => |
array ( |
), |
'makurazaki' => |
array ( |
), |
'matsumoto' => |
array ( |
), |
'minamitane' => |
array ( |
), |
'nakatane' => |
array ( |
), |
'nishinoomote' => |
array ( |
), |
'satsumasendai' => |
array ( |
), |
'soo' => |
array ( |
), |
'tarumizu' => |
array ( |
), |
'yusui' => |
array ( |
), |
), |
'kanagawa' => |
array ( |
'aikawa' => |
array ( |
), |
'atsugi' => |
array ( |
), |
'ayase' => |
array ( |
), |
'chigasaki' => |
array ( |
), |
'ebina' => |
array ( |
), |
'fujisawa' => |
array ( |
), |
'hadano' => |
array ( |
), |
'hakone' => |
array ( |
), |
'hiratsuka' => |
array ( |
), |
'isehara' => |
array ( |
), |
'kaisei' => |
array ( |
), |
'kamakura' => |
array ( |
), |
'kiyokawa' => |
array ( |
), |
'matsuda' => |
array ( |
), |
'minamiashigara' => |
array ( |
), |
'miura' => |
array ( |
), |
'nakai' => |
array ( |
), |
'ninomiya' => |
array ( |
), |
'odawara' => |
array ( |
), |
'oi' => |
array ( |
), |
'oiso' => |
array ( |
), |
'sagamihara' => |
array ( |
), |
'samukawa' => |
array ( |
), |
'tsukui' => |
array ( |
), |
'yamakita' => |
array ( |
), |
'yamato' => |
array ( |
), |
'yokosuka' => |
array ( |
), |
'yugawara' => |
array ( |
), |
'zama' => |
array ( |
), |
'zushi' => |
array ( |
), |
), |
'kochi' => |
array ( |
'aki' => |
array ( |
), |
'geisei' => |
array ( |
), |
'hidaka' => |
array ( |
), |
'higashitsuno' => |
array ( |
), |
'ino' => |
array ( |
), |
'kagami' => |
array ( |
), |
'kami' => |
array ( |
), |
'kitagawa' => |
array ( |
), |
'kochi' => |
array ( |
), |
'mihara' => |
array ( |
), |
'motoyama' => |
array ( |
), |
'muroto' => |
array ( |
), |
'nahari' => |
array ( |
), |
'nakamura' => |
array ( |
), |
'nankoku' => |
array ( |
), |
'nishitosa' => |
array ( |
), |
'niyodogawa' => |
array ( |
), |
'ochi' => |
array ( |
), |
'okawa' => |
array ( |
), |
'otoyo' => |
array ( |
), |
'otsuki' => |
array ( |
), |
'sakawa' => |
array ( |
), |
'sukumo' => |
array ( |
), |
'susaki' => |
array ( |
), |
'tosa' => |
array ( |
), |
'tosashimizu' => |
array ( |
), |
'toyo' => |
array ( |
), |
'tsuno' => |
array ( |
), |
'umaji' => |
array ( |
), |
'yasuda' => |
array ( |
), |
'yusuhara' => |
array ( |
), |
), |
'kumamoto' => |
array ( |
'amakusa' => |
array ( |
), |
'arao' => |
array ( |
), |
'aso' => |
array ( |
), |
'choyo' => |
array ( |
), |
'gyokuto' => |
array ( |
), |
'hitoyoshi' => |
array ( |
), |
'kamiamakusa' => |
array ( |
), |
'kashima' => |
array ( |
), |
'kikuchi' => |
array ( |
), |
'kosa' => |
array ( |
), |
'kumamoto' => |
array ( |
), |
'mashiki' => |
array ( |
), |
'mifune' => |
array ( |
), |
'minamata' => |
array ( |
), |
'minamioguni' => |
array ( |
), |
'nagasu' => |
array ( |
), |
'nishihara' => |
array ( |
), |
'oguni' => |
array ( |
), |
'ozu' => |
array ( |
), |
'sumoto' => |
array ( |
), |
'takamori' => |
array ( |
), |
'uki' => |
array ( |
), |
'uto' => |
array ( |
), |
'yamaga' => |
array ( |
), |
'yamato' => |
array ( |
), |
'yatsushiro' => |
array ( |
), |
), |
'kyoto' => |
array ( |
'ayabe' => |
array ( |
), |
'fukuchiyama' => |
array ( |
), |
'higashiyama' => |
array ( |
), |
'ide' => |
array ( |
), |
'ine' => |
array ( |
), |
'joyo' => |
array ( |
), |
'kameoka' => |
array ( |
), |
'kamo' => |
array ( |
), |
'kita' => |
array ( |
), |
'kizu' => |
array ( |
), |
'kumiyama' => |
array ( |
), |
'kyotamba' => |
array ( |
), |
'kyotanabe' => |
array ( |
), |
'kyotango' => |
array ( |
), |
'maizuru' => |
array ( |
), |
'minami' => |
array ( |
), |
'minamiyamashiro' => |
array ( |
), |
'miyazu' => |
array ( |
), |
'muko' => |
array ( |
), |
'nagaokakyo' => |
array ( |
), |
'nakagyo' => |
array ( |
), |
'nantan' => |
array ( |
), |
'oyamazaki' => |
array ( |
), |
'sakyo' => |
array ( |
), |
'seika' => |
array ( |
), |
'tanabe' => |
array ( |
), |
'uji' => |
array ( |
), |
'ujitawara' => |
array ( |
), |
'wazuka' => |
array ( |
), |
'yamashina' => |
array ( |
), |
'yawata' => |
array ( |
), |
), |
'mie' => |
array ( |
'asahi' => |
array ( |
), |
'inabe' => |
array ( |
), |
'ise' => |
array ( |
), |
'kameyama' => |
array ( |
), |
'kawagoe' => |
array ( |
), |
'kiho' => |
array ( |
), |
'kisosaki' => |
array ( |
), |
'kiwa' => |
array ( |
), |
'komono' => |
array ( |
), |
'kumano' => |
array ( |
), |
'kuwana' => |
array ( |
), |
'matsusaka' => |
array ( |
), |
'meiwa' => |
array ( |
), |
'mihama' => |
array ( |
), |
'minamiise' => |
array ( |
), |
'misugi' => |
array ( |
), |
'miyama' => |
array ( |
), |
'nabari' => |
array ( |
), |
'shima' => |
array ( |
), |
'suzuka' => |
array ( |
), |
'tado' => |
array ( |
), |
'taiki' => |
array ( |
), |
'taki' => |
array ( |
), |
'tamaki' => |
array ( |
), |
'toba' => |
array ( |
), |
'tsu' => |
array ( |
), |
'udono' => |
array ( |
), |
'ureshino' => |
array ( |
), |
'watarai' => |
array ( |
), |
'yokkaichi' => |
array ( |
), |
), |
'miyagi' => |
array ( |
'furukawa' => |
array ( |
), |
'higashimatsushima' => |
array ( |
), |
'ishinomaki' => |
array ( |
), |
'iwanuma' => |
array ( |
), |
'kakuda' => |
array ( |
), |
'kami' => |
array ( |
), |
'kawasaki' => |
array ( |
), |
'kesennuma' => |
array ( |
), |
'marumori' => |
array ( |
), |
'matsushima' => |
array ( |
), |
'minamisanriku' => |
array ( |
), |
'misato' => |
array ( |
), |
'murata' => |
array ( |
), |
'natori' => |
array ( |
), |
'ogawara' => |
array ( |
), |
'ohira' => |
array ( |
), |
'onagawa' => |
array ( |
), |
'osaki' => |
array ( |
), |
'rifu' => |
array ( |
), |
'semine' => |
array ( |
), |
'shibata' => |
array ( |
), |
'shichikashuku' => |
array ( |
), |
'shikama' => |
array ( |
), |
'shiogama' => |
array ( |
), |
'shiroishi' => |
array ( |
), |
'tagajo' => |
array ( |
), |
'taiwa' => |
array ( |
), |
'tome' => |
array ( |
), |
'tomiya' => |
array ( |
), |
'wakuya' => |
array ( |
), |
'watari' => |
array ( |
), |
'yamamoto' => |
array ( |
), |
'zao' => |
array ( |
), |
), |
'miyazaki' => |
array ( |
'aya' => |
array ( |
), |
'ebino' => |
array ( |
), |
'gokase' => |
array ( |
), |
'hyuga' => |
array ( |
), |
'kadogawa' => |
array ( |
), |
'kawaminami' => |
array ( |
), |
'kijo' => |
array ( |
), |
'kitagawa' => |
array ( |
), |
'kitakata' => |
array ( |
), |
'kitaura' => |
array ( |
), |
'kobayashi' => |
array ( |
), |
'kunitomi' => |
array ( |
), |
'kushima' => |
array ( |
), |
'mimata' => |
array ( |
), |
'miyakonojo' => |
array ( |
), |
'miyazaki' => |
array ( |
), |
'morotsuka' => |
array ( |
), |
'nichinan' => |
array ( |
), |
'nishimera' => |
array ( |
), |
'nobeoka' => |
array ( |
), |
'saito' => |
array ( |
), |
'shiiba' => |
array ( |
), |
'shintomi' => |
array ( |
), |
'takaharu' => |
array ( |
), |
'takanabe' => |
array ( |
), |
'takazaki' => |
array ( |
), |
'tsuno' => |
array ( |
), |
), |
'nagano' => |
array ( |
'achi' => |
array ( |
), |
'agematsu' => |
array ( |
), |
'anan' => |
array ( |
), |
'aoki' => |
array ( |
), |
'asahi' => |
array ( |
), |
'azumino' => |
array ( |
), |
'chikuhoku' => |
array ( |
), |
'chikuma' => |
array ( |
), |
'chino' => |
array ( |
), |
'fujimi' => |
array ( |
), |
'hakuba' => |
array ( |
), |
'hara' => |
array ( |
), |
'hiraya' => |
array ( |
), |
'iida' => |
array ( |
), |
'iijima' => |
array ( |
), |
'iiyama' => |
array ( |
), |
'iizuna' => |
array ( |
), |
'ikeda' => |
array ( |
), |
'ikusaka' => |
array ( |
), |
'ina' => |
array ( |
), |
'karuizawa' => |
array ( |
), |
'kawakami' => |
array ( |
), |
'kiso' => |
array ( |
), |
'kisofukushima' => |
array ( |
), |
'kitaaiki' => |
array ( |
), |
'komagane' => |
array ( |
), |
'komoro' => |
array ( |
), |
'matsukawa' => |
array ( |
), |
'matsumoto' => |
array ( |
), |
'miasa' => |
array ( |
), |
'minamiaiki' => |
array ( |
), |
'minamimaki' => |
array ( |
), |
'minamiminowa' => |
array ( |
), |
'minowa' => |
array ( |
), |
'miyada' => |
array ( |
), |
'miyota' => |
array ( |
), |
'mochizuki' => |
array ( |
), |
'nagano' => |
array ( |
), |
'nagawa' => |
array ( |
), |
'nagiso' => |
array ( |
), |
'nakagawa' => |
array ( |
), |
'nakano' => |
array ( |
), |
'nozawaonsen' => |
array ( |
), |
'obuse' => |
array ( |
), |
'ogawa' => |
array ( |
), |
'okaya' => |
array ( |
), |
'omachi' => |
array ( |
), |
'omi' => |
array ( |
), |
'ookuwa' => |
array ( |
), |
'ooshika' => |
array ( |
), |
'otaki' => |
array ( |
), |
'otari' => |
array ( |
), |
'sakae' => |
array ( |
), |
'sakaki' => |
array ( |
), |
'saku' => |
array ( |
), |
'sakuho' => |
array ( |
), |
'shimosuwa' => |
array ( |
), |
'shinanomachi' => |
array ( |
), |
'shiojiri' => |
array ( |
), |
'suwa' => |
array ( |
), |
'suzaka' => |
array ( |
), |
'takagi' => |
array ( |
), |
'takamori' => |
array ( |
), |
'takayama' => |
array ( |
), |
'tateshina' => |
array ( |
), |
'tatsuno' => |
array ( |
), |
'togakushi' => |
array ( |
), |
'togura' => |
array ( |
), |
'tomi' => |
array ( |
), |
'ueda' => |
array ( |
), |
'wada' => |
array ( |
), |
'yamagata' => |
array ( |
), |
'yamanouchi' => |
array ( |
), |
'yasaka' => |
array ( |
), |
'yasuoka' => |
array ( |
), |
), |
'nagasaki' => |
array ( |
'chijiwa' => |
array ( |
), |
'futsu' => |
array ( |
), |
'goto' => |
array ( |
), |
'hasami' => |
array ( |
), |
'hirado' => |
array ( |
), |
'iki' => |
array ( |
), |
'isahaya' => |
array ( |
), |
'kawatana' => |
array ( |
), |
'kuchinotsu' => |
array ( |
), |
'matsuura' => |
array ( |
), |
'nagasaki' => |
array ( |
), |
'obama' => |
array ( |
), |
'omura' => |
array ( |
), |
'oseto' => |
array ( |
), |
'saikai' => |
array ( |
), |
'sasebo' => |
array ( |
), |
'seihi' => |
array ( |
), |
'shimabara' => |
array ( |
), |
'shinkamigoto' => |
array ( |
), |
'togitsu' => |
array ( |
), |
'tsushima' => |
array ( |
), |
'unzen' => |
array ( |
), |
), |
'nara' => |
array ( |
'ando' => |
array ( |
), |
'gose' => |
array ( |
), |
'heguri' => |
array ( |
), |
'higashiyoshino' => |
array ( |
), |
'ikaruga' => |
array ( |
), |
'ikoma' => |
array ( |
), |
'kamikitayama' => |
array ( |
), |
'kanmaki' => |
array ( |
), |
'kashiba' => |
array ( |
), |
'kashihara' => |
array ( |
), |
'katsuragi' => |
array ( |
), |
'kawai' => |
array ( |
), |
'kawakami' => |
array ( |
), |
'kawanishi' => |
array ( |
), |
'koryo' => |
array ( |
), |
'kurotaki' => |
array ( |
), |
'mitsue' => |
array ( |
), |
'miyake' => |
array ( |
), |
'nara' => |
array ( |
), |
'nosegawa' => |
array ( |
), |
'oji' => |
array ( |
), |
'ouda' => |
array ( |
), |
'oyodo' => |
array ( |
), |
'sakurai' => |
array ( |
), |
'sango' => |
array ( |
), |
'shimoichi' => |
array ( |
), |
'shimokitayama' => |
array ( |
), |
'shinjo' => |
array ( |
), |
'soni' => |
array ( |
), |
'takatori' => |
array ( |
), |
'tawaramoto' => |
array ( |
), |
'tenkawa' => |
array ( |
), |
'tenri' => |
array ( |
), |
'uda' => |
array ( |
), |
'yamatokoriyama' => |
array ( |
), |
'yamatotakada' => |
array ( |
), |
'yamazoe' => |
array ( |
), |
'yoshino' => |
array ( |
), |
), |
'niigata' => |
array ( |
'aga' => |
array ( |
), |
'agano' => |
array ( |
), |
'gosen' => |
array ( |
), |
'itoigawa' => |
array ( |
), |
'izumozaki' => |
array ( |
), |
'joetsu' => |
array ( |
), |
'kamo' => |
array ( |
), |
'kariwa' => |
array ( |
), |
'kashiwazaki' => |
array ( |
), |
'minamiuonuma' => |
array ( |
), |
'mitsuke' => |
array ( |
), |
'muika' => |
array ( |
), |
'murakami' => |
array ( |
), |
'myoko' => |
array ( |
), |
'nagaoka' => |
array ( |
), |
'niigata' => |
array ( |
), |
'ojiya' => |
array ( |
), |
'omi' => |
array ( |
), |
'sado' => |
array ( |
), |
'sanjo' => |
array ( |
), |
'seiro' => |
array ( |
), |
'seirou' => |
array ( |
), |
'sekikawa' => |
array ( |
), |
'shibata' => |
array ( |
), |
'tagami' => |
array ( |
), |
'tainai' => |
array ( |
), |
'tochio' => |
array ( |
), |
'tokamachi' => |
array ( |
), |
'tsubame' => |
array ( |
), |
'tsunan' => |
array ( |
), |
'uonuma' => |
array ( |
), |
'yahiko' => |
array ( |
), |
'yoita' => |
array ( |
), |
'yuzawa' => |
array ( |
), |
), |
'oita' => |
array ( |
'beppu' => |
array ( |
), |
'bungoono' => |
array ( |
), |
'bungotakada' => |
array ( |
), |
'hasama' => |
array ( |
), |
'hiji' => |
array ( |
), |
'himeshima' => |
array ( |
), |
'hita' => |
array ( |
), |
'kamitsue' => |
array ( |
), |
'kokonoe' => |
array ( |
), |
'kuju' => |
array ( |
), |
'kunisaki' => |
array ( |
), |
'kusu' => |
array ( |
), |
'oita' => |
array ( |
), |
'saiki' => |
array ( |
), |
'taketa' => |
array ( |
), |
'tsukumi' => |
array ( |
), |
'usa' => |
array ( |
), |
'usuki' => |
array ( |
), |
'yufu' => |
array ( |
), |
), |
'okayama' => |
array ( |
'akaiwa' => |
array ( |
), |
'asakuchi' => |
array ( |
), |
'bizen' => |
array ( |
), |
'hayashima' => |
array ( |
), |
'ibara' => |
array ( |
), |
'kagamino' => |
array ( |
), |
'kasaoka' => |
array ( |
), |
'kibichuo' => |
array ( |
), |
'kumenan' => |
array ( |
), |
'kurashiki' => |
array ( |
), |
'maniwa' => |
array ( |
), |
'misaki' => |
array ( |
), |
'nagi' => |
array ( |
), |
'niimi' => |
array ( |
), |
'nishiawakura' => |
array ( |
), |
'okayama' => |
array ( |
), |
'satosho' => |
array ( |
), |
'setouchi' => |
array ( |
), |
'shinjo' => |
array ( |
), |
'shoo' => |
array ( |
), |
'soja' => |
array ( |
), |
'takahashi' => |
array ( |
), |
'tamano' => |
array ( |
), |
'tsuyama' => |
array ( |
), |
'wake' => |
array ( |
), |
'yakage' => |
array ( |
), |
), |
'okinawa' => |
array ( |
'aguni' => |
array ( |
), |
'ginowan' => |
array ( |
), |
'ginoza' => |
array ( |
), |
'gushikami' => |
array ( |
), |
'haebaru' => |
array ( |
), |
'higashi' => |
array ( |
), |
'hirara' => |
array ( |
), |
'iheya' => |
array ( |
), |
'ishigaki' => |
array ( |
), |
'ishikawa' => |
array ( |
), |
'itoman' => |
array ( |
), |
'izena' => |
array ( |
), |
'kadena' => |
array ( |
), |
'kin' => |
array ( |
), |
'kitadaito' => |
array ( |
), |
'kitanakagusuku' => |
array ( |
), |
'kumejima' => |
array ( |
), |
'kunigami' => |
array ( |
), |
'minamidaito' => |
array ( |
), |
'motobu' => |
array ( |
), |
'nago' => |
array ( |
), |
'naha' => |
array ( |
), |
'nakagusuku' => |
array ( |
), |
'nakijin' => |
array ( |
), |
'nanjo' => |
array ( |
), |
'nishihara' => |
array ( |
), |
'ogimi' => |
array ( |
), |
'okinawa' => |
array ( |
), |
'onna' => |
array ( |
), |
'shimoji' => |
array ( |
), |
'taketomi' => |
array ( |
), |
'tarama' => |
array ( |
), |
'tokashiki' => |
array ( |
), |
'tomigusuku' => |
array ( |
), |
'tonaki' => |
array ( |
), |
'urasoe' => |
array ( |
), |
'uruma' => |
array ( |
), |
'yaese' => |
array ( |
), |
'yomitan' => |
array ( |
), |
'yonabaru' => |
array ( |
), |
'yonaguni' => |
array ( |
), |
'zamami' => |
array ( |
), |
), |
'osaka' => |
array ( |
'abeno' => |
array ( |
), |
'chihayaakasaka' => |
array ( |
), |
'chuo' => |
array ( |
), |
'daito' => |
array ( |
), |
'fujiidera' => |
array ( |
), |
'habikino' => |
array ( |
), |
'hannan' => |
array ( |
), |
'higashiosaka' => |
array ( |
), |
'higashisumiyoshi' => |
array ( |
), |
'higashiyodogawa' => |
array ( |
), |
'hirakata' => |
array ( |
), |
'ibaraki' => |
array ( |
), |
'ikeda' => |
array ( |
), |
'izumi' => |
array ( |
), |
'izumiotsu' => |
array ( |
), |
'izumisano' => |
array ( |
), |
'kadoma' => |
array ( |
), |
'kaizuka' => |
array ( |
), |
'kanan' => |
array ( |
), |
'kashiwara' => |
array ( |
), |
'katano' => |
array ( |
), |
'kawachinagano' => |
array ( |
), |
'kishiwada' => |
array ( |
), |
'kita' => |
array ( |
), |
'kumatori' => |
array ( |
), |
'matsubara' => |
array ( |
), |
'minato' => |
array ( |
), |
'minoh' => |
array ( |
), |
'misaki' => |
array ( |
), |
'moriguchi' => |
array ( |
), |
'neyagawa' => |
array ( |
), |
'nishi' => |
array ( |
), |
'nose' => |
array ( |
), |
'osakasayama' => |
array ( |
), |
'sakai' => |
array ( |
), |
'sayama' => |
array ( |
), |
'sennan' => |
array ( |
), |
'settsu' => |
array ( |
), |
'shijonawate' => |
array ( |
), |
'shimamoto' => |
array ( |
), |
'suita' => |
array ( |
), |
'tadaoka' => |
array ( |
), |
'taishi' => |
array ( |
), |
'tajiri' => |
array ( |
), |
'takaishi' => |
array ( |
), |
'takatsuki' => |
array ( |
), |
'tondabayashi' => |
array ( |
), |
'toyonaka' => |
array ( |
), |
'toyono' => |
array ( |
), |
'yao' => |
array ( |
), |
), |
'saga' => |
array ( |
'ariake' => |
array ( |
), |
'arita' => |
array ( |
), |
'fukudomi' => |
array ( |
), |
'genkai' => |
array ( |
), |
'hamatama' => |
array ( |
), |
'hizen' => |
array ( |
), |
'imari' => |
array ( |
), |
'kamimine' => |
array ( |
), |
'kanzaki' => |
array ( |
), |
'karatsu' => |
array ( |
), |
'kashima' => |
array ( |
), |
'kitagata' => |
array ( |
), |
'kitahata' => |
array ( |
), |
'kiyama' => |
array ( |
), |
'kouhoku' => |
array ( |
), |
'kyuragi' => |
array ( |
), |
'nishiarita' => |
array ( |
), |
'ogi' => |
array ( |
), |
'omachi' => |
array ( |
), |
'ouchi' => |
array ( |
), |
'saga' => |
array ( |
), |
'shiroishi' => |
array ( |
), |
'taku' => |
array ( |
), |
'tara' => |
array ( |
), |
'tosu' => |
array ( |
), |
'yoshinogari' => |
array ( |
), |
), |
'saitama' => |
array ( |
'arakawa' => |
array ( |
), |
'asaka' => |
array ( |
), |
'chichibu' => |
array ( |
), |
'fujimi' => |
array ( |
), |
'fujimino' => |
array ( |
), |
'fukaya' => |
array ( |
), |
'hanno' => |
array ( |
), |
'hanyu' => |
array ( |
), |
'hasuda' => |
array ( |
), |
'hatogaya' => |
array ( |
), |
'hatoyama' => |
array ( |
), |
'hidaka' => |
array ( |
), |
'higashichichibu' => |
array ( |
), |
'higashimatsuyama' => |
array ( |
), |
'honjo' => |
array ( |
), |
'ina' => |
array ( |
), |
'iruma' => |
array ( |
), |
'iwatsuki' => |
array ( |
), |
'kamiizumi' => |
array ( |
), |
'kamikawa' => |
array ( |
), |
'kamisato' => |
array ( |
), |
'kasukabe' => |
array ( |
), |
'kawagoe' => |
array ( |
), |
'kawaguchi' => |
array ( |
), |
'kawajima' => |
array ( |
), |
'kazo' => |
array ( |
), |
'kitamoto' => |
array ( |
), |
'koshigaya' => |
array ( |
), |
'kounosu' => |
array ( |
), |
'kuki' => |
array ( |
), |
'kumagaya' => |
array ( |
), |
'matsubushi' => |
array ( |
), |
'minano' => |
array ( |
), |
'misato' => |
array ( |
), |
'miyashiro' => |
array ( |
), |
'miyoshi' => |
array ( |
), |
'moroyama' => |
array ( |
), |
'nagatoro' => |
array ( |
), |
'namegawa' => |
array ( |
), |
'niiza' => |
array ( |
), |
'ogano' => |
array ( |
), |
'ogawa' => |
array ( |
), |
'ogose' => |
array ( |
), |
'okegawa' => |
array ( |
), |
'omiya' => |
array ( |
), |
'otaki' => |
array ( |
), |
'ranzan' => |
array ( |
), |
'ryokami' => |
array ( |
), |
'saitama' => |
array ( |
), |
'sakado' => |
array ( |
), |
'satte' => |
array ( |
), |
'sayama' => |
array ( |
), |
'shiki' => |
array ( |
), |
'shiraoka' => |
array ( |
), |
'soka' => |
array ( |
), |
'sugito' => |
array ( |
), |
'toda' => |
array ( |
), |
'tokigawa' => |
array ( |
), |
'tokorozawa' => |
array ( |
), |
'tsurugashima' => |
array ( |
), |
'urawa' => |
array ( |
), |
'warabi' => |
array ( |
), |
'yashio' => |
array ( |
), |
'yokoze' => |
array ( |
), |
'yono' => |
array ( |
), |
'yorii' => |
array ( |
), |
'yoshida' => |
array ( |
), |
'yoshikawa' => |
array ( |
), |
'yoshimi' => |
array ( |
), |
), |
'shiga' => |
array ( |
'aisho' => |
array ( |
), |
'gamo' => |
array ( |
), |
'higashiomi' => |
array ( |
), |
'hikone' => |
array ( |
), |
'koka' => |
array ( |
), |
'konan' => |
array ( |
), |
'kosei' => |
array ( |
), |
'koto' => |
array ( |
), |
'kusatsu' => |
array ( |
), |
'maibara' => |
array ( |
), |
'moriyama' => |
array ( |
), |
'nagahama' => |
array ( |
), |
'nishiazai' => |
array ( |
), |
'notogawa' => |
array ( |
), |
'omihachiman' => |
array ( |
), |
'otsu' => |
array ( |
), |
'ritto' => |
array ( |
), |
'ryuoh' => |
array ( |
), |
'takashima' => |
array ( |
), |
'takatsuki' => |
array ( |
), |
'torahime' => |
array ( |
), |
'toyosato' => |
array ( |
), |
'yasu' => |
array ( |
), |
), |
'shimane' => |
array ( |
'akagi' => |
array ( |
), |
'ama' => |
array ( |
), |
'gotsu' => |
array ( |
), |
'hamada' => |
array ( |
), |
'higashiizumo' => |
array ( |
), |
'hikawa' => |
array ( |
), |
'hikimi' => |
array ( |
), |
'izumo' => |
array ( |
), |
'kakinoki' => |
array ( |
), |
'masuda' => |
array ( |
), |
'matsue' => |
array ( |
), |
'misato' => |
array ( |
), |
'nishinoshima' => |
array ( |
), |
'ohda' => |
array ( |
), |
'okinoshima' => |
array ( |
), |
'okuizumo' => |
array ( |
), |
'shimane' => |
array ( |
), |
'tamayu' => |
array ( |
), |
'tsuwano' => |
array ( |
), |
'unnan' => |
array ( |
), |
'yakumo' => |
array ( |
), |
'yasugi' => |
array ( |
), |
'yatsuka' => |
array ( |
), |
), |
'shizuoka' => |
array ( |
'arai' => |
array ( |
), |
'atami' => |
array ( |
), |
'fuji' => |
array ( |
), |
'fujieda' => |
array ( |
), |
'fujikawa' => |
array ( |
), |
'fujinomiya' => |
array ( |
), |
'fukuroi' => |
array ( |
), |
'gotemba' => |
array ( |
), |
'haibara' => |
array ( |
), |
'hamamatsu' => |
array ( |
), |
'higashiizu' => |
array ( |
), |
'ito' => |
array ( |
), |
'iwata' => |
array ( |
), |
'izu' => |
array ( |
), |
'izunokuni' => |
array ( |
), |
'kakegawa' => |
array ( |
), |
'kannami' => |
array ( |
), |
'kawanehon' => |
array ( |
), |
'kawazu' => |
array ( |
), |
'kikugawa' => |
array ( |
), |
'kosai' => |
array ( |
), |
'makinohara' => |
array ( |
), |
'matsuzaki' => |
array ( |
), |
'minamiizu' => |
array ( |
), |
'mishima' => |
array ( |
), |
'morimachi' => |
array ( |
), |
'nishiizu' => |
array ( |
), |
'numazu' => |
array ( |
), |
'omaezaki' => |
array ( |
), |
'shimada' => |
array ( |
), |
'shimizu' => |
array ( |
), |
'shimoda' => |
array ( |
), |
'shizuoka' => |
array ( |
), |
'susono' => |
array ( |
), |
'yaizu' => |
array ( |
), |
'yoshida' => |
array ( |
), |
), |
'tochigi' => |
array ( |
'ashikaga' => |
array ( |
), |
'bato' => |
array ( |
), |
'haga' => |
array ( |
), |
'ichikai' => |
array ( |
), |
'iwafune' => |
array ( |
), |
'kaminokawa' => |
array ( |
), |
'kanuma' => |
array ( |
), |
'karasuyama' => |
array ( |
), |
'kuroiso' => |
array ( |
), |
'mashiko' => |
array ( |
), |
'mibu' => |
array ( |
), |
'moka' => |
array ( |
), |
'motegi' => |
array ( |
), |
'nasu' => |
array ( |
), |
'nasushiobara' => |
array ( |
), |
'nikko' => |
array ( |
), |
'nishikata' => |
array ( |
), |
'nogi' => |
array ( |
), |
'ohira' => |
array ( |
), |
'ohtawara' => |
array ( |
), |
'oyama' => |
array ( |
), |
'sakura' => |
array ( |
), |
'sano' => |
array ( |
), |
'shimotsuke' => |
array ( |
), |
'shioya' => |
array ( |
), |
'takanezawa' => |
array ( |
), |
'tochigi' => |
array ( |
), |
'tsuga' => |
array ( |
), |
'ujiie' => |
array ( |
), |
'utsunomiya' => |
array ( |
), |
'yaita' => |
array ( |
), |
), |
'tokushima' => |
array ( |
'aizumi' => |
array ( |
), |
'anan' => |
array ( |
), |
'ichiba' => |
array ( |
), |
'itano' => |
array ( |
), |
'kainan' => |
array ( |
), |
'komatsushima' => |
array ( |
), |
'matsushige' => |
array ( |
), |
'mima' => |
array ( |
), |
'minami' => |
array ( |
), |
'miyoshi' => |
array ( |
), |
'mugi' => |
array ( |
), |
'nakagawa' => |
array ( |
), |
'naruto' => |
array ( |
), |
'sanagochi' => |
array ( |
), |
'shishikui' => |
array ( |
), |
'tokushima' => |
array ( |
), |
'wajiki' => |
array ( |
), |
), |
'tokyo' => |
array ( |
'adachi' => |
array ( |
), |
'akiruno' => |
array ( |
), |
'akishima' => |
array ( |
), |
'aogashima' => |
array ( |
), |
'arakawa' => |
array ( |
), |
'bunkyo' => |
array ( |
), |
'chiyoda' => |
array ( |
), |
'chofu' => |
array ( |
), |
'chuo' => |
array ( |
), |
'edogawa' => |
array ( |
), |
'fuchu' => |
array ( |
), |
'fussa' => |
array ( |
), |
'hachijo' => |
array ( |
), |
'hachioji' => |
array ( |
), |
'hamura' => |
array ( |
), |
'higashikurume' => |
array ( |
), |
'higashimurayama' => |
array ( |
), |
'higashiyamato' => |
array ( |
), |
'hino' => |
array ( |
), |
'hinode' => |
array ( |
), |
'hinohara' => |
array ( |
), |
'inagi' => |
array ( |
), |
'itabashi' => |
array ( |
), |
'katsushika' => |
array ( |
), |
'kita' => |
array ( |
), |
'kiyose' => |
array ( |
), |
'kodaira' => |
array ( |
), |
'koganei' => |
array ( |
), |
'kokubunji' => |
array ( |
), |
'komae' => |
array ( |
), |
'koto' => |
array ( |
), |
'kouzushima' => |
array ( |
), |
'kunitachi' => |
array ( |
), |
'machida' => |
array ( |
), |
'meguro' => |
array ( |
), |
'minato' => |
array ( |
), |
'mitaka' => |
array ( |
), |
'mizuho' => |
array ( |
), |
'musashimurayama' => |
array ( |
), |
'musashino' => |
array ( |
), |
'nakano' => |
array ( |
), |
'nerima' => |
array ( |
), |
'ogasawara' => |
array ( |
), |
'okutama' => |
array ( |
), |
'ome' => |
array ( |
), |
'oshima' => |
array ( |
), |
'ota' => |
array ( |
), |
'setagaya' => |
array ( |
), |
'shibuya' => |
array ( |
), |
'shinagawa' => |
array ( |
), |
'shinjuku' => |
array ( |
), |
'suginami' => |
array ( |
), |
'sumida' => |
array ( |
), |
'tachikawa' => |
array ( |
), |
'taito' => |
array ( |
), |
'tama' => |
array ( |
), |
'toshima' => |
array ( |
), |
), |
'tottori' => |
array ( |
'chizu' => |
array ( |
), |
'hino' => |
array ( |
), |
'kawahara' => |
array ( |
), |
'koge' => |
array ( |
), |
'kotoura' => |
array ( |
), |
'misasa' => |
array ( |
), |
'nanbu' => |
array ( |
), |
'nichinan' => |
array ( |
), |
'sakaiminato' => |
array ( |
), |
'tottori' => |
array ( |
), |
'wakasa' => |
array ( |
), |
'yazu' => |
array ( |
), |
'yonago' => |
array ( |
), |
), |
'toyama' => |
array ( |
'asahi' => |
array ( |
), |
'fuchu' => |
array ( |
), |
'fukumitsu' => |
array ( |
), |
'funahashi' => |
array ( |
), |
'himi' => |
array ( |
), |
'imizu' => |
array ( |
), |
'inami' => |
array ( |
), |
'johana' => |
array ( |
), |
'kamiichi' => |
array ( |
), |
'kurobe' => |
array ( |
), |
'nakaniikawa' => |
array ( |
), |
'namerikawa' => |
array ( |
), |
'nanto' => |
array ( |
), |
'nyuzen' => |
array ( |
), |
'oyabe' => |
array ( |
), |
'taira' => |
array ( |
), |
'takaoka' => |
array ( |
), |
'tateyama' => |
array ( |
), |
'toga' => |
array ( |
), |
'tonami' => |
array ( |
), |
'toyama' => |
array ( |
), |
'unazuki' => |
array ( |
), |
'uozu' => |
array ( |
), |
'yamada' => |
array ( |
), |
), |
'wakayama' => |
array ( |
'arida' => |
array ( |
), |
'aridagawa' => |
array ( |
), |
'gobo' => |
array ( |
), |
'hashimoto' => |
array ( |
), |
'hidaka' => |
array ( |
), |
'hirogawa' => |
array ( |
), |
'inami' => |
array ( |
), |
'iwade' => |
array ( |
), |
'kainan' => |
array ( |
), |
'kamitonda' => |
array ( |
), |
'katsuragi' => |
array ( |
), |
'kimino' => |
array ( |
), |
'kinokawa' => |
array ( |
), |
'kitayama' => |
array ( |
), |
'koya' => |
array ( |
), |
'koza' => |
array ( |
), |
'kozagawa' => |
array ( |
), |
'kudoyama' => |
array ( |
), |
'kushimoto' => |
array ( |
), |
'mihama' => |
array ( |
), |
'misato' => |
array ( |
), |
'nachikatsuura' => |
array ( |
), |
'shingu' => |
array ( |
), |
'shirahama' => |
array ( |
), |
'taiji' => |
array ( |
), |
'tanabe' => |
array ( |
), |
'wakayama' => |
array ( |
), |
'yuasa' => |
array ( |
), |
'yura' => |
array ( |
), |
), |
'yamagata' => |
array ( |
'asahi' => |
array ( |
), |
'funagata' => |
array ( |
), |
'higashine' => |
array ( |
), |
'iide' => |
array ( |
), |
'kahoku' => |
array ( |
), |
'kaminoyama' => |
array ( |
), |
'kaneyama' => |
array ( |
), |
'kawanishi' => |
array ( |
), |
'mamurogawa' => |
array ( |
), |
'mikawa' => |
array ( |
), |
'murayama' => |
array ( |
), |
'nagai' => |
array ( |
), |
'nakayama' => |
array ( |
), |
'nanyo' => |
array ( |
), |
'nishikawa' => |
array ( |
), |
'obanazawa' => |
array ( |
), |
'oe' => |
array ( |
), |
'oguni' => |
array ( |
), |
'ohkura' => |
array ( |
), |
'oishida' => |
array ( |
), |
'sagae' => |
array ( |
), |
'sakata' => |
array ( |
), |
'sakegawa' => |
array ( |
), |
'shinjo' => |
array ( |
), |
'shirataka' => |
array ( |
), |
'shonai' => |
array ( |
), |
'takahata' => |
array ( |
), |
'tendo' => |
array ( |
), |
'tozawa' => |
array ( |
), |
'tsuruoka' => |
array ( |
), |
'yamagata' => |
array ( |
), |
'yamanobe' => |
array ( |
), |
'yonezawa' => |
array ( |
), |
'yuza' => |
array ( |
), |
), |
'yamaguchi' => |
array ( |
'abu' => |
array ( |
), |
'hagi' => |
array ( |
), |
'hikari' => |
array ( |
), |
'hofu' => |
array ( |
), |
'iwakuni' => |
array ( |
), |
'kudamatsu' => |
array ( |
), |
'mitou' => |
array ( |
), |
'nagato' => |
array ( |
), |
'oshima' => |
array ( |
), |
'shimonoseki' => |
array ( |
), |
'shunan' => |
array ( |
), |
'tabuse' => |
array ( |
), |
'tokuyama' => |
array ( |
), |
'toyota' => |
array ( |
), |
'ube' => |
array ( |
), |
'yuu' => |
array ( |
), |
), |
'yamanashi' => |
array ( |
'chuo' => |
array ( |
), |
'doshi' => |
array ( |
), |
'fuefuki' => |
array ( |
), |
'fujikawa' => |
array ( |
), |
'fujikawaguchiko' => |
array ( |
), |
'fujiyoshida' => |
array ( |
), |
'hayakawa' => |
array ( |
), |
'hokuto' => |
array ( |
), |
'ichikawamisato' => |
array ( |
), |
'kai' => |
array ( |
), |
'kofu' => |
array ( |
), |
'koshu' => |
array ( |
), |
'kosuge' => |
array ( |
), |
'minami-alps' => |
array ( |
), |
'minobu' => |
array ( |
), |
'nakamichi' => |
array ( |
), |
'nanbu' => |
array ( |
), |
'narusawa' => |
array ( |
), |
'nirasaki' => |
array ( |
), |
'nishikatsura' => |
array ( |
), |
'oshino' => |
array ( |
), |
'otsuki' => |
array ( |
), |
'showa' => |
array ( |
), |
'tabayama' => |
array ( |
), |
'tsuru' => |
array ( |
), |
'uenohara' => |
array ( |
), |
'yamanakako' => |
array ( |
), |
'yamanashi' => |
array ( |
), |
), |
'kawasaki' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'kitakyushu' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'kobe' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'nagoya' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'sapporo' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'sendai' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'yokohama' => |
array ( |
'*' => |
array ( |
), |
'city' => |
array ( |
'!' => '', |
), |
), |
'blogspot' => |
array ( |
), |
), |
'ke' => |
array ( |
'*' => |
array ( |
), |
), |
'kg' => |
array ( |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'kh' => |
array ( |
'*' => |
array ( |
), |
), |
'ki' => |
array ( |
'edu' => |
array ( |
), |
'biz' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
'com' => |
array ( |
), |
), |
'km' => |
array ( |
'org' => |
array ( |
), |
'nom' => |
array ( |
), |
'gov' => |
array ( |
), |
'prd' => |
array ( |
), |
'tm' => |
array ( |
), |
'edu' => |
array ( |
), |
'mil' => |
array ( |
), |
'ass' => |
array ( |
), |
'com' => |
array ( |
), |
'coop' => |
array ( |
), |
'asso' => |
array ( |
), |
'presse' => |
array ( |
), |
'medecin' => |
array ( |
), |
'notaires' => |
array ( |
), |
'pharmaciens' => |
array ( |
), |
'veterinaire' => |
array ( |
), |
'gouv' => |
array ( |
), |
), |
'kn' => |
array ( |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'kp' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'rep' => |
array ( |
), |
'tra' => |
array ( |
), |
), |
'kr' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'es' => |
array ( |
), |
'go' => |
array ( |
), |
'hs' => |
array ( |
), |
'kg' => |
array ( |
), |
'mil' => |
array ( |
), |
'ms' => |
array ( |
), |
'ne' => |
array ( |
), |
'or' => |
array ( |
), |
'pe' => |
array ( |
), |
're' => |
array ( |
), |
'sc' => |
array ( |
), |
'busan' => |
array ( |
), |
'chungbuk' => |
array ( |
), |
'chungnam' => |
array ( |
), |
'daegu' => |
array ( |
), |
'daejeon' => |
array ( |
), |
'gangwon' => |
array ( |
), |
'gwangju' => |
array ( |
), |
'gyeongbuk' => |
array ( |
), |
'gyeonggi' => |
array ( |
), |
'gyeongnam' => |
array ( |
), |
'incheon' => |
array ( |
), |
'jeju' => |
array ( |
), |
'jeonbuk' => |
array ( |
), |
'jeonnam' => |
array ( |
), |
'seoul' => |
array ( |
), |
'ulsan' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'kw' => |
array ( |
'*' => |
array ( |
), |
), |
'ky' => |
array ( |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'kz' => |
array ( |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
), |
'la' => |
array ( |
'int' => |
array ( |
), |
'net' => |
array ( |
), |
'info' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'per' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'c' => |
array ( |
), |
), |
'lb' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'lc' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'li' => |
array ( |
), |
'lk' => |
array ( |
'gov' => |
array ( |
), |
'sch' => |
array ( |
), |
'net' => |
array ( |
), |
'int' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'ngo' => |
array ( |
), |
'soc' => |
array ( |
), |
'web' => |
array ( |
), |
'ltd' => |
array ( |
), |
'assn' => |
array ( |
), |
'grp' => |
array ( |
), |
'hotel' => |
array ( |
), |
), |
'lr' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'ls' => |
array ( |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'lt' => |
array ( |
'gov' => |
array ( |
), |
), |
'lu' => |
array ( |
), |
'lv' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'mil' => |
array ( |
), |
'id' => |
array ( |
), |
'net' => |
array ( |
), |
'asn' => |
array ( |
), |
'conf' => |
array ( |
), |
), |
'ly' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'plc' => |
array ( |
), |
'edu' => |
array ( |
), |
'sch' => |
array ( |
), |
'med' => |
array ( |
), |
'org' => |
array ( |
), |
'id' => |
array ( |
), |
), |
'ma' => |
array ( |
'co' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'ac' => |
array ( |
), |
'press' => |
array ( |
), |
), |
'mc' => |
array ( |
'tm' => |
array ( |
), |
'asso' => |
array ( |
), |
), |
'md' => |
array ( |
), |
'me' => |
array ( |
'co' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'ac' => |
array ( |
), |
'gov' => |
array ( |
), |
'its' => |
array ( |
), |
'priv' => |
array ( |
), |
), |
'mg' => |
array ( |
'org' => |
array ( |
), |
'nom' => |
array ( |
), |
'gov' => |
array ( |
), |
'prd' => |
array ( |
), |
'tm' => |
array ( |
), |
'edu' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
), |
'mh' => |
array ( |
), |
'mil' => |
array ( |
), |
'mk' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'inf' => |
array ( |
), |
'name' => |
array ( |
), |
), |
'ml' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gouv' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'presse' => |
array ( |
), |
), |
'mm' => |
array ( |
'*' => |
array ( |
), |
), |
'mn' => |
array ( |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'nyc' => |
array ( |
), |
), |
'mo' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
), |
'mobi' => |
array ( |
), |
'mp' => |
array ( |
), |
'mq' => |
array ( |
), |
'mr' => |
array ( |
'gov' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'ms' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'mt' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'mu' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'or' => |
array ( |
), |
), |
'museum' => |
array ( |
'academy' => |
array ( |
), |
'agriculture' => |
array ( |
), |
'air' => |
array ( |
), |
'airguard' => |
array ( |
), |
'alabama' => |
array ( |
), |
'alaska' => |
array ( |
), |
'amber' => |
array ( |
), |
'ambulance' => |
array ( |
), |
'american' => |
array ( |
), |
'americana' => |
array ( |
), |
'americanantiques' => |
array ( |
), |
'americanart' => |
array ( |
), |
'amsterdam' => |
array ( |
), |
'and' => |
array ( |
), |
'annefrank' => |
array ( |
), |
'anthro' => |
array ( |
), |
'anthropology' => |
array ( |
), |
'antiques' => |
array ( |
), |
'aquarium' => |
array ( |
), |
'arboretum' => |
array ( |
), |
'archaeological' => |
array ( |
), |
'archaeology' => |
array ( |
), |
'architecture' => |
array ( |
), |
'art' => |
array ( |
), |
'artanddesign' => |
array ( |
), |
'artcenter' => |
array ( |
), |
'artdeco' => |
array ( |
), |
'arteducation' => |
array ( |
), |
'artgallery' => |
array ( |
), |
'arts' => |
array ( |
), |
'artsandcrafts' => |
array ( |
), |
'asmatart' => |
array ( |
), |
'assassination' => |
array ( |
), |
'assisi' => |
array ( |
), |
'association' => |
array ( |
), |
'astronomy' => |
array ( |
), |
'atlanta' => |
array ( |
), |
'austin' => |
array ( |
), |
'australia' => |
array ( |
), |
'automotive' => |
array ( |
), |
'aviation' => |
array ( |
), |
'axis' => |
array ( |
), |
'badajoz' => |
array ( |
), |
'baghdad' => |
array ( |
), |
'bahn' => |
array ( |
), |
'bale' => |
array ( |
), |
'baltimore' => |
array ( |
), |
'barcelona' => |
array ( |
), |
'baseball' => |
array ( |
), |
'basel' => |
array ( |
), |
'baths' => |
array ( |
), |
'bauern' => |
array ( |
), |
'beauxarts' => |
array ( |
), |
'beeldengeluid' => |
array ( |
), |
'bellevue' => |
array ( |
), |
'bergbau' => |
array ( |
), |
'berkeley' => |
array ( |
), |
'berlin' => |
array ( |
), |
'bern' => |
array ( |
), |
'bible' => |
array ( |
), |
'bilbao' => |
array ( |
), |
'bill' => |
array ( |
), |
'birdart' => |
array ( |
), |
'birthplace' => |
array ( |
), |
'bonn' => |
array ( |
), |
'boston' => |
array ( |
), |
'botanical' => |
array ( |
), |
'botanicalgarden' => |
array ( |
), |
'botanicgarden' => |
array ( |
), |
'botany' => |
array ( |
), |
'brandywinevalley' => |
array ( |
), |
'brasil' => |
array ( |
), |
'bristol' => |
array ( |
), |
'british' => |
array ( |
), |
'britishcolumbia' => |
array ( |
), |
'broadcast' => |
array ( |
), |
'brunel' => |
array ( |
), |
'brussel' => |
array ( |
), |
'brussels' => |
array ( |
), |
'bruxelles' => |
array ( |
), |
'building' => |
array ( |
), |
'burghof' => |
array ( |
), |
'bus' => |
array ( |
), |
'bushey' => |
array ( |
), |
'cadaques' => |
array ( |
), |
'california' => |
array ( |
), |
'cambridge' => |
array ( |
), |
'can' => |
array ( |
), |
'canada' => |
array ( |
), |
'capebreton' => |
array ( |
), |
'carrier' => |
array ( |
), |
'cartoonart' => |
array ( |
), |
'casadelamoneda' => |
array ( |
), |
'castle' => |
array ( |
), |
'castres' => |
array ( |
), |
'celtic' => |
array ( |
), |
'center' => |
array ( |
), |
'chattanooga' => |
array ( |
), |
'cheltenham' => |
array ( |
), |
'chesapeakebay' => |
array ( |
), |
'chicago' => |
array ( |
), |
'children' => |
array ( |
), |
'childrens' => |
array ( |
), |
'childrensgarden' => |
array ( |
), |
'chiropractic' => |
array ( |
), |
'chocolate' => |
array ( |
), |
'christiansburg' => |
array ( |
), |
'cincinnati' => |
array ( |
), |
'cinema' => |
array ( |
), |
'circus' => |
array ( |
), |
'civilisation' => |
array ( |
), |
'civilization' => |
array ( |
), |
'civilwar' => |
array ( |
), |
'clinton' => |
array ( |
), |
'clock' => |
array ( |
), |
'coal' => |
array ( |
), |
'coastaldefence' => |
array ( |
), |
'cody' => |
array ( |
), |
'coldwar' => |
array ( |
), |
'collection' => |
array ( |
), |
'colonialwilliamsburg' => |
array ( |
), |
'coloradoplateau' => |
array ( |
), |
'columbia' => |
array ( |
), |
'columbus' => |
array ( |
), |
'communication' => |
array ( |
), |
'communications' => |
array ( |
), |
'community' => |
array ( |
), |
'computer' => |
array ( |
), |
'computerhistory' => |
array ( |
), |
'comunicações' => |
array ( |
), |
'contemporary' => |
array ( |
), |
'contemporaryart' => |
array ( |
), |
'convent' => |
array ( |
), |
'copenhagen' => |
array ( |
), |
'corporation' => |
array ( |
), |
'correios-e-telecomunicações' => |
array ( |
), |
'corvette' => |
array ( |
), |
'costume' => |
array ( |
), |
'countryestate' => |
array ( |
), |
'county' => |
array ( |
), |
'crafts' => |
array ( |
), |
'cranbrook' => |
array ( |
), |
'creation' => |
array ( |
), |
'cultural' => |
array ( |
), |
'culturalcenter' => |
array ( |
), |
'culture' => |
array ( |
), |
'cyber' => |
array ( |
), |
'cymru' => |
array ( |
), |
'dali' => |
array ( |
), |
'dallas' => |
array ( |
), |
'database' => |
array ( |
), |
'ddr' => |
array ( |
), |
'decorativearts' => |
array ( |
), |
'delaware' => |
array ( |
), |
'delmenhorst' => |
array ( |
), |
'denmark' => |
array ( |
), |
'depot' => |
array ( |
), |
'design' => |
array ( |
), |
'detroit' => |
array ( |
), |
'dinosaur' => |
array ( |
), |
'discovery' => |
array ( |
), |
'dolls' => |
array ( |
), |
'donostia' => |
array ( |
), |
'durham' => |
array ( |
), |
'eastafrica' => |
array ( |
), |
'eastcoast' => |
array ( |
), |
'education' => |
array ( |
), |
'educational' => |
array ( |
), |
'egyptian' => |
array ( |
), |
'eisenbahn' => |
array ( |
), |
'elburg' => |
array ( |
), |
'elvendrell' => |
array ( |
), |
'embroidery' => |
array ( |
), |
'encyclopedic' => |
array ( |
), |
'england' => |
array ( |
), |
'entomology' => |
array ( |
), |
'environment' => |
array ( |
), |
'environmentalconservation' => |
array ( |
), |
'epilepsy' => |
array ( |
), |
'essex' => |
array ( |
), |
'estate' => |
array ( |
), |
'ethnology' => |
array ( |
), |
'exeter' => |
array ( |
), |
'exhibition' => |
array ( |
), |
'family' => |
array ( |
), |
'farm' => |
array ( |
), |
'farmequipment' => |
array ( |
), |
'farmers' => |
array ( |
), |
'farmstead' => |
array ( |
), |
'field' => |
array ( |
), |
'figueres' => |
array ( |
), |
'filatelia' => |
array ( |
), |
'film' => |
array ( |
), |
'fineart' => |
array ( |
), |
'finearts' => |
array ( |
), |
'finland' => |
array ( |
), |
'flanders' => |
array ( |
), |
'florida' => |
array ( |
), |
'force' => |
array ( |
), |
'fortmissoula' => |
array ( |
), |
'fortworth' => |
array ( |
), |
'foundation' => |
array ( |
), |
'francaise' => |
array ( |
), |
'frankfurt' => |
array ( |
), |
'franziskaner' => |
array ( |
), |
'freemasonry' => |
array ( |
), |
'freiburg' => |
array ( |
), |
'fribourg' => |
array ( |
), |
'frog' => |
array ( |
), |
'fundacio' => |
array ( |
), |
'furniture' => |
array ( |
), |
'gallery' => |
array ( |
), |
'garden' => |
array ( |
), |
'gateway' => |
array ( |
), |
'geelvinck' => |
array ( |
), |
'gemological' => |
array ( |
), |
'geology' => |
array ( |
), |
'georgia' => |
array ( |
), |
'giessen' => |
array ( |
), |
'glas' => |
array ( |
), |
'glass' => |
array ( |
), |
'gorge' => |
array ( |
), |
'grandrapids' => |
array ( |
), |
'graz' => |
array ( |
), |
'guernsey' => |
array ( |
), |
'halloffame' => |
array ( |
), |
'hamburg' => |
array ( |
), |
'handson' => |
array ( |
), |
'harvestcelebration' => |
array ( |
), |
'hawaii' => |
array ( |
), |
'health' => |
array ( |
), |
'heimatunduhren' => |
array ( |
), |
'hellas' => |
array ( |
), |
'helsinki' => |
array ( |
), |
'hembygdsforbund' => |
array ( |
), |
'heritage' => |
array ( |
), |
'histoire' => |
array ( |
), |
'historical' => |
array ( |
), |
'historicalsociety' => |
array ( |
), |
'historichouses' => |
array ( |
), |
'historisch' => |
array ( |
), |
'historisches' => |
array ( |
), |
'history' => |
array ( |
), |
'historyofscience' => |
array ( |
), |
'horology' => |
array ( |
), |
'house' => |
array ( |
), |
'humanities' => |
array ( |
), |
'illustration' => |
array ( |
), |
'imageandsound' => |
array ( |
), |
'indian' => |
array ( |
), |
'indiana' => |
array ( |
), |
'indianapolis' => |
array ( |
), |
'indianmarket' => |
array ( |
), |
'intelligence' => |
array ( |
), |
'interactive' => |
array ( |
), |
'iraq' => |
array ( |
), |
'iron' => |
array ( |
), |
'isleofman' => |
array ( |
), |
'jamison' => |
array ( |
), |
'jefferson' => |
array ( |
), |
'jerusalem' => |
array ( |
), |
'jewelry' => |
array ( |
), |
'jewish' => |
array ( |
), |
'jewishart' => |
array ( |
), |
'jfk' => |
array ( |
), |
'journalism' => |
array ( |
), |
'judaica' => |
array ( |
), |
'judygarland' => |
array ( |
), |
'juedisches' => |
array ( |
), |
'juif' => |
array ( |
), |
'karate' => |
array ( |
), |
'karikatur' => |
array ( |
), |
'kids' => |
array ( |
), |
'koebenhavn' => |
array ( |
), |
'koeln' => |
array ( |
), |
'kunst' => |
array ( |
), |
'kunstsammlung' => |
array ( |
), |
'kunstunddesign' => |
array ( |
), |
'labor' => |
array ( |
), |
'labour' => |
array ( |
), |
'lajolla' => |
array ( |
), |
'lancashire' => |
array ( |
), |
'landes' => |
array ( |
), |
'lans' => |
array ( |
), |
'läns' => |
array ( |
), |
'larsson' => |
array ( |
), |
'lewismiller' => |
array ( |
), |
'lincoln' => |
array ( |
), |
'linz' => |
array ( |
), |
'living' => |
array ( |
), |
'livinghistory' => |
array ( |
), |
'localhistory' => |
array ( |
), |
'london' => |
array ( |
), |
'losangeles' => |
array ( |
), |
'louvre' => |
array ( |
), |
'loyalist' => |
array ( |
), |
'lucerne' => |
array ( |
), |
'luxembourg' => |
array ( |
), |
'luzern' => |
array ( |
), |
'mad' => |
array ( |
), |
'madrid' => |
array ( |
), |
'mallorca' => |
array ( |
), |
'manchester' => |
array ( |
), |
'mansion' => |
array ( |
), |
'mansions' => |
array ( |
), |
'manx' => |
array ( |
), |
'marburg' => |
array ( |
), |
'maritime' => |
array ( |
), |
'maritimo' => |
array ( |
), |
'maryland' => |
array ( |
), |
'marylhurst' => |
array ( |
), |
'media' => |
array ( |
), |
'medical' => |
array ( |
), |
'medizinhistorisches' => |
array ( |
), |
'meeres' => |
array ( |
), |
'memorial' => |
array ( |
), |
'mesaverde' => |
array ( |
), |
'michigan' => |
array ( |
), |
'midatlantic' => |
array ( |
), |
'military' => |
array ( |
), |
'mill' => |
array ( |
), |
'miners' => |
array ( |
), |
'mining' => |
array ( |
), |
'minnesota' => |
array ( |
), |
'missile' => |
array ( |
), |
'missoula' => |
array ( |
), |
'modern' => |
array ( |
), |
'moma' => |
array ( |
), |
'money' => |
array ( |
), |
'monmouth' => |
array ( |
), |
'monticello' => |
array ( |
), |
'montreal' => |
array ( |
), |
'moscow' => |
array ( |
), |
'motorcycle' => |
array ( |
), |
'muenchen' => |
array ( |
), |
'muenster' => |
array ( |
), |
'mulhouse' => |
array ( |
), |
'muncie' => |
array ( |
), |
'museet' => |
array ( |
), |
'museumcenter' => |
array ( |
), |
'museumvereniging' => |
array ( |
), |
'music' => |
array ( |
), |
'national' => |
array ( |
), |
'nationalfirearms' => |
array ( |
), |
'nationalheritage' => |
array ( |
), |
'nativeamerican' => |
array ( |
), |
'naturalhistory' => |
array ( |
), |
'naturalhistorymuseum' => |
array ( |
), |
'naturalsciences' => |
array ( |
), |
'nature' => |
array ( |
), |
'naturhistorisches' => |
array ( |
), |
'natuurwetenschappen' => |
array ( |
), |
'naumburg' => |
array ( |
), |
'naval' => |
array ( |
), |
'nebraska' => |
array ( |
), |
'neues' => |
array ( |
), |
'newhampshire' => |
array ( |
), |
'newjersey' => |
array ( |
), |
'newmexico' => |
array ( |
), |
'newport' => |
array ( |
), |
'newspaper' => |
array ( |
), |
'newyork' => |
array ( |
), |
'niepce' => |
array ( |
), |
'norfolk' => |
array ( |
), |
'north' => |
array ( |
), |
'nrw' => |
array ( |
), |
'nuernberg' => |
array ( |
), |
'nuremberg' => |
array ( |
), |
'nyc' => |
array ( |
), |
'nyny' => |
array ( |
), |
'oceanographic' => |
array ( |
), |
'oceanographique' => |
array ( |
), |
'omaha' => |
array ( |
), |
'online' => |
array ( |
), |
'ontario' => |
array ( |
), |
'openair' => |
array ( |
), |
'oregon' => |
array ( |
), |
'oregontrail' => |
array ( |
), |
'otago' => |
array ( |
), |
'oxford' => |
array ( |
), |
'pacific' => |
array ( |
), |
'paderborn' => |
array ( |
), |
'palace' => |
array ( |
), |
'paleo' => |
array ( |
), |
'palmsprings' => |
array ( |
), |
'panama' => |
array ( |
), |
'paris' => |
array ( |
), |
'pasadena' => |
array ( |
), |
'pharmacy' => |
array ( |
), |
'philadelphia' => |
array ( |
), |
'philadelphiaarea' => |
array ( |
), |
'philately' => |
array ( |
), |
'phoenix' => |
array ( |
), |
'photography' => |
array ( |
), |
'pilots' => |
array ( |
), |
'pittsburgh' => |
array ( |
), |
'planetarium' => |
array ( |
), |
'plantation' => |
array ( |
), |
'plants' => |
array ( |
), |
'plaza' => |
array ( |
), |
'portal' => |
array ( |
), |
'portland' => |
array ( |
), |
'portlligat' => |
array ( |
), |
'posts-and-telecommunications' => |
array ( |
), |
'preservation' => |
array ( |
), |
'presidio' => |
array ( |
), |
'press' => |
array ( |
), |
'project' => |
array ( |
), |
'public' => |
array ( |
), |
'pubol' => |
array ( |
), |
'quebec' => |
array ( |
), |
'railroad' => |
array ( |
), |
'railway' => |
array ( |
), |
'research' => |
array ( |
), |
'resistance' => |
array ( |
), |
'riodejaneiro' => |
array ( |
), |
'rochester' => |
array ( |
), |
'rockart' => |
array ( |
), |
'roma' => |
array ( |
), |
'russia' => |
array ( |
), |
'saintlouis' => |
array ( |
), |
'salem' => |
array ( |
), |
'salvadordali' => |
array ( |
), |
'salzburg' => |
array ( |
), |
'sandiego' => |
array ( |
), |
'sanfrancisco' => |
array ( |
), |
'santabarbara' => |
array ( |
), |
'santacruz' => |
array ( |
), |
'santafe' => |
array ( |
), |
'saskatchewan' => |
array ( |
), |
'satx' => |
array ( |
), |
'savannahga' => |
array ( |
), |
'schlesisches' => |
array ( |
), |
'schoenbrunn' => |
array ( |
), |
'schokoladen' => |
array ( |
), |
'school' => |
array ( |
), |
'schweiz' => |
array ( |
), |
'science' => |
array ( |
), |
'scienceandhistory' => |
array ( |
), |
'scienceandindustry' => |
array ( |
), |
'sciencecenter' => |
array ( |
), |
'sciencecenters' => |
array ( |
), |
'science-fiction' => |
array ( |
), |
'sciencehistory' => |
array ( |
), |
'sciences' => |
array ( |
), |
'sciencesnaturelles' => |
array ( |
), |
'scotland' => |
array ( |
), |
'seaport' => |
array ( |
), |
'settlement' => |
array ( |
), |
'settlers' => |
array ( |
), |
'shell' => |
array ( |
), |
'sherbrooke' => |
array ( |
), |
'sibenik' => |
array ( |
), |
'silk' => |
array ( |
), |
'ski' => |
array ( |
), |
'skole' => |
array ( |
), |
'society' => |
array ( |
), |
'sologne' => |
array ( |
), |
'soundandvision' => |
array ( |
), |
'southcarolina' => |
array ( |
), |
'southwest' => |
array ( |
), |
'space' => |
array ( |
), |
'spy' => |
array ( |
), |
'square' => |
array ( |
), |
'stadt' => |
array ( |
), |
'stalbans' => |
array ( |
), |
'starnberg' => |
array ( |
), |
'state' => |
array ( |
), |
'stateofdelaware' => |
array ( |
), |
'station' => |
array ( |
), |
'steam' => |
array ( |
), |
'steiermark' => |
array ( |
), |
'stjohn' => |
array ( |
), |
'stockholm' => |
array ( |
), |
'stpetersburg' => |
array ( |
), |
'stuttgart' => |
array ( |
), |
'suisse' => |
array ( |
), |
'surgeonshall' => |
array ( |
), |
'surrey' => |
array ( |
), |
'svizzera' => |
array ( |
), |
'sweden' => |
array ( |
), |
'sydney' => |
array ( |
), |
'tank' => |
array ( |
), |
'tcm' => |
array ( |
), |
'technology' => |
array ( |
), |
'telekommunikation' => |
array ( |
), |
'television' => |
array ( |
), |
'texas' => |
array ( |
), |
'textile' => |
array ( |
), |
'theater' => |
array ( |
), |
'time' => |
array ( |
), |
'timekeeping' => |
array ( |
), |
'topology' => |
array ( |
), |
'torino' => |
array ( |
), |
'touch' => |
array ( |
), |
'town' => |
array ( |
), |
'transport' => |
array ( |
), |
'tree' => |
array ( |
), |
'trolley' => |
array ( |
), |
'trust' => |
array ( |
), |
'trustee' => |
array ( |
), |
'uhren' => |
array ( |
), |
'ulm' => |
array ( |
), |
'undersea' => |
array ( |
), |
'university' => |
array ( |
), |
'usa' => |
array ( |
), |
'usantiques' => |
array ( |
), |
'usarts' => |
array ( |
), |
'uscountryestate' => |
array ( |
), |
'usculture' => |
array ( |
), |
'usdecorativearts' => |
array ( |
), |
'usgarden' => |
array ( |
), |
'ushistory' => |
array ( |
), |
'ushuaia' => |
array ( |
), |
'uslivinghistory' => |
array ( |
), |
'utah' => |
array ( |
), |
'uvic' => |
array ( |
), |
'valley' => |
array ( |
), |
'vantaa' => |
array ( |
), |
'versailles' => |
array ( |
), |
'viking' => |
array ( |
), |
'village' => |
array ( |
), |
'virginia' => |
array ( |
), |
'virtual' => |
array ( |
), |
'virtuel' => |
array ( |
), |
'vlaanderen' => |
array ( |
), |
'volkenkunde' => |
array ( |
), |
'wales' => |
array ( |
), |
'wallonie' => |
array ( |
), |
'war' => |
array ( |
), |
'washingtondc' => |
array ( |
), |
'watchandclock' => |
array ( |
), |
'watch-and-clock' => |
array ( |
), |
'western' => |
array ( |
), |
'westfalen' => |
array ( |
), |
'whaling' => |
array ( |
), |
'wildlife' => |
array ( |
), |
'williamsburg' => |
array ( |
), |
'windmill' => |
array ( |
), |
'workshop' => |
array ( |
), |
'york' => |
array ( |
), |
'yorkshire' => |
array ( |
), |
'yosemite' => |
array ( |
), |
'youth' => |
array ( |
), |
'zoological' => |
array ( |
), |
'zoology' => |
array ( |
), |
'ירושלים' => |
array ( |
), |
'иком' => |
array ( |
), |
), |
'mv' => |
array ( |
'aero' => |
array ( |
), |
'biz' => |
array ( |
), |
'com' => |
array ( |
), |
'coop' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
'int' => |
array ( |
), |
'mil' => |
array ( |
), |
'museum' => |
array ( |
), |
'name' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'pro' => |
array ( |
), |
), |
'mw' => |
array ( |
'ac' => |
array ( |
), |
'biz' => |
array ( |
), |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'coop' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'int' => |
array ( |
), |
'museum' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'mx' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'gob' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'my' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
), |
'mz' => |
array ( |
'*' => |
array ( |
), |
'teledata' => |
array ( |
'!' => '', |
), |
), |
'na' => |
array ( |
'info' => |
array ( |
), |
'pro' => |
array ( |
), |
'name' => |
array ( |
), |
'school' => |
array ( |
), |
'or' => |
array ( |
), |
'dr' => |
array ( |
), |
'us' => |
array ( |
), |
'mx' => |
array ( |
), |
'ca' => |
array ( |
), |
'in' => |
array ( |
), |
'cc' => |
array ( |
), |
'tv' => |
array ( |
), |
'ws' => |
array ( |
), |
'mobi' => |
array ( |
), |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'name' => |
array ( |
'her' => |
array ( |
'forgot' => |
array ( |
), |
), |
'his' => |
array ( |
'forgot' => |
array ( |
), |
), |
), |
'nc' => |
array ( |
'asso' => |
array ( |
), |
), |
'ne' => |
array ( |
), |
'net' => |
array ( |
'cloudfront' => |
array ( |
), |
'gb' => |
array ( |
), |
'hu' => |
array ( |
), |
'jp' => |
array ( |
), |
'se' => |
array ( |
), |
'uk' => |
array ( |
), |
'in' => |
array ( |
), |
'at-band-camp' => |
array ( |
), |
'blogdns' => |
array ( |
), |
'broke-it' => |
array ( |
), |
'buyshouses' => |
array ( |
), |
'dnsalias' => |
array ( |
), |
'dnsdojo' => |
array ( |
), |
'does-it' => |
array ( |
), |
'dontexist' => |
array ( |
), |
'dynalias' => |
array ( |
), |
'dynathome' => |
array ( |
), |
'endofinternet' => |
array ( |
), |
'from-az' => |
array ( |
), |
'from-co' => |
array ( |
), |
'from-la' => |
array ( |
), |
'from-ny' => |
array ( |
), |
'gets-it' => |
array ( |
), |
'ham-radio-op' => |
array ( |
), |
'homeftp' => |
array ( |
), |
'homeip' => |
array ( |
), |
'homelinux' => |
array ( |
), |
'homeunix' => |
array ( |
), |
'in-the-band' => |
array ( |
), |
'is-a-chef' => |
array ( |
), |
'is-a-geek' => |
array ( |
), |
'isa-geek' => |
array ( |
), |
'kicks-ass' => |
array ( |
), |
'office-on-the' => |
array ( |
), |
'podzone' => |
array ( |
), |
'scrapper-site' => |
array ( |
), |
'selfip' => |
array ( |
), |
'sells-it' => |
array ( |
), |
'servebbs' => |
array ( |
), |
'serveftp' => |
array ( |
), |
'thruhere' => |
array ( |
), |
'webhop' => |
array ( |
), |
'fastly' => |
array ( |
'ssl' => |
array ( |
'a' => |
array ( |
), |
'b' => |
array ( |
), |
'global' => |
array ( |
), |
), |
'prod' => |
array ( |
'a' => |
array ( |
), |
'global' => |
array ( |
), |
), |
), |
'azurewebsites' => |
array ( |
), |
'azure-mobile' => |
array ( |
), |
'cloudapp' => |
array ( |
), |
'za' => |
array ( |
), |
), |
'nf' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'per' => |
array ( |
), |
'rec' => |
array ( |
), |
'web' => |
array ( |
), |
'arts' => |
array ( |
), |
'firm' => |
array ( |
), |
'info' => |
array ( |
), |
'other' => |
array ( |
), |
'store' => |
array ( |
), |
), |
'ng' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'name' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sch' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'mobi' => |
array ( |
), |
), |
'ni' => |
array ( |
'*' => |
array ( |
), |
), |
'nl' => |
array ( |
'bv' => |
array ( |
), |
'co' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'no' => |
array ( |
'fhs' => |
array ( |
), |
'vgs' => |
array ( |
), |
'fylkesbibl' => |
array ( |
), |
'folkebibl' => |
array ( |
), |
'museum' => |
array ( |
), |
'idrett' => |
array ( |
), |
'priv' => |
array ( |
), |
'mil' => |
array ( |
), |
'stat' => |
array ( |
), |
'dep' => |
array ( |
), |
'kommune' => |
array ( |
), |
'herad' => |
array ( |
), |
'aa' => |
array ( |
'gs' => |
array ( |
), |
), |
'ah' => |
array ( |
'gs' => |
array ( |
), |
), |
'bu' => |
array ( |
'gs' => |
array ( |
), |
), |
'fm' => |
array ( |
'gs' => |
array ( |
), |
), |
'hl' => |
array ( |
'gs' => |
array ( |
), |
), |
'hm' => |
array ( |
'gs' => |
array ( |
), |
), |
'jan-mayen' => |
array ( |
'gs' => |
array ( |
), |
), |
'mr' => |
array ( |
'gs' => |
array ( |
), |
), |
'nl' => |
array ( |
'gs' => |
array ( |
), |
), |
'nt' => |
array ( |
'gs' => |
array ( |
), |
), |
'of' => |
array ( |
'gs' => |
array ( |
), |
), |
'ol' => |
array ( |
'gs' => |
array ( |
), |
), |
'oslo' => |
array ( |
'gs' => |
array ( |
), |
), |
'rl' => |
array ( |
'gs' => |
array ( |
), |
), |
'sf' => |
array ( |
'gs' => |
array ( |
), |
), |
'st' => |
array ( |
'gs' => |
array ( |
), |
), |
'svalbard' => |
array ( |
'gs' => |
array ( |
), |
), |
'tm' => |
array ( |
'gs' => |
array ( |
), |
), |
'tr' => |
array ( |
'gs' => |
array ( |
), |
), |
'va' => |
array ( |
'gs' => |
array ( |
), |
), |
'vf' => |
array ( |
'gs' => |
array ( |
), |
), |
'akrehamn' => |
array ( |
), |
'åkrehamn' => |
array ( |
), |
'algard' => |
array ( |
), |
'ålgård' => |
array ( |
), |
'arna' => |
array ( |
), |
'brumunddal' => |
array ( |
), |
'bryne' => |
array ( |
), |
'bronnoysund' => |
array ( |
), |
'brønnøysund' => |
array ( |
), |
'drobak' => |
array ( |
), |
'drøbak' => |
array ( |
), |
'egersund' => |
array ( |
), |
'fetsund' => |
array ( |
), |
'floro' => |
array ( |
), |
'florø' => |
array ( |
), |
'fredrikstad' => |
array ( |
), |
'hokksund' => |
array ( |
), |
'honefoss' => |
array ( |
), |
'hønefoss' => |
array ( |
), |
'jessheim' => |
array ( |
), |
'jorpeland' => |
array ( |
), |
'jørpeland' => |
array ( |
), |
'kirkenes' => |
array ( |
), |
'kopervik' => |
array ( |
), |
'krokstadelva' => |
array ( |
), |
'langevag' => |
array ( |
), |
'langevåg' => |
array ( |
), |
'leirvik' => |
array ( |
), |
'mjondalen' => |
array ( |
), |
'mjøndalen' => |
array ( |
), |
'mo-i-rana' => |
array ( |
), |
'mosjoen' => |
array ( |
), |
'mosjøen' => |
array ( |
), |
'nesoddtangen' => |
array ( |
), |
'orkanger' => |
array ( |
), |
'osoyro' => |
array ( |
), |
'osøyro' => |
array ( |
), |
'raholt' => |
array ( |
), |
'råholt' => |
array ( |
), |
'sandnessjoen' => |
array ( |
), |
'sandnessjøen' => |
array ( |
), |
'skedsmokorset' => |
array ( |
), |
'slattum' => |
array ( |
), |
'spjelkavik' => |
array ( |
), |
'stathelle' => |
array ( |
), |
'stavern' => |
array ( |
), |
'stjordalshalsen' => |
array ( |
), |
'stjørdalshalsen' => |
array ( |
), |
'tananger' => |
array ( |
), |
'tranby' => |
array ( |
), |
'vossevangen' => |
array ( |
), |
'afjord' => |
array ( |
), |
'åfjord' => |
array ( |
), |
'agdenes' => |
array ( |
), |
'al' => |
array ( |
), |
'ål' => |
array ( |
), |
'alesund' => |
array ( |
), |
'ålesund' => |
array ( |
), |
'alstahaug' => |
array ( |
), |
'alta' => |
array ( |
), |
'áltá' => |
array ( |
), |
'alaheadju' => |
array ( |
), |
'álaheadju' => |
array ( |
), |
'alvdal' => |
array ( |
), |
'amli' => |
array ( |
), |
'åmli' => |
array ( |
), |
'amot' => |
array ( |
), |
'åmot' => |
array ( |
), |
'andebu' => |
array ( |
), |
'andoy' => |
array ( |
), |
'andøy' => |
array ( |
), |
'andasuolo' => |
array ( |
), |
'ardal' => |
array ( |
), |
'årdal' => |
array ( |
), |
'aremark' => |
array ( |
), |
'arendal' => |
array ( |
), |
'ås' => |
array ( |
), |
'aseral' => |
array ( |
), |
'åseral' => |
array ( |
), |
'asker' => |
array ( |
), |
'askim' => |
array ( |
), |
'askvoll' => |
array ( |
), |
'askoy' => |
array ( |
), |
'askøy' => |
array ( |
), |
'asnes' => |
array ( |
), |
'åsnes' => |
array ( |
), |
'audnedaln' => |
array ( |
), |
'aukra' => |
array ( |
), |
'aure' => |
array ( |
), |
'aurland' => |
array ( |
), |
'aurskog-holand' => |
array ( |
), |
'aurskog-høland' => |
array ( |
), |
'austevoll' => |
array ( |
), |
'austrheim' => |
array ( |
), |
'averoy' => |
array ( |
), |
'averøy' => |
array ( |
), |
'balestrand' => |
array ( |
), |
'ballangen' => |
array ( |
), |
'balat' => |
array ( |
), |
'bálát' => |
array ( |
), |
'balsfjord' => |
array ( |
), |
'bahccavuotna' => |
array ( |
), |
'báhccavuotna' => |
array ( |
), |
'bamble' => |
array ( |
), |
'bardu' => |
array ( |
), |
'beardu' => |
array ( |
), |
'beiarn' => |
array ( |
), |
'bajddar' => |
array ( |
), |
'bájddar' => |
array ( |
), |
'baidar' => |
array ( |
), |
'báidár' => |
array ( |
), |
'berg' => |
array ( |
), |
'bergen' => |
array ( |
), |
'berlevag' => |
array ( |
), |
'berlevåg' => |
array ( |
), |
'bearalvahki' => |
array ( |
), |
'bearalváhki' => |
array ( |
), |
'bindal' => |
array ( |
), |
'birkenes' => |
array ( |
), |
'bjarkoy' => |
array ( |
), |
'bjarkøy' => |
array ( |
), |
'bjerkreim' => |
array ( |
), |
'bjugn' => |
array ( |
), |
'bodo' => |
array ( |
), |
'bodø' => |
array ( |
), |
'badaddja' => |
array ( |
), |
'bådåddjå' => |
array ( |
), |
'budejju' => |
array ( |
), |
'bokn' => |
array ( |
), |
'bremanger' => |
array ( |
), |
'bronnoy' => |
array ( |
), |
'brønnøy' => |
array ( |
), |
'bygland' => |
array ( |
), |
'bykle' => |
array ( |
), |
'barum' => |
array ( |
), |
'bærum' => |
array ( |
), |
'telemark' => |
array ( |
'bo' => |
array ( |
), |
'bø' => |
array ( |
), |
), |
'nordland' => |
array ( |
'bo' => |
array ( |
), |
'bø' => |
array ( |
), |
'heroy' => |
array ( |
), |
'herøy' => |
array ( |
), |
), |
'bievat' => |
array ( |
), |
'bievát' => |
array ( |
), |
'bomlo' => |
array ( |
), |
'bømlo' => |
array ( |
), |
'batsfjord' => |
array ( |
), |
'båtsfjord' => |
array ( |
), |
'bahcavuotna' => |
array ( |
), |
'báhcavuotna' => |
array ( |
), |
'dovre' => |
array ( |
), |
'drammen' => |
array ( |
), |
'drangedal' => |
array ( |
), |
'dyroy' => |
array ( |
), |
'dyrøy' => |
array ( |
), |
'donna' => |
array ( |
), |
'dønna' => |
array ( |
), |
'eid' => |
array ( |
), |
'eidfjord' => |
array ( |
), |
'eidsberg' => |
array ( |
), |
'eidskog' => |
array ( |
), |
'eidsvoll' => |
array ( |
), |
'eigersund' => |
array ( |
), |
'elverum' => |
array ( |
), |
'enebakk' => |
array ( |
), |
'engerdal' => |
array ( |
), |
'etne' => |
array ( |
), |
'etnedal' => |
array ( |
), |
'evenes' => |
array ( |
), |
'evenassi' => |
array ( |
), |
'evenášši' => |
array ( |
), |
'evje-og-hornnes' => |
array ( |
), |
'farsund' => |
array ( |
), |
'fauske' => |
array ( |
), |
'fuossko' => |
array ( |
), |
'fuoisku' => |
array ( |
), |
'fedje' => |
array ( |
), |
'fet' => |
array ( |
), |
'finnoy' => |
array ( |
), |
'finnøy' => |
array ( |
), |
'fitjar' => |
array ( |
), |
'fjaler' => |
array ( |
), |
'fjell' => |
array ( |
), |
'flakstad' => |
array ( |
), |
'flatanger' => |
array ( |
), |
'flekkefjord' => |
array ( |
), |
'flesberg' => |
array ( |
), |
'flora' => |
array ( |
), |
'fla' => |
array ( |
), |
'flå' => |
array ( |
), |
'folldal' => |
array ( |
), |
'forsand' => |
array ( |
), |
'fosnes' => |
array ( |
), |
'frei' => |
array ( |
), |
'frogn' => |
array ( |
), |
'froland' => |
array ( |
), |
'frosta' => |
array ( |
), |
'frana' => |
array ( |
), |
'fræna' => |
array ( |
), |
'froya' => |
array ( |
), |
'frøya' => |
array ( |
), |
'fusa' => |
array ( |
), |
'fyresdal' => |
array ( |
), |
'forde' => |
array ( |
), |
'førde' => |
array ( |
), |
'gamvik' => |
array ( |
), |
'gangaviika' => |
array ( |
), |
'gáŋgaviika' => |
array ( |
), |
'gaular' => |
array ( |
), |
'gausdal' => |
array ( |
), |
'gildeskal' => |
array ( |
), |
'gildeskål' => |
array ( |
), |
'giske' => |
array ( |
), |
'gjemnes' => |
array ( |
), |
'gjerdrum' => |
array ( |
), |
'gjerstad' => |
array ( |
), |
'gjesdal' => |
array ( |
), |
'gjovik' => |
array ( |
), |
'gjøvik' => |
array ( |
), |
'gloppen' => |
array ( |
), |
'gol' => |
array ( |
), |
'gran' => |
array ( |
), |
'grane' => |
array ( |
), |
'granvin' => |
array ( |
), |
'gratangen' => |
array ( |
), |
'grimstad' => |
array ( |
), |
'grong' => |
array ( |
), |
'kraanghke' => |
array ( |
), |
'kråanghke' => |
array ( |
), |
'grue' => |
array ( |
), |
'gulen' => |
array ( |
), |
'hadsel' => |
array ( |
), |
'halden' => |
array ( |
), |
'halsa' => |
array ( |
), |
'hamar' => |
array ( |
), |
'hamaroy' => |
array ( |
), |
'habmer' => |
array ( |
), |
'hábmer' => |
array ( |
), |
'hapmir' => |
array ( |
), |
'hápmir' => |
array ( |
), |
'hammerfest' => |
array ( |
), |
'hammarfeasta' => |
array ( |
), |
'hámmárfeasta' => |
array ( |
), |
'haram' => |
array ( |
), |
'hareid' => |
array ( |
), |
'harstad' => |
array ( |
), |
'hasvik' => |
array ( |
), |
'aknoluokta' => |
array ( |
), |
'ákŋoluokta' => |
array ( |
), |
'hattfjelldal' => |
array ( |
), |
'aarborte' => |
array ( |
), |
'haugesund' => |
array ( |
), |
'hemne' => |
array ( |
), |
'hemnes' => |
array ( |
), |
'hemsedal' => |
array ( |
), |
'more-og-romsdal' => |
array ( |
'heroy' => |
array ( |
), |
'sande' => |
array ( |
), |
), |
'møre-og-romsdal' => |
array ( |
'herøy' => |
array ( |
), |
'sande' => |
array ( |
), |
), |
'hitra' => |
array ( |
), |
'hjartdal' => |
array ( |
), |
'hjelmeland' => |
array ( |
), |
'hobol' => |
array ( |
), |
'hobøl' => |
array ( |
), |
'hof' => |
array ( |
), |
'hol' => |
array ( |
), |
'hole' => |
array ( |
), |
'holmestrand' => |
array ( |
), |
'holtalen' => |
array ( |
), |
'holtålen' => |
array ( |
), |
'hornindal' => |
array ( |
), |
'horten' => |
array ( |
), |
'hurdal' => |
array ( |
), |
'hurum' => |
array ( |
), |
'hvaler' => |
array ( |
), |
'hyllestad' => |
array ( |
), |
'hagebostad' => |
array ( |
), |
'hægebostad' => |
array ( |
), |
'hoyanger' => |
array ( |
), |
'høyanger' => |
array ( |
), |
'hoylandet' => |
array ( |
), |
'høylandet' => |
array ( |
), |
'ha' => |
array ( |
), |
'hå' => |
array ( |
), |
'ibestad' => |
array ( |
), |
'inderoy' => |
array ( |
), |
'inderøy' => |
array ( |
), |
'iveland' => |
array ( |
), |
'jevnaker' => |
array ( |
), |
'jondal' => |
array ( |
), |
'jolster' => |
array ( |
), |
'jølster' => |
array ( |
), |
'karasjok' => |
array ( |
), |
'karasjohka' => |
array ( |
), |
'kárášjohka' => |
array ( |
), |
'karlsoy' => |
array ( |
), |
'galsa' => |
array ( |
), |
'gálsá' => |
array ( |
), |
'karmoy' => |
array ( |
), |
'karmøy' => |
array ( |
), |
'kautokeino' => |
array ( |
), |
'guovdageaidnu' => |
array ( |
), |
'klepp' => |
array ( |
), |
'klabu' => |
array ( |
), |
'klæbu' => |
array ( |
), |
'kongsberg' => |
array ( |
), |
'kongsvinger' => |
array ( |
), |
'kragero' => |
array ( |
), |
'kragerø' => |
array ( |
), |
'kristiansand' => |
array ( |
), |
'kristiansund' => |
array ( |
), |
'krodsherad' => |
array ( |
), |
'krødsherad' => |
array ( |
), |
'kvalsund' => |
array ( |
), |
'rahkkeravju' => |
array ( |
), |
'ráhkkerávju' => |
array ( |
), |
'kvam' => |
array ( |
), |
'kvinesdal' => |
array ( |
), |
'kvinnherad' => |
array ( |
), |
'kviteseid' => |
array ( |
), |
'kvitsoy' => |
array ( |
), |
'kvitsøy' => |
array ( |
), |
'kvafjord' => |
array ( |
), |
'kvæfjord' => |
array ( |
), |
'giehtavuoatna' => |
array ( |
), |
'kvanangen' => |
array ( |
), |
'kvænangen' => |
array ( |
), |
'navuotna' => |
array ( |
), |
'návuotna' => |
array ( |
), |
'kafjord' => |
array ( |
), |
'kåfjord' => |
array ( |
), |
'gaivuotna' => |
array ( |
), |
'gáivuotna' => |
array ( |
), |
'larvik' => |
array ( |
), |
'lavangen' => |
array ( |
), |
'lavagis' => |
array ( |
), |
'loabat' => |
array ( |
), |
'loabát' => |
array ( |
), |
'lebesby' => |
array ( |
), |
'davvesiida' => |
array ( |
), |
'leikanger' => |
array ( |
), |
'leirfjord' => |
array ( |
), |
'leka' => |
array ( |
), |
'leksvik' => |
array ( |
), |
'lenvik' => |
array ( |
), |
'leangaviika' => |
array ( |
), |
'leaŋgaviika' => |
array ( |
), |
'lesja' => |
array ( |
), |
'levanger' => |
array ( |
), |
'lier' => |
array ( |
), |
'lierne' => |
array ( |
), |
'lillehammer' => |
array ( |
), |
'lillesand' => |
array ( |
), |
'lindesnes' => |
array ( |
), |
'lindas' => |
array ( |
), |
'lindås' => |
array ( |
), |
'lom' => |
array ( |
), |
'loppa' => |
array ( |
), |
'lahppi' => |
array ( |
), |
'láhppi' => |
array ( |
), |
'lund' => |
array ( |
), |
'lunner' => |
array ( |
), |
'luroy' => |
array ( |
), |
'lurøy' => |
array ( |
), |
'luster' => |
array ( |
), |
'lyngdal' => |
array ( |
), |
'lyngen' => |
array ( |
), |
'ivgu' => |
array ( |
), |
'lardal' => |
array ( |
), |
'lerdal' => |
array ( |
), |
'lærdal' => |
array ( |
), |
'lodingen' => |
array ( |
), |
'lødingen' => |
array ( |
), |
'lorenskog' => |
array ( |
), |
'lørenskog' => |
array ( |
), |
'loten' => |
array ( |
), |
'løten' => |
array ( |
), |
'malvik' => |
array ( |
), |
'masoy' => |
array ( |
), |
'måsøy' => |
array ( |
), |
'muosat' => |
array ( |
), |
'muosát' => |
array ( |
), |
'mandal' => |
array ( |
), |
'marker' => |
array ( |
), |
'marnardal' => |
array ( |
), |
'masfjorden' => |
array ( |
), |
'meland' => |
array ( |
), |
'meldal' => |
array ( |
), |
'melhus' => |
array ( |
), |
'meloy' => |
array ( |
), |
'meløy' => |
array ( |
), |
'meraker' => |
array ( |
), |
'meråker' => |
array ( |
), |
'moareke' => |
array ( |
), |
'moåreke' => |
array ( |
), |
'midsund' => |
array ( |
), |
'midtre-gauldal' => |
array ( |
), |
'modalen' => |
array ( |
), |
'modum' => |
array ( |
), |
'molde' => |
array ( |
), |
'moskenes' => |
array ( |
), |
'moss' => |
array ( |
), |
'mosvik' => |
array ( |
), |
'malselv' => |
array ( |
), |
'målselv' => |
array ( |
), |
'malatvuopmi' => |
array ( |
), |
'málatvuopmi' => |
array ( |
), |
'namdalseid' => |
array ( |
), |
'aejrie' => |
array ( |
), |
'namsos' => |
array ( |
), |
'namsskogan' => |
array ( |
), |
'naamesjevuemie' => |
array ( |
), |
'nååmesjevuemie' => |
array ( |
), |
'laakesvuemie' => |
array ( |
), |
'nannestad' => |
array ( |
), |
'narvik' => |
array ( |
), |
'narviika' => |
array ( |
), |
'naustdal' => |
array ( |
), |
'nedre-eiker' => |
array ( |
), |
'akershus' => |
array ( |
'nes' => |
array ( |
), |
), |
'buskerud' => |
array ( |
'nes' => |
array ( |
), |
), |
'nesna' => |
array ( |
), |
'nesodden' => |
array ( |
), |
'nesseby' => |
array ( |
), |
'unjarga' => |
array ( |
), |
'unjárga' => |
array ( |
), |
'nesset' => |
array ( |
), |
'nissedal' => |
array ( |
), |
'nittedal' => |
array ( |
), |
'nord-aurdal' => |
array ( |
), |
'nord-fron' => |
array ( |
), |
'nord-odal' => |
array ( |
), |
'norddal' => |
array ( |
), |
'nordkapp' => |
array ( |
), |
'davvenjarga' => |
array ( |
), |
'davvenjárga' => |
array ( |
), |
'nordre-land' => |
array ( |
), |
'nordreisa' => |
array ( |
), |
'raisa' => |
array ( |
), |
'ráisa' => |
array ( |
), |
'nore-og-uvdal' => |
array ( |
), |
'notodden' => |
array ( |
), |
'naroy' => |
array ( |
), |
'nærøy' => |
array ( |
), |
'notteroy' => |
array ( |
), |
'nøtterøy' => |
array ( |
), |
'odda' => |
array ( |
), |
'oksnes' => |
array ( |
), |
'øksnes' => |
array ( |
), |
'oppdal' => |
array ( |
), |
'oppegard' => |
array ( |
), |
'oppegård' => |
array ( |
), |
'orkdal' => |
array ( |
), |
'orland' => |
array ( |
), |
'ørland' => |
array ( |
), |
'orskog' => |
array ( |
), |
'ørskog' => |
array ( |
), |
'orsta' => |
array ( |
), |
'ørsta' => |
array ( |
), |
'hedmark' => |
array ( |
'os' => |
array ( |
), |
'valer' => |
array ( |
), |
'våler' => |
array ( |
), |
), |
'hordaland' => |
array ( |
'os' => |
array ( |
), |
), |
'osen' => |
array ( |
), |
'osteroy' => |
array ( |
), |
'osterøy' => |
array ( |
), |
'ostre-toten' => |
array ( |
), |
'østre-toten' => |
array ( |
), |
'overhalla' => |
array ( |
), |
'ovre-eiker' => |
array ( |
), |
'øvre-eiker' => |
array ( |
), |
'oyer' => |
array ( |
), |
'øyer' => |
array ( |
), |
'oygarden' => |
array ( |
), |
'øygarden' => |
array ( |
), |
'oystre-slidre' => |
array ( |
), |
'øystre-slidre' => |
array ( |
), |
'porsanger' => |
array ( |
), |
'porsangu' => |
array ( |
), |
'porsáŋgu' => |
array ( |
), |
'porsgrunn' => |
array ( |
), |
'radoy' => |
array ( |
), |
'radøy' => |
array ( |
), |
'rakkestad' => |
array ( |
), |
'rana' => |
array ( |
), |
'ruovat' => |
array ( |
), |
'randaberg' => |
array ( |
), |
'rauma' => |
array ( |
), |
'rendalen' => |
array ( |
), |
'rennebu' => |
array ( |
), |
'rennesoy' => |
array ( |
), |
'rennesøy' => |
array ( |
), |
'rindal' => |
array ( |
), |
'ringebu' => |
array ( |
), |
'ringerike' => |
array ( |
), |
'ringsaker' => |
array ( |
), |
'rissa' => |
array ( |
), |
'risor' => |
array ( |
), |
'risør' => |
array ( |
), |
'roan' => |
array ( |
), |
'rollag' => |
array ( |
), |
'rygge' => |
array ( |
), |
'ralingen' => |
array ( |
), |
'rælingen' => |
array ( |
), |
'rodoy' => |
array ( |
), |
'rødøy' => |
array ( |
), |
'romskog' => |
array ( |
), |
'rømskog' => |
array ( |
), |
'roros' => |
array ( |
), |
'røros' => |
array ( |
), |
'rost' => |
array ( |
), |
'røst' => |
array ( |
), |
'royken' => |
array ( |
), |
'røyken' => |
array ( |
), |
'royrvik' => |
array ( |
), |
'røyrvik' => |
array ( |
), |
'rade' => |
array ( |
), |
'råde' => |
array ( |
), |
'salangen' => |
array ( |
), |
'siellak' => |
array ( |
), |
'saltdal' => |
array ( |
), |
'salat' => |
array ( |
), |
'sálát' => |
array ( |
), |
'sálat' => |
array ( |
), |
'samnanger' => |
array ( |
), |
'vestfold' => |
array ( |
'sande' => |
array ( |
), |
), |
'sandefjord' => |
array ( |
), |
'sandnes' => |
array ( |
), |
'sandoy' => |
array ( |
), |
'sandøy' => |
array ( |
), |
'sarpsborg' => |
array ( |
), |
'sauda' => |
array ( |
), |
'sauherad' => |
array ( |
), |
'sel' => |
array ( |
), |
'selbu' => |
array ( |
), |
'selje' => |
array ( |
), |
'seljord' => |
array ( |
), |
'sigdal' => |
array ( |
), |
'siljan' => |
array ( |
), |
'sirdal' => |
array ( |
), |
'skaun' => |
array ( |
), |
'skedsmo' => |
array ( |
), |
'ski' => |
array ( |
), |
'skien' => |
array ( |
), |
'skiptvet' => |
array ( |
), |
'skjervoy' => |
array ( |
), |
'skjervøy' => |
array ( |
), |
'skierva' => |
array ( |
), |
'skiervá' => |
array ( |
), |
'skjak' => |
array ( |
), |
'skjåk' => |
array ( |
), |
'skodje' => |
array ( |
), |
'skanland' => |
array ( |
), |
'skånland' => |
array ( |
), |
'skanit' => |
array ( |
), |
'skánit' => |
array ( |
), |
'smola' => |
array ( |
), |
'smøla' => |
array ( |
), |
'snillfjord' => |
array ( |
), |
'snasa' => |
array ( |
), |
'snåsa' => |
array ( |
), |
'snoasa' => |
array ( |
), |
'snaase' => |
array ( |
), |
'snåase' => |
array ( |
), |
'sogndal' => |
array ( |
), |
'sokndal' => |
array ( |
), |
'sola' => |
array ( |
), |
'solund' => |
array ( |
), |
'songdalen' => |
array ( |
), |
'sortland' => |
array ( |
), |
'spydeberg' => |
array ( |
), |
'stange' => |
array ( |
), |
'stavanger' => |
array ( |
), |
'steigen' => |
array ( |
), |
'steinkjer' => |
array ( |
), |
'stjordal' => |
array ( |
), |
'stjørdal' => |
array ( |
), |
'stokke' => |
array ( |
), |
'stor-elvdal' => |
array ( |
), |
'stord' => |
array ( |
), |
'stordal' => |
array ( |
), |
'storfjord' => |
array ( |
), |
'omasvuotna' => |
array ( |
), |
'strand' => |
array ( |
), |
'stranda' => |
array ( |
), |
'stryn' => |
array ( |
), |
'sula' => |
array ( |
), |
'suldal' => |
array ( |
), |
'sund' => |
array ( |
), |
'sunndal' => |
array ( |
), |
'surnadal' => |
array ( |
), |
'sveio' => |
array ( |
), |
'svelvik' => |
array ( |
), |
'sykkylven' => |
array ( |
), |
'sogne' => |
array ( |
), |
'søgne' => |
array ( |
), |
'somna' => |
array ( |
), |
'sømna' => |
array ( |
), |
'sondre-land' => |
array ( |
), |
'søndre-land' => |
array ( |
), |
'sor-aurdal' => |
array ( |
), |
'sør-aurdal' => |
array ( |
), |
'sor-fron' => |
array ( |
), |
'sør-fron' => |
array ( |
), |
'sor-odal' => |
array ( |
), |
'sør-odal' => |
array ( |
), |
'sor-varanger' => |
array ( |
), |
'sør-varanger' => |
array ( |
), |
'matta-varjjat' => |
array ( |
), |
'mátta-várjjat' => |
array ( |
), |
'sorfold' => |
array ( |
), |
'sørfold' => |
array ( |
), |
'sorreisa' => |
array ( |
), |
'sørreisa' => |
array ( |
), |
'sorum' => |
array ( |
), |
'sørum' => |
array ( |
), |
'tana' => |
array ( |
), |
'deatnu' => |
array ( |
), |
'time' => |
array ( |
), |
'tingvoll' => |
array ( |
), |
'tinn' => |
array ( |
), |
'tjeldsund' => |
array ( |
), |
'dielddanuorri' => |
array ( |
), |
'tjome' => |
array ( |
), |
'tjøme' => |
array ( |
), |
'tokke' => |
array ( |
), |
'tolga' => |
array ( |
), |
'torsken' => |
array ( |
), |
'tranoy' => |
array ( |
), |
'tranøy' => |
array ( |
), |
'tromso' => |
array ( |
), |
'tromsø' => |
array ( |
), |
'tromsa' => |
array ( |
), |
'romsa' => |
array ( |
), |
'trondheim' => |
array ( |
), |
'troandin' => |
array ( |
), |
'trysil' => |
array ( |
), |
'trana' => |
array ( |
), |
'træna' => |
array ( |
), |
'trogstad' => |
array ( |
), |
'trøgstad' => |
array ( |
), |
'tvedestrand' => |
array ( |
), |
'tydal' => |
array ( |
), |
'tynset' => |
array ( |
), |
'tysfjord' => |
array ( |
), |
'divtasvuodna' => |
array ( |
), |
'divttasvuotna' => |
array ( |
), |
'tysnes' => |
array ( |
), |
'tysvar' => |
array ( |
), |
'tysvær' => |
array ( |
), |
'tonsberg' => |
array ( |
), |
'tønsberg' => |
array ( |
), |
'ullensaker' => |
array ( |
), |
'ullensvang' => |
array ( |
), |
'ulvik' => |
array ( |
), |
'utsira' => |
array ( |
), |
'vadso' => |
array ( |
), |
'vadsø' => |
array ( |
), |
'cahcesuolo' => |
array ( |
), |
'čáhcesuolo' => |
array ( |
), |
'vaksdal' => |
array ( |
), |
'valle' => |
array ( |
), |
'vang' => |
array ( |
), |
'vanylven' => |
array ( |
), |
'vardo' => |
array ( |
), |
'vardø' => |
array ( |
), |
'varggat' => |
array ( |
), |
'várggát' => |
array ( |
), |
'vefsn' => |
array ( |
), |
'vaapste' => |
array ( |
), |
'vega' => |
array ( |
), |
'vegarshei' => |
array ( |
), |
'vegårshei' => |
array ( |
), |
'vennesla' => |
array ( |
), |
'verdal' => |
array ( |
), |
'verran' => |
array ( |
), |
'vestby' => |
array ( |
), |
'vestnes' => |
array ( |
), |
'vestre-slidre' => |
array ( |
), |
'vestre-toten' => |
array ( |
), |
'vestvagoy' => |
array ( |
), |
'vestvågøy' => |
array ( |
), |
'vevelstad' => |
array ( |
), |
'vik' => |
array ( |
), |
'vikna' => |
array ( |
), |
'vindafjord' => |
array ( |
), |
'volda' => |
array ( |
), |
'voss' => |
array ( |
), |
'varoy' => |
array ( |
), |
'værøy' => |
array ( |
), |
'vagan' => |
array ( |
), |
'vågan' => |
array ( |
), |
'voagat' => |
array ( |
), |
'vagsoy' => |
array ( |
), |
'vågsøy' => |
array ( |
), |
'vaga' => |
array ( |
), |
'vågå' => |
array ( |
), |
'ostfold' => |
array ( |
'valer' => |
array ( |
), |
), |
'østfold' => |
array ( |
'våler' => |
array ( |
), |
), |
'co' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'np' => |
array ( |
'*' => |
array ( |
), |
), |
'nr' => |
array ( |
'biz' => |
array ( |
), |
'info' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'com' => |
array ( |
), |
), |
'nu' => |
array ( |
'merseine' => |
array ( |
), |
'mine' => |
array ( |
), |
'shacknet' => |
array ( |
), |
), |
'nz' => |
array ( |
'*' => |
array ( |
), |
'co' => |
array ( |
'blogspot' => |
array ( |
), |
), |
), |
'om' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'med' => |
array ( |
), |
'museum' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'pro' => |
array ( |
), |
), |
'org' => |
array ( |
'ae' => |
array ( |
), |
'us' => |
array ( |
), |
'dyndns' => |
array ( |
'go' => |
array ( |
), |
'home' => |
array ( |
), |
), |
'blogdns' => |
array ( |
), |
'blogsite' => |
array ( |
), |
'boldlygoingnowhere' => |
array ( |
), |
'dnsalias' => |
array ( |
), |
'dnsdojo' => |
array ( |
), |
'doesntexist' => |
array ( |
), |
'dontexist' => |
array ( |
), |
'doomdns' => |
array ( |
), |
'dvrdns' => |
array ( |
), |
'dynalias' => |
array ( |
), |
'endofinternet' => |
array ( |
), |
'endoftheinternet' => |
array ( |
), |
'from-me' => |
array ( |
), |
'game-host' => |
array ( |
), |
'gotdns' => |
array ( |
), |
'hobby-site' => |
array ( |
), |
'homedns' => |
array ( |
), |
'homeftp' => |
array ( |
), |
'homelinux' => |
array ( |
), |
'homeunix' => |
array ( |
), |
'is-a-bruinsfan' => |
array ( |
), |
'is-a-candidate' => |
array ( |
), |
'is-a-celticsfan' => |
array ( |
), |
'is-a-chef' => |
array ( |
), |
'is-a-geek' => |
array ( |
), |
'is-a-knight' => |
array ( |
), |
'is-a-linux-user' => |
array ( |
), |
'is-a-patsfan' => |
array ( |
), |
'is-a-soxfan' => |
array ( |
), |
'is-found' => |
array ( |
), |
'is-lost' => |
array ( |
), |
'is-saved' => |
array ( |
), |
'is-very-bad' => |
array ( |
), |
'is-very-evil' => |
array ( |
), |
'is-very-good' => |
array ( |
), |
'is-very-nice' => |
array ( |
), |
'is-very-sweet' => |
array ( |
), |
'isa-geek' => |
array ( |
), |
'kicks-ass' => |
array ( |
), |
'misconfused' => |
array ( |
), |
'podzone' => |
array ( |
), |
'readmyblog' => |
array ( |
), |
'selfip' => |
array ( |
), |
'sellsyourhome' => |
array ( |
), |
'servebbs' => |
array ( |
), |
'serveftp' => |
array ( |
), |
'servegame' => |
array ( |
), |
'stuff-4-sale' => |
array ( |
), |
'webhop' => |
array ( |
), |
'za' => |
array ( |
), |
), |
'pa' => |
array ( |
'ac' => |
array ( |
), |
'gob' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'sld' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
'ing' => |
array ( |
), |
'abo' => |
array ( |
), |
'med' => |
array ( |
), |
'nom' => |
array ( |
), |
), |
'pe' => |
array ( |
'edu' => |
array ( |
), |
'gob' => |
array ( |
), |
'nom' => |
array ( |
), |
'mil' => |
array ( |
), |
'org' => |
array ( |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'pf' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'pg' => |
array ( |
'*' => |
array ( |
), |
), |
'ph' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'ngo' => |
array ( |
), |
'mil' => |
array ( |
), |
'i' => |
array ( |
), |
), |
'pk' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'org' => |
array ( |
), |
'fam' => |
array ( |
), |
'biz' => |
array ( |
), |
'web' => |
array ( |
), |
'gov' => |
array ( |
), |
'gob' => |
array ( |
), |
'gok' => |
array ( |
), |
'gon' => |
array ( |
), |
'gop' => |
array ( |
), |
'gos' => |
array ( |
), |
'info' => |
array ( |
), |
), |
'pl' => |
array ( |
'aid' => |
array ( |
), |
'agro' => |
array ( |
), |
'atm' => |
array ( |
), |
'auto' => |
array ( |
), |
'biz' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gmina' => |
array ( |
), |
'gsm' => |
array ( |
), |
'info' => |
array ( |
), |
'mail' => |
array ( |
), |
'miasta' => |
array ( |
), |
'media' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'nieruchomosci' => |
array ( |
), |
'nom' => |
array ( |
), |
'org' => |
array ( |
), |
'pc' => |
array ( |
), |
'powiat' => |
array ( |
), |
'priv' => |
array ( |
), |
'realestate' => |
array ( |
), |
'rel' => |
array ( |
), |
'sex' => |
array ( |
), |
'shop' => |
array ( |
), |
'sklep' => |
array ( |
), |
'sos' => |
array ( |
), |
'szkola' => |
array ( |
), |
'targi' => |
array ( |
), |
'tm' => |
array ( |
), |
'tourism' => |
array ( |
), |
'travel' => |
array ( |
), |
'turystyka' => |
array ( |
), |
'6bone' => |
array ( |
), |
'art' => |
array ( |
), |
'mbone' => |
array ( |
), |
'gov' => |
array ( |
'uw' => |
array ( |
), |
'um' => |
array ( |
), |
'ug' => |
array ( |
), |
'upow' => |
array ( |
), |
'starostwo' => |
array ( |
), |
'so' => |
array ( |
), |
'sr' => |
array ( |
), |
'po' => |
array ( |
), |
'pa' => |
array ( |
), |
), |
'ngo' => |
array ( |
), |
'irc' => |
array ( |
), |
'usenet' => |
array ( |
), |
'augustow' => |
array ( |
), |
'babia-gora' => |
array ( |
), |
'bedzin' => |
array ( |
), |
'beskidy' => |
array ( |
), |
'bialowieza' => |
array ( |
), |
'bialystok' => |
array ( |
), |
'bielawa' => |
array ( |
), |
'bieszczady' => |
array ( |
), |
'boleslawiec' => |
array ( |
), |
'bydgoszcz' => |
array ( |
), |
'bytom' => |
array ( |
), |
'cieszyn' => |
array ( |
), |
'czeladz' => |
array ( |
), |
'czest' => |
array ( |
), |
'dlugoleka' => |
array ( |
), |
'elblag' => |
array ( |
), |
'elk' => |
array ( |
), |
'glogow' => |
array ( |
), |
'gniezno' => |
array ( |
), |
'gorlice' => |
array ( |
), |
'grajewo' => |
array ( |
), |
'ilawa' => |
array ( |
), |
'jaworzno' => |
array ( |
), |
'jelenia-gora' => |
array ( |
), |
'jgora' => |
array ( |
), |
'kalisz' => |
array ( |
), |
'kazimierz-dolny' => |
array ( |
), |
'karpacz' => |
array ( |
), |
'kartuzy' => |
array ( |
), |
'kaszuby' => |
array ( |
), |
'katowice' => |
array ( |
), |
'kepno' => |
array ( |
), |
'ketrzyn' => |
array ( |
), |
'klodzko' => |
array ( |
), |
'kobierzyce' => |
array ( |
), |
'kolobrzeg' => |
array ( |
), |
'konin' => |
array ( |
), |
'konskowola' => |
array ( |
), |
'kutno' => |
array ( |
), |
'lapy' => |
array ( |
), |
'lebork' => |
array ( |
), |
'legnica' => |
array ( |
), |
'lezajsk' => |
array ( |
), |
'limanowa' => |
array ( |
), |
'lomza' => |
array ( |
), |
'lowicz' => |
array ( |
), |
'lubin' => |
array ( |
), |
'lukow' => |
array ( |
), |
'malbork' => |
array ( |
), |
'malopolska' => |
array ( |
), |
'mazowsze' => |
array ( |
), |
'mazury' => |
array ( |
), |
'mielec' => |
array ( |
), |
'mielno' => |
array ( |
), |
'mragowo' => |
array ( |
), |
'naklo' => |
array ( |
), |
'nowaruda' => |
array ( |
), |
'nysa' => |
array ( |
), |
'olawa' => |
array ( |
), |
'olecko' => |
array ( |
), |
'olkusz' => |
array ( |
), |
'olsztyn' => |
array ( |
), |
'opoczno' => |
array ( |
), |
'opole' => |
array ( |
), |
'ostroda' => |
array ( |
), |
'ostroleka' => |
array ( |
), |
'ostrowiec' => |
array ( |
), |
'ostrowwlkp' => |
array ( |
), |
'pila' => |
array ( |
), |
'pisz' => |
array ( |
), |
'podhale' => |
array ( |
), |
'podlasie' => |
array ( |
), |
'polkowice' => |
array ( |
), |
'pomorze' => |
array ( |
), |
'pomorskie' => |
array ( |
), |
'prochowice' => |
array ( |
), |
'pruszkow' => |
array ( |
), |
'przeworsk' => |
array ( |
), |
'pulawy' => |
array ( |
), |
'radom' => |
array ( |
), |
'rawa-maz' => |
array ( |
), |
'rybnik' => |
array ( |
), |
'rzeszow' => |
array ( |
), |
'sanok' => |
array ( |
), |
'sejny' => |
array ( |
), |
'siedlce' => |
array ( |
), |
'slask' => |
array ( |
), |
'slupsk' => |
array ( |
), |
'sosnowiec' => |
array ( |
), |
'stalowa-wola' => |
array ( |
), |
'skoczow' => |
array ( |
), |
'starachowice' => |
array ( |
), |
'stargard' => |
array ( |
), |
'suwalki' => |
array ( |
), |
'swidnica' => |
array ( |
), |
'swiebodzin' => |
array ( |
), |
'swinoujscie' => |
array ( |
), |
'szczecin' => |
array ( |
), |
'szczytno' => |
array ( |
), |
'tarnobrzeg' => |
array ( |
), |
'tgory' => |
array ( |
), |
'turek' => |
array ( |
), |
'tychy' => |
array ( |
), |
'ustka' => |
array ( |
), |
'walbrzych' => |
array ( |
), |
'warmia' => |
array ( |
), |
'warszawa' => |
array ( |
), |
'waw' => |
array ( |
), |
'wegrow' => |
array ( |
), |
'wielun' => |
array ( |
), |
'wlocl' => |
array ( |
), |
'wloclawek' => |
array ( |
), |
'wodzislaw' => |
array ( |
), |
'wolomin' => |
array ( |
), |
'wroclaw' => |
array ( |
), |
'zachpomor' => |
array ( |
), |
'zagan' => |
array ( |
), |
'zarow' => |
array ( |
), |
'zgora' => |
array ( |
), |
'zgorzelec' => |
array ( |
), |
'gda' => |
array ( |
), |
'gdansk' => |
array ( |
), |
'gdynia' => |
array ( |
), |
'med' => |
array ( |
), |
'sopot' => |
array ( |
), |
'gliwice' => |
array ( |
), |
'krakow' => |
array ( |
), |
'poznan' => |
array ( |
), |
'wroc' => |
array ( |
), |
'zakopane' => |
array ( |
), |
'co' => |
array ( |
), |
), |
'pm' => |
array ( |
), |
'pn' => |
array ( |
'gov' => |
array ( |
), |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'post' => |
array ( |
), |
'pr' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'isla' => |
array ( |
), |
'pro' => |
array ( |
), |
'biz' => |
array ( |
), |
'info' => |
array ( |
), |
'name' => |
array ( |
), |
'est' => |
array ( |
), |
'prof' => |
array ( |
), |
'ac' => |
array ( |
), |
), |
'pro' => |
array ( |
'aca' => |
array ( |
), |
'bar' => |
array ( |
), |
'cpa' => |
array ( |
), |
'jur' => |
array ( |
), |
'law' => |
array ( |
), |
'med' => |
array ( |
), |
'eng' => |
array ( |
), |
), |
'ps' => |
array ( |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'sec' => |
array ( |
), |
'plo' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
), |
'pt' => |
array ( |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'int' => |
array ( |
), |
'publ' => |
array ( |
), |
'com' => |
array ( |
), |
'nome' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'pw' => |
array ( |
'co' => |
array ( |
), |
'ne' => |
array ( |
), |
'or' => |
array ( |
), |
'ed' => |
array ( |
), |
'go' => |
array ( |
), |
'belau' => |
array ( |
), |
), |
'py' => |
array ( |
'com' => |
array ( |
), |
'coop' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'qa' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'sch' => |
array ( |
), |
), |
're' => |
array ( |
'com' => |
array ( |
), |
'asso' => |
array ( |
), |
'nom' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'ro' => |
array ( |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'tm' => |
array ( |
), |
'nt' => |
array ( |
), |
'nom' => |
array ( |
), |
'info' => |
array ( |
), |
'rec' => |
array ( |
), |
'arts' => |
array ( |
), |
'firm' => |
array ( |
), |
'store' => |
array ( |
), |
'www' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'rs' => |
array ( |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'ac' => |
array ( |
), |
'gov' => |
array ( |
), |
'in' => |
array ( |
), |
), |
'ru' => |
array ( |
'ac' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'int' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'pp' => |
array ( |
), |
'adygeya' => |
array ( |
), |
'altai' => |
array ( |
), |
'amur' => |
array ( |
), |
'arkhangelsk' => |
array ( |
), |
'astrakhan' => |
array ( |
), |
'bashkiria' => |
array ( |
), |
'belgorod' => |
array ( |
), |
'bir' => |
array ( |
), |
'bryansk' => |
array ( |
), |
'buryatia' => |
array ( |
), |
'cbg' => |
array ( |
), |
'chel' => |
array ( |
), |
'chelyabinsk' => |
array ( |
), |
'chita' => |
array ( |
), |
'chukotka' => |
array ( |
), |
'chuvashia' => |
array ( |
), |
'dagestan' => |
array ( |
), |
'dudinka' => |
array ( |
), |
'e-burg' => |
array ( |
), |
'grozny' => |
array ( |
), |
'irkutsk' => |
array ( |
), |
'ivanovo' => |
array ( |
), |
'izhevsk' => |
array ( |
), |
'jar' => |
array ( |
), |
'joshkar-ola' => |
array ( |
), |
'kalmykia' => |
array ( |
), |
'kaluga' => |
array ( |
), |
'kamchatka' => |
array ( |
), |
'karelia' => |
array ( |
), |
'kazan' => |
array ( |
), |
'kchr' => |
array ( |
), |
'kemerovo' => |
array ( |
), |
'khabarovsk' => |
array ( |
), |
'khakassia' => |
array ( |
), |
'khv' => |
array ( |
), |
'kirov' => |
array ( |
), |
'koenig' => |
array ( |
), |
'komi' => |
array ( |
), |
'kostroma' => |
array ( |
), |
'krasnoyarsk' => |
array ( |
), |
'kuban' => |
array ( |
), |
'kurgan' => |
array ( |
), |
'kursk' => |
array ( |
), |
'lipetsk' => |
array ( |
), |
'magadan' => |
array ( |
), |
'mari' => |
array ( |
), |
'mari-el' => |
array ( |
), |
'marine' => |
array ( |
), |
'mordovia' => |
array ( |
), |
'mosreg' => |
array ( |
), |
'msk' => |
array ( |
), |
'murmansk' => |
array ( |
), |
'nalchik' => |
array ( |
), |
'nnov' => |
array ( |
), |
'nov' => |
array ( |
), |
'novosibirsk' => |
array ( |
), |
'nsk' => |
array ( |
), |
'omsk' => |
array ( |
), |
'orenburg' => |
array ( |
), |
'oryol' => |
array ( |
), |
'palana' => |
array ( |
), |
'penza' => |
array ( |
), |
'perm' => |
array ( |
), |
'pskov' => |
array ( |
), |
'ptz' => |
array ( |
), |
'rnd' => |
array ( |
), |
'ryazan' => |
array ( |
), |
'sakhalin' => |
array ( |
), |
'samara' => |
array ( |
), |
'saratov' => |
array ( |
), |
'simbirsk' => |
array ( |
), |
'smolensk' => |
array ( |
), |
'spb' => |
array ( |
), |
'stavropol' => |
array ( |
), |
'stv' => |
array ( |
), |
'surgut' => |
array ( |
), |
'tambov' => |
array ( |
), |
'tatarstan' => |
array ( |
), |
'tom' => |
array ( |
), |
'tomsk' => |
array ( |
), |
'tsaritsyn' => |
array ( |
), |
'tsk' => |
array ( |
), |
'tula' => |
array ( |
), |
'tuva' => |
array ( |
), |
'tver' => |
array ( |
), |
'tyumen' => |
array ( |
), |
'udm' => |
array ( |
), |
'udmurtia' => |
array ( |
), |
'ulan-ude' => |
array ( |
), |
'vladikavkaz' => |
array ( |
), |
'vladimir' => |
array ( |
), |
'vladivostok' => |
array ( |
), |
'volgograd' => |
array ( |
), |
'vologda' => |
array ( |
), |
'voronezh' => |
array ( |
), |
'vrn' => |
array ( |
), |
'vyatka' => |
array ( |
), |
'yakutia' => |
array ( |
), |
'yamal' => |
array ( |
), |
'yaroslavl' => |
array ( |
), |
'yekaterinburg' => |
array ( |
), |
'yuzhno-sakhalinsk' => |
array ( |
), |
'amursk' => |
array ( |
), |
'baikal' => |
array ( |
), |
'cmw' => |
array ( |
), |
'fareast' => |
array ( |
), |
'jamal' => |
array ( |
), |
'kms' => |
array ( |
), |
'k-uralsk' => |
array ( |
), |
'kustanai' => |
array ( |
), |
'kuzbass' => |
array ( |
), |
'magnitka' => |
array ( |
), |
'mytis' => |
array ( |
), |
'nakhodka' => |
array ( |
), |
'nkz' => |
array ( |
), |
'norilsk' => |
array ( |
), |
'oskol' => |
array ( |
), |
'pyatigorsk' => |
array ( |
), |
'rubtsovsk' => |
array ( |
), |
'snz' => |
array ( |
), |
'syzran' => |
array ( |
), |
'vdonsk' => |
array ( |
), |
'zgrad' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'test' => |
array ( |
), |
), |
'rw' => |
array ( |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'ac' => |
array ( |
), |
'com' => |
array ( |
), |
'co' => |
array ( |
), |
'int' => |
array ( |
), |
'mil' => |
array ( |
), |
'gouv' => |
array ( |
), |
), |
'sa' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'med' => |
array ( |
), |
'pub' => |
array ( |
), |
'edu' => |
array ( |
), |
'sch' => |
array ( |
), |
), |
'sb' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'sc' => |
array ( |
'com' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'sd' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'med' => |
array ( |
), |
'tv' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
), |
'se' => |
array ( |
'a' => |
array ( |
), |
'ac' => |
array ( |
), |
'b' => |
array ( |
), |
'bd' => |
array ( |
), |
'brand' => |
array ( |
), |
'c' => |
array ( |
), |
'd' => |
array ( |
), |
'e' => |
array ( |
), |
'f' => |
array ( |
), |
'fh' => |
array ( |
), |
'fhsk' => |
array ( |
), |
'fhv' => |
array ( |
), |
'g' => |
array ( |
), |
'h' => |
array ( |
), |
'i' => |
array ( |
), |
'k' => |
array ( |
), |
'komforb' => |
array ( |
), |
'kommunalforbund' => |
array ( |
), |
'komvux' => |
array ( |
), |
'l' => |
array ( |
), |
'lanbib' => |
array ( |
), |
'm' => |
array ( |
), |
'n' => |
array ( |
), |
'naturbruksgymn' => |
array ( |
), |
'o' => |
array ( |
), |
'org' => |
array ( |
), |
'p' => |
array ( |
), |
'parti' => |
array ( |
), |
'pp' => |
array ( |
), |
'press' => |
array ( |
), |
'r' => |
array ( |
), |
's' => |
array ( |
), |
't' => |
array ( |
), |
'tm' => |
array ( |
), |
'u' => |
array ( |
), |
'w' => |
array ( |
), |
'x' => |
array ( |
), |
'y' => |
array ( |
), |
'z' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'sg' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'per' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'sh' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'si' => |
array ( |
), |
'sj' => |
array ( |
), |
'sk' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'sl' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'sm' => |
array ( |
), |
'sn' => |
array ( |
'art' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gouv' => |
array ( |
), |
'org' => |
array ( |
), |
'perso' => |
array ( |
), |
'univ' => |
array ( |
), |
), |
'so' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'sr' => |
array ( |
), |
'st' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'consulado' => |
array ( |
), |
'edu' => |
array ( |
), |
'embaixada' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'principe' => |
array ( |
), |
'saotome' => |
array ( |
), |
'store' => |
array ( |
), |
), |
'su' => |
array ( |
), |
'sv' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gob' => |
array ( |
), |
'org' => |
array ( |
), |
'red' => |
array ( |
), |
), |
'sx' => |
array ( |
'gov' => |
array ( |
), |
), |
'sy' => |
array ( |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'sz' => |
array ( |
'co' => |
array ( |
), |
'ac' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'tc' => |
array ( |
), |
'td' => |
array ( |
'blogspot' => |
array ( |
), |
), |
'tel' => |
array ( |
), |
'tf' => |
array ( |
), |
'tg' => |
array ( |
), |
'th' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'go' => |
array ( |
), |
'in' => |
array ( |
), |
'mi' => |
array ( |
), |
'net' => |
array ( |
), |
'or' => |
array ( |
), |
), |
'tj' => |
array ( |
'ac' => |
array ( |
), |
'biz' => |
array ( |
), |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'go' => |
array ( |
), |
'gov' => |
array ( |
), |
'int' => |
array ( |
), |
'mil' => |
array ( |
), |
'name' => |
array ( |
), |
'net' => |
array ( |
), |
'nic' => |
array ( |
), |
'org' => |
array ( |
), |
'test' => |
array ( |
), |
'web' => |
array ( |
), |
), |
'tk' => |
array ( |
), |
'tl' => |
array ( |
'gov' => |
array ( |
), |
), |
'tm' => |
array ( |
'com' => |
array ( |
), |
'co' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'nom' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'tn' => |
array ( |
'com' => |
array ( |
), |
'ens' => |
array ( |
), |
'fin' => |
array ( |
), |
'gov' => |
array ( |
), |
'ind' => |
array ( |
), |
'intl' => |
array ( |
), |
'nat' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'info' => |
array ( |
), |
'perso' => |
array ( |
), |
'tourism' => |
array ( |
), |
'edunet' => |
array ( |
), |
'rnrt' => |
array ( |
), |
'rns' => |
array ( |
), |
'rnu' => |
array ( |
), |
'mincom' => |
array ( |
), |
'agrinet' => |
array ( |
), |
'defense' => |
array ( |
), |
'turen' => |
array ( |
), |
), |
'to' => |
array ( |
'com' => |
array ( |
), |
'gov' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'mil' => |
array ( |
), |
), |
'tp' => |
array ( |
), |
'tr' => |
array ( |
'*' => |
array ( |
), |
'nic' => |
array ( |
'!' => '', |
), |
'nc' => |
array ( |
'gov' => |
array ( |
), |
), |
), |
'travel' => |
array ( |
), |
'tt' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
'net' => |
array ( |
), |
'biz' => |
array ( |
), |
'info' => |
array ( |
), |
'pro' => |
array ( |
), |
'int' => |
array ( |
), |
'coop' => |
array ( |
), |
'jobs' => |
array ( |
), |
'mobi' => |
array ( |
), |
'travel' => |
array ( |
), |
'museum' => |
array ( |
), |
'aero' => |
array ( |
), |
'name' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
'tv' => |
array ( |
'dyndns' => |
array ( |
), |
'better-than' => |
array ( |
), |
'on-the-web' => |
array ( |
), |
'worse-than' => |
array ( |
), |
), |
'tw' => |
array ( |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'idv' => |
array ( |
), |
'game' => |
array ( |
), |
'ebiz' => |
array ( |
), |
'club' => |
array ( |
), |
'網路' => |
array ( |
), |
'組織' => |
array ( |
), |
'商業' => |
array ( |
), |
'blogspot' => |
array ( |
), |
), |
'tz' => |
array ( |
'ac' => |
array ( |
), |
'co' => |
array ( |
), |
'go' => |
array ( |
), |
'hotel' => |
array ( |
), |
'info' => |
array ( |
), |
'me' => |
array ( |
), |
'mil' => |
array ( |
), |
'mobi' => |
array ( |
), |
'ne' => |
array ( |
), |
'or' => |
array ( |
), |
'sc' => |
array ( |
), |
'tv' => |
array ( |
), |
), |
'ua' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'in' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'cherkassy' => |
array ( |
), |
'cherkasy' => |
array ( |
), |
'chernigov' => |
array ( |
), |
'chernihiv' => |
array ( |
), |
'chernivtsi' => |
array ( |
), |
'chernovtsy' => |
array ( |
), |
'ck' => |
array ( |
), |
'cn' => |
array ( |
), |
'cr' => |
array ( |
), |
'crimea' => |
array ( |
), |
'cv' => |
array ( |
), |
'dn' => |
array ( |
), |
'dnepropetrovsk' => |
array ( |
), |
'dnipropetrovsk' => |
array ( |
), |
'dominic' => |
array ( |
), |
'donetsk' => |
array ( |
), |
'dp' => |
array ( |
), |
'if' => |
array ( |
), |
'ivano-frankivsk' => |
array ( |
), |
'kh' => |
array ( |
), |
'kharkiv' => |
array ( |
), |
'kharkov' => |
array ( |
), |
'kherson' => |
array ( |
), |
'khmelnitskiy' => |
array ( |
), |
'khmelnytskyi' => |
array ( |
), |
'kiev' => |
array ( |
), |
'kirovograd' => |
array ( |
), |
'km' => |
array ( |
), |
'kr' => |
array ( |
), |
'krym' => |
array ( |
), |
'ks' => |
array ( |
), |
'kv' => |
array ( |
), |
'kyiv' => |
array ( |
), |
'lg' => |
array ( |
), |
'lt' => |
array ( |
), |
'lugansk' => |
array ( |
), |
'lutsk' => |
array ( |
), |
'lv' => |
array ( |
), |
'lviv' => |
array ( |
), |
'mk' => |
array ( |
), |
'mykolaiv' => |
array ( |
), |
'nikolaev' => |
array ( |
), |
'od' => |
array ( |
), |
'odesa' => |
array ( |
), |
'odessa' => |
array ( |
), |
'pl' => |
array ( |
), |
'poltava' => |
array ( |
), |
'rivne' => |
array ( |
), |
'rovno' => |
array ( |
), |
'rv' => |
array ( |
), |
'sb' => |
array ( |
), |
'sebastopol' => |
array ( |
), |
'sevastopol' => |
array ( |
), |
'sm' => |
array ( |
), |
'sumy' => |
array ( |
), |
'te' => |
array ( |
), |
'ternopil' => |
array ( |
), |
'uz' => |
array ( |
), |
'uzhgorod' => |
array ( |
), |
'vinnica' => |
array ( |
), |
'vinnytsia' => |
array ( |
), |
'vn' => |
array ( |
), |
'volyn' => |
array ( |
), |
'yalta' => |
array ( |
), |
'zaporizhzhe' => |
array ( |
), |
'zaporizhzhia' => |
array ( |
), |
'zhitomir' => |
array ( |
), |
'zhytomyr' => |
array ( |
), |
'zp' => |
array ( |
), |
'zt' => |
array ( |
), |
'co' => |
array ( |
), |
'pp' => |
array ( |
), |
), |
'ug' => |
array ( |
'co' => |
array ( |
), |
'or' => |
array ( |
), |
'ac' => |
array ( |
), |
'sc' => |
array ( |
), |
'go' => |
array ( |
), |
'ne' => |
array ( |
), |
'com' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'uk' => |
array ( |
'*' => |
array ( |
), |
'sch' => |
array ( |
'*' => |
array ( |
), |
), |
'bl' => |
array ( |
'!' => '', |
), |
'british-library' => |
array ( |
'!' => '', |
), |
'jet' => |
array ( |
'!' => '', |
), |
'mod' => |
array ( |
'!' => '', |
), |
'national-library-scotland' => |
array ( |
'!' => '', |
), |
'nel' => |
array ( |
'!' => '', |
), |
'nic' => |
array ( |
'!' => '', |
), |
'nls' => |
array ( |
'!' => '', |
), |
'parliament' => |
array ( |
'!' => '', |
), |
'co' => |
array ( |
'blogspot' => |
array ( |
), |
), |
), |
'us' => |
array ( |
'dni' => |
array ( |
), |
'fed' => |
array ( |
), |
'isa' => |
array ( |
), |
'kids' => |
array ( |
), |
'nsn' => |
array ( |
), |
'ak' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'al' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ar' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'as' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'az' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ca' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'co' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ct' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'dc' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'de' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'fl' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ga' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'gu' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'hi' => |
array ( |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ia' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'id' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'il' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'in' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ks' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ky' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'la' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ma' => |
array ( |
'k12' => |
array ( |
'pvt' => |
array ( |
), |
'chtr' => |
array ( |
), |
'paroch' => |
array ( |
), |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'md' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'me' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'mi' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'mn' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'mo' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ms' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'mt' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nc' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nd' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ne' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nh' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nj' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nm' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'nv' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ny' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'oh' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ok' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'or' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'pa' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'pr' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ri' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'sc' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'sd' => |
array ( |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'tn' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'tx' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'ut' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'vi' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'vt' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'va' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'wa' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'wi' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'wv' => |
array ( |
'cc' => |
array ( |
), |
), |
'wy' => |
array ( |
'k12' => |
array ( |
), |
'cc' => |
array ( |
), |
'lib' => |
array ( |
), |
), |
'is-by' => |
array ( |
), |
'land-4-sale' => |
array ( |
), |
'stuff-4-sale' => |
array ( |
), |
), |
'uy' => |
array ( |
'com' => |
array ( |
), |
'edu' => |
array ( |
), |
'gub' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'uz' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'va' => |
array ( |
), |
'vc' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'mil' => |
array ( |
), |
'edu' => |
array ( |
), |
), |
've' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'e12' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'info' => |
array ( |
), |
'mil' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'web' => |
array ( |
), |
), |
'vg' => |
array ( |
), |
'vi' => |
array ( |
'co' => |
array ( |
), |
'com' => |
array ( |
), |
'k12' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
), |
'vn' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'edu' => |
array ( |
), |
'gov' => |
array ( |
), |
'int' => |
array ( |
), |
'ac' => |
array ( |
), |
'biz' => |
array ( |
), |
'info' => |
array ( |
), |
'name' => |
array ( |
), |
'pro' => |
array ( |
), |
'health' => |
array ( |
), |
), |
'vu' => |
array ( |
), |
'wf' => |
array ( |
), |
'ws' => |
array ( |
'com' => |
array ( |
), |
'net' => |
array ( |
), |
'org' => |
array ( |
), |
'gov' => |
array ( |
), |
'edu' => |
array ( |
), |
'dyndns' => |
array ( |
), |
'mypets' => |
array ( |
), |
), |
'yt' => |
array ( |
), |
'امارات' => |
array ( |
), |
'বাংলা' => |
array ( |
), |
'中国' => |
array ( |
), |
'中國' => |
array ( |
), |
'الجزائر' => |
array ( |
), |
'مصر' => |
array ( |
), |
'გე' => |
array ( |
), |
'香港' => |
array ( |
), |
'भारत' => |
array ( |
), |
'بھارت' => |
array ( |
), |
'à°à°¾à°°à°¤à±' => |
array ( |
), |
'àªàª¾àª°àª¤' => |
array ( |
), |
'à¨à¨¾à¨°à¨¤' => |
array ( |
), |
'à¦à¦¾à¦°à¦¤' => |
array ( |
), |
'இநà¯à®¤à®¿à®¯à®¾' => |
array ( |
), |
'ایران' => |
array ( |
), |
'ايران' => |
array ( |
), |
'الاردن' => |
array ( |
), |
'한국' => |
array ( |
), |
'қаз' => |
array ( |
), |
'ලංකà·' => |
array ( |
), |
'இலஙà¯à®•à¯ˆ' => |
array ( |
), |
'المغرب' => |
array ( |
), |
'мон' => |
array ( |
), |
'مليسيا' => |
array ( |
), |
'عمان' => |
array ( |
), |
'فلسطين' => |
array ( |
), |
'срб' => |
array ( |
), |
'рф' => |
array ( |
), |
'قطر' => |
array ( |
), |
'السعودية' => |
array ( |
), |
'السعودیة' => |
array ( |
), |
'السعودیۃ' => |
array ( |
), |
'السعوديه' => |
array ( |
), |
'سورية' => |
array ( |
), |
'سوريا' => |
array ( |
), |
'新加坡' => |
array ( |
), |
'சிஙà¯à®•à®ªà¯à®ªà¯‚à®°à¯' => |
array ( |
), |
'ไทย' => |
array ( |
), |
'تونس' => |
array ( |
), |
'台灣' => |
array ( |
), |
'台湾' => |
array ( |
), |
'臺灣' => |
array ( |
), |
'укр' => |
array ( |
), |
'اليمن' => |
array ( |
), |
'xxx' => |
array ( |
), |
'ye' => |
array ( |
'*' => |
array ( |
), |
), |
'za' => |
array ( |
'*' => |
array ( |
), |
), |
'zm' => |
array ( |
'*' => |
array ( |
), |
), |
'zw' => |
array ( |
'*' => |
array ( |
), |
), |
'онлайн' => |
array ( |
), |
'сайт' => |
array ( |
), |
'شبكة' => |
array ( |
), |
'游戏' => |
array ( |
), |
'企业' => |
array ( |
), |
'camera' => |
array ( |
), |
'clothing' => |
array ( |
), |
'lighting' => |
array ( |
), |
'singles' => |
array ( |
), |
'ventures' => |
array ( |
), |
'voyage' => |
array ( |
), |
'guru' => |
array ( |
), |
'holdings' => |
array ( |
), |
'equipment' => |
array ( |
), |
'bike' => |
array ( |
), |
'estate' => |
array ( |
), |
'tattoo' => |
array ( |
), |
'在线' => |
array ( |
), |
'中文网' => |
array ( |
), |
'land' => |
array ( |
), |
'plumbing' => |
array ( |
), |
'contractors' => |
array ( |
), |
'sexy' => |
array ( |
), |
'menu' => |
array ( |
), |
'世界' => |
array ( |
), |
'uno' => |
array ( |
), |
'gallery' => |
array ( |
), |
'technology' => |
array ( |
), |
'集团' => |
array ( |
), |
'reviews' => |
array ( |
), |
'guide' => |
array ( |
), |
'我爱你' => |
array ( |
), |
'graphics' => |
array ( |
), |
'construction' => |
array ( |
), |
'onl' => |
array ( |
), |
'みんな' => |
array ( |
), |
'diamonds' => |
array ( |
), |
'kiwi' => |
array ( |
), |
'enterprises' => |
array ( |
), |
'today' => |
array ( |
), |
'futbol' => |
array ( |
), |
'photography' => |
array ( |
), |
'tips' => |
array ( |
), |
'directory' => |
array ( |
), |
'kitchen' => |
array ( |
), |
'移动' => |
array ( |
), |
'kim' => |
array ( |
), |
'삼성' => |
array ( |
), |
'monash' => |
array ( |
), |
'wed' => |
array ( |
), |
'pink' => |
array ( |
), |
'ruhr' => |
array ( |
), |
'buzz' => |
array ( |
), |
'careers' => |
array ( |
), |
'shoes' => |
array ( |
), |
'موقع' => |
array ( |
), |
'career' => |
array ( |
), |
'otsuka' => |
array ( |
), |
'中信' => |
array ( |
), |
'gift' => |
array ( |
), |
'recipes' => |
array ( |
), |
'coffee' => |
array ( |
), |
'luxury' => |
array ( |
), |
'domains' => |
array ( |
), |
'photos' => |
array ( |
), |
'limo' => |
array ( |
), |
'viajes' => |
array ( |
), |
'wang' => |
array ( |
), |
'democrat' => |
array ( |
), |
'mango' => |
array ( |
), |
'cab' => |
array ( |
), |
'support' => |
array ( |
), |
'dance' => |
array ( |
), |
'nagoya' => |
array ( |
), |
'computer' => |
array ( |
), |
'wien' => |
array ( |
), |
'berlin' => |
array ( |
), |
'codes' => |
array ( |
), |
'email' => |
array ( |
), |
'بازار' => |
array ( |
), |
'repair' => |
array ( |
), |
'holiday' => |
array ( |
), |
'center' => |
array ( |
), |
'systems' => |
array ( |
), |
'wiki' => |
array ( |
), |
'ceo' => |
array ( |
), |
'international' => |
array ( |
), |
'solar' => |
array ( |
), |
'company' => |
array ( |
), |
'education' => |
array ( |
), |
'training' => |
array ( |
), |
'academy' => |
array ( |
), |
'marketing' => |
array ( |
), |
'florist' => |
array ( |
), |
'solutions' => |
array ( |
), |
'build' => |
array ( |
), |
'institute' => |
array ( |
), |
'builders' => |
array ( |
), |
'red' => |
array ( |
), |
'blue' => |
array ( |
), |
'ninja' => |
array ( |
), |
'business' => |
array ( |
), |
'gal' => |
array ( |
), |
'social' => |
array ( |
), |
'house' => |
array ( |
), |
'camp' => |
array ( |
), |
'immobilien' => |
array ( |
), |
'moda' => |
array ( |
), |
'glass' => |
array ( |
), |
'management' => |
array ( |
), |
'kaufen' => |
array ( |
), |
'farm' => |
array ( |
), |
'公益' => |
array ( |
), |
'政务' => |
array ( |
), |
'club' => |
array ( |
), |
'voting' => |
array ( |
), |
'tokyo' => |
array ( |
), |
'moe' => |
array ( |
), |
'guitars' => |
array ( |
), |
'bargains' => |
array ( |
), |
'组织机构' => |
array ( |
), |
'desi' => |
array ( |
), |
'cool' => |
array ( |
), |
'boutique' => |
array ( |
), |
'pics' => |
array ( |
), |
'орг' => |
array ( |
), |
'公司' => |
array ( |
), |
'网络' => |
array ( |
), |
'cheap' => |
array ( |
), |
'广东' => |
array ( |
), |
'photo' => |
array ( |
), |
'network' => |
array ( |
), |
'zone' => |
array ( |
), |
'机构' => |
array ( |
), |
'link' => |
array ( |
), |
'qpon' => |
array ( |
), |
'संगठन' => |
array ( |
), |
'agency' => |
array ( |
), |
'tienda' => |
array ( |
), |
'works' => |
array ( |
), |
'london' => |
array ( |
), |
'watch' => |
array ( |
), |
'rocks' => |
array ( |
), |
'shiksha' => |
array ( |
), |
'дети' => |
array ( |
), |
'budapest' => |
array ( |
), |
'nrw' => |
array ( |
), |
'vote' => |
array ( |
), |
'fishing' => |
array ( |
), |
'expert' => |
array ( |
), |
'horse' => |
array ( |
), |
'christmas' => |
array ( |
), |
'cooking' => |
array ( |
), |
'商城' => |
array ( |
), |
'casa' => |
array ( |
), |
'rich' => |
array ( |
), |
'voto' => |
array ( |
), |
'tools' => |
array ( |
), |
'八卦' => |
array ( |
), |
'praxi' => |
array ( |
), |
'events' => |
array ( |
), |
'flights' => |
array ( |
), |
'report' => |
array ( |
), |
'partners' => |
array ( |
), |
'neustar' => |
array ( |
), |
'rentals' => |
array ( |
), |
'catering' => |
array ( |
), |
'community' => |
array ( |
), |
'maison' => |
array ( |
), |
'parts' => |
array ( |
), |
'cleaning' => |
array ( |
), |
'okinawa' => |
array ( |
), |
'foundation' => |
array ( |
), |
'properties' => |
array ( |
), |
'vacations' => |
array ( |
), |
'productions' => |
array ( |
), |
'industries' => |
array ( |
), |
'haus' => |
array ( |
), |
'vision' => |
array ( |
), |
'mormon' => |
array ( |
), |
'cards' => |
array ( |
), |
'ink' => |
array ( |
), |
'villas' => |
array ( |
), |
'consulting' => |
array ( |
), |
'cruises' => |
array ( |
), |
'krd' => |
array ( |
), |
'xyz' => |
array ( |
), |
'dating' => |
array ( |
), |
'exposed' => |
array ( |
), |
'condos' => |
array ( |
), |
'eus' => |
array ( |
), |
'caravan' => |
array ( |
), |
'actor' => |
array ( |
), |
'saarland' => |
array ( |
), |
'yokohama' => |
array ( |
), |
'pub' => |
array ( |
), |
'рус' => |
array ( |
), |
'ren' => |
array ( |
), |
'fish' => |
array ( |
), |
'bar' => |
array ( |
), |
'dnp' => |
array ( |
), |
'bid' => |
array ( |
), |
'supply' => |
array ( |
), |
'miami' => |
array ( |
), |
'supplies' => |
array ( |
), |
'quebec' => |
array ( |
), |
'moscow' => |
array ( |
), |
'globo' => |
array ( |
), |
'axa' => |
array ( |
), |
'москва' => |
array ( |
), |
'商店' => |
array ( |
), |
'vodka' => |
array ( |
), |
'rest' => |
array ( |
), |
'frogans' => |
array ( |
), |
'wtc' => |
array ( |
), |
'rodeo' => |
array ( |
), |
'sohu' => |
array ( |
), |
'best' => |
array ( |
), |
'country' => |
array ( |
), |
'kred' => |
array ( |
), |
'feedback' => |
array ( |
), |
'work' => |
array ( |
), |
'luxe' => |
array ( |
), |
'ryukyu' => |
array ( |
), |
'autos' => |
array ( |
), |
'homes' => |
array ( |
), |
'jetzt' => |
array ( |
), |
'yachts' => |
array ( |
), |
'motorcycles' => |
array ( |
), |
'mini' => |
array ( |
), |
'ggee' => |
array ( |
), |
'beer' => |
array ( |
), |
'佛山' => |
array ( |
), |
'college' => |
array ( |
), |
'ovh' => |
array ( |
), |
'meet' => |
array ( |
), |
'网址' => |
array ( |
), |
'gop' => |
array ( |
), |
'blackfriday' => |
array ( |
), |
'lacaixa' => |
array ( |
), |
'商标' => |
array ( |
), |
'vegas' => |
array ( |
), |
'black' => |
array ( |
), |
'soy' => |
array ( |
), |
'trade' => |
array ( |
), |
'gent' => |
array ( |
), |
'ing' => |
array ( |
), |
'dad' => |
array ( |
), |
'shriram' => |
array ( |
), |
'bayern' => |
array ( |
), |
'scot' => |
array ( |
), |
'webcam' => |
array ( |
), |
'foo' => |
array ( |
), |
'eat' => |
array ( |
), |
'nyc' => |
array ( |
), |
'prod' => |
array ( |
), |
'how' => |
array ( |
), |
'day' => |
array ( |
), |
'meme' => |
array ( |
), |
'mov' => |
array ( |
), |
'paris' => |
array ( |
), |
'boo' => |
array ( |
), |
'new' => |
array ( |
), |
'ifm' => |
array ( |
), |
'life' => |
array ( |
), |
'archi' => |
array ( |
), |
'spiegel' => |
array ( |
), |
'brussels' => |
array ( |
), |
'church' => |
array ( |
), |
'here' => |
array ( |
), |
'dabur' => |
array ( |
), |
'vlaanderen' => |
array ( |
), |
'cologne' => |
array ( |
), |
'手机' => |
array ( |
), |
'wme' => |
array ( |
), |
'nhk' => |
array ( |
), |
'suzuki' => |
array ( |
), |
'whoswho' => |
array ( |
), |
'scb' => |
array ( |
), |
'hamburg' => |
array ( |
), |
'services' => |
array ( |
), |
'bzh' => |
array ( |
), |
'rio' => |
array ( |
), |
'cash' => |
array ( |
), |
'gives' => |
array ( |
), |
'hiphop' => |
array ( |
), |
'degree' => |
array ( |
), |
'digital' => |
array ( |
), |
'rehab' => |
array ( |
), |
'wtf' => |
array ( |
), |
'financial' => |
array ( |
), |
'limited' => |
array ( |
), |
'discount' => |
array ( |
), |
'fail' => |
array ( |
), |
'vet' => |
array ( |
), |
'ngo' => |
array ( |
), |
'fitness' => |
array ( |
), |
'schule' => |
array ( |
), |
'navy' => |
array ( |
), |
'bio' => |
array ( |
), |
'ong' => |
array ( |
), |
'town' => |
array ( |
), |
'toys' => |
array ( |
), |
'army' => |
array ( |
), |
'engineering' => |
array ( |
), |
'capital' => |
array ( |
), |
'exchange' => |
array ( |
), |
'fan' => |
array ( |
), |
'market' => |
array ( |
), |
'media' => |
array ( |
), |
'lease' => |
array ( |
), |
'university' => |
array ( |
), |
'reisen' => |
array ( |
), |
'airforce' => |
array ( |
), |
'pictures' => |
array ( |
), |
'gripe' => |
array ( |
), |
'associates' => |
array ( |
), |
'政府' => |
array ( |
), |
'williamhill' => |
array ( |
), |
'hiv' => |
array ( |
), |
'sca' => |
array ( |
), |
'reise' => |
array ( |
), |
); |
/vendor/aura/uri/meta/authors.csv |
---|
@@ -0,0 +1,4 @@ |
lead,pmjones,Paul M. Jones,pmjones88@gmail.com,http://paul-m-jones.com |
developer,compwright,Jonathon Hill,jhill9693@gmail.com,http://jonathonhill.net |
developer,harikt,Hari KT,kthari85@gmail.com,http://harikt.com |
developer,jeremykendall,Jeremy Kendall,jeremy@jeremykendall.net,http://www.jeremykendall.net |
/vendor/aura/uri/meta/changes.txt |
---|
@@ -0,0 +1,5 @@ |
- Merge pull request #24 from jeremykendall/develop; adds support for schemeless URLs and for ftp/ftps schemes |
- Merge pull request #23 from jeremykendall/develop; updates allowing parser to handle single label hosts. |
- Merge pull request #21 from jeremykendall/develop; updates public suffix list and test data |
/vendor/aura/uri/meta/description.txt |
---|
@@ -0,0 +1 @@ |
The Aura Uri package provides tools to build and manipulate URL strings. |
/vendor/aura/uri/meta/keywords.csv |
---|
@@ -0,0 +1 @@ |
uri, url |
/vendor/aura/uri/meta/require.csv |
---|
@@ -0,0 +1,2 @@ |
php,>=5.4.0 |
aura/installer-default,1.0.* |
/vendor/aura/uri/meta/summary.txt |
---|
@@ -0,0 +1 @@ |
Tools to build and manipulate URL strings. |
/vendor/aura/uri/scripts/instance.php |
---|
@@ -0,0 +1,9 @@ |
<?php |
namespace Aura\Uri; |
require_once dirname(__DIR__) . '/src.php'; |
return new Url\Factory( |
$_SERVER, |
new PublicSuffixList( |
include dirname(__DIR__) . '/data/public-suffix-list.php' |
) |
); |
/vendor/aura/uri/scripts/update.php |
---|
@@ -0,0 +1,68 @@ |
<?php |
/** |
* |
* Builds the PSL data array from the parts of a text line. |
* |
* @param array &$data The PSL data array. |
* |
* @param array $parts The parts of a PSL text line. |
* |
* @return void |
* |
*/ |
function build(array &$data, array $parts) |
{ |
$part = array_pop($parts); |
$is_domain = true; |
if (strpos($part, '!') === 0) { |
$part = substr($part, 1); |
$is_domain = false; |
} |
if (! array_key_exists($part, $data)) { |
if ($is_domain) { |
$data[$part] = array(); |
} else { |
$data[$part] = array('!' => ''); |
} |
} |
if ($is_domain && count($parts) > 0) { |
build($data[$part], $parts); |
} |
} |
/** |
* |
* Update the public suffix list files. |
* |
*/ |
// get the origin text file |
$text = file_get_contents('http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1'); |
$lines = explode("\n", $text); |
// convert text lines to data |
$data = []; |
foreach ($lines as $line) { |
// massage the line |
$line = trim($line); |
// skip empty and comment lines |
if (! $line || substr($line, 0, 2) == '//') { |
continue; |
} |
// get the line parts and build into the psl data |
$parts = explode('.', $line); |
build($data, $parts); |
} |
// write the data to a PHP file |
$code = '<?php' . PHP_EOL . 'return ' . var_export($data, true) . ';'; |
$file = dirname(__DIR__) . DIRECTORY_SEPARATOR |
. 'data' . DIRECTORY_SEPARATOR |
. 'public-suffix-list.php'; |
file_put_contents($file, $code); |
// done! |
exit(0); |
/vendor/aura/uri/src/Aura/Uri/Host.php |
---|
@@ -0,0 +1,170 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri; |
/** |
* |
* Processing the host |
* |
* @package Aura.Uri |
* |
*/ |
class Host |
{ |
/** |
* |
* The public suffix list. |
* |
* @var array |
* |
*/ |
protected $psl; |
/** |
* |
* The full Host this object represents. |
* |
* @var string |
* |
*/ |
protected $host; |
/** |
* |
* Subdomain portion of host. |
* |
* @var string |
* |
*/ |
protected $subdomain; |
/** |
* |
* Registerable domain portion of host. |
* |
* @var string |
* |
*/ |
protected $registerable_domain; |
/** |
* |
* Public suffix portion of host. |
* |
* @var string |
* |
*/ |
protected $public_suffix; |
/** |
* |
* Constructor. |
* |
* @param PublicSuffixList $psl Public suffix list. |
* |
* @param array $spec Host elements. |
* |
*/ |
public function __construct(PublicSuffixList $psl, array $spec = []) |
{ |
$this->psl = $psl; |
foreach ($spec as $key => $val) { |
$this->$key = $val; |
} |
} |
/** |
* |
* Returns this Host object as a string. |
* |
* @return string The full Host this object represents. |
* |
*/ |
public function __toString() |
{ |
return $this->get(); |
} |
/** |
* |
* Returns this Host object as a string. |
* |
* @return string The full Host this object represents. |
* |
*/ |
public function get() |
{ |
if ($this->host !== null) { |
return $this->host; |
} |
// retain only the elements that are not empty |
$str = array_filter( |
[$this->subdomain, $this->registerable_domain], |
'strlen' |
); |
return implode('.', $str); |
} |
/** |
* |
* Sets values from a host string; overwrites any previous values. |
* |
* @param string $spec The host string to use; e.g., 'example.com'. |
* |
* @return void |
* |
*/ |
public function setFromString($spec) |
{ |
$this->host = $spec; |
$this->public_suffix = $this->psl->getPublicSuffix($spec); |
$this->registerable_domain = $this->psl->getRegisterableDomain($spec); |
$this->subdomain = $this->psl->getSubdomain($spec); |
} |
/** |
* |
* Returns the public suffix portion of the host. |
* |
* @return string |
* |
*/ |
public function getPublicSuffix() |
{ |
return $this->public_suffix; |
} |
/** |
* |
* Returns the subdomain portion of the host. |
* |
* @return string |
* |
*/ |
public function getSubdomain() |
{ |
return $this->subdomain; |
} |
/** |
* |
* Returns the registerable domain portion of the host. |
* |
* @return string |
* |
*/ |
public function getRegisterableDomain() |
{ |
return $this->registerable_domain; |
} |
} |
/vendor/aura/uri/src/Aura/Uri/Path.php |
---|
@@ -0,0 +1,118 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri; |
/** |
* |
* Manage the Path |
* |
* @package Aura.Uri |
* |
*/ |
class Path extends \ArrayObject |
{ |
/** |
* |
* The dot-format extension of the last path element, including the dot |
* (for example, the ".rss" in "feed.rss"). |
* |
* @var string |
* |
*/ |
protected $format; |
/** |
* |
* Returns the path array as a string, including the format. |
* |
* @return string The path string. |
* |
*/ |
public function __toString() |
{ |
$spec = $this->getArrayCopy(); |
$path = []; |
// encode each path element |
foreach ($spec as $elem) { |
$path[] = rawurlencode($elem); |
} |
// create a string from the encoded elements |
$url = implode('/', $path) . $this->format; |
return !empty( $url ) ? '/' . $url : $url; |
} |
/** |
* |
* Sets the $path array and $format value from a string. |
* |
* This will overwrite any previous values. |
* |
* @param string $path The path string to use; for example, |
* "/foo/bar/baz/dib.gir". A leading slash will *not* create an empty |
* first element; if the string has a leading slash, it is ignored. |
* |
* @return void |
* |
*/ |
public function setFromString($path) |
{ |
$this->exchangeArray([]); |
$path = explode('/', $path); |
if ($path[0] == '') { |
array_shift($path); |
} |
foreach ($path as $key => $val) { |
$this[$key] = urldecode($val); |
} |
// $key and $val are already at the end |
$this->setFormat(null); |
if ( isset($val) ) { |
// find the last dot in the value |
$pos = strrpos($val, '.'); |
if ($pos !== false) { |
// remove from the path and retain as the format |
$this[$key] = substr($val, 0, $pos); |
$this->setFormat(substr($val, $pos)); |
} |
} |
} |
/** |
* |
* Set the dot-format; remember to include the leading dot. |
* |
* @param string $format |
* |
* @return void |
* |
*/ |
public function setFormat($format) |
{ |
$this->format = $format; |
} |
/** |
* |
* Get the dot-format extension. |
* |
* @return string |
*/ |
public function getFormat() |
{ |
return $this->format; |
} |
} |
/vendor/aura/uri/src/Aura/Uri/PublicSuffixList.php |
---|
@@ -0,0 +1,146 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri; |
/** |
* |
* Object representation of the Public Suffix List |
* |
* @package Aura.Uri |
* |
*/ |
class PublicSuffixList |
{ |
/** |
* |
* Public suffix list data. |
* |
* @var array |
* |
*/ |
protected $psl; |
/** |
* |
* Constructor. |
* |
* @param array $list Array representation of the Public Suffix List |
* |
*/ |
public function __construct(array $list) |
{ |
$this->psl = $list; |
} |
/** |
* Returns the public suffix portion of provided host |
* |
* @param string $host host |
* @return string public suffix |
*/ |
public function getPublicSuffix($host) |
{ |
if (strpos($host, '.') === 0) { |
return null; |
} |
if (strpos($host, '.') === false) { |
return null; |
} |
$host = strtolower($host); |
$parts = array_reverse(explode('.', $host)); |
$publicSuffix = array(); |
$psl = $this->psl; |
foreach ($parts as $part) { |
if (array_key_exists($part, $psl) |
&& array_key_exists('!', $psl[$part])) { |
break; |
} |
if (array_key_exists($part, $psl)) { |
array_unshift($publicSuffix, $part); |
$psl = $psl[$part]; |
continue; |
} |
if (array_key_exists('*', $psl)) { |
array_unshift($publicSuffix, $part); |
$psl = $psl['*']; |
continue; |
} |
// Avoids improper parsing when $host's subdomain + public suffix === |
// a valid public suffix (e.g. host 'us.example.com' and public suffix 'us.com') |
break; |
} |
// Apply algorithm rule #2: If no rules match, the prevailing rule is "*". |
if (empty($publicSuffix)) { |
$publicSuffix[0] = $parts[0]; |
} |
return implode('.', array_filter($publicSuffix, 'strlen')); |
} |
/** |
* Returns registerable domain portion of provided host |
* |
* Per the test cases provided by Mozilla |
* (http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1), |
* this method should return null if the domain provided is a public suffix. |
* |
* @param string $host host |
* @return string registerable domain |
*/ |
public function getRegisterableDomain($host) |
{ |
if (strpos($host, '.') === false) { |
return null; |
} |
$host = strtolower($host); |
$publicSuffix = $this->getPublicSuffix($host); |
if ($publicSuffix === null || $host == $publicSuffix) { |
return null; |
} |
$publicSuffixParts = array_reverse(explode('.', $publicSuffix)); |
$hostParts = array_reverse(explode('.', $host)); |
$registerableDomainParts = array_slice($hostParts, 0, count($publicSuffixParts) + 1); |
return implode('.', array_reverse($registerableDomainParts)); |
} |
/** |
* Returns the subdomain portion of provided host |
* |
* @param string $host host |
* @return string subdomain |
*/ |
public function getSubdomain($host) |
{ |
$host = strtolower($host); |
$registerableDomain = $this->getRegisterableDomain($host); |
if ($registerableDomain === null || $host == $registerableDomain) { |
return null; |
} |
$registerableDomainParts = array_reverse(explode('.', $registerableDomain)); |
$hostParts = array_reverse(explode('.', $host)); |
$subdomainParts = array_slice($hostParts, count($registerableDomainParts)); |
return implode('.', array_reverse($subdomainParts)); |
} |
} |
/vendor/aura/uri/src/Aura/Uri/Query.php |
---|
@@ -0,0 +1,83 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri; |
/** |
* |
* Processing the query string |
* |
* @package Aura.Uri |
* |
*/ |
class Query extends \ArrayObject |
{ |
/** |
* |
* Returns the query portion as a string. |
* |
* @return string The query string; e.g., `foo=bar&baz=dib`. |
* |
*/ |
public function __toString() |
{ |
return $this->buildString($this->getArrayCopy()); |
} |
/** |
* |
* Sets values from a query string; overwrites any previous values. |
* |
* To set from an array, use `exchangeArray()`. |
* |
* @param string $spec The query string to use; for example, |
* `foo=bar&baz=dib`. |
* |
* @return void |
* |
*/ |
public function setFromString($spec) |
{ |
parse_str($spec, $query); |
$this->exchangeArray($query); |
} |
/** |
* |
* Build string from an array |
* |
* @param array $array |
* |
* @param string $prefix Defaults to null |
* |
* @return string Returns a string |
*/ |
protected function buildString(array $array, $prefix = null) |
{ |
$elem = []; |
foreach ($array as $key => $val) { |
$key = ($prefix) |
? $prefix . '[' . $key . ']' |
: $key; |
if (is_array($val)) { |
$elem[] = $this->buildString($val, $key); |
} else { |
$val = ($val === null || $val === false) |
? '' |
: rawurlencode($val); |
$elem[] = rawurlencode($key) . '=' . $val; |
} |
} |
return implode('&', $elem); |
} |
} |
/vendor/aura/uri/src/Aura/Uri/Url/Factory.php |
---|
@@ -0,0 +1,160 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri\Url; |
use Aura\Uri\Url; |
use Aura\Uri\Path; |
use Aura\Uri\Query; |
use Aura\Uri\Host; |
use Aura\Uri\PublicSuffixList; |
/** |
* |
* Factory to create new Url objects. |
* |
* @package Aura.Uri |
* |
*/ |
class Factory |
{ |
/** |
* |
* A string representing the current URL, built from $_SERVER. |
* |
* @var string |
* |
*/ |
protected $current; |
/** |
* Public suffix list |
* |
* @var PublicSuffixList |
*/ |
protected $psl; |
/** |
* |
* Constructor. |
* |
* @param array $server An array copy of $_SERVER. |
* |
* @param PublicSuffixList $psl Public suffix list |
*/ |
public function __construct(array $server, PublicSuffixList $psl) |
{ |
$https = isset($server['HTTPS']) |
&& strtolower($server['HTTPS']) == 'on'; |
$ssl = isset($server['SERVER_PORT']) |
&& $server['SERVER_PORT'] == 443; |
if ($https || $ssl) { |
$scheme = 'https'; |
} else { |
$scheme = 'http'; |
} |
if (isset($server['HTTP_HOST'])) { |
$host = $server['HTTP_HOST']; |
} else { |
$host = ''; |
} |
if (isset($server['REQUEST_URI'])) { |
$resource = $server['REQUEST_URI']; |
} else { |
$resource = ''; |
} |
$this->current = $scheme . '://' . $host . $resource; |
$this->psl = $psl; |
} |
/** |
* |
* Creates and returns a new Url object. |
* |
* If no host is specified, the parsing will fail. |
* |
* @param string $spec The URL string to set from. |
* |
* @return Url |
* |
*/ |
public function newInstance($spec) |
{ |
$elem = [ |
'scheme' => null, |
'user' => null, |
'pass' => null, |
'host' => null, |
'port' => null, |
'path' => null, |
'query' => null, |
'fragment' => null, |
]; |
$parts = $this->parse($spec); |
$elem = (array) $parts + $elem; |
$path = new Path([]); |
$path->setFromString($elem['path']); |
$query = new Query([]); |
$query->setFromString($elem['query']); |
$host = new Host($this->psl, []); |
$host->setFromString($elem['host']); |
return new Url( |
$elem['scheme'], |
$elem['user'], |
$elem['pass'], |
$host, |
$elem['port'], |
$path, |
$query, |
$elem['fragment'] |
); |
} |
/** |
* |
* Creates and returns a new URL object based on the current URL. |
* |
* @return Url |
* |
*/ |
public function newCurrent() |
{ |
return $this->newInstance($this->current); |
} |
/** |
* Parses url |
* |
* @param string $spec Url to parse |
* @return array Parsed url |
*/ |
public function parse($spec) |
{ |
preg_match(Url::SCHEME_PATTERN, $spec, $schemeMatches); |
if (empty($schemeMatches)) { |
$spec = 'http://' . preg_replace('#^//#', '', $spec, 1); |
} |
return parse_url($spec); |
} |
} |
/vendor/aura/uri/src/Aura/Uri/Url.php |
---|
@@ -0,0 +1,358 @@ |
<?php |
/** |
* |
* This file is part of the Aura project for PHP. |
* |
* @package Aura.Uri |
* |
* @license http://opensource.org/licenses/bsd-license.php BSD |
* |
*/ |
namespace Aura\Uri; |
/** |
* |
* Manipulates and generates URLs. |
* |
* @package Aura.Uri |
* |
*/ |
class Url |
{ |
/** |
* Pattern for URL scheme matching |
*/ |
const SCHEME_PATTERN = '#^(http|ftp)s?://#i'; |
/** |
* |
* The scheme (for example 'http' or 'https'). |
* |
* @var string |
* |
*/ |
protected $scheme; |
/** |
* |
* The username, if any. |
* |
* @var string |
* |
*/ |
protected $user; |
/** |
* |
* The password, if any. |
* |
* @var string |
* |
*/ |
protected $pass; |
/** |
* |
* The Host object |
* |
* @var Host |
* |
*/ |
protected $host; |
/** |
* |
* The port number (for example, '80'). |
* |
* @var string |
* |
*/ |
protected $port; |
/** |
* |
* A Path object. |
* |
* @var Path |
* |
*/ |
protected $path; |
/** |
* |
* A Query object. |
* |
* @var Query |
* |
*/ |
protected $query; |
/** |
* |
* The fragment portion (for example, the "foo" in "#foo"). |
* |
* @var string |
* |
*/ |
protected $fragment; |
// authority = userinfo@host:port |
/** |
* |
* Constructor. |
* |
* @param string $scheme The URL scheme (e.g. `http`). |
* |
* @param string $user The username. |
* |
* @param string $pass The password. |
* |
* @param Host $host The host elements. |
* |
* @param int $port The port number. |
* |
* @param Path $path The path elements, including format. |
* |
* @param Query $query The query elements. |
* |
* @param string $fragment The fragment. |
* |
*/ |
public function __construct( |
$scheme, |
$user, |
$pass, |
Host $host, |
$port, |
Path $path, |
Query $query, |
$fragment |
) { |
$this->scheme = $scheme; |
$this->user = $user; |
$this->pass = $pass; |
$this->host = $host; |
$this->port = $port; |
$this->path = $path; |
$this->query = $query; |
$this->fragment = $fragment; |
} |
/** |
* |
* Converts the URI object to a string and returns it. |
* |
* @return string The full URI this object represents. |
* |
*/ |
public function __toString() |
{ |
return $this->getFull(true); |
} |
/** |
* |
* Magic get for properties. |
* |
* @param string $key The property to get. |
* |
* @return mixed The value of the property. |
* |
*/ |
public function __get($key) |
{ |
return $this->$key; |
} |
/** |
* |
* Returns the URL as a string, not including scheme or host. |
* |
* @return string The URL string. |
* |
*/ |
public function get() |
{ |
// get the query as a string |
$query = $this->query->__toString(); |
// we use trim() instead of empty() on string |
// elements to allow for string-zero values. |
return $this->path->__toString() |
. (empty($query) ? '' : '?' . $query) |
. (trim($this->fragment) === '' ? '' : '#' . rawurlencode($this->fragment)); |
} |
/** |
* |
* Returns the URL as a string, including the scheme and host. |
* |
* @return string The URL string. |
* |
*/ |
public function getFull() |
{ |
// start with the scheme |
$url = empty($this->scheme) |
? '' |
: rawurlencode($this->scheme) . '://'; |
// add the username and password, if any. |
if (! empty($this->user)) { |
$url .= rawurlencode($this->user); |
if (! empty($this->pass)) { |
$url .= ':' . rawurlencode($this->pass); |
} |
$url .= '@'; |
} |
$host = $this->host->__toString(); |
// add the host and port, if any. |
$url .= (empty($this->host) ? '' : rawurlencode($this->host)) |
. (empty($this->port) ? '' : ':' . (int) $this->port); |
return $url . $this->get(); |
} |
/** |
* |
* Returns the URL as a string, including the host but excluding the scheme |
* |
* @return string The URL string. |
* |
*/ |
public function getSchemeless() |
{ |
return preg_replace(self::SCHEME_PATTERN, '//', $this->getFull(), 1); |
} |
/** |
* |
* Set the scheme (for example 'http' or 'https'). |
* |
* @param string $scheme The scheme (for example 'http' or 'https'). |
* |
* @return $this |
* |
*/ |
public function setScheme($scheme) |
{ |
$this->scheme = $scheme; |
return $this; |
} |
/** |
* |
* Sets the username. |
* |
* @param string $user The username. |
* |
* @return $this |
* |
*/ |
public function setUser($user) |
{ |
$this->user = $user; |
return $this; |
} |
/** |
* |
* Sets the password. |
* |
* @param string $pass The password. |
* |
* @return $this |
* |
*/ |
public function setPass($pass) |
{ |
$this->pass = $pass; |
return $this; |
} |
/** |
* |
* Sets the Host object for this URL. |
* |
* @param Host $host The host name. |
* |
* @return $this |
* |
*/ |
public function setHost(Host $host) |
{ |
$this->host = $host; |
return $this; |
} |
/** |
* |
* Sets the port number (for example, '80'). |
* |
* @param int $port The port number. |
* |
* @return $this |
* |
*/ |
public function setPort($port) |
{ |
$this->port = $port; |
return $this; |
} |
/** |
* |
* Sets the Path object for this URL. |
* |
* @param Path $path The Path object. |
* |
* @return $this |
* |
*/ |
public function setPath(Path $path) |
{ |
$this->path = $path; |
return $this; |
} |
/** |
* |
* Sets the Query object for this URL. |
* |
* @param Query $query The Query object. |
* |
* @return $this |
* |
*/ |
public function setQuery(Query $query) |
{ |
$this->query = $query; |
return $this; |
} |
/** |
* |
* Sets the fragment portion (for example, the "foo" in "#foo"). |
* |
* @param string $fragment The fragment. |
* |
* @return $this |
* |
*/ |
public function setFragment($fragment) |
{ |
$this->fragment = $fragment; |
return $this; |
} |
} |
/vendor/aura/uri/src.php |
---|
@@ -0,0 +1,7 @@ |
<?php |
require_once __DIR__ . '/src/Aura/Uri/Host.php'; |
require_once __DIR__ . '/src/Aura/Uri/Path.php'; |
require_once __DIR__ . '/src/Aura/Uri/Query.php'; |
require_once __DIR__ . '/src/Aura/Uri/PublicSuffixList.php'; |
require_once __DIR__ . '/src/Aura/Uri/Url.php'; |
require_once __DIR__ . '/src/Aura/Uri/Url/Factory.php'; |
/vendor/aura/uri/tests/Aura/Uri/CheckPublicSuffixTest.php |
---|
@@ -0,0 +1,123 @@ |
<?php |
namespace Aura\Uri; |
/** |
* This test case is based on the test data linked at |
* http://publicsuffix.org/list/ and provided by Rob Strading of Comodo. |
* @link |
* http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1 |
*/ |
class CheckPublicSuffixTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var \Aura\Uri\PublicSuffixList |
*/ |
protected $psl; |
protected function setUp() |
{ |
parent::setUp(); |
$file = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR |
. 'data' . DIRECTORY_SEPARATOR |
. 'public-suffix-list.php'; |
$this->psl = new PublicSuffixList(require $file); |
} |
public function testPublicSuffixSpec() |
{ |
// Test data from Rob Stradling at Comodo |
// http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1 |
// null input. |
$this->checkPublicSuffix(null, null); |
// Mixed case. |
$this->checkPublicSuffix('COM', null); |
$this->checkPublicSuffix('example.COM', 'example.com'); |
$this->checkPublicSuffix('WwW.example.COM', 'example.com'); |
// Leading dot. |
$this->checkPublicSuffix('.com', null); |
$this->checkPublicSuffix('.example', null); |
$this->checkPublicSuffix('.example.com', null); |
$this->checkPublicSuffix('.example.example', null); |
$this->checkPublicSuffix('localhost', null); |
// Unlisted TLD. |
// Addresses algorithm rule #2: If no rules match, the prevailing rule is "*". |
$this->checkPublicSuffix('example', null); |
$this->checkPublicSuffix('example.example', 'example.example'); |
$this->checkPublicSuffix('b.example.example', 'example.example'); |
$this->checkPublicSuffix('a.b.example.example', 'example.example'); |
// TLD with only 1 rule. |
$this->checkPublicSuffix('biz', null); |
$this->checkPublicSuffix('domain.biz', 'domain.biz'); |
$this->checkPublicSuffix('b.domain.biz', 'domain.biz'); |
$this->checkPublicSuffix('a.b.domain.biz', 'domain.biz'); |
// TLD with some 2-level rules. |
$this->checkPublicSuffix('com', null); |
$this->checkPublicSuffix('example.com', 'example.com'); |
$this->checkPublicSuffix('b.example.com', 'example.com'); |
$this->checkPublicSuffix('a.b.example.com', 'example.com'); |
$this->checkPublicSuffix('uk.com', null); |
$this->checkPublicSuffix('example.uk.com', 'example.uk.com'); |
$this->checkPublicSuffix('b.example.uk.com', 'example.uk.com'); |
$this->checkPublicSuffix('a.b.example.uk.com', 'example.uk.com'); |
$this->checkPublicSuffix('test.ac', 'test.ac'); |
// TLD with only 1 (wildcard) rule. |
$this->checkPublicSuffix('cy', null); |
$this->checkPublicSuffix('c.cy', null); |
$this->checkPublicSuffix('b.c.cy', 'b.c.cy'); |
$this->checkPublicSuffix('a.b.c.cy', 'b.c.cy'); |
// More complex TLD. |
$this->checkPublicSuffix('jp', null); |
$this->checkPublicSuffix('test.jp', 'test.jp'); |
$this->checkPublicSuffix('www.test.jp', 'test.jp'); |
$this->checkPublicSuffix('ac.jp', null); |
$this->checkPublicSuffix('test.ac.jp', 'test.ac.jp'); |
$this->checkPublicSuffix('www.test.ac.jp', 'test.ac.jp'); |
$this->checkPublicSuffix('kyoto.jp', null); |
$this->checkPublicSuffix('test.kyoto.jp', 'test.kyoto.jp'); |
$this->checkPublicSuffix('ide.kyoto.jp', null); |
$this->checkPublicSuffix('b.ide.kyoto.jp', 'b.ide.kyoto.jp'); |
$this->checkPublicSuffix('a.b.ide.kyoto.jp', 'b.ide.kyoto.jp'); |
$this->checkPublicSuffix('c.kobe.jp', null); |
$this->checkPublicSuffix('b.c.kobe.jp', 'b.c.kobe.jp'); |
$this->checkPublicSuffix('a.b.c.kobe.jp', 'b.c.kobe.jp'); |
$this->checkPublicSuffix('city.kobe.jp', 'city.kobe.jp'); |
$this->checkPublicSuffix('www.city.kobe.jp', 'city.kobe.jp'); |
// TLD with a wildcard rule and exceptions. |
$this->checkPublicSuffix('om', null); |
$this->checkPublicSuffix('test.ck', null); |
$this->checkPublicSuffix('b.test.ck', 'b.test.ck'); |
$this->checkPublicSuffix('a.b.test.ck', 'b.test.ck'); |
$this->checkPublicSuffix('www.ck', 'www.ck'); |
$this->checkPublicSuffix('www.www.ck', 'www.ck'); |
// US K12. |
$this->checkPublicSuffix('us', null); |
$this->checkPublicSuffix('test.us', 'test.us'); |
$this->checkPublicSuffix('www.test.us', 'test.us'); |
$this->checkPublicSuffix('ak.us', null); |
$this->checkPublicSuffix('test.ak.us', 'test.ak.us'); |
$this->checkPublicSuffix('www.test.ak.us', 'test.ak.us'); |
$this->checkPublicSuffix('k12.ak.us', null); |
$this->checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us'); |
$this->checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us'); |
} |
/** |
* This is my version of the checkPublicSuffix function referred to in the |
* test instructions at the Public Suffix List project. |
* |
* "You will need to define a checkPublicSuffix() function which takes as a |
* parameter a domain name and the public suffix, runs your implementation |
* on the domain name and checks the result is the public suffix expected." |
* |
* @link http://publicsuffix.org/list/ |
* |
* @param string $input Domain and public suffix |
* @param string $expected Expected result |
*/ |
public function checkPublicSuffix($input, $expected) |
{ |
$this->assertSame($expected, $this->psl->getRegisterableDomain($input)); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/HostTest.php |
---|
@@ -0,0 +1,106 @@ |
<?php |
namespace Aura\Uri; |
class HostTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var \Aura\Uri\Host |
*/ |
protected $host; |
protected function setUp() |
{ |
parent::setUp(); |
$file = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR |
. 'data' . DIRECTORY_SEPARATOR |
. 'public-suffix-list.php'; |
$psl = new PublicSuffixList(require $file); |
$this->host = new Host($psl); |
} |
protected function tearDown() |
{ |
$this->host = null; |
parent::tearDown(); |
} |
/** |
* @dataProvider hostDataProvider |
*/ |
public function test__toString($string) |
{ |
$this->host->setFromString($string); |
$this->assertEquals($string, $this->host->__toString()); |
} |
/** |
* @dataProvider hostDataProvider |
*/ |
public function testGet($string) |
{ |
$this->host->setFromString($string); |
$this->assertEquals($string, $this->host->get()); |
} |
/** |
* @dataProvider hostDataProvider |
*/ |
public function testSetFromString($string) |
{ |
$this->host->setFromString($string); |
$this->assertEquals($string, $this->host->__toString()); |
} |
public function hostDataProvider() |
{ |
return array( |
array('example.com'), |
array('purple.com'), |
array('localhost'), |
); |
} |
/** |
* @dataProvider parseDataProvider |
*/ |
public function testParse($url, $publicSuffix, $registerableDomain, $subdomain) |
{ |
$this->host->setFromString($url); |
$this->assertSame($subdomain, $this->host->getSubdomain()); |
$this->assertEquals($publicSuffix, $this->host->getPublicSuffix()); |
$this->assertEquals($registerableDomain, $this->host->getRegisterableDomain()); |
$this->assertEquals($url, $this->host->get()); |
} |
public function parseDataProvider() |
{ |
// $url, $publicSuffix, $registerableDomain, $subdomain |
return array( |
array('www.waxaudio.com.au', 'com.au', 'waxaudio.com.au', 'www'), |
array('example.com', 'com', 'example.com', null), |
array('us.example.com', 'com', 'example.com', 'us', 'us.example.com'), |
array('us.example.na', 'na', 'example.na', 'us', 'us.example.na'), |
array('www.example.us.na', 'us.na', 'example.us.na', 'www', 'www.example.us.na'), |
array('us.example.org', 'org', 'example.org', 'us', 'us.example.org'), |
array('webhop.broken.biz', 'biz', 'broken.biz', 'webhop', 'webhop.broken.biz'), |
array('www.broken.webhop.biz', 'webhop.biz', 'broken.webhop.biz', 'www', 'www.broken.webhop.biz'), |
array('cea-law.co.il', 'co.il', 'cea-law.co.il', null), |
array('edition.cnn.com', 'com', 'cnn.com', 'edition'), |
array('en.wikipedia.org', 'org', 'wikipedia.org', 'en'), |
array('a.b.c.cy', 'c.cy', 'b.c.cy', 'a'), |
array('test.k12.ak.us', 'k12.ak.us', 'test.k12.ak.us', null), |
array('www.scottwills.co.uk', 'co.uk', 'scottwills.co.uk', 'www'), |
array('b.ide.kyoto.jp', 'ide.kyoto.jp', 'b.ide.kyoto.jp', null), |
array('a.b.example.uk.com', 'uk.com', 'example.uk.com', 'a.b'), |
array('test.nic.ar', 'ar', 'nic.ar', 'test'), |
array('a.b.test.ck', 'test.ck', 'b.test.ck', 'a', null), |
array('baez.songfest.om', 'om', 'songfest.om', 'baez'), |
array('politics.news.omanpost.om', 'om', 'omanpost.om', 'politics.news'), |
array('localhost', null, null, null), |
); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/PathTest.php |
---|
@@ -0,0 +1,72 @@ |
<?php |
namespace Aura\Uri; |
/** |
* Test class for Path. |
* Generated by PHPUnit on 2012-07-21 at 15:45:14. |
*/ |
class PathTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var Path |
*/ |
protected $path; |
/** |
* Sets up the fixture, for example, opens a network connection. |
* This method is called before a test is executed. |
*/ |
protected function setUp() |
{ |
parent::setUp(); |
$this->path = new Path; |
} |
/** |
* Tears down the fixture, for example, closes a network connection. |
* This method is called after a test is executed. |
*/ |
protected function tearDown() |
{ |
parent::tearDown(); |
} |
/** |
* @covers Aura\Uri\Path::__toString |
*/ |
public function test__toString() |
{ |
$path = '/foo/bar/baz/dib.gir'; |
$this->path->setFromString($path); |
$actual = $this->path->__toString(); |
$this->assertSame($path, $actual); |
} |
/** |
* @covers Aura\Uri\Path::setFromString |
*/ |
public function testSetFromString() |
{ |
$path = '/foo/bar/baz/dib.gir'; |
$this->path->setFromString($path); |
$expect = '.gir'; |
$actual = $this->path->getFormat(); |
$this->assertSame($expect, $actual); |
$actual = $this->path->__toString(); |
$this->assertSame($path, $actual); |
} |
/** |
* @covers Aura\Uri\Path::setFormat |
* @covers Aura\Uri\Path::getFormat |
*/ |
public function testSetAndGetFormat() |
{ |
$format = '.json'; |
$this->path->setFormat($format); |
$actual = $this->path->getFormat($format); |
$this->assertSame($format, $actual); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/PublicSuffixListTest.php |
---|
@@ -0,0 +1,76 @@ |
<?php |
namespace Aura\Uri; |
class PublicSuffixListTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var \Aura\Uri\PublicSuffixList |
*/ |
protected $psl; |
protected function setUp() |
{ |
parent::setUp(); |
$file = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR |
. 'data' . DIRECTORY_SEPARATOR |
. 'public-suffix-list.php'; |
$this->psl = new PublicSuffixList(require $file); |
} |
/** |
* @dataProvider parseDataProvider |
*/ |
public function testGetPublicSuffix($url, $publicSuffix, $registerableDomain, $subdomain, $hostPart) |
{ |
$this->assertSame($publicSuffix, $this->psl->getPublicSuffix($hostPart)); |
} |
/** |
* @dataProvider parseDataProvider |
*/ |
public function testGetRegisterableDomain($url, $publicSuffix, $registerableDomain, $subdomain, $hostPart) |
{ |
$this->assertSame($registerableDomain, $this->psl->getRegisterableDomain($hostPart)); |
} |
/** |
* @dataProvider parseDataProvider |
*/ |
public function testGetSubdomain($url, $publicSuffix, $registerableDomain, $subdomain, $hostPart) |
{ |
$this->assertSame($subdomain, $this->psl->getSubdomain($hostPart)); |
} |
/** |
* @dataProvider parseDataProvider |
*/ |
public function testPHPparse_urlCanReturnCorrectHost($url, $publicSuffix, $registerableDomain, $subdomain, $hostPart) |
{ |
$this->assertEquals($hostPart, parse_url('http://' . $hostPart, PHP_URL_HOST)); |
} |
public function parseDataProvider() |
{ |
// $url, $publicSuffix, $registerableDomain, $subdomain, $hostPart |
return array( |
array('http://www.waxaudio.com.au/audio/albums/the_mashening', 'com.au', 'waxaudio.com.au', 'www', 'www.waxaudio.com.au'), |
array('example.com', 'com', 'example.com', null, 'example.com'), |
array('giant.yyyy', 'yyyy', 'giant.yyyy', null, 'giant.yyyy'), |
array('cea-law.co.il', 'co.il', 'cea-law.co.il', null, 'cea-law.co.il'), |
array('http://edition.cnn.com/WORLD/', 'com', 'cnn.com', 'edition', 'edition.cnn.com'), |
array('http://en.wikipedia.org/', 'org', 'wikipedia.org', 'en', 'en.wikipedia.org'), |
array('a.b.c.cy', 'c.cy', 'b.c.cy', 'a', 'a.b.c.cy'), |
array('https://test.k12.ak.us', 'k12.ak.us', 'test.k12.ak.us', null, 'test.k12.ak.us'), |
array('www.scottwills.co.uk', 'co.uk', 'scottwills.co.uk', 'www', 'www.scottwills.co.uk'), |
array('b.ide.kyoto.jp', 'ide.kyoto.jp', 'b.ide.kyoto.jp', null, 'b.ide.kyoto.jp'), |
array('a.b.example.uk.com', 'uk.com', 'example.uk.com', 'a.b', 'a.b.example.uk.com'), |
array('test.nic.ar', 'ar', 'nic.ar', 'test', 'test.nic.ar'), |
array('a.b.test.ck', 'test.ck', 'b.test.ck', 'a', 'a.b.test.ck'), |
array('baez.songfest.om', 'om', 'songfest.om', 'baez', 'baez.songfest.om'), |
array('politics.news.omanpost.om', 'om', 'omanpost.om', 'politics.news', 'politics.news.omanpost.om'), |
array('http://localhost', null, null, null, 'localhost'), |
); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/QueryTest.php |
---|
@@ -0,0 +1,68 @@ |
<?php |
namespace Aura\Uri; |
/** |
* Test class for Query. |
* Generated by PHPUnit on 2012-07-21 at 15:45:19. |
*/ |
class QueryTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var Query |
*/ |
protected $query; |
/** |
* Sets up the fixture, for example, opens a network connection. |
* This method is called before a test is executed. |
*/ |
protected function setUp() |
{ |
parent::setUp(); |
$this->query = new Query; |
} |
/** |
* Tears down the fixture, for example, closes a network connection. |
* This method is called after a test is executed. |
*/ |
protected function tearDown() |
{ |
parent::tearDown(); |
} |
/** |
* @covers Aura\Uri\Query::__toString |
*/ |
public function test__toString() |
{ |
$query_string = 'foo=bar&baz=dib'; |
$this->query->setFromString($query_string); |
$actual = $this->query->__toString(); |
$this->assertEquals($actual, $query_string); |
} |
/** |
* @covers Aura\Uri\Query::setFromString |
*/ |
public function testSetFromString() |
{ |
$query_string = 'foo=bar&baz=dib'; |
$this->query->setFromString($query_string); |
$actual = $this->query->getArrayCopy(); |
$expected = [ |
'foo' => 'bar', |
'baz' => 'dib', |
]; |
$this->assertEquals($actual, $expected); |
} |
public function test_deepArrays() |
{ |
$query_string = 'foo[bar]=baz&zim[gir]=dib'; |
$this->query->setFromString($query_string); |
$expect = 'foo%5Bbar%5D=baz&zim%5Bgir%5D=dib'; |
$actual = $this->query->__toString(); |
$this->assertEquals($expect, $actual); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/Url/FactoryTest.php |
---|
@@ -0,0 +1,135 @@ |
<?php |
namespace Aura\Uri\Url; |
use Aura\Uri\PublicSuffixList; |
/** |
* Test class for Factory. |
* Generated by PHPUnit on 2012-07-21 at 17:13:55. |
*/ |
class FactoryTest extends \PHPUnit_Framework_TestCase |
{ |
protected function newFactory($server = []) |
{ |
$psl = new PublicSuffixList([]); |
return new Factory($server, $psl); |
} |
/** |
* @covers Aura\Uri\Url\Factory::newInstance |
*/ |
public function testNewInstance() |
{ |
$factory = $this->newFactory([]); |
$spec = 'http://anonymous:guest@example.com/path/to/index.php/foo/bar.xml?baz=dib#anchor'; |
$url = $factory->newInstance($spec); |
$this->assertTrue($url instanceof \Aura\Uri\Url); |
} |
/** |
* @covers Aura\Uri\Url\Factory::newCurrent |
*/ |
public function testNewCurrent() |
{ |
$factory = $this->newFactory([ |
'HTTP_HOST' => 'example.com', |
'REQUEST_URI' => '/path/to/index.php/foo/bar.xml?baz=dib', |
]); |
$url = $factory->newCurrent(); |
$actual = $url->__toString(); |
$expect = 'http://example.com/path/to/index.php/foo/bar.xml?baz=dib'; |
$this->assertSame($expect, $actual); |
} |
public function testNewCurrent_https() |
{ |
$factory = $this->newFactory([ |
'HTTPS' => 'on', |
'HTTP_HOST' => 'example.com', |
'REQUEST_URI' => '/path/to/index.php/foo/bar.xml?baz=dib', |
]); |
$url = $factory->newCurrent(); |
$actual = $url->__toString(); |
$expect = 'https://example.com/path/to/index.php/foo/bar.xml?baz=dib'; |
$this->assertSame($expect, $actual); |
} |
public function testNewCurrent_ssl() |
{ |
$factory = $this->newFactory([ |
'SERVER_PORT' => '443', |
'HTTP_HOST' => 'example.com', |
'REQUEST_URI' => '/path/to/index.php/foo/bar.xml?baz=dib', |
]); |
$url = $factory->newCurrent(); |
$actual = $url->__toString(); |
$expect = 'https://example.com/path/to/index.php/foo/bar.xml?baz=dib'; |
$this->assertSame($expect, $actual); |
} |
public function testNewCurrent_noHttpHost() |
{ |
$factory = $this->newFactory([ |
'REQUEST_URI' => '/path/to/index.php/foo/bar.xml?baz=dib', |
]); |
$url = $factory->newCurrent(); |
$actual = $url->__toString(); |
$expect = ''; |
$this->assertSame($expect, $actual); |
} |
public function testNewCurrent_noRequestUri() |
{ |
$factory = $this->newFactory([ |
'HTTP_HOST' => 'example.com', |
]); |
$url = $factory->newCurrent(); |
$actual = $url->__toString(); |
$expect = 'http://example.com'; |
$this->assertSame($expect, $actual); |
} |
public function testIssue9() |
{ |
$factory = $this->newFactory([ |
'HTTP_HOST' => 'example.com', |
]); |
$string = 'http://localhost:8000/site/foo/bar'; |
$url = $factory->newInstance($string); |
$this->assertSame(array('site', 'foo', 'bar'), $url->path->getArrayCopy()); |
} |
public function testNewInstance_noScheme() |
{ |
$factory = $this->newFactory([]); |
$string = 'example.com'; |
$url = $factory->newInstance($string); |
$actual = $url->__toString(); |
$expect = 'http://example.com'; |
$this->assertSame($expect, $actual); |
} |
public function testNewInstance_schemeless() |
{ |
$factory = $this->newFactory([]); |
$string = '//example.com'; |
$url = $factory->newInstance($string); |
$actual = $url->__toString(); |
$expect = 'http://example.com'; |
$this->assertSame($expect, $actual); |
} |
public function testNewInstance_ftpUrl() |
{ |
$factory = $this->newFactory([]); |
$string = 'ftp://ftp.example.com'; |
$url = $factory->newInstance($string); |
$actual = $url->__toString(); |
$this->assertSame($string, $actual); |
} |
} |
/vendor/aura/uri/tests/Aura/Uri/UrlTest.php |
---|
@@ -0,0 +1,210 @@ |
<?php |
namespace Aura\Uri; |
use Aura\Uri\Url\Factory as UrlFactory; |
/** |
* Test class for Url. |
* Generated by PHPUnit on 2012-07-21 at 15:46:30. |
*/ |
class UrlTest extends \PHPUnit_Framework_TestCase |
{ |
/** |
* @var Url |
*/ |
protected $url; |
/** |
* @var string Url spec |
*/ |
protected $spec = 'http://anonymous:guest@example.com/path/to/index.php/foo/bar.xml?baz=dib#anchor'; |
/** |
* @var PublicSuffixList Public Suffix List |
*/ |
protected $psl; |
/** |
* Sets up the fixture, for example, opens a network connection. |
* This method is called before a test is executed. |
*/ |
protected function setUp() |
{ |
parent::setUp(); |
$file = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR |
. 'data' . DIRECTORY_SEPARATOR |
. 'public-suffix-list.php'; |
$this->psl = new PublicSuffixList(require $file); |
$factory = new UrlFactory([], $this->psl); |
$this->url = $factory->newInstance($this->spec); |
} |
/** |
* Tears down the fixture, for example, closes a network connection. |
* This method is called after a test is executed. |
*/ |
protected function tearDown() |
{ |
parent::tearDown(); |
} |
public function test__construct() |
{ |
$url = new Url( |
'http', |
'username', |
'password', |
new Host( |
$this->psl, |
[ |
'subdomain' => null, |
'registerableDomain' => 'example.com', |
'publicSuffix' => 'com' |
] |
), |
'80', |
new Path(['foo', 'bar']), |
new Query(['baz' => 'dib', 'zim' => 'gir']), |
'fragment' |
); |
$this->assertInstanceOf('Aura\Uri\Url', $url); |
} |
/** |
* @covers Aura\Uri\Url::__toString |
*/ |
public function test__toString() |
{ |
$actual = $this->url->__toString(); |
$this->assertSame($this->spec, $actual); |
} |
/** |
* @covers Aura\Uri\Url::__get |
*/ |
public function test__get() |
{ |
$expected = [ |
'scheme' => 'http', |
'user' => 'anonymous', |
'pass' => 'guest', |
'host' => 'example.com', |
'fragment' => 'anchor' |
]; |
$this->assertEquals($expected['scheme'], $this->url->scheme); |
$this->assertEquals($expected['user'], $this->url->user); |
$this->assertEquals($expected['pass'], $this->url->pass); |
$this->assertEquals($expected['host'], $this->url->host); |
$this->assertEquals($expected['fragment'], $this->url->fragment); |
} |
/** |
* @covers Aura\Uri\Url::get |
*/ |
public function testGet() |
{ |
$actual = $this->url->get(); |
$expected = '/path/to/index.php/foo/bar.xml?baz=dib#anchor'; |
$this->assertSame($expected, $actual); |
} |
/** |
* @covers Aura\Uri\Url::getFull |
*/ |
public function testGetFull() |
{ |
$actual = $this->url->getFull(); |
$this->assertSame($this->spec, $actual); |
} |
/** |
* @covers Aura\Uri\Url::getSchemeless |
*/ |
public function testGetSchemeless() |
{ |
$schemeless = substr_replace($this->spec, '', 0, 5); |
$actual = $this->url->getSchemeless(); |
$this->assertSame($schemeless, $actual); |
} |
/** |
* @covers Aura\Uri\Url::setScheme |
*/ |
public function testSetScheme() |
{ |
$scheme = 'https'; |
$this->url->setScheme($scheme); |
$this->assertSame($scheme, $this->url->scheme); |
} |
/** |
* @covers Aura\Uri\Url::setUser |
*/ |
public function testSetUser() |
{ |
$guest = 'guest'; |
$this->url->setUser($guest); |
$this->assertSame($guest, $this->url->user); |
} |
/** |
* @covers Aura\Uri\Url::setPass |
*/ |
public function testSetPass() |
{ |
$password = 'password'; |
$this->url->setPass($password); |
$this->assertSame($password, $this->url->pass); |
} |
/** |
* @covers Aura\Uri\Url::setHost |
*/ |
public function testSetHost() |
{ |
$host = new Host($this->psl); |
$this->url->setHost($host); |
$this->assertSame($host, $this->url->host); |
} |
/** |
* @covers Aura\Uri\Url::setPort |
*/ |
public function testSetPort() |
{ |
$port = '8000'; |
$this->url->setPort($port); |
$this->assertSame($port, $this->url->port); |
} |
/** |
* @covers Aura\Uri\Url::setPath |
*/ |
public function testSetPath() |
{ |
$path = new Path(); |
$this->url->setPath($path); |
$this->assertSame($path, $this->url->path); |
} |
/** |
* @covers Aura\Uri\Url::setQuery |
*/ |
public function testSetQuery() |
{ |
$query = new Query(); |
$this->url->setQuery($query); |
$this->assertSame($query, $this->url->query); |
} |
/** |
* @covers Aura\Uri\Url::setFragment |
*/ |
public function testSetFragment() |
{ |
$fragment = '#hello'; |
$this->url->setFragment($fragment); |
$this->assertSame($fragment, $this->url->fragment); |
} |
} |
/vendor/aura/uri/tests/WiringTest.php |
---|
@@ -0,0 +1,22 @@ |
<?php |
namespace Aura\Uri; |
use Aura\Framework\Test\WiringAssertionsTrait; |
class WiringTest extends \PHPUnit_Framework_TestCase |
{ |
use WiringAssertionsTrait; |
protected function setUp() |
{ |
$this->loadDi(); |
} |
public function testInstances() |
{ |
$this->assertNewInstance('Aura\Uri\PublicSuffixList'); |
$factory = $this->assertNewInstance('Aura\Uri\Url\Factory'); |
$this->assertInstanceOf('Aura\Uri\Url', $factory->newInstance('http://example.com')); |
$this->assertInstanceOf('Aura\Uri\Url', $factory->newCurrent()); |
} |
} |
/vendor/aura/uri/tests/bootstrap.php |
---|
@@ -0,0 +1,20 @@ |
<?php |
error_reporting(-1); |
ini_set('display_errors', 1); |
ini_set('display_startup_errors', 1); |
define('AURA_URI_TEST_ROOT', __DIR__); |
// preload source files |
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src.php'; |
// autoload test files |
spl_autoload_register(function($class) { |
$file = dirname(__DIR__). DIRECTORY_SEPARATOR |
. 'tests' . DIRECTORY_SEPARATOR |
. str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; |
if (file_exists($file)) { |
require $file; |
} |
}); |
/vendor/aura/uri/tests/phpunit.xml |
---|
@@ -0,0 +1,13 @@ |
<?xml version="1.0" encoding="UTF-8"?> |
<phpunit bootstrap="./bootstrap.php"> |
<testsuites> |
<testsuite> |
<directory>./Aura/Uri</directory> |
</testsuite> |
</testsuites> |
<filter> |
<whitelist> |
<directory suffix=".php">../src/Aura/Uri</directory> |
</whitelist> |
</filter> |
</phpunit> |
/vendor/symfony/filesystem/.gitignore |
---|
@@ -0,0 +1,3 @@ |
vendor/ |
composer.lock |
phpunit.xml |
/vendor/symfony/filesystem/CHANGELOG.md |
---|
@@ -0,0 +1,48 @@ |
CHANGELOG |
========= |
3.3.0 |
----- |
* added `appendToFile()` to append contents to existing files |
3.2.0 |
----- |
* added `readlink()` as a platform independent method to read links |
3.0.0 |
----- |
* removed `$mode` argument from `Filesystem::dumpFile()` |
2.8.0 |
----- |
* added tempnam() a stream aware version of PHP's native tempnam() |
2.6.0 |
----- |
* added LockHandler |
2.3.12 |
------ |
* deprecated dumpFile() file mode argument. |
2.3.0 |
----- |
* added the dumpFile() method to atomically write files |
2.2.0 |
----- |
* added a delete option for the mirror() method |
2.1.0 |
----- |
* 24eb396 : BC Break : mkdir() function now throws exception in case of failure instead of returning Boolean value |
* created the component |
/vendor/symfony/filesystem/Exception/ExceptionInterface.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Exception; |
/** |
* Exception interface for all exceptions thrown by the component. |
* |
* @author Romain Neutron <imprec@gmail.com> |
*/ |
interface ExceptionInterface |
{ |
} |
/vendor/symfony/filesystem/Exception/FileNotFoundException.php |
---|
@@ -0,0 +1,34 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Exception; |
/** |
* Exception class thrown when a file couldn't be found. |
* |
* @author Fabien Potencier <fabien@symfony.com> |
* @author Christian Gärtner <christiangaertner.film@googlemail.com> |
*/ |
class FileNotFoundException extends IOException |
{ |
public function __construct($message = null, $code = 0, \Exception $previous = null, $path = null) |
{ |
if (null === $message) { |
if (null === $path) { |
$message = 'File could not be found.'; |
} else { |
$message = sprintf('File "%s" could not be found.', $path); |
} |
} |
parent::__construct($message, $code, $previous, $path); |
} |
} |
/vendor/symfony/filesystem/Exception/IOException.php |
---|
@@ -0,0 +1,39 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Exception; |
/** |
* Exception class thrown when a filesystem operation failure happens. |
* |
* @author Romain Neutron <imprec@gmail.com> |
* @author Christian Gärtner <christiangaertner.film@googlemail.com> |
* @author Fabien Potencier <fabien@symfony.com> |
*/ |
class IOException extends \RuntimeException implements IOExceptionInterface |
{ |
private $path; |
public function __construct($message, $code = 0, \Exception $previous = null, $path = null) |
{ |
$this->path = $path; |
parent::__construct($message, $code, $previous); |
} |
/** |
* {@inheritdoc} |
*/ |
public function getPath() |
{ |
return $this->path; |
} |
} |
/vendor/symfony/filesystem/Exception/IOExceptionInterface.php |
---|
@@ -0,0 +1,27 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Exception; |
/** |
* IOException interface for file and input/output stream related exceptions thrown by the component. |
* |
* @author Christian Gärtner <christiangaertner.film@googlemail.com> |
*/ |
interface IOExceptionInterface extends ExceptionInterface |
{ |
/** |
* Returns the associated path for the exception. |
* |
* @return string The path |
*/ |
public function getPath(); |
} |
/vendor/symfony/filesystem/Filesystem.php |
---|
@@ -0,0 +1,738 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem; |
use Symfony\Component\Filesystem\Exception\IOException; |
use Symfony\Component\Filesystem\Exception\FileNotFoundException; |
/** |
* Provides basic utility to manipulate the file system. |
* |
* @author Fabien Potencier <fabien@symfony.com> |
*/ |
class Filesystem |
{ |
/** |
* Copies a file. |
* |
* If the target file is older than the origin file, it's always overwritten. |
* If the target file is newer, it is overwritten only when the |
* $overwriteNewerFiles option is set to true. |
* |
* @param string $originFile The original filename |
* @param string $targetFile The target filename |
* @param bool $overwriteNewerFiles If true, target files newer than origin files are overwritten |
* |
* @throws FileNotFoundException When originFile doesn't exist |
* @throws IOException When copy fails |
*/ |
public function copy($originFile, $targetFile, $overwriteNewerFiles = false) |
{ |
if (stream_is_local($originFile) && !is_file($originFile)) { |
throw new FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile); |
} |
$this->mkdir(dirname($targetFile)); |
$doCopy = true; |
if (!$overwriteNewerFiles && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) { |
$doCopy = filemtime($originFile) > filemtime($targetFile); |
} |
if ($doCopy) { |
// https://bugs.php.net/bug.php?id=64634 |
if (false === $source = @fopen($originFile, 'r')) { |
throw new IOException(sprintf('Failed to copy "%s" to "%s" because source file could not be opened for reading.', $originFile, $targetFile), 0, null, $originFile); |
} |
// Stream context created to allow files overwrite when using FTP stream wrapper - disabled by default |
if (false === $target = @fopen($targetFile, 'w', null, stream_context_create(array('ftp' => array('overwrite' => true))))) { |
throw new IOException(sprintf('Failed to copy "%s" to "%s" because target file could not be opened for writing.', $originFile, $targetFile), 0, null, $originFile); |
} |
$bytesCopied = stream_copy_to_stream($source, $target); |
fclose($source); |
fclose($target); |
unset($source, $target); |
if (!is_file($targetFile)) { |
throw new IOException(sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile); |
} |
// Like `cp`, preserve executable permission bits |
@chmod($targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111)); |
if (stream_is_local($originFile) && $bytesCopied !== ($bytesOrigin = filesize($originFile))) { |
throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile); |
} |
} |
} |
/** |
* Creates a directory recursively. |
* |
* @param string|array|\Traversable $dirs The directory path |
* @param int $mode The directory mode |
* |
* @throws IOException On any directory creation failure |
*/ |
public function mkdir($dirs, $mode = 0777) |
{ |
foreach ($this->toIterator($dirs) as $dir) { |
if (is_dir($dir)) { |
continue; |
} |
if (true !== @mkdir($dir, $mode, true)) { |
$error = error_get_last(); |
if (!is_dir($dir)) { |
// The directory was not created by a concurrent process. Let's throw an exception with a developer friendly error message if we have one |
if ($error) { |
throw new IOException(sprintf('Failed to create "%s": %s.', $dir, $error['message']), 0, null, $dir); |
} |
throw new IOException(sprintf('Failed to create "%s"', $dir), 0, null, $dir); |
} |
} |
} |
} |
/** |
* Checks the existence of files or directories. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to check |
* |
* @return bool true if the file exists, false otherwise |
*/ |
public function exists($files) |
{ |
foreach ($this->toIterator($files) as $file) { |
if ('\\' === DIRECTORY_SEPARATOR && strlen($file) > 258) { |
throw new IOException('Could not check if file exist because path length exceeds 258 characters.', 0, null, $file); |
} |
if (!file_exists($file)) { |
return false; |
} |
} |
return true; |
} |
/** |
* Sets access and modification time of file. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create |
* @param int $time The touch time as a Unix timestamp |
* @param int $atime The access time as a Unix timestamp |
* |
* @throws IOException When touch fails |
*/ |
public function touch($files, $time = null, $atime = null) |
{ |
foreach ($this->toIterator($files) as $file) { |
$touch = $time ? @touch($file, $time, $atime) : @touch($file); |
if (true !== $touch) { |
throw new IOException(sprintf('Failed to touch "%s".', $file), 0, null, $file); |
} |
} |
} |
/** |
* Removes files or directories. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove |
* |
* @throws IOException When removal fails |
*/ |
public function remove($files) |
{ |
if ($files instanceof \Traversable) { |
$files = iterator_to_array($files, false); |
} elseif (!is_array($files)) { |
$files = array($files); |
} |
$files = array_reverse($files); |
foreach ($files as $file) { |
if (is_link($file)) { |
// See https://bugs.php.net/52176 |
if (!@(unlink($file) || '\\' !== DIRECTORY_SEPARATOR || rmdir($file)) && file_exists($file)) { |
$error = error_get_last(); |
throw new IOException(sprintf('Failed to remove symlink "%s": %s.', $file, $error['message'])); |
} |
} elseif (is_dir($file)) { |
$this->remove(new \FilesystemIterator($file, \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::SKIP_DOTS)); |
if (!@rmdir($file) && file_exists($file)) { |
$error = error_get_last(); |
throw new IOException(sprintf('Failed to remove directory "%s": %s.', $file, $error['message'])); |
} |
} elseif (!@unlink($file) && file_exists($file)) { |
$error = error_get_last(); |
throw new IOException(sprintf('Failed to remove file "%s": %s.', $file, $error['message'])); |
} |
} |
} |
/** |
* Change mode for an array of files or directories. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change mode |
* @param int $mode The new mode (octal) |
* @param int $umask The mode mask (octal) |
* @param bool $recursive Whether change the mod recursively or not |
* |
* @throws IOException When the change fail |
*/ |
public function chmod($files, $mode, $umask = 0000, $recursive = false) |
{ |
foreach ($this->toIterator($files) as $file) { |
if (true !== @chmod($file, $mode & ~$umask)) { |
throw new IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file); |
} |
if ($recursive && is_dir($file) && !is_link($file)) { |
$this->chmod(new \FilesystemIterator($file), $mode, $umask, true); |
} |
} |
} |
/** |
* Change the owner of an array of files or directories. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner |
* @param string $user The new owner user name |
* @param bool $recursive Whether change the owner recursively or not |
* |
* @throws IOException When the change fail |
*/ |
public function chown($files, $user, $recursive = false) |
{ |
foreach ($this->toIterator($files) as $file) { |
if ($recursive && is_dir($file) && !is_link($file)) { |
$this->chown(new \FilesystemIterator($file), $user, true); |
} |
if (is_link($file) && function_exists('lchown')) { |
if (true !== @lchown($file, $user)) { |
throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file); |
} |
} else { |
if (true !== @chown($file, $user)) { |
throw new IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file); |
} |
} |
} |
} |
/** |
* Change the group of an array of files or directories. |
* |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group |
* @param string $group The group name |
* @param bool $recursive Whether change the group recursively or not |
* |
* @throws IOException When the change fail |
*/ |
public function chgrp($files, $group, $recursive = false) |
{ |
foreach ($this->toIterator($files) as $file) { |
if ($recursive && is_dir($file) && !is_link($file)) { |
$this->chgrp(new \FilesystemIterator($file), $group, true); |
} |
if (is_link($file) && function_exists('lchgrp')) { |
if (true !== @lchgrp($file, $group) || (defined('HHVM_VERSION') && !posix_getgrnam($group))) { |
throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file); |
} |
} else { |
if (true !== @chgrp($file, $group)) { |
throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file); |
} |
} |
} |
} |
/** |
* Renames a file or a directory. |
* |
* @param string $origin The origin filename or directory |
* @param string $target The new filename or directory |
* @param bool $overwrite Whether to overwrite the target if it already exists |
* |
* @throws IOException When target file or directory already exists |
* @throws IOException When origin cannot be renamed |
*/ |
public function rename($origin, $target, $overwrite = false) |
{ |
// we check that target does not exist |
if (!$overwrite && $this->isReadable($target)) { |
throw new IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target); |
} |
if (true !== @rename($origin, $target)) { |
if (is_dir($origin)) { |
// See https://bugs.php.net/bug.php?id=54097 & http://php.net/manual/en/function.rename.php#113943 |
$this->mirror($origin, $target, null, array('override' => $overwrite, 'delete' => $overwrite)); |
$this->remove($origin); |
return; |
} |
throw new IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target); |
} |
} |
/** |
* Tells whether a file exists and is readable. |
* |
* @param string $filename Path to the file |
* |
* @return bool |
* |
* @throws IOException When windows path is longer than 258 characters |
*/ |
private function isReadable($filename) |
{ |
if ('\\' === DIRECTORY_SEPARATOR && strlen($filename) > 258) { |
throw new IOException('Could not check if file is readable because path length exceeds 258 characters.', 0, null, $filename); |
} |
return is_readable($filename); |
} |
/** |
* Creates a symbolic link or copy a directory. |
* |
* @param string $originDir The origin directory path |
* @param string $targetDir The symbolic link name |
* @param bool $copyOnWindows Whether to copy files if on Windows |
* |
* @throws IOException When symlink fails |
*/ |
public function symlink($originDir, $targetDir, $copyOnWindows = false) |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$originDir = strtr($originDir, '/', '\\'); |
$targetDir = strtr($targetDir, '/', '\\'); |
if ($copyOnWindows) { |
$this->mirror($originDir, $targetDir); |
return; |
} |
} |
$this->mkdir(dirname($targetDir)); |
$ok = false; |
if (is_link($targetDir)) { |
if (readlink($targetDir) != $originDir) { |
$this->remove($targetDir); |
} else { |
$ok = true; |
} |
} |
if (!$ok && true !== @symlink($originDir, $targetDir)) { |
$this->linkException($originDir, $targetDir, 'symbolic'); |
} |
} |
/** |
* Creates a hard link, or several hard links to a file. |
* |
* @param string $originFile The original file |
* @param string|string[] $targetFiles The target file(s) |
* |
* @throws FileNotFoundException When original file is missing or not a file |
* @throws IOException When link fails, including if link already exists |
*/ |
public function hardlink($originFile, $targetFiles) |
{ |
if (!$this->exists($originFile)) { |
throw new FileNotFoundException(null, 0, null, $originFile); |
} |
if (!is_file($originFile)) { |
throw new FileNotFoundException(sprintf('Origin file "%s" is not a file', $originFile)); |
} |
foreach ($this->toIterator($targetFiles) as $targetFile) { |
if (is_file($targetFile)) { |
if (fileinode($originFile) === fileinode($targetFile)) { |
continue; |
} |
$this->remove($targetFile); |
} |
if (true !== @link($originFile, $targetFile)) { |
$this->linkException($originFile, $targetFile, 'hard'); |
} |
} |
} |
/** |
* @param string $origin |
* @param string $target |
* @param string $linkType Name of the link type, typically 'symbolic' or 'hard' |
*/ |
private function linkException($origin, $target, $linkType) |
{ |
$report = error_get_last(); |
if (is_array($report)) { |
if ('\\' === DIRECTORY_SEPARATOR && false !== strpos($report['message'], 'error code(1314)')) { |
throw new IOException(sprintf('Unable to create %s link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target); |
} |
} |
throw new IOException(sprintf('Failed to create %s link from "%s" to "%s".', $linkType, $origin, $target), 0, null, $target); |
} |
/** |
* Resolves links in paths. |
* |
* With $canonicalize = false (default) |
* - if $path does not exist or is not a link, returns null |
* - if $path is a link, returns the next direct target of the link without considering the existence of the target |
* |
* With $canonicalize = true |
* - if $path does not exist, returns null |
* - if $path exists, returns its absolute fully resolved final version |
* |
* @param string $path A filesystem path |
* @param bool $canonicalize Whether or not to return a canonicalized path |
* |
* @return string|null |
*/ |
public function readlink($path, $canonicalize = false) |
{ |
if (!$canonicalize && !is_link($path)) { |
return; |
} |
if ($canonicalize) { |
if (!$this->exists($path)) { |
return; |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
$path = readlink($path); |
} |
return realpath($path); |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
return realpath($path); |
} |
return readlink($path); |
} |
/** |
* Given an existing path, convert it to a path relative to a given starting path. |
* |
* @param string $endPath Absolute path of target |
* @param string $startPath Absolute path where traversal begins |
* |
* @return string Path of target relative to starting path |
*/ |
public function makePathRelative($endPath, $startPath) |
{ |
// Normalize separators on Windows |
if ('\\' === DIRECTORY_SEPARATOR) { |
$endPath = str_replace('\\', '/', $endPath); |
$startPath = str_replace('\\', '/', $startPath); |
} |
// Split the paths into arrays |
$startPathArr = explode('/', trim($startPath, '/')); |
$endPathArr = explode('/', trim($endPath, '/')); |
if ('/' !== $startPath[0]) { |
array_shift($startPathArr); |
} |
if ('/' !== $endPath[0]) { |
array_shift($endPathArr); |
} |
$normalizePathArray = function ($pathSegments) { |
$result = array(); |
foreach ($pathSegments as $segment) { |
if ('..' === $segment) { |
array_pop($result); |
} else { |
$result[] = $segment; |
} |
} |
return $result; |
}; |
$startPathArr = $normalizePathArray($startPathArr); |
$endPathArr = $normalizePathArray($endPathArr); |
// Find for which directory the common path stops |
$index = 0; |
while (isset($startPathArr[$index]) && isset($endPathArr[$index]) && $startPathArr[$index] === $endPathArr[$index]) { |
++$index; |
} |
// Determine how deep the start path is relative to the common path (ie, "web/bundles" = 2 levels) |
if (count($startPathArr) === 1 && $startPathArr[0] === '') { |
$depth = 0; |
} else { |
$depth = count($startPathArr) - $index; |
} |
// When we need to traverse from the start, and we are starting from a root path, don't add '../' |
if ('/' === $startPath[0] && 0 === $index && 0 === $depth) { |
$traverser = ''; |
} else { |
// Repeated "../" for each level need to reach the common path |
$traverser = str_repeat('../', $depth); |
} |
$endPathRemainder = implode('/', array_slice($endPathArr, $index)); |
// Construct $endPath from traversing to the common path, then to the remaining $endPath |
$relativePath = $traverser.('' !== $endPathRemainder ? $endPathRemainder.'/' : ''); |
return '' === $relativePath ? './' : $relativePath; |
} |
/** |
* Mirrors a directory to another. |
* |
* @param string $originDir The origin directory |
* @param string $targetDir The target directory |
* @param \Traversable $iterator A Traversable instance |
* @param array $options An array of boolean options |
* Valid options are: |
* - $options['override'] Whether to override an existing file on copy or not (see copy()) |
* - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink()) |
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false) |
* |
* @throws IOException When file type is unknown |
*/ |
public function mirror($originDir, $targetDir, \Traversable $iterator = null, $options = array()) |
{ |
$targetDir = rtrim($targetDir, '/\\'); |
$originDir = rtrim($originDir, '/\\'); |
// Iterate in destination folder to remove obsolete entries |
if ($this->exists($targetDir) && isset($options['delete']) && $options['delete']) { |
$deleteIterator = $iterator; |
if (null === $deleteIterator) { |
$flags = \FilesystemIterator::SKIP_DOTS; |
$deleteIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($targetDir, $flags), \RecursiveIteratorIterator::CHILD_FIRST); |
} |
foreach ($deleteIterator as $file) { |
$origin = str_replace($targetDir, $originDir, $file->getPathname()); |
if (!$this->exists($origin)) { |
$this->remove($file); |
} |
} |
} |
$copyOnWindows = false; |
if (isset($options['copy_on_windows'])) { |
$copyOnWindows = $options['copy_on_windows']; |
} |
if (null === $iterator) { |
$flags = $copyOnWindows ? \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS : \FilesystemIterator::SKIP_DOTS; |
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($originDir, $flags), \RecursiveIteratorIterator::SELF_FIRST); |
} |
if ($this->exists($originDir)) { |
$this->mkdir($targetDir); |
} |
foreach ($iterator as $file) { |
$target = str_replace($originDir, $targetDir, $file->getPathname()); |
if ($copyOnWindows) { |
if (is_file($file)) { |
$this->copy($file, $target, isset($options['override']) ? $options['override'] : false); |
} elseif (is_dir($file)) { |
$this->mkdir($target); |
} else { |
throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); |
} |
} else { |
if (is_link($file)) { |
$this->symlink($file->getLinkTarget(), $target); |
} elseif (is_dir($file)) { |
$this->mkdir($target); |
} elseif (is_file($file)) { |
$this->copy($file, $target, isset($options['override']) ? $options['override'] : false); |
} else { |
throw new IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file); |
} |
} |
} |
} |
/** |
* Returns whether the file path is an absolute path. |
* |
* @param string $file A file path |
* |
* @return bool |
*/ |
public function isAbsolutePath($file) |
{ |
return strspn($file, '/\\', 0, 1) |
|| (strlen($file) > 3 && ctype_alpha($file[0]) |
&& substr($file, 1, 1) === ':' |
&& strspn($file, '/\\', 2, 1) |
) |
|| null !== parse_url($file, PHP_URL_SCHEME) |
; |
} |
/** |
* Creates a temporary file with support for custom stream wrappers. |
* |
* @param string $dir The directory where the temporary filename will be created |
* @param string $prefix The prefix of the generated temporary filename |
* Note: Windows uses only the first three characters of prefix |
* |
* @return string The new temporary filename (with path), or throw an exception on failure |
*/ |
public function tempnam($dir, $prefix) |
{ |
list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir); |
// If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem |
if (null === $scheme || 'file' === $scheme || 'gs' === $scheme) { |
$tmpFile = @tempnam($hierarchy, $prefix); |
// If tempnam failed or no scheme return the filename otherwise prepend the scheme |
if (false !== $tmpFile) { |
if (null !== $scheme && 'gs' !== $scheme) { |
return $scheme.'://'.$tmpFile; |
} |
return $tmpFile; |
} |
throw new IOException('A temporary file could not be created.'); |
} |
// Loop until we create a valid temp file or have reached 10 attempts |
for ($i = 0; $i < 10; ++$i) { |
// Create a unique filename |
$tmpFile = $dir.'/'.$prefix.uniqid(mt_rand(), true); |
// Use fopen instead of file_exists as some streams do not support stat |
// Use mode 'x+' to atomically check existence and create to avoid a TOCTOU vulnerability |
$handle = @fopen($tmpFile, 'x+'); |
// If unsuccessful restart the loop |
if (false === $handle) { |
continue; |
} |
// Close the file if it was successfully opened |
@fclose($handle); |
return $tmpFile; |
} |
throw new IOException('A temporary file could not be created.'); |
} |
/** |
* Atomically dumps content into a file. |
* |
* @param string $filename The file to be written to |
* @param string $content The data to write into the file |
* |
* @throws IOException If the file cannot be written to |
*/ |
public function dumpFile($filename, $content) |
{ |
$dir = dirname($filename); |
if (!is_dir($dir)) { |
$this->mkdir($dir); |
} |
if (!is_writable($dir)) { |
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir); |
} |
// Will create a temp file with 0600 access rights |
// when the filesystem supports chmod. |
$tmpFile = $this->tempnam($dir, basename($filename)); |
if (false === @file_put_contents($tmpFile, $content)) { |
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename); |
} |
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask()); |
$this->rename($tmpFile, $filename, true); |
} |
/** |
* Appends content to an existing file. |
* |
* @param string $filename The file to which to append content |
* @param string $content The content to append |
* |
* @throws IOException If the file is not writable |
*/ |
public function appendToFile($filename, $content) |
{ |
$dir = dirname($filename); |
if (!is_dir($dir)) { |
$this->mkdir($dir); |
} |
if (!is_writable($dir)) { |
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir); |
} |
if (false === @file_put_contents($filename, $content, FILE_APPEND)) { |
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename); |
} |
} |
/** |
* @param mixed $files |
* |
* @return \Traversable |
*/ |
private function toIterator($files) |
{ |
if (!$files instanceof \Traversable) { |
$files = new \ArrayObject(is_array($files) ? $files : array($files)); |
} |
return $files; |
} |
/** |
* Gets a 2-tuple of scheme (may be null) and hierarchical part of a filename (e.g. file:///tmp -> array(file, tmp)). |
* |
* @param string $filename The filename to be parsed |
* |
* @return array The filename scheme and hierarchical part |
*/ |
private function getSchemeAndHierarchy($filename) |
{ |
$components = explode('://', $filename, 2); |
return 2 === count($components) ? array($components[0], $components[1]) : array(null, $components[0]); |
} |
} |
/vendor/symfony/filesystem/LICENSE |
---|
@@ -0,0 +1,19 @@ |
Copyright (c) 2004-2017 Fabien Potencier |
Permission is hereby granted, free of charge, to any person obtaining a copy |
of this software and associated documentation files (the "Software"), to deal |
in the Software without restriction, including without limitation the rights |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
copies of the Software, and to permit persons to whom the Software is furnished |
to do so, subject to the following conditions: |
The above copyright notice and this permission notice shall be included in all |
copies or substantial portions of the Software. |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
THE SOFTWARE. |
/vendor/symfony/filesystem/LockHandler.php |
---|
@@ -0,0 +1,115 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem; |
use Symfony\Component\Filesystem\Exception\IOException; |
/** |
* LockHandler class provides a simple abstraction to lock anything by means of |
* a file lock. |
* |
* A locked file is created based on the lock name when calling lock(). Other |
* lock handlers will not be able to lock the same name until it is released |
* (explicitly by calling release() or implicitly when the instance holding the |
* lock is destroyed). |
* |
* @author Grégoire Pineau <lyrixx@lyrixx.info> |
* @author Romain Neutron <imprec@gmail.com> |
* @author Nicolas Grekas <p@tchwork.com> |
*/ |
class LockHandler |
{ |
private $file; |
private $handle; |
/** |
* @param string $name The lock name |
* @param string|null $lockPath The directory to store the lock. Default values will use temporary directory |
* |
* @throws IOException If the lock directory could not be created or is not writable |
*/ |
public function __construct($name, $lockPath = null) |
{ |
$lockPath = $lockPath ?: sys_get_temp_dir(); |
if (!is_dir($lockPath)) { |
$fs = new Filesystem(); |
$fs->mkdir($lockPath); |
} |
if (!is_writable($lockPath)) { |
throw new IOException(sprintf('The directory "%s" is not writable.', $lockPath), 0, null, $lockPath); |
} |
$this->file = sprintf('%s/sf.%s.%s.lock', $lockPath, preg_replace('/[^a-z0-9\._-]+/i', '-', $name), hash('sha256', $name)); |
} |
/** |
* Lock the resource. |
* |
* @param bool $blocking wait until the lock is released |
* |
* @return bool Returns true if the lock was acquired, false otherwise |
* |
* @throws IOException If the lock file could not be created or opened |
*/ |
public function lock($blocking = false) |
{ |
if ($this->handle) { |
return true; |
} |
$error = null; |
// Silence error reporting |
set_error_handler(function ($errno, $msg) use (&$error) { |
$error = $msg; |
}); |
if (!$this->handle = fopen($this->file, 'r')) { |
if ($this->handle = fopen($this->file, 'x')) { |
chmod($this->file, 0444); |
} elseif (!$this->handle = fopen($this->file, 'r')) { |
usleep(100); // Give some time for chmod() to complete |
$this->handle = fopen($this->file, 'r'); |
} |
} |
restore_error_handler(); |
if (!$this->handle) { |
throw new IOException($error, 0, null, $this->file); |
} |
// On Windows, even if PHP doc says the contrary, LOCK_NB works, see |
// https://bugs.php.net/54129 |
if (!flock($this->handle, LOCK_EX | ($blocking ? 0 : LOCK_NB))) { |
fclose($this->handle); |
$this->handle = null; |
return false; |
} |
return true; |
} |
/** |
* Release the resource. |
*/ |
public function release() |
{ |
if ($this->handle) { |
flock($this->handle, LOCK_UN | LOCK_NB); |
fclose($this->handle); |
$this->handle = null; |
} |
} |
} |
/vendor/symfony/filesystem/README.md |
---|
@@ -0,0 +1,13 @@ |
Filesystem Component |
==================== |
The Filesystem component provides basic utilities for the filesystem. |
Resources |
--------- |
* [Documentation](https://symfony.com/doc/current/components/filesystem/index.html) |
* [Contributing](https://symfony.com/doc/current/contributing/index.html) |
* [Report issues](https://github.com/symfony/symfony/issues) and |
[send Pull Requests](https://github.com/symfony/symfony/pulls) |
in the [main Symfony repository](https://github.com/symfony/symfony) |
/vendor/symfony/filesystem/Tests/ExceptionTest.php |
---|
@@ -0,0 +1,47 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Filesystem\Exception\IOException; |
use Symfony\Component\Filesystem\Exception\FileNotFoundException; |
/** |
* Test class for Filesystem. |
*/ |
class ExceptionTest extends TestCase |
{ |
public function testGetPath() |
{ |
$e = new IOException('', 0, null, '/foo'); |
$this->assertEquals('/foo', $e->getPath(), 'The pass should be returned.'); |
} |
public function testGeneratedMessage() |
{ |
$e = new FileNotFoundException(null, 0, null, '/foo'); |
$this->assertEquals('/foo', $e->getPath()); |
$this->assertEquals('File "/foo" could not be found.', $e->getMessage(), 'A message should be generated.'); |
} |
public function testGeneratedMessageWithoutPath() |
{ |
$e = new FileNotFoundException(); |
$this->assertEquals('File could not be found.', $e->getMessage(), 'A message should be generated.'); |
} |
public function testCustomMessage() |
{ |
$e = new FileNotFoundException('bar', 0, null, '/foo'); |
$this->assertEquals('bar', $e->getMessage(), 'A custom message should be possible still.'); |
} |
} |
/vendor/symfony/filesystem/Tests/FilesystemTest.php |
---|
@@ -0,0 +1,1568 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Tests; |
/** |
* Test class for Filesystem. |
*/ |
class FilesystemTest extends FilesystemTestCase |
{ |
public function testCopyCreatesNewFile() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testCopyFails() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testCopyUnreadableFileFails() |
{ |
// skip test on Windows; PHP can't easily set file as unreadable on Windows |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('This test cannot run on Windows.'); |
} |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
// make sure target cannot be read |
$this->filesystem->chmod($sourceFilePath, 0222); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
} |
public function testCopyOverridesExistingFileIfModified() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
file_put_contents($targetFilePath, 'TARGET FILE'); |
touch($targetFilePath, time() - 1000); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); |
} |
public function testCopyDoesNotOverrideExistingFileByDefault() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
file_put_contents($targetFilePath, 'TARGET FILE'); |
// make sure both files have the same modification time |
$modificationTime = time() - 1000; |
touch($sourceFilePath, $modificationTime); |
touch($targetFilePath, $modificationTime); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals('TARGET FILE', file_get_contents($targetFilePath)); |
} |
public function testCopyOverridesExistingFileIfForced() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
file_put_contents($targetFilePath, 'TARGET FILE'); |
// make sure both files have the same modification time |
$modificationTime = time() - 1000; |
touch($sourceFilePath, $modificationTime); |
touch($targetFilePath, $modificationTime); |
$this->filesystem->copy($sourceFilePath, $targetFilePath, true); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testCopyWithOverrideWithReadOnlyTargetFails() |
{ |
// skip test on Windows; PHP can't easily set file as unwritable on Windows |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('This test cannot run on Windows.'); |
} |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
file_put_contents($targetFilePath, 'TARGET FILE'); |
// make sure both files have the same modification time |
$modificationTime = time() - 1000; |
touch($sourceFilePath, $modificationTime); |
touch($targetFilePath, $modificationTime); |
// make sure target is read-only |
$this->filesystem->chmod($targetFilePath, 0444); |
$this->filesystem->copy($sourceFilePath, $targetFilePath, true); |
} |
public function testCopyCreatesTargetDirectoryIfItDoesNotExist() |
{ |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFileDirectory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; |
$targetFilePath = $targetFileDirectory.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
$this->assertTrue(is_dir($targetFileDirectory)); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals('SOURCE FILE', file_get_contents($targetFilePath)); |
} |
/** |
* @group network |
*/ |
public function testCopyForOriginUrlsAndExistingLocalFileDefaultsToCopy() |
{ |
$sourceFilePath = 'http://symfony.com/images/common/logo/logo_symfony_header.png'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($targetFilePath, 'TARGET FILE'); |
$this->filesystem->copy($sourceFilePath, $targetFilePath, false); |
$this->assertFileExists($targetFilePath); |
$this->assertEquals(file_get_contents($sourceFilePath), file_get_contents($targetFilePath)); |
} |
public function testMkdirCreatesDirectoriesRecursively() |
{ |
$directory = $this->workspace |
.DIRECTORY_SEPARATOR.'directory' |
.DIRECTORY_SEPARATOR.'sub_directory'; |
$this->filesystem->mkdir($directory); |
$this->assertTrue(is_dir($directory)); |
} |
public function testMkdirCreatesDirectoriesFromArray() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
$directories = array( |
$basePath.'1', $basePath.'2', $basePath.'3', |
); |
$this->filesystem->mkdir($directories); |
$this->assertTrue(is_dir($basePath.'1')); |
$this->assertTrue(is_dir($basePath.'2')); |
$this->assertTrue(is_dir($basePath.'3')); |
} |
public function testMkdirCreatesDirectoriesFromTraversableObject() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
$directories = new \ArrayObject(array( |
$basePath.'1', $basePath.'2', $basePath.'3', |
)); |
$this->filesystem->mkdir($directories); |
$this->assertTrue(is_dir($basePath.'1')); |
$this->assertTrue(is_dir($basePath.'2')); |
$this->assertTrue(is_dir($basePath.'3')); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testMkdirCreatesDirectoriesFails() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
$dir = $basePath.'2'; |
file_put_contents($dir, ''); |
$this->filesystem->mkdir($dir); |
} |
public function testTouchCreatesEmptyFile() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.'1'; |
$this->filesystem->touch($file); |
$this->assertFileExists($file); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testTouchFails() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.'1'.DIRECTORY_SEPARATOR.'2'; |
$this->filesystem->touch($file); |
} |
public function testTouchCreatesEmptyFilesFromArray() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
$files = array( |
$basePath.'1', $basePath.'2', $basePath.'3', |
); |
$this->filesystem->touch($files); |
$this->assertFileExists($basePath.'1'); |
$this->assertFileExists($basePath.'2'); |
$this->assertFileExists($basePath.'3'); |
} |
public function testTouchCreatesEmptyFilesFromTraversableObject() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
$files = new \ArrayObject(array( |
$basePath.'1', $basePath.'2', $basePath.'3', |
)); |
$this->filesystem->touch($files); |
$this->assertFileExists($basePath.'1'); |
$this->assertFileExists($basePath.'2'); |
$this->assertFileExists($basePath.'3'); |
} |
public function testRemoveCleansFilesAndDirectoriesIteratively() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; |
mkdir($basePath); |
mkdir($basePath.'dir'); |
touch($basePath.'file'); |
$this->filesystem->remove($basePath); |
$this->assertFileNotExists($basePath); |
} |
public function testRemoveCleansArrayOfFilesAndDirectories() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
mkdir($basePath.'dir'); |
touch($basePath.'file'); |
$files = array( |
$basePath.'dir', $basePath.'file', |
); |
$this->filesystem->remove($files); |
$this->assertFileNotExists($basePath.'dir'); |
$this->assertFileNotExists($basePath.'file'); |
} |
public function testRemoveCleansTraversableObjectOfFilesAndDirectories() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
mkdir($basePath.'dir'); |
touch($basePath.'file'); |
$files = new \ArrayObject(array( |
$basePath.'dir', $basePath.'file', |
)); |
$this->filesystem->remove($files); |
$this->assertFileNotExists($basePath.'dir'); |
$this->assertFileNotExists($basePath.'file'); |
} |
public function testRemoveIgnoresNonExistingFiles() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
mkdir($basePath.'dir'); |
$files = array( |
$basePath.'dir', $basePath.'file', |
); |
$this->filesystem->remove($files); |
$this->assertFileNotExists($basePath.'dir'); |
} |
public function testRemoveCleansInvalidLinks() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; |
mkdir($basePath); |
mkdir($basePath.'dir'); |
// create symlink to nonexistent file |
@symlink($basePath.'file', $basePath.'file-link'); |
// create symlink to dir using trailing forward slash |
$this->filesystem->symlink($basePath.'dir/', $basePath.'dir-link'); |
$this->assertTrue(is_dir($basePath.'dir-link')); |
// create symlink to nonexistent dir |
rmdir($basePath.'dir'); |
$this->assertFalse('\\' === DIRECTORY_SEPARATOR ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link')); |
$this->filesystem->remove($basePath); |
$this->assertFileNotExists($basePath); |
} |
public function testFilesExists() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; |
mkdir($basePath); |
touch($basePath.'file1'); |
mkdir($basePath.'folder'); |
$this->assertTrue($this->filesystem->exists($basePath.'file1')); |
$this->assertTrue($this->filesystem->exists($basePath.'folder')); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testFilesExistsFails() |
{ |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Test covers edge case on Windows only.'); |
} |
$basePath = $this->workspace.'\\directory\\'; |
$oldPath = getcwd(); |
mkdir($basePath); |
chdir($basePath); |
$file = str_repeat('T', 259 - strlen($basePath)); |
$path = $basePath.$file; |
exec('TYPE NUL >>'.$file); // equivalent of touch, we can not use the php touch() here because it suffers from the same limitation |
$this->longPathNamesWindows[] = $path; // save this so we can clean up later |
chdir($oldPath); |
$this->filesystem->exists($path); |
} |
public function testFilesExistsTraversableObjectOfFilesAndDirectories() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
mkdir($basePath.'dir'); |
touch($basePath.'file'); |
$files = new \ArrayObject(array( |
$basePath.'dir', $basePath.'file', |
)); |
$this->assertTrue($this->filesystem->exists($files)); |
} |
public function testFilesNotExistsTraversableObjectOfFilesAndDirectories() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR; |
mkdir($basePath.'dir'); |
touch($basePath.'file'); |
touch($basePath.'file2'); |
$files = new \ArrayObject(array( |
$basePath.'dir', $basePath.'file', $basePath.'file2', |
)); |
unlink($basePath.'file'); |
$this->assertFalse($this->filesystem->exists($files)); |
} |
public function testInvalidFileNotExists() |
{ |
$basePath = $this->workspace.DIRECTORY_SEPARATOR.'directory'.DIRECTORY_SEPARATOR; |
$this->assertFalse($this->filesystem->exists($basePath.time())); |
} |
public function testChmodChangesFileMode() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$file = $dir.DIRECTORY_SEPARATOR.'file'; |
touch($file); |
$this->filesystem->chmod($file, 0400); |
$this->filesystem->chmod($dir, 0753); |
$this->assertFilePermissions(753, $dir); |
$this->assertFilePermissions(400, $file); |
} |
public function testChmodWithWrongModLeavesPreviousPermissionsUntouched() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
if (defined('HHVM_VERSION')) { |
$this->markTestSkipped('chmod() changes permissions even when passing invalid modes on HHVM'); |
} |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
touch($dir); |
$permissions = fileperms($dir); |
$this->filesystem->chmod($dir, 'Wrongmode'); |
$this->assertSame($permissions, fileperms($dir)); |
} |
public function testChmodRecursive() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$file = $dir.DIRECTORY_SEPARATOR.'file'; |
touch($file); |
$this->filesystem->chmod($file, 0400, 0000, true); |
$this->filesystem->chmod($dir, 0753, 0000, true); |
$this->assertFilePermissions(753, $dir); |
$this->assertFilePermissions(753, $file); |
} |
public function testChmodAppliesUmask() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
touch($file); |
$this->filesystem->chmod($file, 0770, 0022); |
$this->assertFilePermissions(750, $file); |
} |
public function testChmodChangesModeOfArrayOfFiles() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$directory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$files = array($directory, $file); |
mkdir($directory); |
touch($file); |
$this->filesystem->chmod($files, 0753); |
$this->assertFilePermissions(753, $file); |
$this->assertFilePermissions(753, $directory); |
} |
public function testChmodChangesModeOfTraversableFileObject() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$directory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$files = new \ArrayObject(array($directory, $file)); |
mkdir($directory); |
touch($file); |
$this->filesystem->chmod($files, 0753); |
$this->assertFilePermissions(753, $file); |
$this->assertFilePermissions(753, $directory); |
} |
public function testChmodChangesZeroModeOnSubdirectoriesOnRecursive() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$directory = $this->workspace.DIRECTORY_SEPARATOR.'directory'; |
$subdirectory = $directory.DIRECTORY_SEPARATOR.'subdirectory'; |
mkdir($directory); |
mkdir($subdirectory); |
chmod($subdirectory, 0000); |
$this->filesystem->chmod($directory, 0753, 0000, true); |
$this->assertFilePermissions(753, $subdirectory); |
} |
public function testChown() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$owner = $this->getFileOwner($dir); |
$this->filesystem->chown($dir, $owner); |
$this->assertSame($owner, $this->getFileOwner($dir)); |
} |
public function testChownRecursive() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$file = $dir.DIRECTORY_SEPARATOR.'file'; |
touch($file); |
$owner = $this->getFileOwner($dir); |
$this->filesystem->chown($dir, $owner, true); |
$this->assertSame($owner, $this->getFileOwner($file)); |
} |
public function testChownSymlink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->symlink($file, $link); |
$owner = $this->getFileOwner($link); |
$this->filesystem->chown($link, $owner); |
$this->assertSame($owner, $this->getFileOwner($link)); |
} |
public function testChownLink() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->hardlink($file, $link); |
$owner = $this->getFileOwner($link); |
$this->filesystem->chown($link, $owner); |
$this->assertSame($owner, $this->getFileOwner($link)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChownSymlinkFails() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->symlink($file, $link); |
$this->filesystem->chown($link, 'user'.time().mt_rand(1000, 9999)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChownLinkFails() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->hardlink($file, $link); |
$this->filesystem->chown($link, 'user'.time().mt_rand(1000, 9999)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChownFail() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$this->filesystem->chown($dir, 'user'.time().mt_rand(1000, 9999)); |
} |
public function testChgrp() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$group = $this->getFileGroup($dir); |
$this->filesystem->chgrp($dir, $group); |
$this->assertSame($group, $this->getFileGroup($dir)); |
} |
public function testChgrpRecursive() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$file = $dir.DIRECTORY_SEPARATOR.'file'; |
touch($file); |
$group = $this->getFileGroup($dir); |
$this->filesystem->chgrp($dir, $group, true); |
$this->assertSame($group, $this->getFileGroup($file)); |
} |
public function testChgrpSymlink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->symlink($file, $link); |
$group = $this->getFileGroup($link); |
$this->filesystem->chgrp($link, $group); |
$this->assertSame($group, $this->getFileGroup($link)); |
} |
public function testChgrpLink() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->hardlink($file, $link); |
$group = $this->getFileGroup($link); |
$this->filesystem->chgrp($link, $group); |
$this->assertSame($group, $this->getFileGroup($link)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChgrpSymlinkFails() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->symlink($file, $link); |
$this->filesystem->chgrp($link, 'user'.time().mt_rand(1000, 9999)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChgrpLinkFails() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->hardlink($file, $link); |
$this->filesystem->chgrp($link, 'user'.time().mt_rand(1000, 9999)); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testChgrpFail() |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$dir = $this->workspace.DIRECTORY_SEPARATOR.'dir'; |
mkdir($dir); |
$this->filesystem->chgrp($dir, 'user'.time().mt_rand(1000, 9999)); |
} |
public function testRename() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; |
touch($file); |
$this->filesystem->rename($file, $newPath); |
$this->assertFileNotExists($file); |
$this->assertFileExists($newPath); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testRenameThrowsExceptionIfTargetAlreadyExists() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; |
touch($file); |
touch($newPath); |
$this->filesystem->rename($file, $newPath); |
} |
public function testRenameOverwritesTheTargetIfItAlreadyExists() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; |
touch($file); |
touch($newPath); |
$this->filesystem->rename($file, $newPath, true); |
$this->assertFileNotExists($file); |
$this->assertFileExists($newPath); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testRenameThrowsExceptionOnError() |
{ |
$file = $this->workspace.DIRECTORY_SEPARATOR.uniqid('fs_test_', true); |
$newPath = $this->workspace.DIRECTORY_SEPARATOR.'new_file'; |
$this->filesystem->rename($file, $newPath); |
} |
public function testSymlink() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support creating "broken" symlinks'); |
} |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
// $file does not exists right now: creating "broken" links is a wanted feature |
$this->filesystem->symlink($file, $link); |
$this->assertTrue(is_link($link)); |
// Create the linked file AFTER creating the link |
touch($file); |
$this->assertEquals($file, readlink($link)); |
} |
/** |
* @depends testSymlink |
*/ |
public function testRemoveSymlink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
$this->filesystem->remove($link); |
$this->assertTrue(!is_link($link)); |
$this->assertTrue(!is_file($link)); |
$this->assertTrue(!is_dir($link)); |
} |
public function testSymlinkIsOverwrittenIfPointsToDifferentTarget() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
symlink($this->workspace, $link); |
$this->filesystem->symlink($file, $link); |
$this->assertTrue(is_link($link)); |
$this->assertEquals($file, readlink($link)); |
} |
public function testSymlinkIsNotOverwrittenIfAlreadyCreated() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
symlink($file, $link); |
$this->filesystem->symlink($file, $link); |
$this->assertTrue(is_link($link)); |
$this->assertEquals($file, readlink($link)); |
} |
public function testSymlinkCreatesTargetDirectoryIfItDoesNotExist() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link1 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'link'; |
$link2 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'subdir'.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->symlink($file, $link1); |
$this->filesystem->symlink($file, $link2); |
$this->assertTrue(is_link($link1)); |
$this->assertEquals($file, readlink($link1)); |
$this->assertTrue(is_link($link2)); |
$this->assertEquals($file, readlink($link2)); |
} |
public function testLink() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
$this->filesystem->hardlink($file, $link); |
$this->assertTrue(is_file($link)); |
$this->assertEquals(fileinode($file), fileinode($link)); |
} |
/** |
* @depends testLink |
*/ |
public function testRemoveLink() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
$this->filesystem->remove($link); |
$this->assertTrue(!is_file($link)); |
} |
public function testLinkIsOverwrittenIfPointsToDifferentTarget() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$file2 = $this->workspace.DIRECTORY_SEPARATOR.'file2'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
touch($file2); |
link($file2, $link); |
$this->filesystem->hardlink($file, $link); |
$this->assertTrue(is_file($link)); |
$this->assertEquals(fileinode($file), fileinode($link)); |
} |
public function testLinkIsNotOverwrittenIfAlreadyCreated() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
link($file, $link); |
$this->filesystem->hardlink($file, $link); |
$this->assertTrue(is_file($link)); |
$this->assertEquals(fileinode($file), fileinode($link)); |
} |
public function testLinkWithSeveralTargets() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link1 = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
$link2 = $this->workspace.DIRECTORY_SEPARATOR.'link2'; |
touch($file); |
$this->filesystem->hardlink($file, array($link1, $link2)); |
$this->assertTrue(is_file($link1)); |
$this->assertEquals(fileinode($file), fileinode($link1)); |
$this->assertTrue(is_file($link2)); |
$this->assertEquals(fileinode($file), fileinode($link2)); |
} |
public function testLinkWithSameTarget() |
{ |
$this->markAsSkippedIfLinkIsMissing(); |
$file = $this->workspace.DIRECTORY_SEPARATOR.'file'; |
$link = $this->workspace.DIRECTORY_SEPARATOR.'link'; |
touch($file); |
// practically same as testLinkIsNotOverwrittenIfAlreadyCreated |
$this->filesystem->hardlink($file, array($link, $link)); |
$this->assertTrue(is_file($link)); |
$this->assertEquals(fileinode($file), fileinode($link)); |
} |
public function testReadRelativeLink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Relative symbolic links are not supported on Windows'); |
} |
$file = $this->workspace.'/file'; |
$link1 = $this->workspace.'/dir/link'; |
$link2 = $this->workspace.'/dir/link2'; |
touch($file); |
$this->filesystem->symlink('../file', $link1); |
$this->filesystem->symlink('link', $link2); |
$this->assertEquals($this->normalize('../file'), $this->filesystem->readlink($link1)); |
$this->assertEquals('link', $this->filesystem->readlink($link2)); |
$this->assertEquals($file, $this->filesystem->readlink($link1, true)); |
$this->assertEquals($file, $this->filesystem->readlink($link2, true)); |
$this->assertEquals($file, $this->filesystem->readlink($file, true)); |
} |
public function testReadAbsoluteLink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->normalize($this->workspace.'/file'); |
$link1 = $this->normalize($this->workspace.'/dir/link'); |
$link2 = $this->normalize($this->workspace.'/dir/link2'); |
touch($file); |
$this->filesystem->symlink($file, $link1); |
$this->filesystem->symlink($link1, $link2); |
$this->assertEquals($file, $this->filesystem->readlink($link1)); |
$this->assertEquals($link1, $this->filesystem->readlink($link2)); |
$this->assertEquals($file, $this->filesystem->readlink($link1, true)); |
$this->assertEquals($file, $this->filesystem->readlink($link2, true)); |
$this->assertEquals($file, $this->filesystem->readlink($file, true)); |
} |
public function testReadBrokenLink() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support creating "broken" symlinks'); |
} |
$file = $this->workspace.'/file'; |
$link = $this->workspace.'/link'; |
$this->filesystem->symlink($file, $link); |
$this->assertEquals($file, $this->filesystem->readlink($link)); |
$this->assertNull($this->filesystem->readlink($link, true)); |
touch($file); |
$this->assertEquals($file, $this->filesystem->readlink($link, true)); |
} |
public function testReadLinkDefaultPathDoesNotExist() |
{ |
$this->assertNull($this->filesystem->readlink($this->normalize($this->workspace.'/invalid'))); |
} |
public function testReadLinkDefaultPathNotLink() |
{ |
$file = $this->normalize($this->workspace.'/file'); |
touch($file); |
$this->assertNull($this->filesystem->readlink($file)); |
} |
public function testReadLinkCanonicalizePath() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$file = $this->normalize($this->workspace.'/file'); |
mkdir($this->normalize($this->workspace.'/dir')); |
touch($file); |
$this->assertEquals($file, $this->filesystem->readlink($this->normalize($this->workspace.'/dir/../file'), true)); |
} |
public function testReadLinkCanonicalizedPathDoesNotExist() |
{ |
$this->assertNull($this->filesystem->readlink($this->normalize($this->workspace.'invalid'), true)); |
} |
/** |
* @dataProvider providePathsForMakePathRelative |
*/ |
public function testMakePathRelative($endPath, $startPath, $expectedPath) |
{ |
$path = $this->filesystem->makePathRelative($endPath, $startPath); |
$this->assertEquals($expectedPath, $path); |
} |
/** |
* @return array |
*/ |
public function providePathsForMakePathRelative() |
{ |
$paths = array( |
array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component', '../'), |
array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/src/Symfony/Component/', '../'), |
array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component', '../'), |
array('/var/lib/symfony/src/Symfony', '/var/lib/symfony/src/Symfony/Component/', '../'), |
array('var/lib/symfony/', 'var/lib/symfony/src/Symfony/Component', '../../../'), |
array('/usr/lib/symfony/', '/var/lib/symfony/src/Symfony/Component', '../../../../../../usr/lib/symfony/'), |
array('/var/lib/symfony/src/Symfony/', '/var/lib/symfony/', 'src/Symfony/'), |
array('/aa/bb', '/aa/bb', './'), |
array('/aa/bb', '/aa/bb/', './'), |
array('/aa/bb/', '/aa/bb', './'), |
array('/aa/bb/', '/aa/bb/', './'), |
array('/aa/bb/cc', '/aa/bb/cc/dd', '../'), |
array('/aa/bb/cc', '/aa/bb/cc/dd/', '../'), |
array('/aa/bb/cc/', '/aa/bb/cc/dd', '../'), |
array('/aa/bb/cc/', '/aa/bb/cc/dd/', '../'), |
array('/aa/bb/cc', '/aa', 'bb/cc/'), |
array('/aa/bb/cc', '/aa/', 'bb/cc/'), |
array('/aa/bb/cc/', '/aa', 'bb/cc/'), |
array('/aa/bb/cc/', '/aa/', 'bb/cc/'), |
array('/a/aab/bb', '/a/aa', '../aab/bb/'), |
array('/a/aab/bb', '/a/aa/', '../aab/bb/'), |
array('/a/aab/bb/', '/a/aa', '../aab/bb/'), |
array('/a/aab/bb/', '/a/aa/', '../aab/bb/'), |
array('/a/aab/bb/', '/', 'a/aab/bb/'), |
array('/a/aab/bb/', '/b/aab', '../../a/aab/bb/'), |
array('/aab/bb', '/aa', '../aab/bb/'), |
array('/aab', '/aa', '../aab/'), |
array('/aa/bb/cc', '/aa/dd/..', 'bb/cc/'), |
array('/aa/../bb/cc', '/aa/dd/..', '../bb/cc/'), |
array('/aa/bb/../../cc', '/aa/../dd/..', 'cc/'), |
array('/../aa/bb/cc', '/aa/dd/..', 'bb/cc/'), |
array('/../../aa/../bb/cc', '/aa/dd/..', '../bb/cc/'), |
array('C:/aa/bb/cc', 'C:/aa/dd/..', 'bb/cc/'), |
array('c:/aa/../bb/cc', 'c:/aa/dd/..', '../bb/cc/'), |
array('C:/aa/bb/../../cc', 'C:/aa/../dd/..', 'cc/'), |
array('C:/../aa/bb/cc', 'C:/aa/dd/..', 'bb/cc/'), |
array('C:/../../aa/../bb/cc', 'C:/aa/dd/..', '../bb/cc/'), |
); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$paths[] = array('c:\var\lib/symfony/src/Symfony/', 'c:/var/lib/symfony/', 'src/Symfony/'); |
} |
return $paths; |
} |
public function testMirrorCopiesFilesAndDirectoriesRecursively() |
{ |
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; |
$directory = $sourcePath.'directory'.DIRECTORY_SEPARATOR; |
$file1 = $directory.'file1'; |
$file2 = $sourcePath.'file2'; |
mkdir($sourcePath); |
mkdir($directory); |
file_put_contents($file1, 'FILE1'); |
file_put_contents($file2, 'FILE2'); |
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; |
$this->filesystem->mirror($sourcePath, $targetPath); |
$this->assertTrue(is_dir($targetPath)); |
$this->assertTrue(is_dir($targetPath.'directory')); |
$this->assertFileEquals($file1, $targetPath.'directory'.DIRECTORY_SEPARATOR.'file1'); |
$this->assertFileEquals($file2, $targetPath.'file2'); |
$this->filesystem->remove($file1); |
$this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => false)); |
$this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); |
$this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); |
$this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); |
file_put_contents($file1, 'FILE1'); |
$this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); |
$this->assertTrue($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); |
$this->filesystem->remove($directory); |
$this->filesystem->mirror($sourcePath, $targetPath, null, array('delete' => true)); |
$this->assertFalse($this->filesystem->exists($targetPath.'directory')); |
$this->assertFalse($this->filesystem->exists($targetPath.'directory'.DIRECTORY_SEPARATOR.'file1')); |
} |
public function testMirrorCreatesEmptyDirectory() |
{ |
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; |
mkdir($sourcePath); |
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; |
$this->filesystem->mirror($sourcePath, $targetPath); |
$this->assertTrue(is_dir($targetPath)); |
$this->filesystem->remove($sourcePath); |
} |
public function testMirrorCopiesLinks() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(); |
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; |
mkdir($sourcePath); |
file_put_contents($sourcePath.'file1', 'FILE1'); |
symlink($sourcePath.'file1', $sourcePath.'link1'); |
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; |
$this->filesystem->mirror($sourcePath, $targetPath); |
$this->assertTrue(is_dir($targetPath)); |
$this->assertFileEquals($sourcePath.'file1', $targetPath.'link1'); |
$this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); |
} |
public function testMirrorCopiesLinkedDirectoryContents() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(true); |
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; |
mkdir($sourcePath.'nested/', 0777, true); |
file_put_contents($sourcePath.'/nested/file1.txt', 'FILE1'); |
// Note: We symlink directory, not file |
symlink($sourcePath.'nested', $sourcePath.'link1'); |
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; |
$this->filesystem->mirror($sourcePath, $targetPath); |
$this->assertTrue(is_dir($targetPath)); |
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.'link1/file1.txt'); |
$this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); |
} |
public function testMirrorCopiesRelativeLinkedContents() |
{ |
$this->markAsSkippedIfSymlinkIsMissing(true); |
$sourcePath = $this->workspace.DIRECTORY_SEPARATOR.'source'.DIRECTORY_SEPARATOR; |
$oldPath = getcwd(); |
mkdir($sourcePath.'nested/', 0777, true); |
file_put_contents($sourcePath.'/nested/file1.txt', 'FILE1'); |
// Note: Create relative symlink |
chdir($sourcePath); |
symlink('nested', 'link1'); |
chdir($oldPath); |
$targetPath = $this->workspace.DIRECTORY_SEPARATOR.'target'.DIRECTORY_SEPARATOR; |
$this->filesystem->mirror($sourcePath, $targetPath); |
$this->assertTrue(is_dir($targetPath)); |
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.'link1/file1.txt'); |
$this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1')); |
$this->assertEquals('\\' === DIRECTORY_SEPARATOR ? realpath($sourcePath.'\nested') : 'nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1')); |
} |
/** |
* @dataProvider providePathsForIsAbsolutePath |
*/ |
public function testIsAbsolutePath($path, $expectedResult) |
{ |
$result = $this->filesystem->isAbsolutePath($path); |
$this->assertEquals($expectedResult, $result); |
} |
/** |
* @return array |
*/ |
public function providePathsForIsAbsolutePath() |
{ |
return array( |
array('/var/lib', true), |
array('c:\\\\var\\lib', true), |
array('\\var\\lib', true), |
array('var/lib', false), |
array('../var/lib', false), |
array('', false), |
array(null, false), |
); |
} |
public function testTempnam() |
{ |
$dirname = $this->workspace; |
$filename = $this->filesystem->tempnam($dirname, 'foo'); |
$this->assertFileExists($filename); |
} |
public function testTempnamWithFileScheme() |
{ |
$scheme = 'file://'; |
$dirname = $scheme.$this->workspace; |
$filename = $this->filesystem->tempnam($dirname, 'foo'); |
$this->assertStringStartsWith($scheme, $filename); |
$this->assertFileExists($filename); |
} |
public function testTempnamWithMockScheme() |
{ |
stream_wrapper_register('mock', 'Symfony\Component\Filesystem\Tests\Fixtures\MockStream\MockStream'); |
$scheme = 'mock://'; |
$dirname = $scheme.$this->workspace; |
$filename = $this->filesystem->tempnam($dirname, 'foo'); |
$this->assertStringStartsWith($scheme, $filename); |
$this->assertFileExists($filename); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testTempnamWithZlibSchemeFails() |
{ |
$scheme = 'compress.zlib://'; |
$dirname = $scheme.$this->workspace; |
// The compress.zlib:// stream does not support mode x: creates the file, errors "failed to open stream: operation failed" and returns false |
$this->filesystem->tempnam($dirname, 'bar'); |
} |
public function testTempnamWithPHPTempSchemeFails() |
{ |
$scheme = 'php://temp'; |
$dirname = $scheme; |
$filename = $this->filesystem->tempnam($dirname, 'bar'); |
$this->assertStringStartsWith($scheme, $filename); |
// The php://temp stream deletes the file after close |
$this->assertFileNotExists($filename); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testTempnamWithPharSchemeFails() |
{ |
// Skip test if Phar disabled phar.readonly must be 0 in php.ini |
if (!\Phar::canWrite()) { |
$this->markTestSkipped('This test cannot run when phar.readonly is 1.'); |
} |
$scheme = 'phar://'; |
$dirname = $scheme.$this->workspace; |
$pharname = 'foo.phar'; |
new \Phar($this->workspace.'/'.$pharname, 0, $pharname); |
// The phar:// stream does not support mode x: fails to create file, errors "failed to open stream: phar error: "$filename" is not a file in phar "$pharname"" and returns false |
$this->filesystem->tempnam($dirname, $pharname.'/bar'); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
*/ |
public function testTempnamWithHTTPSchemeFails() |
{ |
$scheme = 'http://'; |
$dirname = $scheme.$this->workspace; |
// The http:// scheme is read-only |
$this->filesystem->tempnam($dirname, 'bar'); |
} |
public function testTempnamOnUnwritableFallsBackToSysTmp() |
{ |
$scheme = 'file://'; |
$dirname = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'does_not_exist'; |
$filename = $this->filesystem->tempnam($dirname, 'bar'); |
$realTempDir = realpath(sys_get_temp_dir()); |
$this->assertStringStartsWith(rtrim($scheme.$realTempDir, DIRECTORY_SEPARATOR), $filename); |
$this->assertFileExists($filename); |
// Tear down |
@unlink($filename); |
} |
public function testDumpFile() |
{ |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$oldMask = umask(0002); |
} |
$this->filesystem->dumpFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('bar', file_get_contents($filename)); |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$this->assertFilePermissions(664, $filename); |
umask($oldMask); |
} |
} |
public function testDumpFileOverwritesAnExistingFile() |
{ |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo.txt'; |
file_put_contents($filename, 'FOO BAR'); |
$this->filesystem->dumpFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('bar', file_get_contents($filename)); |
} |
public function testDumpFileWithFileScheme() |
{ |
if (defined('HHVM_VERSION')) { |
$this->markTestSkipped('HHVM does not handle the file:// scheme correctly'); |
} |
$scheme = 'file://'; |
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; |
$this->filesystem->dumpFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('bar', file_get_contents($filename)); |
} |
public function testDumpFileWithZlibScheme() |
{ |
$scheme = 'compress.zlib://'; |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; |
$this->filesystem->dumpFile($filename, 'bar'); |
// Zlib stat uses file:// wrapper so remove scheme |
$this->assertFileExists(str_replace($scheme, '', $filename)); |
$this->assertSame('bar', file_get_contents($filename)); |
} |
public function testAppendToFile() |
{ |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.txt'; |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$oldMask = umask(0002); |
} |
$this->filesystem->dumpFile($filename, 'foo'); |
$this->filesystem->appendToFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('foobar', file_get_contents($filename)); |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$this->assertFilePermissions(664, $filename, 'The written file should keep the same permissions as before.'); |
umask($oldMask); |
} |
} |
public function testAppendToFileWithScheme() |
{ |
if (defined('HHVM_VERSION')) { |
$this->markTestSkipped('HHVM does not handle the file:// scheme correctly'); |
} |
$scheme = 'file://'; |
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; |
$this->filesystem->dumpFile($filename, 'foo'); |
$this->filesystem->appendToFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('foobar', file_get_contents($filename)); |
} |
public function testAppendToFileWithZlibScheme() |
{ |
$scheme = 'compress.zlib://'; |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt'; |
$this->filesystem->dumpFile($filename, 'foo'); |
// Zlib stat uses file:// wrapper so remove it |
$this->assertSame('foo', file_get_contents(str_replace($scheme, '', $filename))); |
$this->filesystem->appendToFile($filename, 'bar'); |
$this->assertFileExists($filename); |
$this->assertSame('foobar', file_get_contents($filename)); |
} |
public function testAppendToFileCreateTheFileIfNotExists() |
{ |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.txt'; |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$oldMask = umask(0002); |
} |
$this->filesystem->appendToFile($filename, 'bar'); |
// skip mode check on Windows |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$this->assertFilePermissions(664, $filename); |
umask($oldMask); |
} |
$this->assertFileExists($filename); |
$this->assertSame('bar', file_get_contents($filename)); |
} |
public function testDumpKeepsExistingPermissionsWhenOverwritingAnExistingFile() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$filename = $this->workspace.DIRECTORY_SEPARATOR.'foo.txt'; |
file_put_contents($filename, 'FOO BAR'); |
chmod($filename, 0745); |
$this->filesystem->dumpFile($filename, 'bar', null); |
$this->assertFilePermissions(745, $filename); |
} |
public function testCopyShouldKeepExecutionPermission() |
{ |
$this->markAsSkippedIfChmodIsMissing(); |
$sourceFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_source_file'; |
$targetFilePath = $this->workspace.DIRECTORY_SEPARATOR.'copy_target_file'; |
file_put_contents($sourceFilePath, 'SOURCE FILE'); |
chmod($sourceFilePath, 0745); |
$this->filesystem->copy($sourceFilePath, $targetFilePath); |
$this->assertFilePermissions(767, $targetFilePath); |
} |
/** |
* Normalize the given path (transform each blackslash into a real directory separator). |
* |
* @param string $path |
* |
* @return string |
*/ |
private function normalize($path) |
{ |
return str_replace('/', DIRECTORY_SEPARATOR, $path); |
} |
} |
/vendor/symfony/filesystem/Tests/FilesystemTestCase.php |
---|
@@ -0,0 +1,166 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Filesystem\Filesystem; |
class FilesystemTestCase extends TestCase |
{ |
private $umask; |
protected $longPathNamesWindows = array(); |
/** |
* @var \Symfony\Component\Filesystem\Filesystem |
*/ |
protected $filesystem = null; |
/** |
* @var string |
*/ |
protected $workspace = null; |
/** |
* @var null|bool Flag for hard links on Windows |
*/ |
private static $linkOnWindows = null; |
/** |
* @var null|bool Flag for symbolic links on Windows |
*/ |
private static $symlinkOnWindows = null; |
public static function setUpBeforeClass() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
self::$linkOnWindows = true; |
$originFile = tempnam(sys_get_temp_dir(), 'li'); |
$targetFile = tempnam(sys_get_temp_dir(), 'li'); |
if (true !== @link($originFile, $targetFile)) { |
$report = error_get_last(); |
if (is_array($report) && false !== strpos($report['message'], 'error code(1314)')) { |
self::$linkOnWindows = false; |
} |
} else { |
@unlink($targetFile); |
} |
self::$symlinkOnWindows = true; |
$originDir = tempnam(sys_get_temp_dir(), 'sl'); |
$targetDir = tempnam(sys_get_temp_dir(), 'sl'); |
if (true !== @symlink($originDir, $targetDir)) { |
$report = error_get_last(); |
if (is_array($report) && false !== strpos($report['message'], 'error code(1314)')) { |
self::$symlinkOnWindows = false; |
} |
} else { |
@unlink($targetDir); |
} |
} |
} |
protected function setUp() |
{ |
$this->umask = umask(0); |
$this->filesystem = new Filesystem(); |
$this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand(); |
mkdir($this->workspace, 0777, true); |
$this->workspace = realpath($this->workspace); |
} |
protected function tearDown() |
{ |
if (!empty($this->longPathNamesWindows)) { |
foreach ($this->longPathNamesWindows as $path) { |
exec('DEL '.$path); |
} |
$this->longPathNamesWindows = array(); |
} |
$this->filesystem->remove($this->workspace); |
umask($this->umask); |
} |
/** |
* @param int $expectedFilePerms expected file permissions as three digits (i.e. 755) |
* @param string $filePath |
*/ |
protected function assertFilePermissions($expectedFilePerms, $filePath) |
{ |
$actualFilePerms = (int) substr(sprintf('%o', fileperms($filePath)), -3); |
$this->assertEquals( |
$expectedFilePerms, |
$actualFilePerms, |
sprintf('File permissions for %s must be %s. Actual %s', $filePath, $expectedFilePerms, $actualFilePerms) |
); |
} |
protected function getFileOwner($filepath) |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$infos = stat($filepath); |
if ($datas = posix_getpwuid($infos['uid'])) { |
return $datas['name']; |
} |
} |
protected function getFileGroup($filepath) |
{ |
$this->markAsSkippedIfPosixIsMissing(); |
$infos = stat($filepath); |
if ($datas = posix_getgrgid($infos['gid'])) { |
return $datas['name']; |
} |
$this->markTestSkipped('Unable to retrieve file group name'); |
} |
protected function markAsSkippedIfLinkIsMissing() |
{ |
if (!function_exists('link')) { |
$this->markTestSkipped('link is not supported'); |
} |
if ('\\' === DIRECTORY_SEPARATOR && false === self::$linkOnWindows) { |
$this->markTestSkipped('link requires "Create hard links" privilege on windows'); |
} |
} |
protected function markAsSkippedIfSymlinkIsMissing($relative = false) |
{ |
if ('\\' === DIRECTORY_SEPARATOR && false === self::$symlinkOnWindows) { |
$this->markTestSkipped('symlink requires "Create symbolic links" privilege on Windows'); |
} |
// https://bugs.php.net/bug.php?id=69473 |
if ($relative && '\\' === DIRECTORY_SEPARATOR && 1 === PHP_ZTS) { |
$this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions'); |
} |
} |
protected function markAsSkippedIfChmodIsMissing() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('chmod is not supported on Windows'); |
} |
} |
protected function markAsSkippedIfPosixIsMissing() |
{ |
if (!function_exists('posix_isatty')) { |
$this->markTestSkipped('Function posix_isatty is required.'); |
} |
} |
} |
/vendor/symfony/filesystem/Tests/Fixtures/MockStream/MockStream.php |
---|
@@ -0,0 +1,46 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Tests\Fixtures\MockStream; |
/** |
* Mock stream class to be used with stream_wrapper_register. |
* stream_wrapper_register('mock', 'Symfony\Component\Filesystem\Tests\Fixtures\MockStream\MockStream'). |
*/ |
class MockStream |
{ |
/** |
* Opens file or URL. |
* |
* @param string $path Specifies the URL that was passed to the original function |
* @param string $mode The mode used to open the file, as detailed for fopen() |
* @param int $options Holds additional flags set by the streams API |
* @param string $opened_path If the path is opened successfully, and STREAM_USE_PATH is set in options, |
* opened_path should be set to the full path of the file/resource that was actually opened |
* |
* @return bool |
*/ |
public function stream_open($path, $mode, $options, &$opened_path) |
{ |
return true; |
} |
/** |
* @param string $path The file path or URL to stat |
* @param array $flags Holds additional flags set by the streams API |
* |
* @return array File stats |
*/ |
public function url_stat($path, $flags) |
{ |
return array(); |
} |
} |
/vendor/symfony/filesystem/Tests/LockHandlerTest.php |
---|
@@ -0,0 +1,141 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Filesystem\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Filesystem\Exception\IOException; |
use Symfony\Component\Filesystem\Filesystem; |
use Symfony\Component\Filesystem\LockHandler; |
class LockHandlerTest extends TestCase |
{ |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
* @expectedExceptionMessage Failed to create "/a/b/c/d/e": mkdir(): Permission denied. |
*/ |
public function testConstructWhenRepositoryDoesNotExist() |
{ |
if (!getenv('USER') || 'root' === getenv('USER')) { |
$this->markTestSkipped('This test will fail if run under superuser'); |
} |
new LockHandler('lock', '/a/b/c/d/e'); |
} |
/** |
* @expectedException \Symfony\Component\Filesystem\Exception\IOException |
* @expectedExceptionMessage The directory "/" is not writable. |
*/ |
public function testConstructWhenRepositoryIsNotWriteable() |
{ |
if (!getenv('USER') || 'root' === getenv('USER')) { |
$this->markTestSkipped('This test will fail if run under superuser'); |
} |
new LockHandler('lock', '/'); |
} |
public function testErrorHandlingInLockIfLockPathBecomesUnwritable() |
{ |
// skip test on Windows; PHP can't easily set file as unreadable on Windows |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('This test cannot run on Windows.'); |
} |
$lockPath = sys_get_temp_dir().'/'.uniqid('', true); |
$e = null; |
$wrongMessage = null; |
try { |
mkdir($lockPath); |
$lockHandler = new LockHandler('lock', $lockPath); |
chmod($lockPath, 0444); |
$lockHandler->lock(); |
} catch (IOException $e) { |
if (false === strpos($e->getMessage(), 'Permission denied')) { |
$wrongMessage = $e->getMessage(); |
} else { |
$this->addToAssertionCount(1); |
} |
} catch (\Exception $e) { |
} catch (\Throwable $e) { |
} |
if (is_dir($lockPath)) { |
$fs = new Filesystem(); |
$fs->remove($lockPath); |
} |
$this->assertInstanceOf('Symfony\Component\Filesystem\Exception\IOException', $e, sprintf('Expected IOException to be thrown, got %s instead.', get_class($e))); |
$this->assertNull($wrongMessage, sprintf('Expected exception message to contain "Permission denied", got "%s" instead.', $wrongMessage)); |
} |
public function testConstructSanitizeName() |
{ |
$lock = new LockHandler('<?php echo "% hello word ! %" ?>'); |
$file = sprintf('%s/sf.-php-echo-hello-word-.4b3d9d0d27ddef3a78a64685dda3a963e478659a9e5240feaf7b4173a8f28d5f.lock', sys_get_temp_dir()); |
// ensure the file does not exist before the lock |
@unlink($file); |
$lock->lock(); |
$this->assertFileExists($file); |
$lock->release(); |
} |
public function testLockRelease() |
{ |
$name = 'symfony-test-filesystem.lock'; |
$l1 = new LockHandler($name); |
$l2 = new LockHandler($name); |
$this->assertTrue($l1->lock()); |
$this->assertFalse($l2->lock()); |
$l1->release(); |
$this->assertTrue($l2->lock()); |
$l2->release(); |
} |
public function testLockTwice() |
{ |
$name = 'symfony-test-filesystem.lock'; |
$lockHandler = new LockHandler($name); |
$this->assertTrue($lockHandler->lock()); |
$this->assertTrue($lockHandler->lock()); |
$lockHandler->release(); |
} |
public function testLockIsReleased() |
{ |
$name = 'symfony-test-filesystem.lock'; |
$l1 = new LockHandler($name); |
$l2 = new LockHandler($name); |
$this->assertTrue($l1->lock()); |
$this->assertFalse($l2->lock()); |
$l1 = null; |
$this->assertTrue($l2->lock()); |
$l2->release(); |
} |
} |
/vendor/symfony/filesystem/composer.json |
---|
@@ -0,0 +1,33 @@ |
{ |
"name": "symfony/filesystem", |
"type": "library", |
"description": "Symfony Filesystem Component", |
"keywords": [], |
"homepage": "https://symfony.com", |
"license": "MIT", |
"authors": [ |
{ |
"name": "Fabien Potencier", |
"email": "fabien@symfony.com" |
}, |
{ |
"name": "Symfony Community", |
"homepage": "https://symfony.com/contributors" |
} |
], |
"require": { |
"php": ">=5.5.9" |
}, |
"autoload": { |
"psr-4": { "Symfony\\Component\\Filesystem\\": "" }, |
"exclude-from-classmap": [ |
"/Tests/" |
] |
}, |
"minimum-stability": "dev", |
"extra": { |
"branch-alias": { |
"dev-master": "3.3-dev" |
} |
} |
} |
/vendor/symfony/filesystem/phpunit.xml.dist |
---|
@@ -0,0 +1,30 @@ |
<?xml version="1.0" encoding="UTF-8"?> |
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" |
backupGlobals="false" |
colors="true" |
bootstrap="vendor/autoload.php" |
failOnRisky="true" |
failOnWarning="true" |
> |
<php> |
<ini name="error_reporting" value="-1" /> |
</php> |
<testsuites> |
<testsuite name="Symfony Filesystem Component Test Suite"> |
<directory>./Tests/</directory> |
</testsuite> |
</testsuites> |
<filter> |
<whitelist> |
<directory>./</directory> |
<exclude> |
<directory>./Tests</directory> |
<directory>./vendor</directory> |
</exclude> |
</whitelist> |
</filter> |
</phpunit> |
/vendor/symfony/process/.gitignore |
---|
@@ -0,0 +1,3 @@ |
vendor/ |
composer.lock |
phpunit.xml |
/vendor/symfony/process/CHANGELOG.md |
---|
@@ -0,0 +1,51 @@ |
CHANGELOG |
========= |
3.3.0 |
----- |
* added command line arrays in the `Process` class |
* added `$env` argument to `Process::start()`, `run()`, `mustRun()` and `restart()` methods |
* deprecated the `ProcessUtils::escapeArgument()` method |
* deprecated not inheriting environment variables |
* deprecated configuring `proc_open()` options |
* deprecated configuring enhanced Windows compatibility |
* deprecated configuring enhanced sigchild compatibility |
2.5.0 |
----- |
* added support for PTY mode |
* added the convenience method "mustRun" |
* deprecation: Process::setStdin() is deprecated in favor of Process::setInput() |
* deprecation: Process::getStdin() is deprecated in favor of Process::getInput() |
* deprecation: Process::setInput() and ProcessBuilder::setInput() do not accept non-scalar types |
2.4.0 |
----- |
* added the ability to define an idle timeout |
2.3.0 |
----- |
* added ProcessUtils::escapeArgument() to fix the bug in escapeshellarg() function on Windows |
* added Process::signal() |
* added Process::getPid() |
* added support for a TTY mode |
2.2.0 |
----- |
* added ProcessBuilder::setArguments() to reset the arguments on a builder |
* added a way to retrieve the standard and error output incrementally |
* added Process:restart() |
2.1.0 |
----- |
* added support for non-blocking processes (start(), wait(), isRunning(), stop()) |
* enhanced Windows compatibility |
* added Process::getExitCodeText() that returns a string representation for |
the exit code returned by the process |
* added ProcessBuilder |
/vendor/symfony/process/Exception/ExceptionInterface.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
/** |
* Marker Interface for the Process Component. |
* |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
interface ExceptionInterface |
{ |
} |
/vendor/symfony/process/Exception/InvalidArgumentException.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
/** |
* InvalidArgumentException for the Process Component. |
* |
* @author Romain Neutron <imprec@gmail.com> |
*/ |
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface |
{ |
} |
/vendor/symfony/process/Exception/LogicException.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
/** |
* LogicException for the Process Component. |
* |
* @author Romain Neutron <imprec@gmail.com> |
*/ |
class LogicException extends \LogicException implements ExceptionInterface |
{ |
} |
/vendor/symfony/process/Exception/ProcessFailedException.php |
---|
@@ -0,0 +1,54 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
use Symfony\Component\Process\Process; |
/** |
* Exception for failed processes. |
* |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
class ProcessFailedException extends RuntimeException |
{ |
private $process; |
public function __construct(Process $process) |
{ |
if ($process->isSuccessful()) { |
throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); |
} |
$error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", |
$process->getCommandLine(), |
$process->getExitCode(), |
$process->getExitCodeText(), |
$process->getWorkingDirectory() |
); |
if (!$process->isOutputDisabled()) { |
$error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", |
$process->getOutput(), |
$process->getErrorOutput() |
); |
} |
parent::__construct($error); |
$this->process = $process; |
} |
public function getProcess() |
{ |
return $this->process; |
} |
} |
/vendor/symfony/process/Exception/ProcessTimedOutException.php |
---|
@@ -0,0 +1,69 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
use Symfony\Component\Process\Process; |
/** |
* Exception that is thrown when a process times out. |
* |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
class ProcessTimedOutException extends RuntimeException |
{ |
const TYPE_GENERAL = 1; |
const TYPE_IDLE = 2; |
private $process; |
private $timeoutType; |
public function __construct(Process $process, $timeoutType) |
{ |
$this->process = $process; |
$this->timeoutType = $timeoutType; |
parent::__construct(sprintf( |
'The process "%s" exceeded the timeout of %s seconds.', |
$process->getCommandLine(), |
$this->getExceededTimeout() |
)); |
} |
public function getProcess() |
{ |
return $this->process; |
} |
public function isGeneralTimeout() |
{ |
return $this->timeoutType === self::TYPE_GENERAL; |
} |
public function isIdleTimeout() |
{ |
return $this->timeoutType === self::TYPE_IDLE; |
} |
public function getExceededTimeout() |
{ |
switch ($this->timeoutType) { |
case self::TYPE_GENERAL: |
return $this->process->getTimeout(); |
case self::TYPE_IDLE: |
return $this->process->getIdleTimeout(); |
default: |
throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)); |
} |
} |
} |
/vendor/symfony/process/Exception/RuntimeException.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Exception; |
/** |
* RuntimeException for the Process Component. |
* |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
class RuntimeException extends \RuntimeException implements ExceptionInterface |
{ |
} |
/vendor/symfony/process/ExecutableFinder.php |
---|
@@ -0,0 +1,90 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
/** |
* Generic executable finder. |
* |
* @author Fabien Potencier <fabien@symfony.com> |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
class ExecutableFinder |
{ |
private $suffixes = array('.exe', '.bat', '.cmd', '.com'); |
/** |
* Replaces default suffixes of executable. |
* |
* @param array $suffixes |
*/ |
public function setSuffixes(array $suffixes) |
{ |
$this->suffixes = $suffixes; |
} |
/** |
* Adds new possible suffix to check for executable. |
* |
* @param string $suffix |
*/ |
public function addSuffix($suffix) |
{ |
$this->suffixes[] = $suffix; |
} |
/** |
* Finds an executable by name. |
* |
* @param string $name The executable name (without the extension) |
* @param string $default The default to return if no executable is found |
* @param array $extraDirs Additional dirs to check into |
* |
* @return string The executable path or default value |
*/ |
public function find($name, $default = null, array $extraDirs = array()) |
{ |
if (ini_get('open_basedir')) { |
$searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir')); |
$dirs = array(); |
foreach ($searchPath as $path) { |
// Silencing against https://bugs.php.net/69240 |
if (@is_dir($path)) { |
$dirs[] = $path; |
} else { |
if (basename($path) == $name && @is_executable($path)) { |
return $path; |
} |
} |
} |
} else { |
$dirs = array_merge( |
explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), |
$extraDirs |
); |
} |
$suffixes = array(''); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$pathExt = getenv('PATHEXT'); |
$suffixes = array_merge($suffixes, $pathExt ? explode(PATH_SEPARATOR, $pathExt) : $this->suffixes); |
} |
foreach ($suffixes as $suffix) { |
foreach ($dirs as $dir) { |
if (@is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) { |
return $file; |
} |
} |
} |
return $default; |
} |
} |
/vendor/symfony/process/InputStream.php |
---|
@@ -0,0 +1,90 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
use Symfony\Component\Process\Exception\RuntimeException; |
/** |
* Provides a way to continuously write to the input of a Process until the InputStream is closed. |
* |
* @author Nicolas Grekas <p@tchwork.com> |
*/ |
class InputStream implements \IteratorAggregate |
{ |
private $onEmpty = null; |
private $input = array(); |
private $open = true; |
/** |
* Sets a callback that is called when the write buffer becomes empty. |
*/ |
public function onEmpty(callable $onEmpty = null) |
{ |
$this->onEmpty = $onEmpty; |
} |
/** |
* Appends an input to the write buffer. |
* |
* @param resource|scalar|\Traversable|null The input to append as stream resource, scalar or \Traversable |
*/ |
public function write($input) |
{ |
if (null === $input) { |
return; |
} |
if ($this->isClosed()) { |
throw new RuntimeException(sprintf('%s is closed', static::class)); |
} |
$this->input[] = ProcessUtils::validateInput(__METHOD__, $input); |
} |
/** |
* Closes the write buffer. |
*/ |
public function close() |
{ |
$this->open = false; |
} |
/** |
* Tells whether the write buffer is closed or not. |
*/ |
public function isClosed() |
{ |
return !$this->open; |
} |
public function getIterator() |
{ |
$this->open = true; |
while ($this->open || $this->input) { |
if (!$this->input) { |
yield ''; |
continue; |
} |
$current = array_shift($this->input); |
if ($current instanceof \Iterator) { |
foreach ($current as $cur) { |
yield $cur; |
} |
} else { |
yield $current; |
} |
if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { |
$this->write($onEmpty($this)); |
} |
} |
} |
} |
/vendor/symfony/process/LICENSE |
---|
@@ -0,0 +1,19 @@ |
Copyright (c) 2004-2017 Fabien Potencier |
Permission is hereby granted, free of charge, to any person obtaining a copy |
of this software and associated documentation files (the "Software"), to deal |
in the Software without restriction, including without limitation the rights |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
copies of the Software, and to permit persons to whom the Software is furnished |
to do so, subject to the following conditions: |
The above copyright notice and this permission notice shall be included in all |
copies or substantial portions of the Software. |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
THE SOFTWARE. |
/vendor/symfony/process/PhpExecutableFinder.php |
---|
@@ -0,0 +1,90 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
/** |
* An executable finder specifically designed for the PHP executable. |
* |
* @author Fabien Potencier <fabien@symfony.com> |
* @author Johannes M. Schmitt <schmittjoh@gmail.com> |
*/ |
class PhpExecutableFinder |
{ |
private $executableFinder; |
public function __construct() |
{ |
$this->executableFinder = new ExecutableFinder(); |
} |
/** |
* Finds The PHP executable. |
* |
* @param bool $includeArgs Whether or not include command arguments |
* |
* @return string|false The PHP executable path or false if it cannot be found |
*/ |
public function find($includeArgs = true) |
{ |
$args = $this->findArguments(); |
$args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; |
// HHVM support |
if (defined('HHVM_VERSION')) { |
return (getenv('PHP_BINARY') ?: PHP_BINARY).$args; |
} |
// PHP_BINARY return the current sapi executable |
if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) { |
return PHP_BINARY.$args; |
} |
if ($php = getenv('PHP_PATH')) { |
if (!is_executable($php)) { |
return false; |
} |
return $php; |
} |
if ($php = getenv('PHP_PEAR_PHP_BIN')) { |
if (is_executable($php)) { |
return $php; |
} |
} |
$dirs = array(PHP_BINDIR); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$dirs[] = 'C:\xampp\php\\'; |
} |
return $this->executableFinder->find('php', false, $dirs); |
} |
/** |
* Finds the PHP executable arguments. |
* |
* @return array The PHP executable arguments |
*/ |
public function findArguments() |
{ |
$arguments = array(); |
if (defined('HHVM_VERSION')) { |
$arguments[] = '--php'; |
} elseif ('phpdbg' === PHP_SAPI) { |
$arguments[] = '-qrr'; |
} |
return $arguments; |
} |
} |
/vendor/symfony/process/PhpProcess.php |
---|
@@ -0,0 +1,78 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
use Symfony\Component\Process\Exception\RuntimeException; |
/** |
* PhpProcess runs a PHP script in an independent process. |
* |
* $p = new PhpProcess('<?php echo "foo"; ?>'); |
* $p->run(); |
* print $p->getOutput()."\n"; |
* |
* @author Fabien Potencier <fabien@symfony.com> |
*/ |
class PhpProcess extends Process |
{ |
/** |
* Constructor. |
* |
* @param string $script The PHP script to run (as a string) |
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process |
* @param array|null $env The environment variables or null to use the same environment as the current PHP process |
* @param int $timeout The timeout in seconds |
* @param array $options An array of options for proc_open |
*/ |
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = null) |
{ |
$executableFinder = new PhpExecutableFinder(); |
if (false === $php = $executableFinder->find(false)) { |
$php = null; |
} else { |
$php = array_merge(array($php), $executableFinder->findArguments()); |
} |
if ('phpdbg' === PHP_SAPI) { |
$file = tempnam(sys_get_temp_dir(), 'dbg'); |
file_put_contents($file, $script); |
register_shutdown_function('unlink', $file); |
$php[] = $file; |
$script = null; |
} |
if (null !== $options) { |
@trigger_error(sprintf('The $options parameter of the %s constructor is deprecated since version 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED); |
} |
parent::__construct($php, $cwd, $env, $script, $timeout, $options); |
} |
/** |
* Sets the path to the PHP binary to use. |
*/ |
public function setPhpBinary($php) |
{ |
$this->setCommandLine($php); |
} |
/** |
* {@inheritdoc} |
*/ |
public function start(callable $callback = null/*, array $env = array()*/) |
{ |
if (null === $this->getCommandLine()) { |
throw new RuntimeException('Unable to find the PHP executable.'); |
} |
$env = 1 < func_num_args() ? func_get_arg(1) : null; |
parent::start($callback, $env); |
} |
} |
/vendor/symfony/process/Pipes/AbstractPipes.php |
---|
@@ -0,0 +1,169 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Pipes; |
use Symfony\Component\Process\Exception\InvalidArgumentException; |
/** |
* @author Romain Neutron <imprec@gmail.com> |
* |
* @internal |
*/ |
abstract class AbstractPipes implements PipesInterface |
{ |
/** @var array */ |
public $pipes = array(); |
/** @var string */ |
private $inputBuffer = ''; |
/** @var resource|scalar|\Iterator|null */ |
private $input; |
/** @var bool */ |
private $blocked = true; |
public function __construct($input) |
{ |
if (is_resource($input) || $input instanceof \Iterator) { |
$this->input = $input; |
} elseif (is_string($input)) { |
$this->inputBuffer = $input; |
} else { |
$this->inputBuffer = (string) $input; |
} |
} |
/** |
* {@inheritdoc} |
*/ |
public function close() |
{ |
foreach ($this->pipes as $pipe) { |
fclose($pipe); |
} |
$this->pipes = array(); |
} |
/** |
* Returns true if a system call has been interrupted. |
* |
* @return bool |
*/ |
protected function hasSystemCallBeenInterrupted() |
{ |
$lastError = error_get_last(); |
// stream_select returns false when the `select` system call is interrupted by an incoming signal |
return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call'); |
} |
/** |
* Unblocks streams. |
*/ |
protected function unblock() |
{ |
if (!$this->blocked) { |
return; |
} |
foreach ($this->pipes as $pipe) { |
stream_set_blocking($pipe, 0); |
} |
if (is_resource($this->input)) { |
stream_set_blocking($this->input, 0); |
} |
$this->blocked = false; |
} |
/** |
* Writes input to stdin. |
* |
* @throws InvalidArgumentException When an input iterator yields a non supported value |
*/ |
protected function write() |
{ |
if (!isset($this->pipes[0])) { |
return; |
} |
$input = $this->input; |
if ($input instanceof \Iterator) { |
if (!$input->valid()) { |
$input = null; |
} elseif (is_resource($input = $input->current())) { |
stream_set_blocking($input, 0); |
} elseif (!isset($this->inputBuffer[0])) { |
if (!is_string($input)) { |
if (!is_scalar($input)) { |
throw new InvalidArgumentException(sprintf('%s yielded a value of type "%s", but only scalars and stream resources are supported', get_class($this->input), gettype($input))); |
} |
$input = (string) $input; |
} |
$this->inputBuffer = $input; |
$this->input->next(); |
$input = null; |
} else { |
$input = null; |
} |
} |
$r = $e = array(); |
$w = array($this->pipes[0]); |
// let's have a look if something changed in streams |
if (false === $n = @stream_select($r, $w, $e, 0, 0)) { |
return; |
} |
foreach ($w as $stdin) { |
if (isset($this->inputBuffer[0])) { |
$written = fwrite($stdin, $this->inputBuffer); |
$this->inputBuffer = substr($this->inputBuffer, $written); |
if (isset($this->inputBuffer[0])) { |
return array($this->pipes[0]); |
} |
} |
if ($input) { |
for (;;) { |
$data = fread($input, self::CHUNK_SIZE); |
if (!isset($data[0])) { |
break; |
} |
$written = fwrite($stdin, $data); |
$data = substr($data, $written); |
if (isset($data[0])) { |
$this->inputBuffer = $data; |
return array($this->pipes[0]); |
} |
} |
if (feof($input)) { |
if ($this->input instanceof \Iterator) { |
$this->input->next(); |
} else { |
$this->input = null; |
} |
} |
} |
} |
// no input to read on resource, buffer is empty |
if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { |
$this->input = null; |
fclose($this->pipes[0]); |
unset($this->pipes[0]); |
} elseif (!$w) { |
return array($this->pipes[0]); |
} |
} |
} |
/vendor/symfony/process/Pipes/PipesInterface.php |
---|
@@ -0,0 +1,67 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Pipes; |
/** |
* PipesInterface manages descriptors and pipes for the use of proc_open. |
* |
* @author Romain Neutron <imprec@gmail.com> |
* |
* @internal |
*/ |
interface PipesInterface |
{ |
const CHUNK_SIZE = 16384; |
/** |
* Returns an array of descriptors for the use of proc_open. |
* |
* @return array |
*/ |
public function getDescriptors(); |
/** |
* Returns an array of filenames indexed by their related stream in case these pipes use temporary files. |
* |
* @return string[] |
*/ |
public function getFiles(); |
/** |
* Reads data in file handles and pipes. |
* |
* @param bool $blocking Whether to use blocking calls or not |
* @param bool $close Whether to close pipes if they've reached EOF |
* |
* @return string[] An array of read data indexed by their fd |
*/ |
public function readAndWrite($blocking, $close = false); |
/** |
* Returns if the current state has open file handles or pipes. |
* |
* @return bool |
*/ |
public function areOpen(); |
/** |
* Returns if pipes are able to read output. |
* |
* @return bool |
*/ |
public function haveReadSupport(); |
/** |
* Closes file handles and pipes. |
*/ |
public function close(); |
} |
/vendor/symfony/process/Pipes/UnixPipes.php |
---|
@@ -0,0 +1,153 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Pipes; |
use Symfony\Component\Process\Process; |
/** |
* UnixPipes implementation uses unix pipes as handles. |
* |
* @author Romain Neutron <imprec@gmail.com> |
* |
* @internal |
*/ |
class UnixPipes extends AbstractPipes |
{ |
/** @var bool */ |
private $ttyMode; |
/** @var bool */ |
private $ptyMode; |
/** @var bool */ |
private $haveReadSupport; |
public function __construct($ttyMode, $ptyMode, $input, $haveReadSupport) |
{ |
$this->ttyMode = (bool) $ttyMode; |
$this->ptyMode = (bool) $ptyMode; |
$this->haveReadSupport = (bool) $haveReadSupport; |
parent::__construct($input); |
} |
public function __destruct() |
{ |
$this->close(); |
} |
/** |
* {@inheritdoc} |
*/ |
public function getDescriptors() |
{ |
if (!$this->haveReadSupport) { |
$nullstream = fopen('/dev/null', 'c'); |
return array( |
array('pipe', 'r'), |
$nullstream, |
$nullstream, |
); |
} |
if ($this->ttyMode) { |
return array( |
array('file', '/dev/tty', 'r'), |
array('file', '/dev/tty', 'w'), |
array('file', '/dev/tty', 'w'), |
); |
} |
if ($this->ptyMode && Process::isPtySupported()) { |
return array( |
array('pty'), |
array('pty'), |
array('pty'), |
); |
} |
return array( |
array('pipe', 'r'), |
array('pipe', 'w'), // stdout |
array('pipe', 'w'), // stderr |
); |
} |
/** |
* {@inheritdoc} |
*/ |
public function getFiles() |
{ |
return array(); |
} |
/** |
* {@inheritdoc} |
*/ |
public function readAndWrite($blocking, $close = false) |
{ |
$this->unblock(); |
$w = $this->write(); |
$read = $e = array(); |
$r = $this->pipes; |
unset($r[0]); |
// let's have a look if something changed in streams |
if (($r || $w) && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { |
// if a system call has been interrupted, forget about it, let's try again |
// otherwise, an error occurred, let's reset pipes |
if (!$this->hasSystemCallBeenInterrupted()) { |
$this->pipes = array(); |
} |
return $read; |
} |
foreach ($r as $pipe) { |
// prior PHP 5.4 the array passed to stream_select is modified and |
// lose key association, we have to find back the key |
$read[$type = array_search($pipe, $this->pipes, true)] = ''; |
do { |
$data = fread($pipe, self::CHUNK_SIZE); |
$read[$type] .= $data; |
} while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1]))); |
if (!isset($read[$type][0])) { |
unset($read[$type]); |
} |
if ($close && feof($pipe)) { |
fclose($pipe); |
unset($this->pipes[$type]); |
} |
} |
return $read; |
} |
/** |
* {@inheritdoc} |
*/ |
public function haveReadSupport() |
{ |
return $this->haveReadSupport; |
} |
/** |
* {@inheritdoc} |
*/ |
public function areOpen() |
{ |
return (bool) $this->pipes; |
} |
} |
/vendor/symfony/process/Pipes/WindowsPipes.php |
---|
@@ -0,0 +1,200 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Pipes; |
use Symfony\Component\Process\Process; |
use Symfony\Component\Process\Exception\RuntimeException; |
/** |
* WindowsPipes implementation uses temporary files as handles. |
* |
* @see https://bugs.php.net/bug.php?id=51800 |
* @see https://bugs.php.net/bug.php?id=65650 |
* |
* @author Romain Neutron <imprec@gmail.com> |
* |
* @internal |
*/ |
class WindowsPipes extends AbstractPipes |
{ |
/** @var array */ |
private $files = array(); |
/** @var array */ |
private $fileHandles = array(); |
/** @var array */ |
private $readBytes = array( |
Process::STDOUT => 0, |
Process::STDERR => 0, |
); |
/** @var bool */ |
private $haveReadSupport; |
public function __construct($input, $haveReadSupport) |
{ |
$this->haveReadSupport = (bool) $haveReadSupport; |
if ($this->haveReadSupport) { |
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. |
// Workaround for this problem is to use temporary files instead of pipes on Windows platform. |
// |
// @see https://bugs.php.net/bug.php?id=51800 |
$pipes = array( |
Process::STDOUT => Process::OUT, |
Process::STDERR => Process::ERR, |
); |
$tmpCheck = false; |
$tmpDir = sys_get_temp_dir(); |
$lastError = 'unknown reason'; |
set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); |
for ($i = 0;; ++$i) { |
foreach ($pipes as $pipe => $name) { |
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); |
if (file_exists($file) && !unlink($file)) { |
continue 2; |
} |
$h = fopen($file, 'xb'); |
if (!$h) { |
$error = $lastError; |
if ($tmpCheck || $tmpCheck = unlink(tempnam(false, 'sf_check_'))) { |
continue; |
} |
restore_error_handler(); |
throw new RuntimeException(sprintf('A temporary file could not be opened to write the process output: %s', $error)); |
} |
if (!$h || !$this->fileHandles[$pipe] = fopen($file, 'rb')) { |
continue 2; |
} |
if (isset($this->files[$pipe])) { |
unlink($this->files[$pipe]); |
} |
$this->files[$pipe] = $file; |
} |
break; |
} |
restore_error_handler(); |
} |
parent::__construct($input); |
} |
public function __destruct() |
{ |
$this->close(); |
$this->removeFiles(); |
} |
/** |
* {@inheritdoc} |
*/ |
public function getDescriptors() |
{ |
if (!$this->haveReadSupport) { |
$nullstream = fopen('NUL', 'c'); |
return array( |
array('pipe', 'r'), |
$nullstream, |
$nullstream, |
); |
} |
// We're not using pipe on Windows platform as it hangs (https://bugs.php.net/bug.php?id=51800) |
// We're not using file handles as it can produce corrupted output https://bugs.php.net/bug.php?id=65650 |
// So we redirect output within the commandline and pass the nul device to the process |
return array( |
array('pipe', 'r'), |
array('file', 'NUL', 'w'), |
array('file', 'NUL', 'w'), |
); |
} |
/** |
* {@inheritdoc} |
*/ |
public function getFiles() |
{ |
return $this->files; |
} |
/** |
* {@inheritdoc} |
*/ |
public function readAndWrite($blocking, $close = false) |
{ |
$this->unblock(); |
$w = $this->write(); |
$read = $r = $e = array(); |
if ($blocking) { |
if ($w) { |
@stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); |
} elseif ($this->fileHandles) { |
usleep(Process::TIMEOUT_PRECISION * 1E6); |
} |
} |
foreach ($this->fileHandles as $type => $fileHandle) { |
$data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]); |
if (isset($data[0])) { |
$this->readBytes[$type] += strlen($data); |
$read[$type] = $data; |
} |
if ($close) { |
fclose($fileHandle); |
unset($this->fileHandles[$type]); |
} |
} |
return $read; |
} |
/** |
* {@inheritdoc} |
*/ |
public function haveReadSupport() |
{ |
return $this->haveReadSupport; |
} |
/** |
* {@inheritdoc} |
*/ |
public function areOpen() |
{ |
return $this->pipes && $this->fileHandles; |
} |
/** |
* {@inheritdoc} |
*/ |
public function close() |
{ |
parent::close(); |
foreach ($this->fileHandles as $handle) { |
fclose($handle); |
} |
$this->fileHandles = array(); |
} |
/** |
* Removes temporary files. |
*/ |
private function removeFiles() |
{ |
foreach ($this->files as $filename) { |
if (file_exists($filename)) { |
@unlink($filename); |
} |
} |
$this->files = array(); |
} |
} |
/vendor/symfony/process/Process.php |
---|
@@ -0,0 +1,1732 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
use Symfony\Component\Process\Exception\InvalidArgumentException; |
use Symfony\Component\Process\Exception\LogicException; |
use Symfony\Component\Process\Exception\ProcessFailedException; |
use Symfony\Component\Process\Exception\ProcessTimedOutException; |
use Symfony\Component\Process\Exception\RuntimeException; |
use Symfony\Component\Process\Pipes\PipesInterface; |
use Symfony\Component\Process\Pipes\UnixPipes; |
use Symfony\Component\Process\Pipes\WindowsPipes; |
/** |
* Process is a thin wrapper around proc_* functions to easily |
* start independent PHP processes. |
* |
* @author Fabien Potencier <fabien@symfony.com> |
* @author Romain Neutron <imprec@gmail.com> |
*/ |
class Process implements \IteratorAggregate |
{ |
const ERR = 'err'; |
const OUT = 'out'; |
const STATUS_READY = 'ready'; |
const STATUS_STARTED = 'started'; |
const STATUS_TERMINATED = 'terminated'; |
const STDIN = 0; |
const STDOUT = 1; |
const STDERR = 2; |
// Timeout Precision in seconds. |
const TIMEOUT_PRECISION = 0.2; |
const ITER_NON_BLOCKING = 1; // By default, iterating over outputs is a blocking call, use this flag to make it non-blocking |
const ITER_KEEP_OUTPUT = 2; // By default, outputs are cleared while iterating, use this flag to keep them in memory |
const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating |
const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating |
private $callback; |
private $hasCallback = false; |
private $commandline; |
private $cwd; |
private $env; |
private $input; |
private $starttime; |
private $lastOutputTime; |
private $timeout; |
private $idleTimeout; |
private $options = array('suppress_errors' => true); |
private $exitcode; |
private $fallbackStatus = array(); |
private $processInformation; |
private $outputDisabled = false; |
private $stdout; |
private $stderr; |
private $enhanceWindowsCompatibility = true; |
private $enhanceSigchildCompatibility; |
private $process; |
private $status = self::STATUS_READY; |
private $incrementalOutputOffset = 0; |
private $incrementalErrorOutputOffset = 0; |
private $tty; |
private $pty; |
private $inheritEnv = false; |
private $useFileHandles = false; |
/** @var PipesInterface */ |
private $processPipes; |
private $latestSignal; |
private static $sigchild; |
/** |
* Exit codes translation table. |
* |
* User-defined errors must use exit codes in the 64-113 range. |
* |
* @var array |
*/ |
public static $exitCodes = array( |
0 => 'OK', |
1 => 'General error', |
2 => 'Misuse of shell builtins', |
126 => 'Invoked command cannot execute', |
127 => 'Command not found', |
128 => 'Invalid exit argument', |
// signals |
129 => 'Hangup', |
130 => 'Interrupt', |
131 => 'Quit and dump core', |
132 => 'Illegal instruction', |
133 => 'Trace/breakpoint trap', |
134 => 'Process aborted', |
135 => 'Bus error: "access to undefined portion of memory object"', |
136 => 'Floating point exception: "erroneous arithmetic operation"', |
137 => 'Kill (terminate immediately)', |
138 => 'User-defined 1', |
139 => 'Segmentation violation', |
140 => 'User-defined 2', |
141 => 'Write to pipe with no one reading', |
142 => 'Signal raised by alarm', |
143 => 'Termination (request to terminate)', |
// 144 - not defined |
145 => 'Child process terminated, stopped (or continued*)', |
146 => 'Continue if stopped', |
147 => 'Stop executing temporarily', |
148 => 'Terminal stop signal', |
149 => 'Background process attempting to read from tty ("in")', |
150 => 'Background process attempting to write to tty ("out")', |
151 => 'Urgent data available on socket', |
152 => 'CPU time limit exceeded', |
153 => 'File size limit exceeded', |
154 => 'Signal raised by timer counting virtual time: "virtual timer expired"', |
155 => 'Profiling timer expired', |
// 156 - not defined |
157 => 'Pollable event', |
// 158 - not defined |
159 => 'Bad syscall', |
); |
/** |
* Constructor. |
* |
* @param string|array $commandline The command line to run |
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process |
* @param array|null $env The environment variables or null to use the same environment as the current PHP process |
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input |
* @param int|float|null $timeout The timeout in seconds or null to disable |
* @param array $options An array of options for proc_open |
* |
* @throws RuntimeException When proc_open is not installed |
*/ |
public function __construct($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = null) |
{ |
if (!function_exists('proc_open')) { |
throw new RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.'); |
} |
$this->commandline = $commandline; |
$this->cwd = $cwd; |
// on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started |
// on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected |
// @see : https://bugs.php.net/bug.php?id=51800 |
// @see : https://bugs.php.net/bug.php?id=50524 |
if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || '\\' === DIRECTORY_SEPARATOR)) { |
$this->cwd = getcwd(); |
} |
if (null !== $env) { |
$this->setEnv($env); |
} |
$this->setInput($input); |
$this->setTimeout($timeout); |
$this->useFileHandles = '\\' === DIRECTORY_SEPARATOR; |
$this->pty = false; |
$this->enhanceSigchildCompatibility = '\\' !== DIRECTORY_SEPARATOR && $this->isSigchildEnabled(); |
if (null !== $options) { |
@trigger_error(sprintf('The $options parameter of the %s constructor is deprecated since version 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED); |
$this->options = array_replace($this->options, $options); |
} |
} |
public function __destruct() |
{ |
$this->stop(0); |
} |
public function __clone() |
{ |
$this->resetProcessData(); |
} |
/** |
* Runs the process. |
* |
* The callback receives the type of output (out or err) and |
* some bytes from the output in real-time. It allows to have feedback |
* from the independent process during execution. |
* |
* The STDOUT and STDERR are also available after the process is finished |
* via the getOutput() and getErrorOutput() methods. |
* |
* @param callable|null $callback A PHP callback to run whenever there is some |
* output available on STDOUT or STDERR |
* @param array $env An array of additional env vars to set when running the process |
* |
* @return int The exit status code |
* |
* @throws RuntimeException When process can't be launched |
* @throws RuntimeException When process stopped after receiving signal |
* @throws LogicException In case a callback is provided and output has been disabled |
* |
* @final since version 3.3 |
*/ |
public function run($callback = null/*, array $env = array()*/) |
{ |
$env = 1 < func_num_args() ? func_get_arg(1) : null; |
$this->start($callback, $env); |
return $this->wait(); |
} |
/** |
* Runs the process. |
* |
* This is identical to run() except that an exception is thrown if the process |
* exits with a non-zero exit code. |
* |
* @param callable|null $callback |
* @param array $env An array of additional env vars to set when running the process |
* |
* @return self |
* |
* @throws RuntimeException if PHP was compiled with --enable-sigchild and the enhanced sigchild compatibility mode is not enabled |
* @throws ProcessFailedException if the process didn't terminate successfully |
* |
* @final since version 3.3 |
*/ |
public function mustRun(callable $callback = null/*, array $env = array()*/) |
{ |
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.'); |
} |
$env = 1 < func_num_args() ? func_get_arg(1) : null; |
if (0 !== $this->run($callback, $env)) { |
throw new ProcessFailedException($this); |
} |
return $this; |
} |
/** |
* Starts the process and returns after writing the input to STDIN. |
* |
* This method blocks until all STDIN data is sent to the process then it |
* returns while the process runs in the background. |
* |
* The termination of the process can be awaited with wait(). |
* |
* The callback receives the type of output (out or err) and some bytes from |
* the output in real-time while writing the standard input to the process. |
* It allows to have feedback from the independent process during execution. |
* |
* @param callable|null $callback A PHP callback to run whenever there is some |
* output available on STDOUT or STDERR |
* @param array $env An array of additional env vars to set when running the process |
* |
* @throws RuntimeException When process can't be launched |
* @throws RuntimeException When process is already running |
* @throws LogicException In case a callback is provided and output has been disabled |
*/ |
public function start(callable $callback = null/*, array $env = array()*/) |
{ |
if ($this->isRunning()) { |
throw new RuntimeException('Process is already running'); |
} |
if (2 <= func_num_args()) { |
$env = func_get_arg(1); |
} else { |
if (__CLASS__ !== static::class) { |
$r = new \ReflectionMethod($this, __FUNCTION__); |
if (__CLASS__ !== $r->getDeclaringClass()->getName() && (2 > $r->getNumberOfParameters() || 'env' !== $r->getParameters()[0]->name)) { |
@trigger_error(sprintf('The %s::start() method expects a second "$env" argument since version 3.3. It will be made mandatory in 4.0.', static::class), E_USER_DEPRECATED); |
} |
} |
$env = null; |
} |
$this->resetProcessData(); |
$this->starttime = $this->lastOutputTime = microtime(true); |
$this->callback = $this->buildCallback($callback); |
$this->hasCallback = null !== $callback; |
$descriptors = $this->getDescriptors(); |
$inheritEnv = $this->inheritEnv; |
if (is_array($commandline = $this->commandline)) { |
$commandline = implode(' ', array_map(array($this, 'escapeArgument'), $commandline)); |
if ('\\' !== DIRECTORY_SEPARATOR) { |
// exec is mandatory to deal with sending a signal to the process |
$commandline = 'exec '.$commandline; |
} |
} |
if (null === $env) { |
$env = $this->env; |
} else { |
if ($this->env) { |
$env += $this->env; |
} |
$inheritEnv = true; |
} |
$envBackup = array(); |
if (null !== $env && $inheritEnv) { |
foreach ($env as $k => $v) { |
$envBackup[$k] = getenv($k); |
putenv(false === $v || null === $v ? $k : "$k=$v"); |
} |
$env = null; |
} elseif (null !== $env) { |
@trigger_error('Not inheriting environment variables is deprecated since Symfony 3.3 and will always happen in 4.0. Set "Process::inheritEnvironmentVariables()" to true instead.', E_USER_DEPRECATED); |
} |
if ('\\' === DIRECTORY_SEPARATOR && $this->enhanceWindowsCompatibility) { |
$this->options['bypass_shell'] = true; |
$commandline = $this->prepareWindowsCommandLine($commandline, $envBackup, $env); |
} elseif (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
// last exit code is output on the fourth pipe and caught to work around --enable-sigchild |
$descriptors[3] = array('pipe', 'w'); |
// See https://unix.stackexchange.com/questions/71205/background-process-pipe-input |
$commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; |
$commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; |
// Workaround for the bug, when PTS functionality is enabled. |
// @see : https://bugs.php.net/69442 |
$ptsWorkaround = fopen(__FILE__, 'r'); |
} |
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $env, $this->options); |
foreach ($envBackup as $k => $v) { |
putenv(false === $v ? $k : "$k=$v"); |
} |
if (!is_resource($this->process)) { |
throw new RuntimeException('Unable to launch a new process.'); |
} |
$this->status = self::STATUS_STARTED; |
if (isset($descriptors[3])) { |
$this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); |
} |
if ($this->tty) { |
return; |
} |
$this->updateStatus(false); |
$this->checkTimeout(); |
} |
/** |
* Restarts the process. |
* |
* Be warned that the process is cloned before being started. |
* |
* @param callable|null $callback A PHP callback to run whenever there is some |
* output available on STDOUT or STDERR |
* @param array $env An array of additional env vars to set when running the process |
* |
* @return $this |
* |
* @throws RuntimeException When process can't be launched |
* @throws RuntimeException When process is already running |
* |
* @see start() |
* |
* @final since version 3.3 |
*/ |
public function restart(callable $callback = null/*, array $env = array()*/) |
{ |
if ($this->isRunning()) { |
throw new RuntimeException('Process is already running'); |
} |
$env = 1 < func_num_args() ? func_get_arg(1) : null; |
$process = clone $this; |
$process->start($callback, $env); |
return $process; |
} |
/** |
* Waits for the process to terminate. |
* |
* The callback receives the type of output (out or err) and some bytes |
* from the output in real-time while writing the standard input to the process. |
* It allows to have feedback from the independent process during execution. |
* |
* @param callable|null $callback A valid PHP callback |
* |
* @return int The exitcode of the process |
* |
* @throws RuntimeException When process timed out |
* @throws RuntimeException When process stopped after receiving signal |
* @throws LogicException When process is not yet started |
*/ |
public function wait(callable $callback = null) |
{ |
$this->requireProcessIsStarted(__FUNCTION__); |
$this->updateStatus(false); |
if (null !== $callback) { |
if (!$this->processPipes->haveReadSupport()) { |
$this->stop(0); |
throw new \LogicException('Pass the callback to the Process::start method or enableOutput to use a callback with Process::wait'); |
} |
$this->callback = $this->buildCallback($callback); |
} |
do { |
$this->checkTimeout(); |
$running = '\\' === DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); |
$this->readPipes($running, '\\' !== DIRECTORY_SEPARATOR || !$running); |
} while ($running); |
while ($this->isRunning()) { |
usleep(1000); |
} |
if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) { |
throw new RuntimeException(sprintf('The process has been signaled with signal "%s".', $this->processInformation['termsig'])); |
} |
return $this->exitcode; |
} |
/** |
* Returns the Pid (process identifier), if applicable. |
* |
* @return int|null The process id if running, null otherwise |
*/ |
public function getPid() |
{ |
return $this->isRunning() ? $this->processInformation['pid'] : null; |
} |
/** |
* Sends a POSIX signal to the process. |
* |
* @param int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) |
* |
* @return $this |
* |
* @throws LogicException In case the process is not running |
* @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed |
* @throws RuntimeException In case of failure |
*/ |
public function signal($signal) |
{ |
$this->doSignal($signal, true); |
return $this; |
} |
/** |
* Disables fetching output and error output from the underlying process. |
* |
* @return $this |
* |
* @throws RuntimeException In case the process is already running |
* @throws LogicException if an idle timeout is set |
*/ |
public function disableOutput() |
{ |
if ($this->isRunning()) { |
throw new RuntimeException('Disabling output while the process is running is not possible.'); |
} |
if (null !== $this->idleTimeout) { |
throw new LogicException('Output can not be disabled while an idle timeout is set.'); |
} |
$this->outputDisabled = true; |
return $this; |
} |
/** |
* Enables fetching output and error output from the underlying process. |
* |
* @return $this |
* |
* @throws RuntimeException In case the process is already running |
*/ |
public function enableOutput() |
{ |
if ($this->isRunning()) { |
throw new RuntimeException('Enabling output while the process is running is not possible.'); |
} |
$this->outputDisabled = false; |
return $this; |
} |
/** |
* Returns true in case the output is disabled, false otherwise. |
* |
* @return bool |
*/ |
public function isOutputDisabled() |
{ |
return $this->outputDisabled; |
} |
/** |
* Returns the current output of the process (STDOUT). |
* |
* @return string The process output |
* |
* @throws LogicException in case the output has been disabled |
* @throws LogicException In case the process is not started |
*/ |
public function getOutput() |
{ |
$this->readPipesForOutput(__FUNCTION__); |
if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { |
return ''; |
} |
return $ret; |
} |
/** |
* Returns the output incrementally. |
* |
* In comparison with the getOutput method which always return the whole |
* output, this one returns the new output since the last call. |
* |
* @return string The process output since the last call |
* |
* @throws LogicException in case the output has been disabled |
* @throws LogicException In case the process is not started |
*/ |
public function getIncrementalOutput() |
{ |
$this->readPipesForOutput(__FUNCTION__); |
$latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); |
$this->incrementalOutputOffset = ftell($this->stdout); |
if (false === $latest) { |
return ''; |
} |
return $latest; |
} |
/** |
* Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). |
* |
* @param int $flags A bit field of Process::ITER_* flags |
* |
* @throws LogicException in case the output has been disabled |
* @throws LogicException In case the process is not started |
* |
* @return \Generator |
*/ |
public function getIterator($flags = 0) |
{ |
$this->readPipesForOutput(__FUNCTION__, false); |
$clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); |
$blocking = !(self::ITER_NON_BLOCKING & $flags); |
$yieldOut = !(self::ITER_SKIP_OUT & $flags); |
$yieldErr = !(self::ITER_SKIP_ERR & $flags); |
while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { |
if ($yieldOut) { |
$out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); |
if (isset($out[0])) { |
if ($clearOutput) { |
$this->clearOutput(); |
} else { |
$this->incrementalOutputOffset = ftell($this->stdout); |
} |
yield self::OUT => $out; |
} |
} |
if ($yieldErr) { |
$err = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); |
if (isset($err[0])) { |
if ($clearOutput) { |
$this->clearErrorOutput(); |
} else { |
$this->incrementalErrorOutputOffset = ftell($this->stderr); |
} |
yield self::ERR => $err; |
} |
} |
if (!$blocking && !isset($out[0]) && !isset($err[0])) { |
yield self::OUT => ''; |
} |
$this->checkTimeout(); |
$this->readPipesForOutput(__FUNCTION__, $blocking); |
} |
} |
/** |
* Clears the process output. |
* |
* @return $this |
*/ |
public function clearOutput() |
{ |
ftruncate($this->stdout, 0); |
fseek($this->stdout, 0); |
$this->incrementalOutputOffset = 0; |
return $this; |
} |
/** |
* Returns the current error output of the process (STDERR). |
* |
* @return string The process error output |
* |
* @throws LogicException in case the output has been disabled |
* @throws LogicException In case the process is not started |
*/ |
public function getErrorOutput() |
{ |
$this->readPipesForOutput(__FUNCTION__); |
if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { |
return ''; |
} |
return $ret; |
} |
/** |
* Returns the errorOutput incrementally. |
* |
* In comparison with the getErrorOutput method which always return the |
* whole error output, this one returns the new error output since the last |
* call. |
* |
* @return string The process error output since the last call |
* |
* @throws LogicException in case the output has been disabled |
* @throws LogicException In case the process is not started |
*/ |
public function getIncrementalErrorOutput() |
{ |
$this->readPipesForOutput(__FUNCTION__); |
$latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); |
$this->incrementalErrorOutputOffset = ftell($this->stderr); |
if (false === $latest) { |
return ''; |
} |
return $latest; |
} |
/** |
* Clears the process output. |
* |
* @return $this |
*/ |
public function clearErrorOutput() |
{ |
ftruncate($this->stderr, 0); |
fseek($this->stderr, 0); |
$this->incrementalErrorOutputOffset = 0; |
return $this; |
} |
/** |
* Returns the exit code returned by the process. |
* |
* @return null|int The exit status code, null if the Process is not terminated |
* |
* @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled |
*/ |
public function getExitCode() |
{ |
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.'); |
} |
$this->updateStatus(false); |
return $this->exitcode; |
} |
/** |
* Returns a string representation for the exit code returned by the process. |
* |
* This method relies on the Unix exit code status standardization |
* and might not be relevant for other operating systems. |
* |
* @return null|string A string representation for the exit status code, null if the Process is not terminated |
* |
* @see http://tldp.org/LDP/abs/html/exitcodes.html |
* @see http://en.wikipedia.org/wiki/Unix_signal |
*/ |
public function getExitCodeText() |
{ |
if (null === $exitcode = $this->getExitCode()) { |
return; |
} |
return isset(self::$exitCodes[$exitcode]) ? self::$exitCodes[$exitcode] : 'Unknown error'; |
} |
/** |
* Checks if the process ended successfully. |
* |
* @return bool true if the process ended successfully, false otherwise |
*/ |
public function isSuccessful() |
{ |
return 0 === $this->getExitCode(); |
} |
/** |
* Returns true if the child process has been terminated by an uncaught signal. |
* |
* It always returns false on Windows. |
* |
* @return bool |
* |
* @throws RuntimeException In case --enable-sigchild is activated |
* @throws LogicException In case the process is not terminated |
*/ |
public function hasBeenSignaled() |
{ |
$this->requireProcessIsTerminated(__FUNCTION__); |
if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.'); |
} |
return $this->processInformation['signaled']; |
} |
/** |
* Returns the number of the signal that caused the child process to terminate its execution. |
* |
* It is only meaningful if hasBeenSignaled() returns true. |
* |
* @return int |
* |
* @throws RuntimeException In case --enable-sigchild is activated |
* @throws LogicException In case the process is not terminated |
*/ |
public function getTermSignal() |
{ |
$this->requireProcessIsTerminated(__FUNCTION__); |
if ($this->isSigchildEnabled() && (!$this->enhanceSigchildCompatibility || -1 === $this->processInformation['termsig'])) { |
throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.'); |
} |
return $this->processInformation['termsig']; |
} |
/** |
* Returns true if the child process has been stopped by a signal. |
* |
* It always returns false on Windows. |
* |
* @return bool |
* |
* @throws LogicException In case the process is not terminated |
*/ |
public function hasBeenStopped() |
{ |
$this->requireProcessIsTerminated(__FUNCTION__); |
return $this->processInformation['stopped']; |
} |
/** |
* Returns the number of the signal that caused the child process to stop its execution. |
* |
* It is only meaningful if hasBeenStopped() returns true. |
* |
* @return int |
* |
* @throws LogicException In case the process is not terminated |
*/ |
public function getStopSignal() |
{ |
$this->requireProcessIsTerminated(__FUNCTION__); |
return $this->processInformation['stopsig']; |
} |
/** |
* Checks if the process is currently running. |
* |
* @return bool true if the process is currently running, false otherwise |
*/ |
public function isRunning() |
{ |
if (self::STATUS_STARTED !== $this->status) { |
return false; |
} |
$this->updateStatus(false); |
return $this->processInformation['running']; |
} |
/** |
* Checks if the process has been started with no regard to the current state. |
* |
* @return bool true if status is ready, false otherwise |
*/ |
public function isStarted() |
{ |
return $this->status != self::STATUS_READY; |
} |
/** |
* Checks if the process is terminated. |
* |
* @return bool true if process is terminated, false otherwise |
*/ |
public function isTerminated() |
{ |
$this->updateStatus(false); |
return $this->status == self::STATUS_TERMINATED; |
} |
/** |
* Gets the process status. |
* |
* The status is one of: ready, started, terminated. |
* |
* @return string The current process status |
*/ |
public function getStatus() |
{ |
$this->updateStatus(false); |
return $this->status; |
} |
/** |
* Stops the process. |
* |
* @param int|float $timeout The timeout in seconds |
* @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) |
* |
* @return int The exit-code of the process |
*/ |
public function stop($timeout = 10, $signal = null) |
{ |
$timeoutMicro = microtime(true) + $timeout; |
if ($this->isRunning()) { |
// given `SIGTERM` may not be defined and that `proc_terminate` uses the constant value and not the constant itself, we use the same here |
$this->doSignal(15, false); |
do { |
usleep(1000); |
} while ($this->isRunning() && microtime(true) < $timeoutMicro); |
if ($this->isRunning()) { |
// Avoid exception here: process is supposed to be running, but it might have stopped just |
// after this line. In any case, let's silently discard the error, we cannot do anything. |
$this->doSignal($signal ?: 9, false); |
} |
} |
if ($this->isRunning()) { |
if (isset($this->fallbackStatus['pid'])) { |
unset($this->fallbackStatus['pid']); |
return $this->stop(0, $signal); |
} |
$this->close(); |
} |
return $this->exitcode; |
} |
/** |
* Adds a line to the STDOUT stream. |
* |
* @internal |
* |
* @param string $line The line to append |
*/ |
public function addOutput($line) |
{ |
$this->lastOutputTime = microtime(true); |
fseek($this->stdout, 0, SEEK_END); |
fwrite($this->stdout, $line); |
fseek($this->stdout, $this->incrementalOutputOffset); |
} |
/** |
* Adds a line to the STDERR stream. |
* |
* @internal |
* |
* @param string $line The line to append |
*/ |
public function addErrorOutput($line) |
{ |
$this->lastOutputTime = microtime(true); |
fseek($this->stderr, 0, SEEK_END); |
fwrite($this->stderr, $line); |
fseek($this->stderr, $this->incrementalErrorOutputOffset); |
} |
/** |
* Gets the command line to be executed. |
* |
* @return string The command to execute |
*/ |
public function getCommandLine() |
{ |
return is_array($this->commandline) ? implode(' ', array_map(array($this, 'escapeArgument'), $this->commandline)) : $this->commandline; |
} |
/** |
* Sets the command line to be executed. |
* |
* @param string|array $commandline The command to execute |
* |
* @return self The current Process instance |
*/ |
public function setCommandLine($commandline) |
{ |
$this->commandline = $commandline; |
return $this; |
} |
/** |
* Gets the process timeout (max. runtime). |
* |
* @return float|null The timeout in seconds or null if it's disabled |
*/ |
public function getTimeout() |
{ |
return $this->timeout; |
} |
/** |
* Gets the process idle timeout (max. time since last output). |
* |
* @return float|null The timeout in seconds or null if it's disabled |
*/ |
public function getIdleTimeout() |
{ |
return $this->idleTimeout; |
} |
/** |
* Sets the process timeout (max. runtime). |
* |
* To disable the timeout, set this value to null. |
* |
* @param int|float|null $timeout The timeout in seconds |
* |
* @return self The current Process instance |
* |
* @throws InvalidArgumentException if the timeout is negative |
*/ |
public function setTimeout($timeout) |
{ |
$this->timeout = $this->validateTimeout($timeout); |
return $this; |
} |
/** |
* Sets the process idle timeout (max. time since last output). |
* |
* To disable the timeout, set this value to null. |
* |
* @param int|float|null $timeout The timeout in seconds |
* |
* @return self The current Process instance |
* |
* @throws LogicException if the output is disabled |
* @throws InvalidArgumentException if the timeout is negative |
*/ |
public function setIdleTimeout($timeout) |
{ |
if (null !== $timeout && $this->outputDisabled) { |
throw new LogicException('Idle timeout can not be set while the output is disabled.'); |
} |
$this->idleTimeout = $this->validateTimeout($timeout); |
return $this; |
} |
/** |
* Enables or disables the TTY mode. |
* |
* @param bool $tty True to enabled and false to disable |
* |
* @return self The current Process instance |
* |
* @throws RuntimeException In case the TTY mode is not supported |
*/ |
public function setTty($tty) |
{ |
if ('\\' === DIRECTORY_SEPARATOR && $tty) { |
throw new RuntimeException('TTY mode is not supported on Windows platform.'); |
} |
if ($tty) { |
static $isTtySupported; |
if (null === $isTtySupported) { |
$isTtySupported = (bool) @proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes); |
} |
if (!$isTtySupported) { |
throw new RuntimeException('TTY mode requires /dev/tty to be read/writable.'); |
} |
} |
$this->tty = (bool) $tty; |
return $this; |
} |
/** |
* Checks if the TTY mode is enabled. |
* |
* @return bool true if the TTY mode is enabled, false otherwise |
*/ |
public function isTty() |
{ |
return $this->tty; |
} |
/** |
* Sets PTY mode. |
* |
* @param bool $bool |
* |
* @return self |
*/ |
public function setPty($bool) |
{ |
$this->pty = (bool) $bool; |
return $this; |
} |
/** |
* Returns PTY state. |
* |
* @return bool |
*/ |
public function isPty() |
{ |
return $this->pty; |
} |
/** |
* Gets the working directory. |
* |
* @return string|null The current working directory or null on failure |
*/ |
public function getWorkingDirectory() |
{ |
if (null === $this->cwd) { |
// getcwd() will return false if any one of the parent directories does not have |
// the readable or search mode set, even if the current directory does |
return getcwd() ?: null; |
} |
return $this->cwd; |
} |
/** |
* Sets the current working directory. |
* |
* @param string $cwd The new working directory |
* |
* @return self The current Process instance |
*/ |
public function setWorkingDirectory($cwd) |
{ |
$this->cwd = $cwd; |
return $this; |
} |
/** |
* Gets the environment variables. |
* |
* @return array The current environment variables |
*/ |
public function getEnv() |
{ |
return $this->env; |
} |
/** |
* Sets the environment variables. |
* |
* An environment variable value should be a string. |
* If it is an array, the variable is ignored. |
* If it is false or null, it will be removed when |
* env vars are otherwise inherited. |
* |
* That happens in PHP when 'argv' is registered into |
* the $_ENV array for instance. |
* |
* @param array $env The new environment variables |
* |
* @return self The current Process instance |
*/ |
public function setEnv(array $env) |
{ |
// Process can not handle env values that are arrays |
$env = array_filter($env, function ($value) { |
return !is_array($value); |
}); |
$this->env = $env; |
return $this; |
} |
/** |
* Gets the Process input. |
* |
* @return resource|string|\Iterator|null The Process input |
*/ |
public function getInput() |
{ |
return $this->input; |
} |
/** |
* Sets the input. |
* |
* This content will be passed to the underlying process standard input. |
* |
* @param resource|scalar|\Traversable|null $input The content |
* |
* @return self The current Process instance |
* |
* @throws LogicException In case the process is running |
*/ |
public function setInput($input) |
{ |
if ($this->isRunning()) { |
throw new LogicException('Input can not be set while the process is running.'); |
} |
$this->input = ProcessUtils::validateInput(__METHOD__, $input); |
return $this; |
} |
/** |
* Gets the options for proc_open. |
* |
* @return array The current options |
* |
* @deprecated since version 3.3, to be removed in 4.0. |
*/ |
public function getOptions() |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); |
return $this->options; |
} |
/** |
* Sets the options for proc_open. |
* |
* @param array $options The new options |
* |
* @return self The current Process instance |
* |
* @deprecated since version 3.3, to be removed in 4.0. |
*/ |
public function setOptions(array $options) |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); |
$this->options = $options; |
return $this; |
} |
/** |
* Gets whether or not Windows compatibility is enabled. |
* |
* This is true by default. |
* |
* @return bool |
* |
* @deprecated since version 3.3, to be removed in 4.0. Enhanced Windows compatibility will always be enabled. |
*/ |
public function getEnhanceWindowsCompatibility() |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Enhanced Windows compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); |
return $this->enhanceWindowsCompatibility; |
} |
/** |
* Sets whether or not Windows compatibility is enabled. |
* |
* @param bool $enhance |
* |
* @return self The current Process instance |
* |
* @deprecated since version 3.3, to be removed in 4.0. Enhanced Windows compatibility will always be enabled. |
*/ |
public function setEnhanceWindowsCompatibility($enhance) |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Enhanced Windows compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); |
$this->enhanceWindowsCompatibility = (bool) $enhance; |
return $this; |
} |
/** |
* Returns whether sigchild compatibility mode is activated or not. |
* |
* @return bool |
* |
* @deprecated since version 3.3, to be removed in 4.0. Sigchild compatibility will always be enabled. |
*/ |
public function getEnhanceSigchildCompatibility() |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); |
return $this->enhanceSigchildCompatibility; |
} |
/** |
* Activates sigchild compatibility mode. |
* |
* Sigchild compatibility mode is required to get the exit code and |
* determine the success of a process when PHP has been compiled with |
* the --enable-sigchild option |
* |
* @param bool $enhance |
* |
* @return self The current Process instance |
* |
* @deprecated since version 3.3, to be removed in 4.0. |
*/ |
public function setEnhanceSigchildCompatibility($enhance) |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); |
$this->enhanceSigchildCompatibility = (bool) $enhance; |
return $this; |
} |
/** |
* Sets whether environment variables will be inherited or not. |
* |
* @param bool $inheritEnv |
* |
* @return self The current Process instance |
*/ |
public function inheritEnvironmentVariables($inheritEnv = true) |
{ |
if (!$inheritEnv) { |
@trigger_error('Not inheriting environment variables is deprecated since Symfony 3.3 and will always happen in 4.0. Set "Process::inheritEnvironmentVariables()" to true instead.', E_USER_DEPRECATED); |
} |
$this->inheritEnv = (bool) $inheritEnv; |
return $this; |
} |
/** |
* Returns whether environment variables will be inherited or not. |
* |
* @return bool |
* |
* @deprecated since version 3.3, to be removed in 4.0. Environment variables will always be inherited. |
*/ |
public function areEnvironmentVariablesInherited() |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Environment variables will always be inherited.', __METHOD__), E_USER_DEPRECATED); |
return $this->inheritEnv; |
} |
/** |
* Performs a check between the timeout definition and the time the process started. |
* |
* In case you run a background process (with the start method), you should |
* trigger this method regularly to ensure the process timeout |
* |
* @throws ProcessTimedOutException In case the timeout was reached |
*/ |
public function checkTimeout() |
{ |
if ($this->status !== self::STATUS_STARTED) { |
return; |
} |
if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { |
$this->stop(0); |
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); |
} |
if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { |
$this->stop(0); |
throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); |
} |
} |
/** |
* Returns whether PTY is supported on the current operating system. |
* |
* @return bool |
*/ |
public static function isPtySupported() |
{ |
static $result; |
if (null !== $result) { |
return $result; |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
return $result = false; |
} |
return $result = (bool) @proc_open('echo 1 >/dev/null', array(array('pty'), array('pty'), array('pty')), $pipes); |
} |
/** |
* Creates the descriptors needed by the proc_open. |
* |
* @return array |
*/ |
private function getDescriptors() |
{ |
if ($this->input instanceof \Iterator) { |
$this->input->rewind(); |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); |
} else { |
$this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); |
} |
return $this->processPipes->getDescriptors(); |
} |
/** |
* Builds up the callback used by wait(). |
* |
* The callbacks adds all occurred output to the specific buffer and calls |
* the user callback (if present) with the received output. |
* |
* @param callable|null $callback The user defined PHP callback |
* |
* @return \Closure A PHP closure |
*/ |
protected function buildCallback(callable $callback = null) |
{ |
if ($this->outputDisabled) { |
return function ($type, $data) use ($callback) { |
if (null !== $callback) { |
call_user_func($callback, $type, $data); |
} |
}; |
} |
$out = self::OUT; |
return function ($type, $data) use ($callback, $out) { |
if ($out == $type) { |
$this->addOutput($data); |
} else { |
$this->addErrorOutput($data); |
} |
if (null !== $callback) { |
call_user_func($callback, $type, $data); |
} |
}; |
} |
/** |
* Updates the status of the process, reads pipes. |
* |
* @param bool $blocking Whether to use a blocking read call |
*/ |
protected function updateStatus($blocking) |
{ |
if (self::STATUS_STARTED !== $this->status) { |
return; |
} |
$this->processInformation = proc_get_status($this->process); |
$running = $this->processInformation['running']; |
$this->readPipes($running && $blocking, '\\' !== DIRECTORY_SEPARATOR || !$running); |
if ($this->fallbackStatus && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
$this->processInformation = $this->fallbackStatus + $this->processInformation; |
} |
if (!$running) { |
$this->close(); |
} |
} |
/** |
* Returns whether PHP has been compiled with the '--enable-sigchild' option or not. |
* |
* @return bool |
*/ |
protected function isSigchildEnabled() |
{ |
if (null !== self::$sigchild) { |
return self::$sigchild; |
} |
if (!function_exists('phpinfo') || defined('HHVM_VERSION')) { |
return self::$sigchild = false; |
} |
ob_start(); |
phpinfo(INFO_GENERAL); |
return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild'); |
} |
/** |
* Reads pipes for the freshest output. |
* |
* @param string $caller The name of the method that needs fresh outputs |
* @param bool $blocking Whether to use blocking calls or not |
* |
* @throws LogicException in case output has been disabled or process is not started |
*/ |
private function readPipesForOutput($caller, $blocking = false) |
{ |
if ($this->outputDisabled) { |
throw new LogicException('Output has been disabled.'); |
} |
$this->requireProcessIsStarted($caller); |
$this->updateStatus($blocking); |
} |
/** |
* Validates and returns the filtered timeout. |
* |
* @param int|float|null $timeout |
* |
* @return float|null |
* |
* @throws InvalidArgumentException if the given timeout is a negative number |
*/ |
private function validateTimeout($timeout) |
{ |
$timeout = (float) $timeout; |
if (0.0 === $timeout) { |
$timeout = null; |
} elseif ($timeout < 0) { |
throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); |
} |
return $timeout; |
} |
/** |
* Reads pipes, executes callback. |
* |
* @param bool $blocking Whether to use blocking calls or not |
* @param bool $close Whether to close file handles or not |
*/ |
private function readPipes($blocking, $close) |
{ |
$result = $this->processPipes->readAndWrite($blocking, $close); |
$callback = $this->callback; |
foreach ($result as $type => $data) { |
if (3 !== $type) { |
$callback($type === self::STDOUT ? self::OUT : self::ERR, $data); |
} elseif (!isset($this->fallbackStatus['signaled'])) { |
$this->fallbackStatus['exitcode'] = (int) $data; |
} |
} |
} |
/** |
* Closes process resource, closes file handles, sets the exitcode. |
* |
* @return int The exitcode |
*/ |
private function close() |
{ |
$this->processPipes->close(); |
if (is_resource($this->process)) { |
proc_close($this->process); |
} |
$this->exitcode = $this->processInformation['exitcode']; |
$this->status = self::STATUS_TERMINATED; |
if (-1 === $this->exitcode) { |
if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { |
// if process has been signaled, no exitcode but a valid termsig, apply Unix convention |
$this->exitcode = 128 + $this->processInformation['termsig']; |
} elseif ($this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { |
$this->processInformation['signaled'] = true; |
$this->processInformation['termsig'] = -1; |
} |
} |
// Free memory from self-reference callback created by buildCallback |
// Doing so in other contexts like __destruct or by garbage collector is ineffective |
// Now pipes are closed, so the callback is no longer necessary |
$this->callback = null; |
return $this->exitcode; |
} |
/** |
* Resets data related to the latest run of the process. |
*/ |
private function resetProcessData() |
{ |
$this->starttime = null; |
$this->callback = null; |
$this->exitcode = null; |
$this->fallbackStatus = array(); |
$this->processInformation = null; |
$this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'wb+'); |
$this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'wb+'); |
$this->process = null; |
$this->latestSignal = null; |
$this->status = self::STATUS_READY; |
$this->incrementalOutputOffset = 0; |
$this->incrementalErrorOutputOffset = 0; |
} |
/** |
* Sends a POSIX signal to the process. |
* |
* @param int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) |
* @param bool $throwException Whether to throw exception in case signal failed |
* |
* @return bool True if the signal was sent successfully, false otherwise |
* |
* @throws LogicException In case the process is not running |
* @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed |
* @throws RuntimeException In case of failure |
*/ |
private function doSignal($signal, $throwException) |
{ |
if (null === $pid = $this->getPid()) { |
if ($throwException) { |
throw new LogicException('Can not send signal on a non running process.'); |
} |
return false; |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); |
if ($exitCode && $this->isRunning()) { |
if ($throwException) { |
throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); |
} |
return false; |
} |
} else { |
if (!$this->enhanceSigchildCompatibility || !$this->isSigchildEnabled()) { |
$ok = @proc_terminate($this->process, $signal); |
} elseif (function_exists('posix_kill')) { |
$ok = @posix_kill($pid, $signal); |
} elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), array(2 => array('pipe', 'w')), $pipes)) { |
$ok = false === fgets($pipes[2]); |
} |
if (!$ok) { |
if ($throwException) { |
throw new RuntimeException(sprintf('Error while sending signal `%s`.', $signal)); |
} |
return false; |
} |
} |
$this->latestSignal = (int) $signal; |
$this->fallbackStatus['signaled'] = true; |
$this->fallbackStatus['exitcode'] = -1; |
$this->fallbackStatus['termsig'] = $this->latestSignal; |
return true; |
} |
private function prepareWindowsCommandLine($cmd, array &$envBackup, array &$env = null) |
{ |
$uid = uniqid('', true); |
$varCount = 0; |
$varCache = array(); |
$cmd = preg_replace_callback( |
'/"( |
[^"%!^]*+ |
(?: |
(?: !LF! | "(?:\^[%!^])?+" ) |
[^"%!^]*+ |
)++ |
)"/x', |
function ($m) use (&$envBackup, &$env, &$varCache, &$varCount, $uid) { |
if (isset($varCache[$m[0]])) { |
return $varCache[$m[0]]; |
} |
if (false !== strpos($value = $m[1], "\0")) { |
$value = str_replace("\0", '?', $value); |
} |
if (false === strpbrk($value, "\"%!\n")) { |
return '"'.$value.'"'; |
} |
$value = str_replace(array('!LF!', '"^!"', '"^%"', '"^^"', '""'), array("\n", '!', '%', '^', '"'), $value); |
$value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; |
$var = $uid.++$varCount; |
if (null === $env) { |
putenv("$var=$value"); |
} else { |
$env[$var] = $value; |
} |
$envBackup[$var] = false; |
return $varCache[$m[0]] = '!'.$var.'!'; |
}, |
$cmd |
); |
$cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; |
foreach ($this->processPipes->getFiles() as $offset => $filename) { |
$cmd .= ' '.$offset.'>"'.$filename.'"'; |
} |
return $cmd; |
} |
/** |
* Ensures the process is running or terminated, throws a LogicException if the process has a not started. |
* |
* @param string $functionName The function name that was called |
* |
* @throws LogicException If the process has not run. |
*/ |
private function requireProcessIsStarted($functionName) |
{ |
if (!$this->isStarted()) { |
throw new LogicException(sprintf('Process must be started before calling %s.', $functionName)); |
} |
} |
/** |
* Ensures the process is terminated, throws a LogicException if the process has a status different than `terminated`. |
* |
* @param string $functionName The function name that was called |
* |
* @throws LogicException If the process is not yet terminated. |
*/ |
private function requireProcessIsTerminated($functionName) |
{ |
if (!$this->isTerminated()) { |
throw new LogicException(sprintf('Process must be terminated before calling %s.', $functionName)); |
} |
} |
/** |
* Escapes a string to be used as a shell argument. |
* |
* @param string $argument The argument that will be escaped |
* |
* @return string The escaped argument |
*/ |
private function escapeArgument($argument) |
{ |
if ('\\' !== DIRECTORY_SEPARATOR) { |
return "'".str_replace("'", "'\\''", $argument)."'"; |
} |
if ('' === $argument = (string) $argument) { |
return '""'; |
} |
if (false !== strpos($argument, "\0")) { |
$argument = str_replace("\0", '?', $argument); |
} |
if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { |
return $argument; |
} |
$argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); |
return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"'; |
} |
} |
/vendor/symfony/process/ProcessBuilder.php |
---|
@@ -0,0 +1,285 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
use Symfony\Component\Process\Exception\InvalidArgumentException; |
use Symfony\Component\Process\Exception\LogicException; |
/** |
* Process builder. |
* |
* @author Kris Wallsmith <kris@symfony.com> |
*/ |
class ProcessBuilder |
{ |
private $arguments; |
private $cwd; |
private $env = array(); |
private $input; |
private $timeout = 60; |
private $options; |
private $inheritEnv = true; |
private $prefix = array(); |
private $outputDisabled = false; |
/** |
* Constructor. |
* |
* @param string[] $arguments An array of arguments |
*/ |
public function __construct(array $arguments = array()) |
{ |
$this->arguments = $arguments; |
} |
/** |
* Creates a process builder instance. |
* |
* @param string[] $arguments An array of arguments |
* |
* @return static |
*/ |
public static function create(array $arguments = array()) |
{ |
return new static($arguments); |
} |
/** |
* Adds an unescaped argument to the command string. |
* |
* @param string $argument A command argument |
* |
* @return $this |
*/ |
public function add($argument) |
{ |
$this->arguments[] = $argument; |
return $this; |
} |
/** |
* Adds a prefix to the command string. |
* |
* The prefix is preserved when resetting arguments. |
* |
* @param string|array $prefix A command prefix or an array of command prefixes |
* |
* @return $this |
*/ |
public function setPrefix($prefix) |
{ |
$this->prefix = is_array($prefix) ? $prefix : array($prefix); |
return $this; |
} |
/** |
* Sets the arguments of the process. |
* |
* Arguments must not be escaped. |
* Previous arguments are removed. |
* |
* @param string[] $arguments |
* |
* @return $this |
*/ |
public function setArguments(array $arguments) |
{ |
$this->arguments = $arguments; |
return $this; |
} |
/** |
* Sets the working directory. |
* |
* @param null|string $cwd The working directory |
* |
* @return $this |
*/ |
public function setWorkingDirectory($cwd) |
{ |
$this->cwd = $cwd; |
return $this; |
} |
/** |
* Sets whether environment variables will be inherited or not. |
* |
* @param bool $inheritEnv |
* |
* @return $this |
* |
* @deprecated since version 3.3, to be removed in 4.0. |
*/ |
public function inheritEnvironmentVariables($inheritEnv = true) |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); |
$this->inheritEnv = $inheritEnv; |
return $this; |
} |
/** |
* Sets an environment variable. |
* |
* Setting a variable overrides its previous value. Use `null` to unset a |
* defined environment variable. |
* |
* @param string $name The variable name |
* @param null|string $value The variable value |
* |
* @return $this |
*/ |
public function setEnv($name, $value) |
{ |
$this->env[$name] = $value; |
return $this; |
} |
/** |
* Adds a set of environment variables. |
* |
* Already existing environment variables with the same name will be |
* overridden by the new values passed to this method. Pass `null` to unset |
* a variable. |
* |
* @param array $variables The variables |
* |
* @return $this |
*/ |
public function addEnvironmentVariables(array $variables) |
{ |
$this->env = array_replace($this->env, $variables); |
return $this; |
} |
/** |
* Sets the input of the process. |
* |
* @param resource|scalar|\Traversable|null $input The input content |
* |
* @return $this |
* |
* @throws InvalidArgumentException In case the argument is invalid |
*/ |
public function setInput($input) |
{ |
$this->input = ProcessUtils::validateInput(__METHOD__, $input); |
return $this; |
} |
/** |
* Sets the process timeout. |
* |
* To disable the timeout, set this value to null. |
* |
* @param float|null $timeout |
* |
* @return $this |
* |
* @throws InvalidArgumentException |
*/ |
public function setTimeout($timeout) |
{ |
if (null === $timeout) { |
$this->timeout = null; |
return $this; |
} |
$timeout = (float) $timeout; |
if ($timeout < 0) { |
throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); |
} |
$this->timeout = $timeout; |
return $this; |
} |
/** |
* Adds a proc_open option. |
* |
* @param string $name The option name |
* @param string $value The option value |
* |
* @return $this |
* |
* @deprecated since version 3.3, to be removed in 4.0. |
*/ |
public function setOption($name, $value) |
{ |
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); |
$this->options[$name] = $value; |
return $this; |
} |
/** |
* Disables fetching output and error output from the underlying process. |
* |
* @return $this |
*/ |
public function disableOutput() |
{ |
$this->outputDisabled = true; |
return $this; |
} |
/** |
* Enables fetching output and error output from the underlying process. |
* |
* @return $this |
*/ |
public function enableOutput() |
{ |
$this->outputDisabled = false; |
return $this; |
} |
/** |
* Creates a Process instance and returns it. |
* |
* @return Process |
* |
* @throws LogicException In case no arguments have been provided |
*/ |
public function getProcess() |
{ |
if (0 === count($this->prefix) && 0 === count($this->arguments)) { |
throw new LogicException('You must add() command arguments before calling getProcess().'); |
} |
$arguments = array_merge($this->prefix, $this->arguments); |
$process = new Process($arguments, $this->cwd, $this->env, $this->input, $this->timeout, $this->options); |
if ($this->inheritEnv) { |
$process->inheritEnvironmentVariables(); |
} |
if ($this->outputDisabled) { |
$process->disableOutput(); |
} |
return $process; |
} |
} |
/vendor/symfony/process/ProcessUtils.php |
---|
@@ -0,0 +1,123 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process; |
use Symfony\Component\Process\Exception\InvalidArgumentException; |
/** |
* ProcessUtils is a bunch of utility methods. |
* |
* This class contains static methods only and is not meant to be instantiated. |
* |
* @author Martin Hasoň <martin.hason@gmail.com> |
*/ |
class ProcessUtils |
{ |
/** |
* This class should not be instantiated. |
*/ |
private function __construct() |
{ |
} |
/** |
* Escapes a string to be used as a shell argument. |
* |
* @param string $argument The argument that will be escaped |
* |
* @return string The escaped argument |
* |
* @deprecated since version 3.3, to be removed in 4.0. Use a command line array or give env vars to the `Process::start/run()` method instead. |
*/ |
public static function escapeArgument($argument) |
{ |
@trigger_error('The '.__METHOD__.'() method is deprecated since version 3.3 and will be removed in 4.0. Use a command line array or give env vars to the Process::start/run() method instead.', E_USER_DEPRECATED); |
//Fix for PHP bug #43784 escapeshellarg removes % from given string |
//Fix for PHP bug #49446 escapeshellarg doesn't work on Windows |
//@see https://bugs.php.net/bug.php?id=43784 |
//@see https://bugs.php.net/bug.php?id=49446 |
if ('\\' === DIRECTORY_SEPARATOR) { |
if ('' === $argument) { |
return escapeshellarg($argument); |
} |
$escapedArgument = ''; |
$quote = false; |
foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { |
if ('"' === $part) { |
$escapedArgument .= '\\"'; |
} elseif (self::isSurroundedBy($part, '%')) { |
// Avoid environment variable expansion |
$escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; |
} else { |
// escape trailing backslash |
if ('\\' === substr($part, -1)) { |
$part .= '\\'; |
} |
$quote = true; |
$escapedArgument .= $part; |
} |
} |
if ($quote) { |
$escapedArgument = '"'.$escapedArgument.'"'; |
} |
return $escapedArgument; |
} |
return "'".str_replace("'", "'\\''", $argument)."'"; |
} |
/** |
* Validates and normalizes a Process input. |
* |
* @param string $caller The name of method call that validates the input |
* @param mixed $input The input to validate |
* |
* @return mixed The validated input |
* |
* @throws InvalidArgumentException In case the input is not valid |
*/ |
public static function validateInput($caller, $input) |
{ |
if (null !== $input) { |
if (is_resource($input)) { |
return $input; |
} |
if (is_string($input)) { |
return $input; |
} |
if (is_scalar($input)) { |
return (string) $input; |
} |
if ($input instanceof Process) { |
return $input->getIterator($input::ITER_SKIP_ERR); |
} |
if ($input instanceof \Iterator) { |
return $input; |
} |
if ($input instanceof \Traversable) { |
return new \IteratorIterator($input); |
} |
throw new InvalidArgumentException(sprintf('%s only accepts strings, Traversable objects or stream resources.', $caller)); |
} |
return $input; |
} |
private static function isSurroundedBy($arg, $char) |
{ |
return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; |
} |
} |
/vendor/symfony/process/README.md |
---|
@@ -0,0 +1,13 @@ |
Process Component |
================= |
The Process component executes commands in sub-processes. |
Resources |
--------- |
* [Documentation](https://symfony.com/doc/current/components/process.html) |
* [Contributing](https://symfony.com/doc/current/contributing/index.html) |
* [Report issues](https://github.com/symfony/symfony/issues) and |
[send Pull Requests](https://github.com/symfony/symfony/pulls) |
in the [main Symfony repository](https://github.com/symfony/symfony) |
/vendor/symfony/process/Tests/ExecutableFinderTest.php |
---|
@@ -0,0 +1,133 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\ExecutableFinder; |
/** |
* @author Chris Smith <chris@cs278.org> |
*/ |
class ExecutableFinderTest extends TestCase |
{ |
private $path; |
protected function tearDown() |
{ |
if ($this->path) { |
// Restore path if it was changed. |
putenv('PATH='.$this->path); |
} |
} |
private function setPath($path) |
{ |
$this->path = getenv('PATH'); |
putenv('PATH='.$path); |
} |
public function testFind() |
{ |
if (ini_get('open_basedir')) { |
$this->markTestSkipped('Cannot test when open_basedir is set'); |
} |
$this->setPath(dirname(PHP_BINARY)); |
$finder = new ExecutableFinder(); |
$result = $finder->find($this->getPhpBinaryName()); |
$this->assertSamePath(PHP_BINARY, $result); |
} |
public function testFindWithDefault() |
{ |
if (ini_get('open_basedir')) { |
$this->markTestSkipped('Cannot test when open_basedir is set'); |
} |
$expected = 'defaultValue'; |
$this->setPath(''); |
$finder = new ExecutableFinder(); |
$result = $finder->find('foo', $expected); |
$this->assertEquals($expected, $result); |
} |
public function testFindWithExtraDirs() |
{ |
if (ini_get('open_basedir')) { |
$this->markTestSkipped('Cannot test when open_basedir is set'); |
} |
$this->setPath(''); |
$extraDirs = array(dirname(PHP_BINARY)); |
$finder = new ExecutableFinder(); |
$result = $finder->find($this->getPhpBinaryName(), null, $extraDirs); |
$this->assertSamePath(PHP_BINARY, $result); |
} |
public function testFindWithOpenBaseDir() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Cannot run test on windows'); |
} |
if (ini_get('open_basedir')) { |
$this->markTestSkipped('Cannot test when open_basedir is set'); |
} |
$this->iniSet('open_basedir', dirname(PHP_BINARY).(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : '')); |
$finder = new ExecutableFinder(); |
$result = $finder->find($this->getPhpBinaryName()); |
$this->assertSamePath(PHP_BINARY, $result); |
} |
public function testFindProcessInOpenBasedir() |
{ |
if (ini_get('open_basedir')) { |
$this->markTestSkipped('Cannot test when open_basedir is set'); |
} |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Cannot run test on windows'); |
} |
$this->setPath(''); |
$this->iniSet('open_basedir', PHP_BINARY.(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : '')); |
$finder = new ExecutableFinder(); |
$result = $finder->find($this->getPhpBinaryName(), false); |
$this->assertSamePath(PHP_BINARY, $result); |
} |
private function assertSamePath($expected, $tested) |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals(strtolower($expected), strtolower($tested)); |
} else { |
$this->assertEquals($expected, $tested); |
} |
} |
private function getPhpBinaryName() |
{ |
return basename(PHP_BINARY, '\\' === DIRECTORY_SEPARATOR ? '.exe' : ''); |
} |
} |
/vendor/symfony/process/Tests/NonStopableProcess.php |
---|
@@ -0,0 +1,47 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
/** |
* Runs a PHP script that can be stopped only with a SIGKILL (9) signal for 3 seconds. |
* |
* @args duration Run this script with a custom duration |
* |
* @example `php NonStopableProcess.php 42` will run the script for 42 seconds |
*/ |
function handleSignal($signal) |
{ |
switch ($signal) { |
case SIGTERM: |
$name = 'SIGTERM'; |
break; |
case SIGINT: |
$name = 'SIGINT'; |
break; |
default: |
$name = $signal.' (unknown)'; |
break; |
} |
echo "signal $name\n"; |
} |
pcntl_signal(SIGTERM, 'handleSignal'); |
pcntl_signal(SIGINT, 'handleSignal'); |
echo 'received '; |
$duration = isset($argv[1]) ? (int) $argv[1] : 3; |
$start = microtime(true); |
while ($duration > (microtime(true) - $start)) { |
usleep(10000); |
pcntl_signal_dispatch(); |
} |
/vendor/symfony/process/Tests/PhpExecutableFinderTest.php |
---|
@@ -0,0 +1,72 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\PhpExecutableFinder; |
/** |
* @author Robert Schönthal <seroscho@googlemail.com> |
*/ |
class PhpExecutableFinderTest extends TestCase |
{ |
/** |
* tests find() with the constant PHP_BINARY. |
*/ |
public function testFind() |
{ |
if (defined('HHVM_VERSION')) { |
$this->markTestSkipped('Should not be executed in HHVM context.'); |
} |
$f = new PhpExecutableFinder(); |
$current = PHP_BINARY; |
$args = 'phpdbg' === PHP_SAPI ? ' -qrr' : ''; |
$this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP'); |
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); |
} |
/** |
* tests find() with the env var / constant PHP_BINARY with HHVM. |
*/ |
public function testFindWithHHVM() |
{ |
if (!defined('HHVM_VERSION')) { |
$this->markTestSkipped('Should be executed in HHVM context.'); |
} |
$f = new PhpExecutableFinder(); |
$current = getenv('PHP_BINARY') ?: PHP_BINARY; |
$this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP'); |
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); |
} |
/** |
* tests find() with the env var PHP_PATH. |
*/ |
public function testFindArguments() |
{ |
$f = new PhpExecutableFinder(); |
if (defined('HHVM_VERSION')) { |
$this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments'); |
} elseif ('phpdbg' === PHP_SAPI) { |
$this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments'); |
} else { |
$this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments'); |
} |
} |
} |
/vendor/symfony/process/Tests/PhpProcessTest.php |
---|
@@ -0,0 +1,48 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\PhpProcess; |
class PhpProcessTest extends TestCase |
{ |
public function testNonBlockingWorks() |
{ |
$expected = 'hello world!'; |
$process = new PhpProcess(<<<PHP |
<?php echo '$expected'; |
PHP |
); |
$process->start(); |
$process->wait(); |
$this->assertEquals($expected, $process->getOutput()); |
} |
public function testCommandLine() |
{ |
$process = new PhpProcess(<<<'PHP' |
<?php echo phpversion().PHP_SAPI; |
PHP |
); |
$commandLine = $process->getCommandLine(); |
$process->start(); |
$this->assertContains($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after start'); |
$process->wait(); |
$this->assertContains($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after wait'); |
$this->assertSame(phpversion().PHP_SAPI, $process->getOutput()); |
} |
} |
/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php |
---|
@@ -0,0 +1,72 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
define('ERR_SELECT_FAILED', 1); |
define('ERR_TIMEOUT', 2); |
define('ERR_READ_FAILED', 3); |
define('ERR_WRITE_FAILED', 4); |
$read = array(STDIN); |
$write = array(STDOUT, STDERR); |
stream_set_blocking(STDIN, 0); |
stream_set_blocking(STDOUT, 0); |
stream_set_blocking(STDERR, 0); |
$out = $err = ''; |
while ($read || $write) { |
$r = $read; |
$w = $write; |
$e = null; |
$n = stream_select($r, $w, $e, 5); |
if (false === $n) { |
die(ERR_SELECT_FAILED); |
} elseif ($n < 1) { |
die(ERR_TIMEOUT); |
} |
if (in_array(STDOUT, $w) && strlen($out) > 0) { |
$written = fwrite(STDOUT, (binary) $out, 32768); |
if (false === $written) { |
die(ERR_WRITE_FAILED); |
} |
$out = (binary) substr($out, $written); |
} |
if (null === $read && '' === $out) { |
$write = array_diff($write, array(STDOUT)); |
} |
if (in_array(STDERR, $w) && strlen($err) > 0) { |
$written = fwrite(STDERR, (binary) $err, 32768); |
if (false === $written) { |
die(ERR_WRITE_FAILED); |
} |
$err = (binary) substr($err, $written); |
} |
if (null === $read && '' === $err) { |
$write = array_diff($write, array(STDERR)); |
} |
if ($r) { |
$str = fread(STDIN, 32768); |
if (false !== $str) { |
$out .= $str; |
$err .= $str; |
} |
if (false === $str || feof(STDIN)) { |
$read = null; |
if (!feof(STDIN)) { |
die(ERR_READ_FAILED); |
} |
} |
} |
} |
/vendor/symfony/process/Tests/ProcessBuilderTest.php |
---|
@@ -0,0 +1,213 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\ProcessBuilder; |
class ProcessBuilderTest extends TestCase |
{ |
/** |
* @group legacy |
*/ |
public function testInheritEnvironmentVars() |
{ |
$proc = ProcessBuilder::create() |
->add('foo') |
->getProcess(); |
$this->assertTrue($proc->areEnvironmentVariablesInherited()); |
$proc = ProcessBuilder::create() |
->add('foo') |
->inheritEnvironmentVariables(false) |
->getProcess(); |
$this->assertFalse($proc->areEnvironmentVariablesInherited()); |
} |
public function testAddEnvironmentVariables() |
{ |
$pb = new ProcessBuilder(); |
$env = array( |
'foo' => 'bar', |
'foo2' => 'bar2', |
); |
$proc = $pb |
->add('command') |
->setEnv('foo', 'bar2') |
->addEnvironmentVariables($env) |
->getProcess() |
; |
$this->assertSame($env, $proc->getEnv()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException |
*/ |
public function testNegativeTimeoutFromSetter() |
{ |
$pb = new ProcessBuilder(); |
$pb->setTimeout(-1); |
} |
public function testNullTimeout() |
{ |
$pb = new ProcessBuilder(); |
$pb->setTimeout(10); |
$pb->setTimeout(null); |
$r = new \ReflectionObject($pb); |
$p = $r->getProperty('timeout'); |
$p->setAccessible(true); |
$this->assertNull($p->getValue($pb)); |
} |
public function testShouldSetArguments() |
{ |
$pb = new ProcessBuilder(array('initial')); |
$pb->setArguments(array('second')); |
$proc = $pb->getProcess(); |
$this->assertContains('second', $proc->getCommandLine()); |
} |
public function testPrefixIsPrependedToAllGeneratedProcess() |
{ |
$pb = new ProcessBuilder(); |
$pb->setPrefix('/usr/bin/php'); |
$proc = $pb->setArguments(array('-v'))->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php" -v', $proc->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php' '-v'", $proc->getCommandLine()); |
} |
$proc = $pb->setArguments(array('-i'))->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php" -i', $proc->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php' '-i'", $proc->getCommandLine()); |
} |
} |
public function testArrayPrefixesArePrependedToAllGeneratedProcess() |
{ |
$pb = new ProcessBuilder(); |
$pb->setPrefix(array('/usr/bin/php', 'composer.phar')); |
$proc = $pb->setArguments(array('-v'))->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php" composer.phar -v', $proc->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php' 'composer.phar' '-v'", $proc->getCommandLine()); |
} |
$proc = $pb->setArguments(array('-i'))->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php" composer.phar -i', $proc->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php' 'composer.phar' '-i'", $proc->getCommandLine()); |
} |
} |
public function testShouldEscapeArguments() |
{ |
$pb = new ProcessBuilder(array('%path%', 'foo " bar', '%baz%baz')); |
$proc = $pb->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertSame('""^%"path"^%"" "foo "" bar" ""^%"baz"^%"baz"', $proc->getCommandLine()); |
} else { |
$this->assertSame("'%path%' 'foo \" bar' '%baz%baz'", $proc->getCommandLine()); |
} |
} |
public function testShouldEscapeArgumentsAndPrefix() |
{ |
$pb = new ProcessBuilder(array('arg')); |
$pb->setPrefix('%prefix%'); |
$proc = $pb->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertSame('""^%"prefix"^%"" arg', $proc->getCommandLine()); |
} else { |
$this->assertSame("'%prefix%' 'arg'", $proc->getCommandLine()); |
} |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
*/ |
public function testShouldThrowALogicExceptionIfNoPrefixAndNoArgument() |
{ |
ProcessBuilder::create()->getProcess(); |
} |
public function testShouldNotThrowALogicExceptionIfNoArgument() |
{ |
$process = ProcessBuilder::create() |
->setPrefix('/usr/bin/php') |
->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php"', $process->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php'", $process->getCommandLine()); |
} |
} |
public function testShouldNotThrowALogicExceptionIfNoPrefix() |
{ |
$process = ProcessBuilder::create(array('/usr/bin/php')) |
->getProcess(); |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->assertEquals('"/usr/bin/php"', $process->getCommandLine()); |
} else { |
$this->assertEquals("'/usr/bin/php'", $process->getCommandLine()); |
} |
} |
public function testShouldReturnProcessWithDisabledOutput() |
{ |
$process = ProcessBuilder::create(array('/usr/bin/php')) |
->disableOutput() |
->getProcess(); |
$this->assertTrue($process->isOutputDisabled()); |
} |
public function testShouldReturnProcessWithEnabledOutput() |
{ |
$process = ProcessBuilder::create(array('/usr/bin/php')) |
->disableOutput() |
->enableOutput() |
->getProcess(); |
$this->assertFalse($process->isOutputDisabled()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException |
* @expectedExceptionMessage Symfony\Component\Process\ProcessBuilder::setInput only accepts strings, Traversable objects or stream resources. |
*/ |
public function testInvalidInput() |
{ |
$builder = ProcessBuilder::create(); |
$builder->setInput(array()); |
} |
} |
/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php |
---|
@@ -0,0 +1,135 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\Exception\ProcessFailedException; |
/** |
* @author Sebastian Marek <proofek@gmail.com> |
*/ |
class ProcessFailedExceptionTest extends TestCase |
{ |
/** |
* tests ProcessFailedException throws exception if the process was successful. |
*/ |
public function testProcessFailedExceptionThrowsException() |
{ |
$process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful'))->setConstructorArgs(array('php'))->getMock(); |
$process->expects($this->once()) |
->method('isSuccessful') |
->will($this->returnValue(true)); |
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}( |
'\InvalidArgumentException', |
'Expected a failed process, but the given process was successful.' |
); |
new ProcessFailedException($process); |
} |
/** |
* tests ProcessFailedException uses information from process output |
* to generate exception message. |
*/ |
public function testProcessFailedExceptionPopulatesInformationFromProcessOutput() |
{ |
$cmd = 'php'; |
$exitCode = 1; |
$exitText = 'General error'; |
$output = 'Command output'; |
$errorOutput = 'FATAL: Unexpected error'; |
$workingDirectory = getcwd(); |
$process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock(); |
$process->expects($this->once()) |
->method('isSuccessful') |
->will($this->returnValue(false)); |
$process->expects($this->once()) |
->method('getOutput') |
->will($this->returnValue($output)); |
$process->expects($this->once()) |
->method('getErrorOutput') |
->will($this->returnValue($errorOutput)); |
$process->expects($this->once()) |
->method('getExitCode') |
->will($this->returnValue($exitCode)); |
$process->expects($this->once()) |
->method('getExitCodeText') |
->will($this->returnValue($exitText)); |
$process->expects($this->once()) |
->method('isOutputDisabled') |
->will($this->returnValue(false)); |
$process->expects($this->once()) |
->method('getWorkingDirectory') |
->will($this->returnValue($workingDirectory)); |
$exception = new ProcessFailedException($process); |
$this->assertEquals( |
"The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}\n\nOutput:\n================\n{$output}\n\nError Output:\n================\n{$errorOutput}", |
$exception->getMessage() |
); |
} |
/** |
* Tests that ProcessFailedException does not extract information from |
* process output if it was previously disabled. |
*/ |
public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput() |
{ |
$cmd = 'php'; |
$exitCode = 1; |
$exitText = 'General error'; |
$workingDirectory = getcwd(); |
$process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock(); |
$process->expects($this->once()) |
->method('isSuccessful') |
->will($this->returnValue(false)); |
$process->expects($this->never()) |
->method('getOutput'); |
$process->expects($this->never()) |
->method('getErrorOutput'); |
$process->expects($this->once()) |
->method('getExitCode') |
->will($this->returnValue($exitCode)); |
$process->expects($this->once()) |
->method('getExitCodeText') |
->will($this->returnValue($exitText)); |
$process->expects($this->once()) |
->method('isOutputDisabled') |
->will($this->returnValue(true)); |
$process->expects($this->once()) |
->method('getWorkingDirectory') |
->will($this->returnValue($workingDirectory)); |
$exception = new ProcessFailedException($process); |
$this->assertEquals( |
"The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}", |
$exception->getMessage() |
); |
} |
} |
/vendor/symfony/process/Tests/ProcessTest.php |
---|
@@ -0,0 +1,1573 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\Exception\LogicException; |
use Symfony\Component\Process\Exception\ProcessTimedOutException; |
use Symfony\Component\Process\Exception\RuntimeException; |
use Symfony\Component\Process\InputStream; |
use Symfony\Component\Process\PhpExecutableFinder; |
use Symfony\Component\Process\Pipes\PipesInterface; |
use Symfony\Component\Process\Process; |
/** |
* @author Robert Schönthal <seroscho@googlemail.com> |
*/ |
class ProcessTest extends TestCase |
{ |
private static $phpBin; |
private static $process; |
private static $sigchild; |
private static $notEnhancedSigchild = false; |
public static function setUpBeforeClass() |
{ |
$phpBin = new PhpExecutableFinder(); |
self::$phpBin = getenv('SYMFONY_PROCESS_PHP_TEST_BINARY') ?: ('phpdbg' === PHP_SAPI ? 'php' : $phpBin->find()); |
ob_start(); |
phpinfo(INFO_GENERAL); |
self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild'); |
} |
protected function tearDown() |
{ |
if (self::$process) { |
self::$process->stop(0); |
self::$process = null; |
} |
} |
public function testThatProcessDoesNotThrowWarningDuringRun() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('This test is transient on Windows'); |
} |
@trigger_error('Test Error', E_USER_NOTICE); |
$process = $this->getProcessForCode('sleep(3)'); |
$process->run(); |
$actualError = error_get_last(); |
$this->assertEquals('Test Error', $actualError['message']); |
$this->assertEquals(E_USER_NOTICE, $actualError['type']); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException |
*/ |
public function testNegativeTimeoutFromConstructor() |
{ |
$this->getProcess('', null, null, null, -1); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException |
*/ |
public function testNegativeTimeoutFromSetter() |
{ |
$p = $this->getProcess(''); |
$p->setTimeout(-1); |
} |
public function testFloatAndNullTimeout() |
{ |
$p = $this->getProcess(''); |
$p->setTimeout(10); |
$this->assertSame(10.0, $p->getTimeout()); |
$p->setTimeout(null); |
$this->assertNull($p->getTimeout()); |
$p->setTimeout(0.0); |
$this->assertNull($p->getTimeout()); |
} |
/** |
* @requires extension pcntl |
*/ |
public function testStopWithTimeoutIsActuallyWorking() |
{ |
$p = $this->getProcess(array(self::$phpBin, __DIR__.'/NonStopableProcess.php', 30)); |
$p->start(); |
while (false === strpos($p->getOutput(), 'received')) { |
usleep(1000); |
} |
$start = microtime(true); |
$p->stop(0.1); |
$p->wait(); |
$this->assertLessThan(15, microtime(true) - $start); |
} |
public function testAllOutputIsActuallyReadOnTermination() |
{ |
// this code will result in a maximum of 2 reads of 8192 bytes by calling |
// start() and isRunning(). by the time getOutput() is called the process |
// has terminated so the internal pipes array is already empty. normally |
// the call to start() will not read any data as the process will not have |
// generated output, but this is non-deterministic so we must count it as |
// a possibility. therefore we need 2 * PipesInterface::CHUNK_SIZE plus |
// another byte which will never be read. |
$expectedOutputSize = PipesInterface::CHUNK_SIZE * 2 + 2; |
$code = sprintf('echo str_repeat(\'*\', %d);', $expectedOutputSize); |
$p = $this->getProcessForCode($code); |
$p->start(); |
// Don't call Process::run nor Process::wait to avoid any read of pipes |
$h = new \ReflectionProperty($p, 'process'); |
$h->setAccessible(true); |
$h = $h->getValue($p); |
$s = @proc_get_status($h); |
while (!empty($s['running'])) { |
usleep(1000); |
$s = proc_get_status($h); |
} |
$o = $p->getOutput(); |
$this->assertEquals($expectedOutputSize, strlen($o)); |
} |
public function testCallbacksAreExecutedWithStart() |
{ |
$process = $this->getProcess('echo foo'); |
$process->start(function ($type, $buffer) use (&$data) { |
$data .= $buffer; |
}); |
$process->wait(); |
$this->assertSame('foo'.PHP_EOL, $data); |
} |
/** |
* tests results from sub processes. |
* |
* @dataProvider responsesCodeProvider |
*/ |
public function testProcessResponses($expected, $getter, $code) |
{ |
$p = $this->getProcessForCode($code); |
$p->run(); |
$this->assertSame($expected, $p->$getter()); |
} |
/** |
* tests results from sub processes. |
* |
* @dataProvider pipesCodeProvider |
*/ |
public function testProcessPipes($code, $size) |
{ |
$expected = str_repeat(str_repeat('*', 1024), $size).'!'; |
$expectedLength = (1024 * $size) + 1; |
$p = $this->getProcessForCode($code); |
$p->setInput($expected); |
$p->run(); |
$this->assertEquals($expectedLength, strlen($p->getOutput())); |
$this->assertEquals($expectedLength, strlen($p->getErrorOutput())); |
} |
/** |
* @dataProvider pipesCodeProvider |
*/ |
public function testSetStreamAsInput($code, $size) |
{ |
$expected = str_repeat(str_repeat('*', 1024), $size).'!'; |
$expectedLength = (1024 * $size) + 1; |
$stream = fopen('php://temporary', 'w+'); |
fwrite($stream, $expected); |
rewind($stream); |
$p = $this->getProcessForCode($code); |
$p->setInput($stream); |
$p->run(); |
fclose($stream); |
$this->assertEquals($expectedLength, strlen($p->getOutput())); |
$this->assertEquals($expectedLength, strlen($p->getErrorOutput())); |
} |
public function testLiveStreamAsInput() |
{ |
$stream = fopen('php://memory', 'r+'); |
fwrite($stream, 'hello'); |
rewind($stream); |
$p = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);'); |
$p->setInput($stream); |
$p->start(function ($type, $data) use ($stream) { |
if ('hello' === $data) { |
fclose($stream); |
} |
}); |
$p->wait(); |
$this->assertSame('hello', $p->getOutput()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage Input can not be set while the process is running. |
*/ |
public function testSetInputWhileRunningThrowsAnException() |
{ |
$process = $this->getProcessForCode('sleep(30);'); |
$process->start(); |
try { |
$process->setInput('foobar'); |
$process->stop(); |
$this->fail('A LogicException should have been raised.'); |
} catch (LogicException $e) { |
} |
$process->stop(); |
throw $e; |
} |
/** |
* @dataProvider provideInvalidInputValues |
* @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException |
* @expectedExceptionMessage Symfony\Component\Process\Process::setInput only accepts strings, Traversable objects or stream resources. |
*/ |
public function testInvalidInput($value) |
{ |
$process = $this->getProcess('foo'); |
$process->setInput($value); |
} |
public function provideInvalidInputValues() |
{ |
return array( |
array(array()), |
array(new NonStringifiable()), |
); |
} |
/** |
* @dataProvider provideInputValues |
*/ |
public function testValidInput($expected, $value) |
{ |
$process = $this->getProcess('foo'); |
$process->setInput($value); |
$this->assertSame($expected, $process->getInput()); |
} |
public function provideInputValues() |
{ |
return array( |
array(null, null), |
array('24.5', 24.5), |
array('input data', 'input data'), |
); |
} |
public function chainedCommandsOutputProvider() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
return array( |
array("2 \r\n2\r\n", '&&', '2'), |
); |
} |
return array( |
array("1\n1\n", ';', '1'), |
array("2\n2\n", '&&', '2'), |
); |
} |
/** |
* @dataProvider chainedCommandsOutputProvider |
*/ |
public function testChainedCommandsOutput($expected, $operator, $input) |
{ |
$process = $this->getProcess(sprintf('echo %s %s echo %s', $input, $operator, $input)); |
$process->run(); |
$this->assertEquals($expected, $process->getOutput()); |
} |
public function testCallbackIsExecutedForOutput() |
{ |
$p = $this->getProcessForCode('echo \'foo\';'); |
$called = false; |
$p->run(function ($type, $buffer) use (&$called) { |
$called = $buffer === 'foo'; |
}); |
$this->assertTrue($called, 'The callback should be executed with the output'); |
} |
public function testCallbackIsExecutedForOutputWheneverOutputIsDisabled() |
{ |
$p = $this->getProcessForCode('echo \'foo\';'); |
$p->disableOutput(); |
$called = false; |
$p->run(function ($type, $buffer) use (&$called) { |
$called = $buffer === 'foo'; |
}); |
$this->assertTrue($called, 'The callback should be executed with the output'); |
} |
public function testGetErrorOutput() |
{ |
$p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'); |
$p->run(); |
$this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches)); |
} |
public function testFlushErrorOutput() |
{ |
$p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'); |
$p->run(); |
$p->clearErrorOutput(); |
$this->assertEmpty($p->getErrorOutput()); |
} |
/** |
* @dataProvider provideIncrementalOutput |
*/ |
public function testIncrementalOutput($getOutput, $getIncrementalOutput, $uri) |
{ |
$lock = tempnam(sys_get_temp_dir(), __FUNCTION__); |
$p = $this->getProcessForCode('file_put_contents($s = \''.$uri.'\', \'foo\'); flock(fopen('.var_export($lock, true).', \'r\'), LOCK_EX); file_put_contents($s, \'bar\');'); |
$h = fopen($lock, 'w'); |
flock($h, LOCK_EX); |
$p->start(); |
foreach (array('foo', 'bar') as $s) { |
while (false === strpos($p->$getOutput(), $s)) { |
usleep(1000); |
} |
$this->assertSame($s, $p->$getIncrementalOutput()); |
$this->assertSame('', $p->$getIncrementalOutput()); |
flock($h, LOCK_UN); |
} |
fclose($h); |
} |
public function provideIncrementalOutput() |
{ |
return array( |
array('getOutput', 'getIncrementalOutput', 'php://stdout'), |
array('getErrorOutput', 'getIncrementalErrorOutput', 'php://stderr'), |
); |
} |
public function testGetOutput() |
{ |
$p = $this->getProcessForCode('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'); |
$p->run(); |
$this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches)); |
} |
public function testFlushOutput() |
{ |
$p = $this->getProcessForCode('$n=0;while ($n<3) {echo \' foo \';$n++;}'); |
$p->run(); |
$p->clearOutput(); |
$this->assertEmpty($p->getOutput()); |
} |
public function testZeroAsOutput() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
// see http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line |
$p = $this->getProcess('echo | set /p dummyName=0'); |
} else { |
$p = $this->getProcess('printf 0'); |
} |
$p->run(); |
$this->assertSame('0', $p->getOutput()); |
} |
public function testExitCodeCommandFailed() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support POSIX exit code'); |
} |
$this->skipIfNotEnhancedSigchild(); |
// such command run in bash return an exitcode 127 |
$process = $this->getProcess('nonexistingcommandIhopeneversomeonewouldnameacommandlikethis'); |
$process->run(); |
$this->assertGreaterThan(0, $process->getExitCode()); |
} |
/** |
* @group tty |
*/ |
public function testTTYCommand() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not have /dev/tty support'); |
} |
$process = $this->getProcess('echo "foo" >> /dev/null && '.$this->getProcessForCode('usleep(100000);')->getCommandLine()); |
$process->setTty(true); |
$process->start(); |
$this->assertTrue($process->isRunning()); |
$process->wait(); |
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus()); |
} |
/** |
* @group tty |
*/ |
public function testTTYCommandExitCode() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does have /dev/tty support'); |
} |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo "foo" >> /dev/null'); |
$process->setTty(true); |
$process->run(); |
$this->assertTrue($process->isSuccessful()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\RuntimeException |
* @expectedExceptionMessage TTY mode is not supported on Windows platform. |
*/ |
public function testTTYInWindowsEnvironment() |
{ |
if ('\\' !== DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('This test is for Windows platform only'); |
} |
$process = $this->getProcess('echo "foo" >> /dev/null'); |
$process->setTty(false); |
$process->setTty(true); |
} |
public function testExitCodeTextIsNullWhenExitCodeIsNull() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess(''); |
$this->assertNull($process->getExitCodeText()); |
} |
public function testPTYCommand() |
{ |
if (!Process::isPtySupported()) { |
$this->markTestSkipped('PTY is not supported on this operating system.'); |
} |
$process = $this->getProcess('echo "foo"'); |
$process->setPty(true); |
$process->run(); |
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus()); |
$this->assertEquals("foo\r\n", $process->getOutput()); |
} |
public function testMustRun() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo'); |
$this->assertSame($process, $process->mustRun()); |
$this->assertEquals('foo'.PHP_EOL, $process->getOutput()); |
} |
public function testSuccessfulMustRunHasCorrectExitCode() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo')->mustRun(); |
$this->assertEquals(0, $process->getExitCode()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\ProcessFailedException |
*/ |
public function testMustRunThrowsException() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('exit 1'); |
$process->mustRun(); |
} |
public function testExitCodeText() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess(''); |
$r = new \ReflectionObject($process); |
$p = $r->getProperty('exitcode'); |
$p->setAccessible(true); |
$p->setValue($process, 2); |
$this->assertEquals('Misuse of shell builtins', $process->getExitCodeText()); |
} |
public function testStartIsNonBlocking() |
{ |
$process = $this->getProcessForCode('usleep(500000);'); |
$start = microtime(true); |
$process->start(); |
$end = microtime(true); |
$this->assertLessThan(0.4, $end - $start); |
$process->stop(); |
} |
public function testUpdateStatus() |
{ |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertTrue(strlen($process->getOutput()) > 0); |
} |
public function testGetExitCodeIsNullOnStart() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcessForCode('usleep(100000);'); |
$this->assertNull($process->getExitCode()); |
$process->start(); |
$this->assertNull($process->getExitCode()); |
$process->wait(); |
$this->assertEquals(0, $process->getExitCode()); |
} |
public function testGetExitCodeIsNullOnWhenStartingAgain() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcessForCode('usleep(100000);'); |
$process->run(); |
$this->assertEquals(0, $process->getExitCode()); |
$process->start(); |
$this->assertNull($process->getExitCode()); |
$process->wait(); |
$this->assertEquals(0, $process->getExitCode()); |
} |
public function testGetExitCode() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertSame(0, $process->getExitCode()); |
} |
public function testStatus() |
{ |
$process = $this->getProcessForCode('usleep(100000);'); |
$this->assertFalse($process->isRunning()); |
$this->assertFalse($process->isStarted()); |
$this->assertFalse($process->isTerminated()); |
$this->assertSame(Process::STATUS_READY, $process->getStatus()); |
$process->start(); |
$this->assertTrue($process->isRunning()); |
$this->assertTrue($process->isStarted()); |
$this->assertFalse($process->isTerminated()); |
$this->assertSame(Process::STATUS_STARTED, $process->getStatus()); |
$process->wait(); |
$this->assertFalse($process->isRunning()); |
$this->assertTrue($process->isStarted()); |
$this->assertTrue($process->isTerminated()); |
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus()); |
} |
public function testStop() |
{ |
$process = $this->getProcessForCode('sleep(31);'); |
$process->start(); |
$this->assertTrue($process->isRunning()); |
$process->stop(); |
$this->assertFalse($process->isRunning()); |
} |
public function testIsSuccessful() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertTrue($process->isSuccessful()); |
} |
public function testIsSuccessfulOnlyAfterTerminated() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcessForCode('usleep(100000);'); |
$process->start(); |
$this->assertFalse($process->isSuccessful()); |
$process->wait(); |
$this->assertTrue($process->isSuccessful()); |
} |
public function testIsNotSuccessful() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcessForCode('throw new \Exception(\'BOUM\');'); |
$process->run(); |
$this->assertFalse($process->isSuccessful()); |
} |
public function testProcessIsNotSignaled() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support POSIX signals'); |
} |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertFalse($process->hasBeenSignaled()); |
} |
public function testProcessWithoutTermSignal() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support POSIX signals'); |
} |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertEquals(0, $process->getTermSignal()); |
} |
public function testProcessIsSignaledIfStopped() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('Windows does not support POSIX signals'); |
} |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcessForCode('sleep(32);'); |
$process->start(); |
$process->stop(); |
$this->assertTrue($process->hasBeenSignaled()); |
$this->assertEquals(15, $process->getTermSignal()); // SIGTERM |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\RuntimeException |
* @expectedExceptionMessage The process has been signaled |
*/ |
public function testProcessThrowsExceptionWhenExternallySignaled() |
{ |
if (!function_exists('posix_kill')) { |
$this->markTestSkipped('Function posix_kill is required.'); |
} |
$this->skipIfNotEnhancedSigchild(false); |
$process = $this->getProcessForCode('sleep(32.1);'); |
$process->start(); |
posix_kill($process->getPid(), 9); // SIGKILL |
$process->wait(); |
} |
public function testRestart() |
{ |
$process1 = $this->getProcessForCode('echo getmypid();'); |
$process1->run(); |
$process2 = $process1->restart(); |
$process2->wait(); // wait for output |
// Ensure that both processed finished and the output is numeric |
$this->assertFalse($process1->isRunning()); |
$this->assertFalse($process2->isRunning()); |
$this->assertInternalType('numeric', $process1->getOutput()); |
$this->assertInternalType('numeric', $process2->getOutput()); |
// Ensure that restart returned a new process by check that the output is different |
$this->assertNotEquals($process1->getOutput(), $process2->getOutput()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException |
* @expectedExceptionMessage exceeded the timeout of 0.1 seconds. |
*/ |
public function testRunProcessWithTimeout() |
{ |
$process = $this->getProcessForCode('sleep(30);'); |
$process->setTimeout(0.1); |
$start = microtime(true); |
try { |
$process->run(); |
$this->fail('A RuntimeException should have been raised'); |
} catch (RuntimeException $e) { |
} |
$this->assertLessThan(15, microtime(true) - $start); |
throw $e; |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException |
* @expectedExceptionMessage exceeded the timeout of 0.1 seconds. |
*/ |
public function testIterateOverProcessWithTimeout() |
{ |
$process = $this->getProcessForCode('sleep(30);'); |
$process->setTimeout(0.1); |
$start = microtime(true); |
try { |
$process->start(); |
foreach ($process as $buffer); |
$this->fail('A RuntimeException should have been raised'); |
} catch (RuntimeException $e) { |
} |
$this->assertLessThan(15, microtime(true) - $start); |
throw $e; |
} |
public function testCheckTimeoutOnNonStartedProcess() |
{ |
$process = $this->getProcess('echo foo'); |
$this->assertNull($process->checkTimeout()); |
} |
public function testCheckTimeoutOnTerminatedProcess() |
{ |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertNull($process->checkTimeout()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException |
* @expectedExceptionMessage exceeded the timeout of 0.1 seconds. |
*/ |
public function testCheckTimeoutOnStartedProcess() |
{ |
$process = $this->getProcessForCode('sleep(33);'); |
$process->setTimeout(0.1); |
$process->start(); |
$start = microtime(true); |
try { |
while ($process->isRunning()) { |
$process->checkTimeout(); |
usleep(100000); |
} |
$this->fail('A ProcessTimedOutException should have been raised'); |
} catch (ProcessTimedOutException $e) { |
} |
$this->assertLessThan(15, microtime(true) - $start); |
throw $e; |
} |
public function testIdleTimeout() |
{ |
$process = $this->getProcessForCode('sleep(34);'); |
$process->setTimeout(60); |
$process->setIdleTimeout(0.1); |
try { |
$process->run(); |
$this->fail('A timeout exception was expected.'); |
} catch (ProcessTimedOutException $e) { |
$this->assertTrue($e->isIdleTimeout()); |
$this->assertFalse($e->isGeneralTimeout()); |
$this->assertEquals(0.1, $e->getExceededTimeout()); |
} |
} |
public function testIdleTimeoutNotExceededWhenOutputIsSent() |
{ |
$process = $this->getProcessForCode('while (true) {echo \'foo \'; usleep(1000);}'); |
$process->setTimeout(1); |
$process->start(); |
while (false === strpos($process->getOutput(), 'foo')) { |
usleep(1000); |
} |
$process->setIdleTimeout(0.5); |
try { |
$process->wait(); |
$this->fail('A timeout exception was expected.'); |
} catch (ProcessTimedOutException $e) { |
$this->assertTrue($e->isGeneralTimeout(), 'A general timeout is expected.'); |
$this->assertFalse($e->isIdleTimeout(), 'No idle timeout is expected.'); |
$this->assertEquals(1, $e->getExceededTimeout()); |
} |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException |
* @expectedExceptionMessage exceeded the timeout of 0.1 seconds. |
*/ |
public function testStartAfterATimeout() |
{ |
$process = $this->getProcessForCode('sleep(35);'); |
$process->setTimeout(0.1); |
try { |
$process->run(); |
$this->fail('A ProcessTimedOutException should have been raised.'); |
} catch (ProcessTimedOutException $e) { |
} |
$this->assertFalse($process->isRunning()); |
$process->start(); |
$this->assertTrue($process->isRunning()); |
$process->stop(0); |
throw $e; |
} |
public function testGetPid() |
{ |
$process = $this->getProcessForCode('sleep(36);'); |
$process->start(); |
$this->assertGreaterThan(0, $process->getPid()); |
$process->stop(0); |
} |
public function testGetPidIsNullBeforeStart() |
{ |
$process = $this->getProcess('foo'); |
$this->assertNull($process->getPid()); |
} |
public function testGetPidIsNullAfterRun() |
{ |
$process = $this->getProcess('echo foo'); |
$process->run(); |
$this->assertNull($process->getPid()); |
} |
/** |
* @requires extension pcntl |
*/ |
public function testSignal() |
{ |
$process = $this->getProcess(array(self::$phpBin, __DIR__.'/SignalListener.php')); |
$process->start(); |
while (false === strpos($process->getOutput(), 'Caught')) { |
usleep(1000); |
} |
$process->signal(SIGUSR1); |
$process->wait(); |
$this->assertEquals('Caught SIGUSR1', $process->getOutput()); |
} |
/** |
* @requires extension pcntl |
*/ |
public function testExitCodeIsAvailableAfterSignal() |
{ |
$this->skipIfNotEnhancedSigchild(); |
$process = $this->getProcess('sleep 4'); |
$process->start(); |
$process->signal(SIGKILL); |
while ($process->isRunning()) { |
usleep(10000); |
} |
$this->assertFalse($process->isRunning()); |
$this->assertTrue($process->hasBeenSignaled()); |
$this->assertFalse($process->isSuccessful()); |
$this->assertEquals(137, $process->getExitCode()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage Can not send signal on a non running process. |
*/ |
public function testSignalProcessNotRunning() |
{ |
$process = $this->getProcess('foo'); |
$process->signal(1); // SIGHUP |
} |
/** |
* @dataProvider provideMethodsThatNeedARunningProcess |
*/ |
public function testMethodsThatNeedARunningProcess($method) |
{ |
$process = $this->getProcess('foo'); |
if (method_exists($this, 'expectException')) { |
$this->expectException('Symfony\Component\Process\Exception\LogicException'); |
$this->expectExceptionMessage(sprintf('Process must be started before calling %s.', $method)); |
} else { |
$this->setExpectedException('Symfony\Component\Process\Exception\LogicException', sprintf('Process must be started before calling %s.', $method)); |
} |
$process->{$method}(); |
} |
public function provideMethodsThatNeedARunningProcess() |
{ |
return array( |
array('getOutput'), |
array('getIncrementalOutput'), |
array('getErrorOutput'), |
array('getIncrementalErrorOutput'), |
array('wait'), |
); |
} |
/** |
* @dataProvider provideMethodsThatNeedATerminatedProcess |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage Process must be terminated before calling |
*/ |
public function testMethodsThatNeedATerminatedProcess($method) |
{ |
$process = $this->getProcessForCode('sleep(37);'); |
$process->start(); |
try { |
$process->{$method}(); |
$process->stop(0); |
$this->fail('A LogicException must have been thrown'); |
} catch (\Exception $e) { |
} |
$process->stop(0); |
throw $e; |
} |
public function provideMethodsThatNeedATerminatedProcess() |
{ |
return array( |
array('hasBeenSignaled'), |
array('getTermSignal'), |
array('hasBeenStopped'), |
array('getStopSignal'), |
); |
} |
/** |
* @dataProvider provideWrongSignal |
* @expectedException \Symfony\Component\Process\Exception\RuntimeException |
*/ |
public function testWrongSignal($signal) |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
$this->markTestSkipped('POSIX signals do not work on Windows'); |
} |
$process = $this->getProcessForCode('sleep(38);'); |
$process->start(); |
try { |
$process->signal($signal); |
$this->fail('A RuntimeException must have been thrown'); |
} catch (RuntimeException $e) { |
$process->stop(0); |
} |
throw $e; |
} |
public function provideWrongSignal() |
{ |
return array( |
array(-4), |
array('Céphalopodes'), |
); |
} |
public function testDisableOutputDisablesTheOutput() |
{ |
$p = $this->getProcess('foo'); |
$this->assertFalse($p->isOutputDisabled()); |
$p->disableOutput(); |
$this->assertTrue($p->isOutputDisabled()); |
$p->enableOutput(); |
$this->assertFalse($p->isOutputDisabled()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\RuntimeException |
* @expectedExceptionMessage Disabling output while the process is running is not possible. |
*/ |
public function testDisableOutputWhileRunningThrowsException() |
{ |
$p = $this->getProcessForCode('sleep(39);'); |
$p->start(); |
$p->disableOutput(); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\RuntimeException |
* @expectedExceptionMessage Enabling output while the process is running is not possible. |
*/ |
public function testEnableOutputWhileRunningThrowsException() |
{ |
$p = $this->getProcessForCode('sleep(40);'); |
$p->disableOutput(); |
$p->start(); |
$p->enableOutput(); |
} |
public function testEnableOrDisableOutputAfterRunDoesNotThrowException() |
{ |
$p = $this->getProcess('echo foo'); |
$p->disableOutput(); |
$p->run(); |
$p->enableOutput(); |
$p->disableOutput(); |
$this->assertTrue($p->isOutputDisabled()); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage Output can not be disabled while an idle timeout is set. |
*/ |
public function testDisableOutputWhileIdleTimeoutIsSet() |
{ |
$process = $this->getProcess('foo'); |
$process->setIdleTimeout(1); |
$process->disableOutput(); |
} |
/** |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage timeout can not be set while the output is disabled. |
*/ |
public function testSetIdleTimeoutWhileOutputIsDisabled() |
{ |
$process = $this->getProcess('foo'); |
$process->disableOutput(); |
$process->setIdleTimeout(1); |
} |
public function testSetNullIdleTimeoutWhileOutputIsDisabled() |
{ |
$process = $this->getProcess('foo'); |
$process->disableOutput(); |
$this->assertSame($process, $process->setIdleTimeout(null)); |
} |
/** |
* @dataProvider provideOutputFetchingMethods |
* @expectedException \Symfony\Component\Process\Exception\LogicException |
* @expectedExceptionMessage Output has been disabled. |
*/ |
public function testGetOutputWhileDisabled($fetchMethod) |
{ |
$p = $this->getProcessForCode('sleep(41);'); |
$p->disableOutput(); |
$p->start(); |
$p->{$fetchMethod}(); |
} |
public function provideOutputFetchingMethods() |
{ |
return array( |
array('getOutput'), |
array('getIncrementalOutput'), |
array('getErrorOutput'), |
array('getIncrementalErrorOutput'), |
); |
} |
public function testStopTerminatesProcessCleanly() |
{ |
$process = $this->getProcessForCode('echo 123; sleep(42);'); |
$process->run(function () use ($process) { |
$process->stop(); |
}); |
$this->assertTrue(true, 'A call to stop() is not expected to cause wait() to throw a RuntimeException'); |
} |
public function testKillSignalTerminatesProcessCleanly() |
{ |
$process = $this->getProcessForCode('echo 123; sleep(43);'); |
$process->run(function () use ($process) { |
$process->signal(9); // SIGKILL |
}); |
$this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); |
} |
public function testTermSignalTerminatesProcessCleanly() |
{ |
$process = $this->getProcessForCode('echo 123; sleep(44);'); |
$process->run(function () use ($process) { |
$process->signal(15); // SIGTERM |
}); |
$this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); |
} |
public function responsesCodeProvider() |
{ |
return array( |
//expected output / getter / code to execute |
//array(1,'getExitCode','exit(1);'), |
//array(true,'isSuccessful','exit();'), |
array('output', 'getOutput', 'echo \'output\';'), |
); |
} |
public function pipesCodeProvider() |
{ |
$variations = array( |
'fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);', |
'include \''.__DIR__.'/PipeStdinInStdoutStdErrStreamSelect.php\';', |
); |
if ('\\' === DIRECTORY_SEPARATOR) { |
// Avoid XL buffers on Windows because of https://bugs.php.net/bug.php?id=65650 |
$sizes = array(1, 2, 4, 8); |
} else { |
$sizes = array(1, 16, 64, 1024, 4096); |
} |
$codes = array(); |
foreach ($sizes as $size) { |
foreach ($variations as $code) { |
$codes[] = array($code, $size); |
} |
} |
return $codes; |
} |
/** |
* @dataProvider provideVariousIncrementals |
*/ |
public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) |
{ |
$process = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }', null, null, null, null); |
$process->start(); |
$result = ''; |
$limit = microtime(true) + 3; |
$expected = '012'; |
while ($result !== $expected && microtime(true) < $limit) { |
$result .= $process->$method(); |
} |
$this->assertSame($expected, $result); |
$process->stop(); |
} |
public function provideVariousIncrementals() |
{ |
return array( |
array('php://stdout', 'getIncrementalOutput'), |
array('php://stderr', 'getIncrementalErrorOutput'), |
); |
} |
public function testIteratorInput() |
{ |
$input = function () { |
yield 'ping'; |
yield 'pong'; |
}; |
$process = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);', null, null, $input()); |
$process->run(); |
$this->assertSame('pingpong', $process->getOutput()); |
} |
public function testSimpleInputStream() |
{ |
$input = new InputStream(); |
$process = $this->getProcessForCode('echo \'ping\'; stream_copy_to_stream(STDIN, STDOUT);'); |
$process->setInput($input); |
$process->start(function ($type, $data) use ($input) { |
if ('ping' === $data) { |
$input->write('pang'); |
} elseif (!$input->isClosed()) { |
$input->write('pong'); |
$input->close(); |
} |
}); |
$process->wait(); |
$this->assertSame('pingpangpong', $process->getOutput()); |
} |
public function testInputStreamWithCallable() |
{ |
$i = 0; |
$stream = fopen('php://memory', 'w+'); |
$stream = function () use ($stream, &$i) { |
if ($i < 3) { |
rewind($stream); |
fwrite($stream, ++$i); |
rewind($stream); |
return $stream; |
} |
}; |
$input = new InputStream(); |
$input->onEmpty($stream); |
$input->write($stream()); |
$process = $this->getProcessForCode('echo fread(STDIN, 3);'); |
$process->setInput($input); |
$process->start(function ($type, $data) use ($input) { |
$input->close(); |
}); |
$process->wait(); |
$this->assertSame('123', $process->getOutput()); |
} |
public function testInputStreamWithGenerator() |
{ |
$input = new InputStream(); |
$input->onEmpty(function ($input) { |
yield 'pong'; |
$input->close(); |
}); |
$process = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);'); |
$process->setInput($input); |
$process->start(); |
$input->write('ping'); |
$process->wait(); |
$this->assertSame('pingpong', $process->getOutput()); |
} |
public function testInputStreamOnEmpty() |
{ |
$i = 0; |
$input = new InputStream(); |
$input->onEmpty(function () use (&$i) { ++$i; }); |
$process = $this->getProcessForCode('echo 123; echo fread(STDIN, 1); echo 456;'); |
$process->setInput($input); |
$process->start(function ($type, $data) use ($input) { |
if ('123' === $data) { |
$input->close(); |
} |
}); |
$process->wait(); |
$this->assertSame(0, $i, 'InputStream->onEmpty callback should be called only when the input *becomes* empty'); |
$this->assertSame('123456', $process->getOutput()); |
} |
public function testIteratorOutput() |
{ |
$input = new InputStream(); |
$process = $this->getProcessForCode('fwrite(STDOUT, 123); fwrite(STDERR, 234); flush(); usleep(10000); fwrite(STDOUT, fread(STDIN, 3)); fwrite(STDERR, 456);'); |
$process->setInput($input); |
$process->start(); |
$output = array(); |
foreach ($process as $type => $data) { |
$output[] = array($type, $data); |
break; |
} |
$expectedOutput = array( |
array($process::OUT, '123'), |
); |
$this->assertSame($expectedOutput, $output); |
$input->write(345); |
foreach ($process as $type => $data) { |
$output[] = array($type, $data); |
} |
$this->assertSame('', $process->getOutput()); |
$this->assertFalse($process->isRunning()); |
$expectedOutput = array( |
array($process::OUT, '123'), |
array($process::ERR, '234'), |
array($process::OUT, '345'), |
array($process::ERR, '456'), |
); |
$this->assertSame($expectedOutput, $output); |
} |
public function testNonBlockingNorClearingIteratorOutput() |
{ |
$input = new InputStream(); |
$process = $this->getProcessForCode('fwrite(STDOUT, fread(STDIN, 3));'); |
$process->setInput($input); |
$process->start(); |
$output = array(); |
foreach ($process->getIterator($process::ITER_NON_BLOCKING | $process::ITER_KEEP_OUTPUT) as $type => $data) { |
$output[] = array($type, $data); |
break; |
} |
$expectedOutput = array( |
array($process::OUT, ''), |
); |
$this->assertSame($expectedOutput, $output); |
$input->write(123); |
foreach ($process->getIterator($process::ITER_NON_BLOCKING | $process::ITER_KEEP_OUTPUT) as $type => $data) { |
if ('' !== $data) { |
$output[] = array($type, $data); |
} |
} |
$this->assertSame('123', $process->getOutput()); |
$this->assertFalse($process->isRunning()); |
$expectedOutput = array( |
array($process::OUT, ''), |
array($process::OUT, '123'), |
); |
$this->assertSame($expectedOutput, $output); |
} |
public function testChainedProcesses() |
{ |
$p1 = $this->getProcessForCode('fwrite(STDERR, 123); fwrite(STDOUT, 456);'); |
$p2 = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);'); |
$p2->setInput($p1); |
$p1->start(); |
$p2->run(); |
$this->assertSame('123', $p1->getErrorOutput()); |
$this->assertSame('', $p1->getOutput()); |
$this->assertSame('', $p2->getErrorOutput()); |
$this->assertSame('456', $p2->getOutput()); |
} |
public function testSetBadEnv() |
{ |
$process = $this->getProcess('echo hello'); |
$process->setEnv(array('bad%%' => '123')); |
$process->inheritEnvironmentVariables(true); |
$process->run(); |
$this->assertSame('hello'.PHP_EOL, $process->getOutput()); |
$this->assertSame('', $process->getErrorOutput()); |
} |
public function testEnvBackupDoesNotDeleteExistingVars() |
{ |
putenv('existing_var=foo'); |
$process = $this->getProcess('php -r "echo getenv(\'new_test_var\');"'); |
$process->setEnv(array('existing_var' => 'bar', 'new_test_var' => 'foo')); |
$process->inheritEnvironmentVariables(); |
$process->run(); |
$this->assertSame('foo', $process->getOutput()); |
$this->assertSame('foo', getenv('existing_var')); |
$this->assertFalse(getenv('new_test_var')); |
} |
public function testEnvIsInherited() |
{ |
$process = $this->getProcessForCode('echo serialize($_SERVER);', null, array('BAR' => 'BAZ')); |
putenv('FOO=BAR'); |
$process->run(); |
$expected = array('BAR' => 'BAZ', 'FOO' => 'BAR'); |
$env = array_intersect_key(unserialize($process->getOutput()), $expected); |
$this->assertEquals($expected, $env); |
} |
/** |
* @group legacy |
*/ |
public function testInheritEnvDisabled() |
{ |
$process = $this->getProcessForCode('echo serialize($_SERVER);', null, array('BAR' => 'BAZ')); |
putenv('FOO=BAR'); |
$this->assertSame($process, $process->inheritEnvironmentVariables(false)); |
$this->assertFalse($process->areEnvironmentVariablesInherited()); |
$process->run(); |
$expected = array('BAR' => 'BAZ', 'FOO' => 'BAR'); |
$env = array_intersect_key(unserialize($process->getOutput()), $expected); |
unset($expected['FOO']); |
$this->assertSame($expected, $env); |
} |
public function testGetCommandLine() |
{ |
$p = new Process(array('/usr/bin/php')); |
$expected = '\\' === DIRECTORY_SEPARATOR ? '"/usr/bin/php"' : "'/usr/bin/php'"; |
$this->assertSame($expected, $p->getCommandLine()); |
} |
/** |
* @dataProvider provideEscapeArgument |
*/ |
public function testEscapeArgument($arg) |
{ |
$p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg)); |
$p->run(); |
$this->assertSame($arg, $p->getOutput()); |
} |
/** |
* @dataProvider provideEscapeArgument |
* @group legacy |
*/ |
public function testEscapeArgumentWhenInheritEnvDisabled($arg) |
{ |
$p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg), null, array('BAR' => 'BAZ')); |
$p->inheritEnvironmentVariables(false); |
$p->run(); |
$this->assertSame($arg, $p->getOutput()); |
} |
public function provideEscapeArgument() |
{ |
yield array('a"b%c%'); |
yield array('a"b^c^'); |
yield array("a\nb'c"); |
yield array('a^b c!'); |
yield array("a!b\tc"); |
yield array('a\\\\"\\"'); |
yield array('éÉèÈàÀöä'); |
} |
public function testEnvArgument() |
{ |
$env = array('FOO' => 'Foo', 'BAR' => 'Bar'); |
$cmd = '\\' === DIRECTORY_SEPARATOR ? 'echo !FOO! !BAR! !BAZ!' : 'echo $FOO $BAR $BAZ'; |
$p = new Process($cmd, null, $env); |
$p->run(null, array('BAR' => 'baR', 'BAZ' => 'baZ')); |
$this->assertSame('Foo baR baZ', rtrim($p->getOutput())); |
$this->assertSame($env, $p->getEnv()); |
} |
/** |
* @param string $commandline |
* @param null|string $cwd |
* @param null|array $env |
* @param null|string $input |
* @param int $timeout |
* @param array $options |
* |
* @return Process |
*/ |
private function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60) |
{ |
$process = new Process($commandline, $cwd, $env, $input, $timeout); |
$process->inheritEnvironmentVariables(); |
if (false !== $enhance = getenv('ENHANCE_SIGCHLD')) { |
try { |
$process->setEnhanceSigchildCompatibility(false); |
$process->getExitCode(); |
$this->fail('ENHANCE_SIGCHLD must be used together with a sigchild-enabled PHP.'); |
} catch (RuntimeException $e) { |
$this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage()); |
if ($enhance) { |
$process->setEnhanceSigchildCompatibility(true); |
} else { |
self::$notEnhancedSigchild = true; |
} |
} |
} |
if (self::$process) { |
self::$process->stop(0); |
} |
return self::$process = $process; |
} |
/** |
* @return Process |
*/ |
private function getProcessForCode($code, $cwd = null, array $env = null, $input = null, $timeout = 60) |
{ |
return $this->getProcess(array(self::$phpBin, '-r', $code), $cwd, $env, $input, $timeout); |
} |
private function skipIfNotEnhancedSigchild($expectException = true) |
{ |
if (self::$sigchild) { |
if (!$expectException) { |
$this->markTestSkipped('PHP is compiled with --enable-sigchild.'); |
} elseif (self::$notEnhancedSigchild) { |
if (method_exists($this, 'expectException')) { |
$this->expectException('Symfony\Component\Process\Exception\RuntimeException'); |
$this->expectExceptionMessage('This PHP has been compiled with --enable-sigchild.'); |
} else { |
$this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild.'); |
} |
} |
} |
} |
} |
class NonStringifiable |
{ |
} |
/vendor/symfony/process/Tests/ProcessUtilsTest.php |
---|
@@ -0,0 +1,53 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
namespace Symfony\Component\Process\Tests; |
use PHPUnit\Framework\TestCase; |
use Symfony\Component\Process\ProcessUtils; |
/** |
* @group legacy |
*/ |
class ProcessUtilsTest extends TestCase |
{ |
/** |
* @dataProvider dataArguments |
*/ |
public function testEscapeArgument($result, $argument) |
{ |
$this->assertSame($result, ProcessUtils::escapeArgument($argument)); |
} |
public function dataArguments() |
{ |
if ('\\' === DIRECTORY_SEPARATOR) { |
return array( |
array('"\"php\" \"-v\""', '"php" "-v"'), |
array('"foo bar"', 'foo bar'), |
array('^%"path"^%', '%path%'), |
array('"<|>\\" \\"\'f"', '<|>" "\'f'), |
array('""', ''), |
array('"with\trailingbs\\\\"', 'with\trailingbs\\'), |
); |
} |
return array( |
array("'\"php\" \"-v\"'", '"php" "-v"'), |
array("'foo bar'", 'foo bar'), |
array("'%path%'", '%path%'), |
array("'<|>\" \"'\\''f'", '<|>" "\'f'), |
array("''", ''), |
array("'with\\trailingbs\\'", 'with\trailingbs\\'), |
array("'withNonAsciiAccentLikeéÉèÈàÀöä'", 'withNonAsciiAccentLikeéÉèÈàÀöä'), |
); |
} |
} |
/vendor/symfony/process/Tests/SignalListener.php |
---|
@@ -0,0 +1,21 @@ |
<?php |
/* |
* This file is part of the Symfony package. |
* |
* (c) Fabien Potencier <fabien@symfony.com> |
* |
* For the full copyright and license information, please view the LICENSE |
* file that was distributed with this source code. |
*/ |
pcntl_signal(SIGUSR1, function () { echo 'SIGUSR1'; exit; }); |
echo 'Caught '; |
$n = 0; |
while ($n++ < 400) { |
usleep(10000); |
pcntl_signal_dispatch(); |
} |
/vendor/symfony/process/composer.json |
---|
@@ -0,0 +1,33 @@ |
{ |
"name": "symfony/process", |
"type": "library", |
"description": "Symfony Process Component", |
"keywords": [], |
"homepage": "https://symfony.com", |
"license": "MIT", |
"authors": [ |
{ |
"name": "Fabien Potencier", |
"email": "fabien@symfony.com" |
}, |
{ |
"name": "Symfony Community", |
"homepage": "https://symfony.com/contributors" |
} |
], |
"require": { |
"php": ">=5.5.9" |
}, |
"autoload": { |
"psr-4": { "Symfony\\Component\\Process\\": "" }, |
"exclude-from-classmap": [ |
"/Tests/" |
] |
}, |
"minimum-stability": "dev", |
"extra": { |
"branch-alias": { |
"dev-master": "3.3-dev" |
} |
} |
} |
/vendor/symfony/process/phpunit.xml.dist |
---|
@@ -0,0 +1,30 @@ |
<?xml version="1.0" encoding="UTF-8"?> |
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" |
backupGlobals="false" |
colors="true" |
bootstrap="vendor/autoload.php" |
failOnRisky="true" |
failOnWarning="true" |
> |
<php> |
<ini name="error_reporting" value="-1" /> |
</php> |
<testsuites> |
<testsuite name="Symfony Process Component Test Suite"> |
<directory>./Tests/</directory> |
</testsuite> |
</testsuites> |
<filter> |
<whitelist> |
<directory>./</directory> |
<exclude> |
<directory>./Tests</directory> |
<directory>./vendor</directory> |
</exclude> |
</whitelist> |
</filter> |
</phpunit> |