Version Description
Download this release
Release Info
Developer | ignatggeorgiev |
Plugin | SG Optimizer |
Version | 7.0.7 |
Comparing to | |
See all releases |
Code changes from version 7.0.6 to 7.0.7
- core/Images_Optimizer/Images_Optimizer.php +4 -7
- core/Images_Optimizer/Images_Optimizer_Webp.php +4 -6
- readme.txt +6 -1
- sg-cachepress.php +2 -2
- vendor/autoload.php +1 -1
- vendor/bin/minifycss +40 -112
- vendor/bin/minifyjs +40 -112
- vendor/composer/ClassLoader.php +11 -102
- vendor/composer/InstalledVersions.php +6 -19
- vendor/composer/autoload_real.php +9 -14
- vendor/composer/autoload_static.php +5 -5
- vendor/composer/installed.php +6 -6
- vendor/siteground/siteground-i18n/vendor/autoload.php +7 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/.gitignore +2 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/composer.json +32 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/composer.lock +1174 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/phpunit.xml +17 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/readme.md +25 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/src/PoToJson.php +180 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/PoToJsonTest.php +39 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl-jed.json +34 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl.json +43 -0
- vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl.po +58 -0
- vendor/siteground/siteground-i18n/vendor/composer/ClassLoader.php +481 -0
- vendor/siteground/siteground-i18n/vendor/composer/InstalledVersions.php +337 -0
- vendor/siteground/siteground-i18n/vendor/composer/LICENSE +21 -0
- vendor/siteground/siteground-i18n/vendor/composer/autoload_classmap.php +10 -0
- vendor/siteground/siteground-i18n/vendor/composer/autoload_namespaces.php +10 -0
- vendor/siteground/siteground-i18n/vendor/composer/autoload_psr4.php +12 -0
- vendor/siteground/siteground-i18n/vendor/composer/autoload_real.php +57 -0
- vendor/siteground/siteground-i18n/vendor/composer/autoload_static.php +60 -0
- vendor/siteground/siteground-i18n/vendor/composer/installed.json +116 -0
- vendor/siteground/siteground-i18n/vendor/composer/installed.php +43 -0
- vendor/siteground/siteground-i18n/vendor/composer/platform_check.php +26 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.gitignore +3 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.scrutinizer.yml +26 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.travis.yml +14 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/build/.gitignore +4 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/composer.json +30 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/license.txt +28 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/phpunit.xml +8 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/readme.md +113 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/FileHandler.php +74 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/InterfaceHandler.php +41 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/PoParser.php +810 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/StringHandler.php +73 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/context.po +59 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/flags-phpformat-fuzzy.po +23 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/flags-phpformat.po +23 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/healthy.po +29 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/multiflags.po +23 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/multilines.po +78 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/noblankline.po +4 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/noheader.po +23 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/plurals.po +90 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/pluralsMultiline.po +33 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/previous_unstranslated.po +16 -0
- vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/poparserTest.php +348 -0
core/Images_Optimizer/Images_Optimizer.php
CHANGED
@@ -411,22 +411,19 @@ class Images_Optimizer extends Abstract_Images_Optimizer {
|
|
411 |
Â
* @param int $id The attachment ID.
|
412 |
Â
*/
|
413 |
Â
public function delete_backups( $id ) {
|
Â
|
|
414 |
Â
$main_image = get_attached_file( $id );
|
415 |
Â
$metadata = wp_get_attachment_metadata( $id );
|
Â
|
|
416 |
Â
|
417 |
-
$
|
418 |
-
$basename = basename( $main_image );
|
419 |
Â
|
420 |
Â
if ( ! empty( $metadata['sizes'] ) ) {
|
421 |
Â
// Loop through all image sizes and optimize them as well.
|
422 |
Â
foreach ( $metadata['sizes'] as $size ) {
|
423 |
-
$
|
424 |
Â
}
|
425 |
Â
}
|
426 |
-
|
427 |
-
if ( ! empty( $files ) ) {
|
428 |
-
exec( 'rm ' . implode( ' ', $files ) );
|
429 |
-
}
|
430 |
Â
}
|
431 |
Â
|
432 |
Â
/**
|
411 |
Â
* @param int $id The attachment ID.
|
412 |
Â
*/
|
413 |
Â
public function delete_backups( $id ) {
|
414 |
+
global $wp_filesystem;
|
415 |
Â
$main_image = get_attached_file( $id );
|
416 |
Â
$metadata = wp_get_attachment_metadata( $id );
|
417 |
+
$basename = basename( $main_image );
|
418 |
Â
|
419 |
+
$wp_filesystem->delete( preg_replace( '~.(png|jpg|jpeg|gif)$~', '.bak.$1', $main_image ) );
|
Â
|
|
420 |
Â
|
421 |
Â
if ( ! empty( $metadata['sizes'] ) ) {
|
422 |
Â
// Loop through all image sizes and optimize them as well.
|
423 |
Â
foreach ( $metadata['sizes'] as $size ) {
|
424 |
+
$wp_filesystem->delete( preg_replace( '~.(png|jpg|jpeg|gif)$~', '.bak.$1', str_replace( $basename, $size['file'], $main_image ) ) );
|
425 |
Â
}
|
426 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
427 |
Â
}
|
428 |
Â
|
429 |
Â
/**
|
core/Images_Optimizer/Images_Optimizer_Webp.php
CHANGED
@@ -211,22 +211,20 @@ class Images_Optimizer_Webp extends Abstract_Images_Optimizer {
|
|
211 |
Â
* @param int $id The attachment ID.
|
212 |
Â
*/
|
213 |
Â
public function delete_webp_copy( $id ) {
|
Â
|
|
214 |
Â
$main_image = get_attached_file( $id );
|
215 |
Â
$metadata = wp_get_attachment_metadata( $id );
|
Â
|
|
216 |
Â
|
217 |
-
$
|
218 |
-
$basename = basename( $main_image );
|
219 |
Â
|
220 |
Â
if ( ! empty( $metadata['sizes'] ) ) {
|
221 |
Â
// Loop through all image sizes and optimize them as well.
|
222 |
Â
foreach ( $metadata['sizes'] as $size ) {
|
223 |
-
$
|
224 |
Â
}
|
225 |
Â
}
|
226 |
Â
|
227 |
-
if ( ! empty( $files ) ) {
|
228 |
-
exec( 'rm ' . implode( ' ', $files ) );
|
229 |
-
}
|
230 |
Â
}
|
231 |
Â
|
232 |
Â
/**
|
211 |
Â
* @param int $id The attachment ID.
|
212 |
Â
*/
|
213 |
Â
public function delete_webp_copy( $id ) {
|
214 |
+
global $wp_filesystem;
|
215 |
Â
$main_image = get_attached_file( $id );
|
216 |
Â
$metadata = wp_get_attachment_metadata( $id );
|
217 |
+
$basename = basename( $main_image );
|
218 |
Â
|
219 |
+
$wp_filesystem->delete( $main_image . '.webp' );
|
Â
|
|
220 |
Â
|
221 |
Â
if ( ! empty( $metadata['sizes'] ) ) {
|
222 |
Â
// Loop through all image sizes and optimize them as well.
|
223 |
Â
foreach ( $metadata['sizes'] as $size ) {
|
224 |
+
$wp_filesystem->delete( str_replace( $basename, $size['file'], $main_image ) . '.webp' );
|
225 |
Â
}
|
226 |
Â
}
|
227 |
Â
|
Â
|
|
Â
|
|
Â
|
|
228 |
Â
}
|
229 |
Â
|
230 |
Â
/**
|
readme.txt
CHANGED
@@ -328,10 +328,15 @@ Our plugin uses a cookie in order to function properly. It does not store person
|
|
328 |
Â
|
329 |
Â
== Changelog ==
|
330 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
331 |
Â
= Version 7.0.6 =
|
332 |
Â
Release Date: March 4th, 2022
|
333 |
Â
|
334 |
-
* Improved installation for users not hosted on SiteGround
|
335 |
Â
|
336 |
Â
= Version 7.0.5 =
|
337 |
Â
Release Date: March 2nd, 2022
|
328 |
Â
|
329 |
Â
== Changelog ==
|
330 |
Â
|
331 |
+
= Version 7.0.7 =
|
332 |
+
Release Date: March 24th, 2022
|
333 |
+
|
334 |
+
* Image deletion refactoring
|
335 |
+
|
336 |
Â
= Version 7.0.6 =
|
337 |
Â
Release Date: March 4th, 2022
|
338 |
Â
|
339 |
+
* Improved installation for users not hosted on SiteGround
|
340 |
Â
|
341 |
Â
= Version 7.0.5 =
|
342 |
Â
Release Date: March 2nd, 2022
|
sg-cachepress.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
Â
* Plugin Name: SiteGround Optimizer
|
11 |
Â
* Plugin URI: https://siteground.com
|
12 |
Â
* Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
|
13 |
-
* Version: 7.0.
|
14 |
Â
* Author: SiteGround
|
15 |
Â
* Author URI: https://www.siteground.com
|
16 |
Â
* Text Domain: sg-cachepress
|
@@ -32,7 +32,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
32 |
Â
|
33 |
Â
// Define version constant.
|
34 |
Â
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
|
35 |
-
define( __NAMESPACE__ . '\VERSION', '7.0.
|
36 |
Â
}
|
37 |
Â
|
38 |
Â
// Define slug constant.
|
10 |
Â
* Plugin Name: SiteGround Optimizer
|
11 |
Â
* Plugin URI: https://siteground.com
|
12 |
Â
* Description: This plugin will link your WordPress application with all the performance optimizations provided by SiteGround
|
13 |
+
* Version: 7.0.7
|
14 |
Â
* Author: SiteGround
|
15 |
Â
* Author URI: https://www.siteground.com
|
16 |
Â
* Text Domain: sg-cachepress
|
32 |
Â
|
33 |
Â
// Define version constant.
|
34 |
Â
if ( ! defined( __NAMESPACE__ . '\VERSION' ) ) {
|
35 |
+
define( __NAMESPACE__ . '\VERSION', '7.0.7' );
|
36 |
Â
}
|
37 |
Â
|
38 |
Â
// Define slug constant.
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
Â
|
5 |
Â
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
Â
|
7 |
-
return
|
4 |
Â
|
5 |
Â
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
Â
|
7 |
+
return ComposerAutoloaderInit454419e965d59060fd765740e7825238::getLoader();
|
vendor/bin/minifycss
CHANGED
@@ -1,117 +1,45 @@
|
|
1 |
Â
#!/usr/bin/env php
|
2 |
Â
<?php
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
3 |
Â
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
if (
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
private $position;
|
27 |
-
private $realpath;
|
28 |
-
|
29 |
-
public function stream_open($path, $mode, $options, &$opened_path)
|
30 |
-
{
|
31 |
-
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
32 |
-
$opened_path = substr($path, 17);
|
33 |
-
$this->realpath = realpath($opened_path) ?: $opened_path;
|
34 |
-
$opened_path = $this->realpath;
|
35 |
-
$this->handle = fopen($this->realpath, $mode);
|
36 |
-
$this->position = 0;
|
37 |
-
|
38 |
-
return (bool) $this->handle;
|
39 |
-
}
|
40 |
-
|
41 |
-
public function stream_read($count)
|
42 |
-
{
|
43 |
-
$data = fread($this->handle, $count);
|
44 |
-
|
45 |
-
if ($this->position === 0) {
|
46 |
-
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
47 |
-
}
|
48 |
-
|
49 |
-
$this->position += strlen($data);
|
50 |
-
|
51 |
-
return $data;
|
52 |
-
}
|
53 |
-
|
54 |
-
public function stream_cast($castAs)
|
55 |
-
{
|
56 |
-
return $this->handle;
|
57 |
-
}
|
58 |
-
|
59 |
-
public function stream_close()
|
60 |
-
{
|
61 |
-
fclose($this->handle);
|
62 |
-
}
|
63 |
-
|
64 |
-
public function stream_lock($operation)
|
65 |
-
{
|
66 |
-
return $operation ? flock($this->handle, $operation) : true;
|
67 |
-
}
|
68 |
-
|
69 |
-
public function stream_seek($offset, $whence)
|
70 |
-
{
|
71 |
-
if (0 === fseek($this->handle, $offset, $whence)) {
|
72 |
-
$this->position = ftell($this->handle);
|
73 |
-
return true;
|
74 |
-
}
|
75 |
-
|
76 |
-
return false;
|
77 |
-
}
|
78 |
-
|
79 |
-
public function stream_tell()
|
80 |
-
{
|
81 |
-
return $this->position;
|
82 |
-
}
|
83 |
-
|
84 |
-
public function stream_eof()
|
85 |
-
{
|
86 |
-
return feof($this->handle);
|
87 |
-
}
|
88 |
-
|
89 |
-
public function stream_stat()
|
90 |
-
{
|
91 |
-
return array();
|
92 |
-
}
|
93 |
-
|
94 |
-
public function stream_set_option($option, $arg1, $arg2)
|
95 |
-
{
|
96 |
-
return true;
|
97 |
-
}
|
98 |
-
|
99 |
-
public function url_stat($path, $flags)
|
100 |
-
{
|
101 |
-
$path = substr($path, 17);
|
102 |
-
if (file_exists($path)) {
|
103 |
-
return stat($path);
|
104 |
-
}
|
105 |
-
|
106 |
-
return false;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
|
112 |
-
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss');
|
113 |
-
exit(0);
|
114 |
-
}
|
115 |
Â
}
|
116 |
Â
|
117 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
Â
#!/usr/bin/env php
|
2 |
Â
<?php
|
3 |
+
use MatthiasMullie\Minify;
|
4 |
+
|
5 |
+
// command line utility to minify CSS
|
6 |
+
if (file_exists(__DIR__ . '/../../../autoload.php')) {
|
7 |
+
// if composer install
|
8 |
+
require_once __DIR__ . '/../../../autoload.php';
|
9 |
+
} else {
|
10 |
+
require_once __DIR__ . '/../src/Minify.php';
|
11 |
+
require_once __DIR__ . '/../src/CSS.php';
|
12 |
+
require_once __DIR__ . '/../src/Exception.php';
|
13 |
+
}
|
14 |
Â
|
15 |
+
error_reporting(E_ALL);
|
16 |
+
// check PHP setup for cli arguments
|
17 |
+
if (!isset($_SERVER['argv']) && !isset($argv)) {
|
18 |
+
fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
|
19 |
+
exit(1);
|
20 |
+
} elseif (!isset($argv)) {
|
21 |
+
$argv = $_SERVER['argv'];
|
22 |
+
}
|
23 |
+
// check if path to file given
|
24 |
+
if (!isset($argv[1])) {
|
25 |
+
fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
|
26 |
+
exit(1);
|
27 |
+
}
|
28 |
+
// check if script run in cli environment
|
29 |
+
if ('cli' !== php_sapi_name()) {
|
30 |
+
fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
|
31 |
+
exit(1);
|
32 |
+
}
|
33 |
+
// check if source file exists
|
34 |
+
if (!file_exists($argv[1])) {
|
35 |
+
fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
|
36 |
+
exit(1);
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
37 |
Â
}
|
38 |
Â
|
39 |
+
try {
|
40 |
+
$minifier = new Minify\CSS($argv[1]);
|
41 |
+
echo $minifier->minify();
|
42 |
+
} catch (Exception $e) {
|
43 |
+
fwrite(STDERR, $e->getMessage(), PHP_EOL);
|
44 |
+
exit(1);
|
45 |
+
}
|
vendor/bin/minifyjs
CHANGED
@@ -1,117 +1,45 @@
|
|
1 |
Â
#!/usr/bin/env php
|
2 |
Â
<?php
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
3 |
Â
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
if (
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
private $position;
|
27 |
-
private $realpath;
|
28 |
-
|
29 |
-
public function stream_open($path, $mode, $options, &$opened_path)
|
30 |
-
{
|
31 |
-
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
32 |
-
$opened_path = substr($path, 17);
|
33 |
-
$this->realpath = realpath($opened_path) ?: $opened_path;
|
34 |
-
$opened_path = $this->realpath;
|
35 |
-
$this->handle = fopen($this->realpath, $mode);
|
36 |
-
$this->position = 0;
|
37 |
-
|
38 |
-
return (bool) $this->handle;
|
39 |
-
}
|
40 |
-
|
41 |
-
public function stream_read($count)
|
42 |
-
{
|
43 |
-
$data = fread($this->handle, $count);
|
44 |
-
|
45 |
-
if ($this->position === 0) {
|
46 |
-
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
47 |
-
}
|
48 |
-
|
49 |
-
$this->position += strlen($data);
|
50 |
-
|
51 |
-
return $data;
|
52 |
-
}
|
53 |
-
|
54 |
-
public function stream_cast($castAs)
|
55 |
-
{
|
56 |
-
return $this->handle;
|
57 |
-
}
|
58 |
-
|
59 |
-
public function stream_close()
|
60 |
-
{
|
61 |
-
fclose($this->handle);
|
62 |
-
}
|
63 |
-
|
64 |
-
public function stream_lock($operation)
|
65 |
-
{
|
66 |
-
return $operation ? flock($this->handle, $operation) : true;
|
67 |
-
}
|
68 |
-
|
69 |
-
public function stream_seek($offset, $whence)
|
70 |
-
{
|
71 |
-
if (0 === fseek($this->handle, $offset, $whence)) {
|
72 |
-
$this->position = ftell($this->handle);
|
73 |
-
return true;
|
74 |
-
}
|
75 |
-
|
76 |
-
return false;
|
77 |
-
}
|
78 |
-
|
79 |
-
public function stream_tell()
|
80 |
-
{
|
81 |
-
return $this->position;
|
82 |
-
}
|
83 |
-
|
84 |
-
public function stream_eof()
|
85 |
-
{
|
86 |
-
return feof($this->handle);
|
87 |
-
}
|
88 |
-
|
89 |
-
public function stream_stat()
|
90 |
-
{
|
91 |
-
return array();
|
92 |
-
}
|
93 |
-
|
94 |
-
public function stream_set_option($option, $arg1, $arg2)
|
95 |
-
{
|
96 |
-
return true;
|
97 |
-
}
|
98 |
-
|
99 |
-
public function url_stat($path, $flags)
|
100 |
-
{
|
101 |
-
$path = substr($path, 17);
|
102 |
-
if (file_exists($path)) {
|
103 |
-
return stat($path);
|
104 |
-
}
|
105 |
-
|
106 |
-
return false;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
|
112 |
-
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs');
|
113 |
-
exit(0);
|
114 |
-
}
|
115 |
Â
}
|
116 |
Â
|
117 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
Â
#!/usr/bin/env php
|
2 |
Â
<?php
|
3 |
+
use MatthiasMullie\Minify;
|
4 |
+
|
5 |
+
// command line utility to minify JS
|
6 |
+
if (file_exists(__DIR__ . '/../../../autoload.php')) {
|
7 |
+
// if composer install
|
8 |
+
require_once __DIR__ . '/../../../autoload.php';
|
9 |
+
} else {
|
10 |
+
require_once __DIR__ . '/../src/Minify.php';
|
11 |
+
require_once __DIR__ . '/../src/JS.php';
|
12 |
+
require_once __DIR__ . '/../src/Exception.php';
|
13 |
+
}
|
14 |
Â
|
15 |
+
error_reporting(E_ALL);
|
16 |
+
// check PHP setup for cli arguments
|
17 |
+
if (!isset($_SERVER['argv']) && !isset($argv)) {
|
18 |
+
fwrite(STDERR, 'Please enable the "register_argc_argv" directive in your php.ini' . PHP_EOL);
|
19 |
+
exit(1);
|
20 |
+
} elseif (!isset($argv)) {
|
21 |
+
$argv = $_SERVER['argv'];
|
22 |
+
}
|
23 |
+
// check if path to file given
|
24 |
+
if (!isset($argv[1])) {
|
25 |
+
fwrite(STDERR, 'Argument expected: path to file' . PHP_EOL);
|
26 |
+
exit(1);
|
27 |
+
}
|
28 |
+
// check if script run in cli environment
|
29 |
+
if ('cli' !== php_sapi_name()) {
|
30 |
+
fwrite(STDERR, $argv[1] . ' must be run in the command line' . PHP_EOL);
|
31 |
+
exit(1);
|
32 |
+
}
|
33 |
+
// check if source file exists
|
34 |
+
if (!file_exists($argv[1])) {
|
35 |
+
fwrite(STDERR, 'Source file "' . $argv[1] . '" not found' . PHP_EOL);
|
36 |
+
exit(1);
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
37 |
Â
}
|
38 |
Â
|
39 |
+
try {
|
40 |
+
$minifier = new Minify\JS($argv[1]);
|
41 |
+
echo $minifier->minify();
|
42 |
+
} catch (Exception $e) {
|
43 |
+
fwrite(STDERR, $e->getMessage(), PHP_EOL);
|
44 |
+
exit(1);
|
45 |
+
}
|
vendor/composer/ClassLoader.php
CHANGED
@@ -42,75 +42,30 @@ namespace Composer\Autoload;
|
|
42 |
Â
*/
|
43 |
Â
class ClassLoader
|
44 |
Â
{
|
45 |
-
/** @var ?string */
|
46 |
Â
private $vendorDir;
|
47 |
Â
|
48 |
Â
// PSR-4
|
49 |
-
/**
|
50 |
-
* @var array[]
|
51 |
-
* @psalm-var array<string, array<string, int>>
|
52 |
-
*/
|
53 |
Â
private $prefixLengthsPsr4 = array();
|
54 |
-
/**
|
55 |
-
* @var array[]
|
56 |
-
* @psalm-var array<string, array<int, string>>
|
57 |
-
*/
|
58 |
Â
private $prefixDirsPsr4 = array();
|
59 |
-
/**
|
60 |
-
* @var array[]
|
61 |
-
* @psalm-var array<string, string>
|
62 |
-
*/
|
63 |
Â
private $fallbackDirsPsr4 = array();
|
64 |
Â
|
65 |
Â
// PSR-0
|
66 |
-
/**
|
67 |
-
* @var array[]
|
68 |
-
* @psalm-var array<string, array<string, string[]>>
|
69 |
-
*/
|
70 |
Â
private $prefixesPsr0 = array();
|
71 |
-
/**
|
72 |
-
* @var array[]
|
73 |
-
* @psalm-var array<string, string>
|
74 |
-
*/
|
75 |
Â
private $fallbackDirsPsr0 = array();
|
76 |
Â
|
77 |
-
/** @var bool */
|
78 |
Â
private $useIncludePath = false;
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @var string[]
|
82 |
-
* @psalm-var array<string, string>
|
83 |
-
*/
|
84 |
Â
private $classMap = array();
|
85 |
-
|
86 |
-
/** @var bool */
|
87 |
Â
private $classMapAuthoritative = false;
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @var bool[]
|
91 |
-
* @psalm-var array<string, bool>
|
92 |
-
*/
|
93 |
Â
private $missingClasses = array();
|
94 |
-
|
95 |
-
/** @var ?string */
|
96 |
Â
private $apcuPrefix;
|
97 |
Â
|
98 |
-
/**
|
99 |
-
* @var self[]
|
100 |
-
*/
|
101 |
Â
private static $registeredLoaders = array();
|
102 |
Â
|
103 |
-
/**
|
104 |
-
* @param ?string $vendorDir
|
105 |
-
*/
|
106 |
Â
public function __construct($vendorDir = null)
|
107 |
Â
{
|
108 |
Â
$this->vendorDir = $vendorDir;
|
109 |
Â
}
|
110 |
Â
|
111 |
-
/**
|
112 |
-
* @return string[]
|
113 |
-
*/
|
114 |
Â
public function getPrefixes()
|
115 |
Â
{
|
116 |
Â
if (!empty($this->prefixesPsr0)) {
|
@@ -120,47 +75,28 @@ class ClassLoader
|
|
120 |
Â
return array();
|
121 |
Â
}
|
122 |
Â
|
123 |
-
/**
|
124 |
-
* @return array[]
|
125 |
-
* @psalm-return array<string, array<int, string>>
|
126 |
-
*/
|
127 |
Â
public function getPrefixesPsr4()
|
128 |
Â
{
|
129 |
Â
return $this->prefixDirsPsr4;
|
130 |
Â
}
|
131 |
Â
|
132 |
-
/**
|
133 |
-
* @return array[]
|
134 |
-
* @psalm-return array<string, string>
|
135 |
-
*/
|
136 |
Â
public function getFallbackDirs()
|
137 |
Â
{
|
138 |
Â
return $this->fallbackDirsPsr0;
|
139 |
Â
}
|
140 |
Â
|
141 |
-
/**
|
142 |
-
* @return array[]
|
143 |
-
* @psalm-return array<string, string>
|
144 |
-
*/
|
145 |
Â
public function getFallbackDirsPsr4()
|
146 |
Â
{
|
147 |
Â
return $this->fallbackDirsPsr4;
|
148 |
Â
}
|
149 |
Â
|
150 |
-
/**
|
151 |
-
* @return string[] Array of classname => path
|
152 |
-
* @psalm-return array<string, string>
|
153 |
-
*/
|
154 |
Â
public function getClassMap()
|
155 |
Â
{
|
156 |
Â
return $this->classMap;
|
157 |
Â
}
|
158 |
Â
|
159 |
Â
/**
|
160 |
-
* @param
|
161 |
-
* @psalm-param array<string, string> $classMap
|
162 |
-
*
|
163 |
-
* @return void
|
164 |
Â
*/
|
165 |
Â
public function addClassMap(array $classMap)
|
166 |
Â
{
|
@@ -175,11 +111,9 @@ class ClassLoader
|
|
175 |
Â
* Registers a set of PSR-0 directories for a given prefix, either
|
176 |
Â
* appending or prepending to the ones previously set for this prefix.
|
177 |
Â
*
|
178 |
-
* @param string
|
179 |
-
* @param
|
180 |
-
* @param bool
|
181 |
-
*
|
182 |
-
* @return void
|
183 |
Â
*/
|
184 |
Â
public function add($prefix, $paths, $prepend = false)
|
185 |
Â
{
|
@@ -222,13 +156,11 @@ class ClassLoader
|
|
222 |
Â
* Registers a set of PSR-4 directories for a given namespace, either
|
223 |
Â
* appending or prepending to the ones previously set for this namespace.
|
224 |
Â
*
|
225 |
-
* @param string
|
226 |
-
* @param
|
227 |
-
* @param bool
|
228 |
Â
*
|
229 |
Â
* @throws \InvalidArgumentException
|
230 |
-
*
|
231 |
-
* @return void
|
232 |
Â
*/
|
233 |
Â
public function addPsr4($prefix, $paths, $prepend = false)
|
234 |
Â
{
|
@@ -272,10 +204,8 @@ class ClassLoader
|
|
272 |
Â
* Registers a set of PSR-0 directories for a given prefix,
|
273 |
Â
* replacing any others previously set for this prefix.
|
274 |
Â
*
|
275 |
-
* @param string
|
276 |
-
* @param
|
277 |
-
*
|
278 |
-
* @return void
|
279 |
Â
*/
|
280 |
Â
public function set($prefix, $paths)
|
281 |
Â
{
|
@@ -290,12 +220,10 @@ class ClassLoader
|
|
290 |
Â
* Registers a set of PSR-4 directories for a given namespace,
|
291 |
Â
* replacing any others previously set for this namespace.
|
292 |
Â
*
|
293 |
-
* @param string
|
294 |
-
* @param
|
295 |
Â
*
|
296 |
Â
* @throws \InvalidArgumentException
|
297 |
-
*
|
298 |
-
* @return void
|
299 |
Â
*/
|
300 |
Â
public function setPsr4($prefix, $paths)
|
301 |
Â
{
|
@@ -315,8 +243,6 @@ class ClassLoader
|
|
315 |
Â
* Turns on searching the include path for class files.
|
316 |
Â
*
|
317 |
Â
* @param bool $useIncludePath
|
318 |
-
*
|
319 |
-
* @return void
|
320 |
Â
*/
|
321 |
Â
public function setUseIncludePath($useIncludePath)
|
322 |
Â
{
|
@@ -339,8 +265,6 @@ class ClassLoader
|
|
339 |
Â
* that have not been registered with the class map.
|
340 |
Â
*
|
341 |
Â
* @param bool $classMapAuthoritative
|
342 |
-
*
|
343 |
-
* @return void
|
344 |
Â
*/
|
345 |
Â
public function setClassMapAuthoritative($classMapAuthoritative)
|
346 |
Â
{
|
@@ -361,8 +285,6 @@ class ClassLoader
|
|
361 |
Â
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
362 |
Â
*
|
363 |
Â
* @param string|null $apcuPrefix
|
364 |
-
*
|
365 |
-
* @return void
|
366 |
Â
*/
|
367 |
Â
public function setApcuPrefix($apcuPrefix)
|
368 |
Â
{
|
@@ -383,8 +305,6 @@ class ClassLoader
|
|
383 |
Â
* Registers this instance as an autoloader.
|
384 |
Â
*
|
385 |
Â
* @param bool $prepend Whether to prepend the autoloader or not
|
386 |
-
*
|
387 |
-
* @return void
|
388 |
Â
*/
|
389 |
Â
public function register($prepend = false)
|
390 |
Â
{
|
@@ -404,8 +324,6 @@ class ClassLoader
|
|
404 |
Â
|
405 |
Â
/**
|
406 |
Â
* Unregisters this instance as an autoloader.
|
407 |
-
*
|
408 |
-
* @return void
|
409 |
Â
*/
|
410 |
Â
public function unregister()
|
411 |
Â
{
|
@@ -485,11 +403,6 @@ class ClassLoader
|
|
485 |
Â
return self::$registeredLoaders;
|
486 |
Â
}
|
487 |
Â
|
488 |
-
/**
|
489 |
-
* @param string $class
|
490 |
-
* @param string $ext
|
491 |
-
* @return string|false
|
492 |
-
*/
|
493 |
Â
private function findFileWithExtension($class, $ext)
|
494 |
Â
{
|
495 |
Â
// PSR-4 lookup
|
@@ -561,10 +474,6 @@ class ClassLoader
|
|
561 |
Â
* Scope isolated include.
|
562 |
Â
*
|
563 |
Â
* Prevents access to $this/self from included files.
|
564 |
-
*
|
565 |
-
* @param string $file
|
566 |
-
* @return void
|
567 |
-
* @private
|
568 |
Â
*/
|
569 |
Â
function includeFile($file)
|
570 |
Â
{
|
42 |
Â
*/
|
43 |
Â
class ClassLoader
|
44 |
Â
{
|
Â
|
|
45 |
Â
private $vendorDir;
|
46 |
Â
|
47 |
Â
// PSR-4
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
48 |
Â
private $prefixLengthsPsr4 = array();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
49 |
Â
private $prefixDirsPsr4 = array();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
50 |
Â
private $fallbackDirsPsr4 = array();
|
51 |
Â
|
52 |
Â
// PSR-0
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
53 |
Â
private $prefixesPsr0 = array();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
54 |
Â
private $fallbackDirsPsr0 = array();
|
55 |
Â
|
Â
|
|
56 |
Â
private $useIncludePath = false;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
57 |
Â
private $classMap = array();
|
Â
|
|
Â
|
|
58 |
Â
private $classMapAuthoritative = false;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
59 |
Â
private $missingClasses = array();
|
Â
|
|
Â
|
|
60 |
Â
private $apcuPrefix;
|
61 |
Â
|
Â
|
|
Â
|
|
Â
|
|
62 |
Â
private static $registeredLoaders = array();
|
63 |
Â
|
Â
|
|
Â
|
|
Â
|
|
64 |
Â
public function __construct($vendorDir = null)
|
65 |
Â
{
|
66 |
Â
$this->vendorDir = $vendorDir;
|
67 |
Â
}
|
68 |
Â
|
Â
|
|
Â
|
|
Â
|
|
69 |
Â
public function getPrefixes()
|
70 |
Â
{
|
71 |
Â
if (!empty($this->prefixesPsr0)) {
|
75 |
Â
return array();
|
76 |
Â
}
|
77 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
78 |
Â
public function getPrefixesPsr4()
|
79 |
Â
{
|
80 |
Â
return $this->prefixDirsPsr4;
|
81 |
Â
}
|
82 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
83 |
Â
public function getFallbackDirs()
|
84 |
Â
{
|
85 |
Â
return $this->fallbackDirsPsr0;
|
86 |
Â
}
|
87 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
88 |
Â
public function getFallbackDirsPsr4()
|
89 |
Â
{
|
90 |
Â
return $this->fallbackDirsPsr4;
|
91 |
Â
}
|
92 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
93 |
Â
public function getClassMap()
|
94 |
Â
{
|
95 |
Â
return $this->classMap;
|
96 |
Â
}
|
97 |
Â
|
98 |
Â
/**
|
99 |
+
* @param array $classMap Class to filename map
|
Â
|
|
Â
|
|
Â
|
|
100 |
Â
*/
|
101 |
Â
public function addClassMap(array $classMap)
|
102 |
Â
{
|
111 |
Â
* Registers a set of PSR-0 directories for a given prefix, either
|
112 |
Â
* appending or prepending to the ones previously set for this prefix.
|
113 |
Â
*
|
114 |
+
* @param string $prefix The prefix
|
115 |
+
* @param array|string $paths The PSR-0 root directories
|
116 |
+
* @param bool $prepend Whether to prepend the directories
|
Â
|
|
Â
|
|
117 |
Â
*/
|
118 |
Â
public function add($prefix, $paths, $prepend = false)
|
119 |
Â
{
|
156 |
Â
* Registers a set of PSR-4 directories for a given namespace, either
|
157 |
Â
* appending or prepending to the ones previously set for this namespace.
|
158 |
Â
*
|
159 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
160 |
+
* @param array|string $paths The PSR-4 base directories
|
161 |
+
* @param bool $prepend Whether to prepend the directories
|
162 |
Â
*
|
163 |
Â
* @throws \InvalidArgumentException
|
Â
|
|
Â
|
|
164 |
Â
*/
|
165 |
Â
public function addPsr4($prefix, $paths, $prepend = false)
|
166 |
Â
{
|
204 |
Â
* Registers a set of PSR-0 directories for a given prefix,
|
205 |
Â
* replacing any others previously set for this prefix.
|
206 |
Â
*
|
207 |
+
* @param string $prefix The prefix
|
208 |
+
* @param array|string $paths The PSR-0 base directories
|
Â
|
|
Â
|
|
209 |
Â
*/
|
210 |
Â
public function set($prefix, $paths)
|
211 |
Â
{
|
220 |
Â
* Registers a set of PSR-4 directories for a given namespace,
|
221 |
Â
* replacing any others previously set for this namespace.
|
222 |
Â
*
|
223 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
224 |
+
* @param array|string $paths The PSR-4 base directories
|
225 |
Â
*
|
226 |
Â
* @throws \InvalidArgumentException
|
Â
|
|
Â
|
|
227 |
Â
*/
|
228 |
Â
public function setPsr4($prefix, $paths)
|
229 |
Â
{
|
243 |
Â
* Turns on searching the include path for class files.
|
244 |
Â
*
|
245 |
Â
* @param bool $useIncludePath
|
Â
|
|
Â
|
|
246 |
Â
*/
|
247 |
Â
public function setUseIncludePath($useIncludePath)
|
248 |
Â
{
|
265 |
Â
* that have not been registered with the class map.
|
266 |
Â
*
|
267 |
Â
* @param bool $classMapAuthoritative
|
Â
|
|
Â
|
|
268 |
Â
*/
|
269 |
Â
public function setClassMapAuthoritative($classMapAuthoritative)
|
270 |
Â
{
|
285 |
Â
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
286 |
Â
*
|
287 |
Â
* @param string|null $apcuPrefix
|
Â
|
|
Â
|
|
288 |
Â
*/
|
289 |
Â
public function setApcuPrefix($apcuPrefix)
|
290 |
Â
{
|
305 |
Â
* Registers this instance as an autoloader.
|
306 |
Â
*
|
307 |
Â
* @param bool $prepend Whether to prepend the autoloader or not
|
Â
|
|
Â
|
|
308 |
Â
*/
|
309 |
Â
public function register($prepend = false)
|
310 |
Â
{
|
324 |
Â
|
325 |
Â
/**
|
326 |
Â
* Unregisters this instance as an autoloader.
|
Â
|
|
Â
|
|
327 |
Â
*/
|
328 |
Â
public function unregister()
|
329 |
Â
{
|
403 |
Â
return self::$registeredLoaders;
|
404 |
Â
}
|
405 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
406 |
Â
private function findFileWithExtension($class, $ext)
|
407 |
Â
{
|
408 |
Â
// PSR-4 lookup
|
474 |
Â
* Scope isolated include.
|
475 |
Â
*
|
476 |
Â
* Prevents access to $this/self from included files.
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
477 |
Â
*/
|
478 |
Â
function includeFile($file)
|
479 |
Â
{
|
vendor/composer/InstalledVersions.php
CHANGED
@@ -20,25 +20,12 @@ use Composer\Semver\VersionParser;
|
|
20 |
Â
*
|
21 |
Â
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
Â
*
|
23 |
-
* To require
|
24 |
Â
*/
|
25 |
Â
class InstalledVersions
|
26 |
Â
{
|
27 |
-
/**
|
28 |
-
* @var mixed[]|null
|
29 |
-
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
30 |
-
*/
|
31 |
Â
private static $installed;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @var bool|null
|
35 |
-
*/
|
36 |
Â
private static $canGetVendors;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @var array[]
|
40 |
-
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
41 |
-
*/
|
42 |
Â
private static $installedByVendor = array();
|
43 |
Â
|
44 |
Â
/**
|
@@ -241,7 +228,7 @@ class InstalledVersions
|
|
241 |
Â
|
242 |
Â
/**
|
243 |
Â
* @return array
|
244 |
-
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string
|
245 |
Â
*/
|
246 |
Â
public static function getRootPackage()
|
247 |
Â
{
|
@@ -255,7 +242,7 @@ class InstalledVersions
|
|
255 |
Â
*
|
256 |
Â
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
257 |
Â
* @return array[]
|
258 |
-
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string
|
259 |
Â
*/
|
260 |
Â
public static function getRawData()
|
261 |
Â
{
|
@@ -278,7 +265,7 @@ class InstalledVersions
|
|
278 |
Â
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
279 |
Â
*
|
280 |
Â
* @return array[]
|
281 |
-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string
|
282 |
Â
*/
|
283 |
Â
public static function getAllRawData()
|
284 |
Â
{
|
@@ -301,7 +288,7 @@ class InstalledVersions
|
|
301 |
Â
* @param array[] $data A vendor/composer/installed.php data set
|
302 |
Â
* @return void
|
303 |
Â
*
|
304 |
-
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string
|
305 |
Â
*/
|
306 |
Â
public static function reload($data)
|
307 |
Â
{
|
@@ -311,7 +298,7 @@ class InstalledVersions
|
|
311 |
Â
|
312 |
Â
/**
|
313 |
Â
* @return array[]
|
314 |
-
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string
|
315 |
Â
*/
|
316 |
Â
private static function getInstalled()
|
317 |
Â
{
|
20 |
Â
*
|
21 |
Â
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
Â
*
|
23 |
+
* To require it's presence, you can require `composer-runtime-api ^2.0`
|
24 |
Â
*/
|
25 |
Â
class InstalledVersions
|
26 |
Â
{
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
27 |
Â
private static $installed;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
28 |
Â
private static $canGetVendors;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
29 |
Â
private static $installedByVendor = array();
|
30 |
Â
|
31 |
Â
/**
|
228 |
Â
|
229 |
Â
/**
|
230 |
Â
* @return array
|
231 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
|
232 |
Â
*/
|
233 |
Â
public static function getRootPackage()
|
234 |
Â
{
|
242 |
Â
*
|
243 |
Â
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
244 |
Â
* @return array[]
|
245 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
|
246 |
Â
*/
|
247 |
Â
public static function getRawData()
|
248 |
Â
{
|
265 |
Â
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
266 |
Â
*
|
267 |
Â
* @return array[]
|
268 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
269 |
Â
*/
|
270 |
Â
public static function getAllRawData()
|
271 |
Â
{
|
288 |
Â
* @param array[] $data A vendor/composer/installed.php data set
|
289 |
Â
* @return void
|
290 |
Â
*
|
291 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
|
292 |
Â
*/
|
293 |
Â
public static function reload($data)
|
294 |
Â
{
|
298 |
Â
|
299 |
Â
/**
|
300 |
Â
* @return array[]
|
301 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
302 |
Â
*/
|
303 |
Â
private static function getInstalled()
|
304 |
Â
{
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Â
|
3 |
Â
// autoload_real.php @generated by Composer
|
4 |
Â
|
5 |
-
class
|
6 |
Â
{
|
7 |
Â
private static $loader;
|
8 |
Â
|
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit460ee0d6adac6b72427bd47aef32c89e
|
|
24 |
Â
|
25 |
Â
require __DIR__ . '/platform_check.php';
|
26 |
Â
|
27 |
-
spl_autoload_register(array('
|
28 |
Â
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
-
spl_autoload_unregister(array('
|
30 |
Â
|
31 |
Â
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
Â
if ($useStaticLoader) {
|
33 |
Â
require __DIR__ . '/autoload_static.php';
|
34 |
Â
|
35 |
-
call_user_func(\Composer\Autoload\
|
36 |
Â
} else {
|
37 |
Â
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
Â
foreach ($map as $namespace => $path) {
|
@@ -53,28 +53,23 @@ class ComposerAutoloaderInit460ee0d6adac6b72427bd47aef32c89e
|
|
53 |
Â
$loader->register(true);
|
54 |
Â
|
55 |
Â
if ($useStaticLoader) {
|
56 |
-
$includeFiles = Composer\Autoload\
|
57 |
Â
} else {
|
58 |
Â
$includeFiles = require __DIR__ . '/autoload_files.php';
|
59 |
Â
}
|
60 |
Â
foreach ($includeFiles as $fileIdentifier => $file) {
|
61 |
-
|
62 |
Â
}
|
63 |
Â
|
64 |
Â
return $loader;
|
65 |
Â
}
|
66 |
Â
}
|
67 |
Â
|
68 |
-
|
69 |
-
* @param string $fileIdentifier
|
70 |
-
* @param string $file
|
71 |
-
* @return void
|
72 |
-
*/
|
73 |
-
function composerRequire460ee0d6adac6b72427bd47aef32c89e($fileIdentifier, $file)
|
74 |
Â
{
|
75 |
Â
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
76 |
-
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
77 |
-
|
78 |
Â
require $file;
|
Â
|
|
Â
|
|
79 |
Â
}
|
80 |
Â
}
|
2 |
Â
|
3 |
Â
// autoload_real.php @generated by Composer
|
4 |
Â
|
5 |
+
class ComposerAutoloaderInit454419e965d59060fd765740e7825238
|
6 |
Â
{
|
7 |
Â
private static $loader;
|
8 |
Â
|
24 |
Â
|
25 |
Â
require __DIR__ . '/platform_check.php';
|
26 |
Â
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit454419e965d59060fd765740e7825238', 'loadClassLoader'), true, true);
|
28 |
Â
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit454419e965d59060fd765740e7825238', 'loadClassLoader'));
|
30 |
Â
|
31 |
Â
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
Â
if ($useStaticLoader) {
|
33 |
Â
require __DIR__ . '/autoload_static.php';
|
34 |
Â
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit454419e965d59060fd765740e7825238::getInitializer($loader));
|
36 |
Â
} else {
|
37 |
Â
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
Â
foreach ($map as $namespace => $path) {
|
53 |
Â
$loader->register(true);
|
54 |
Â
|
55 |
Â
if ($useStaticLoader) {
|
56 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit454419e965d59060fd765740e7825238::$files;
|
57 |
Â
} else {
|
58 |
Â
$includeFiles = require __DIR__ . '/autoload_files.php';
|
59 |
Â
}
|
60 |
Â
foreach ($includeFiles as $fileIdentifier => $file) {
|
61 |
+
composerRequire454419e965d59060fd765740e7825238($fileIdentifier, $file);
|
62 |
Â
}
|
63 |
Â
|
64 |
Â
return $loader;
|
65 |
Â
}
|
66 |
Â
}
|
67 |
Â
|
68 |
+
function composerRequire454419e965d59060fd765740e7825238($fileIdentifier, $file)
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
69 |
Â
{
|
70 |
Â
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
Â
|
|
Â
|
|
71 |
Â
require $file;
|
72 |
+
|
73 |
+
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
74 |
Â
}
|
75 |
Â
}
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Â
|
5 |
Â
namespace Composer\Autoload;
|
6 |
Â
|
7 |
-
class
|
8 |
Â
{
|
9 |
Â
public static $files = array (
|
10 |
Â
'0d5072bb3af3f8dc141e158c7699adf2' => __DIR__ . '/../..' . '/helpers/helpers.php',
|
@@ -91,10 +91,10 @@ class ComposerStaticInit460ee0d6adac6b72427bd47aef32c89e
|
|
91 |
Â
public static function getInitializer(ClassLoader $loader)
|
92 |
Â
{
|
93 |
Â
return \Closure::bind(function () use ($loader) {
|
94 |
-
$loader->prefixLengthsPsr4 =
|
95 |
-
$loader->prefixDirsPsr4 =
|
96 |
-
$loader->prefixesPsr0 =
|
97 |
-
$loader->classMap =
|
98 |
Â
|
99 |
Â
}, null, ClassLoader::class);
|
100 |
Â
}
|
4 |
Â
|
5 |
Â
namespace Composer\Autoload;
|
6 |
Â
|
7 |
+
class ComposerStaticInit454419e965d59060fd765740e7825238
|
8 |
Â
{
|
9 |
Â
public static $files = array (
|
10 |
Â
'0d5072bb3af3f8dc141e158c7699adf2' => __DIR__ . '/../..' . '/helpers/helpers.php',
|
91 |
Â
public static function getInitializer(ClassLoader $loader)
|
92 |
Â
{
|
93 |
Â
return \Closure::bind(function () use ($loader) {
|
94 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit454419e965d59060fd765740e7825238::$prefixLengthsPsr4;
|
95 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit454419e965d59060fd765740e7825238::$prefixDirsPsr4;
|
96 |
+
$loader->prefixesPsr0 = ComposerStaticInit454419e965d59060fd765740e7825238::$prefixesPsr0;
|
97 |
+
$loader->classMap = ComposerStaticInit454419e965d59060fd765740e7825238::$classMap;
|
98 |
Â
|
99 |
Â
}, null, ClassLoader::class);
|
100 |
Â
}
|
vendor/composer/installed.php
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
Â
<?php return array(
|
2 |
Â
'root' => array(
|
3 |
-
'pretty_version' => 'dev-
|
4 |
-
'version' => 'dev-
|
5 |
Â
'type' => 'library',
|
6 |
Â
'install_path' => __DIR__ . '/../../',
|
7 |
Â
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
Â
'name' => '__root__',
|
10 |
Â
'dev' => true,
|
11 |
Â
),
|
12 |
Â
'versions' => array(
|
13 |
Â
'__root__' => array(
|
14 |
-
'pretty_version' => 'dev-
|
15 |
-
'version' => 'dev-
|
16 |
Â
'type' => 'library',
|
17 |
Â
'install_path' => __DIR__ . '/../../',
|
18 |
Â
'aliases' => array(),
|
19 |
-
'reference' => '
|
20 |
Â
'dev_requirement' => false,
|
21 |
Â
),
|
22 |
Â
'a5hleyrich/wp-background-processing' => array(
|
1 |
Â
<?php return array(
|
2 |
Â
'root' => array(
|
3 |
+
'pretty_version' => 'dev-master',
|
4 |
+
'version' => 'dev-master',
|
5 |
Â
'type' => 'library',
|
6 |
Â
'install_path' => __DIR__ . '/../../',
|
7 |
Â
'aliases' => array(),
|
8 |
+
'reference' => 'c38dea9e2fb74148a26becb10d97c6e0e41b036b',
|
9 |
Â
'name' => '__root__',
|
10 |
Â
'dev' => true,
|
11 |
Â
),
|
12 |
Â
'versions' => array(
|
13 |
Â
'__root__' => array(
|
14 |
+
'pretty_version' => 'dev-master',
|
15 |
+
'version' => 'dev-master',
|
16 |
Â
'type' => 'library',
|
17 |
Â
'install_path' => __DIR__ . '/../../',
|
18 |
Â
'aliases' => array(),
|
19 |
+
'reference' => 'c38dea9e2fb74148a26becb10d97c6e0e41b036b',
|
20 |
Â
'dev_requirement' => false,
|
21 |
Â
),
|
22 |
Â
'a5hleyrich/wp-background-processing' => array(
|
vendor/siteground/siteground-i18n/vendor/autoload.php
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload.php @generated by Composer
|
4 |
+
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
+
|
7 |
+
return ComposerAutoloaderInit069af68d6e649077696a380a2ba6db6a::getLoader();
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
Â
|
|
Â
|
1 |
+
vendor
|
2 |
+
.idea
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/composer.json
ADDED
@@ -0,0 +1,32 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"name": "charles-rumley/php-po-to-json",
|
3 |
+
"type": "package",
|
4 |
+
"license": "MIT",
|
5 |
+
"authors": [
|
6 |
+
{
|
7 |
+
"name": "Charles Rumley",
|
8 |
+
"email": "charles.rumley@gmail.com"
|
9 |
+
}
|
10 |
+
],
|
11 |
+
"description": "",
|
12 |
+
"keywords": [
|
13 |
+
"translation",
|
14 |
+
"i18n",
|
15 |
+
"php",
|
16 |
+
"json",
|
17 |
+
"jed"
|
18 |
+
],
|
19 |
+
"require": {
|
20 |
+
"php": ">=5.3.0",
|
21 |
+
"sepia/po-parser": "^4.2"
|
22 |
+
},
|
23 |
+
"require-dev": {
|
24 |
+
"phpunit/phpunit": "~4.0"
|
25 |
+
},
|
26 |
+
"autoload": {
|
27 |
+
"psr-4": {
|
28 |
+
"CharlesRumley\\": "src/",
|
29 |
+
"CharlesRumley\\Tests\\": "tests/"
|
30 |
+
}
|
31 |
+
}
|
32 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/composer.lock
ADDED
@@ -0,0 +1,1174 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"hash": "e0f4db756f11f377aaf0549a513c14be",
|
8 |
+
"content-hash": "8cf0717e1624c5bd83f2236efdc0c498",
|
9 |
+
"packages": [
|
10 |
+
{
|
11 |
+
"name": "sepia/po-parser",
|
12 |
+
"version": "4.2.1",
|
13 |
+
"source": {
|
14 |
+
"type": "git",
|
15 |
+
"url": "https://github.com/raulferras/PHP-po-parser.git",
|
16 |
+
"reference": "4906b3bc357e1028b84c3cb0ee1d1d1970a21fbb"
|
17 |
+
},
|
18 |
+
"dist": {
|
19 |
+
"type": "zip",
|
20 |
+
"url": "https://api.github.com/repos/raulferras/PHP-po-parser/zipball/4906b3bc357e1028b84c3cb0ee1d1d1970a21fbb",
|
21 |
+
"reference": "4906b3bc357e1028b84c3cb0ee1d1d1970a21fbb",
|
22 |
+
"shasum": ""
|
23 |
+
},
|
24 |
+
"require": {
|
25 |
+
"php": ">=5.3.0"
|
26 |
+
},
|
27 |
+
"require-dev": {
|
28 |
+
"phpunit/phpunit": "3.7.*",
|
29 |
+
"squizlabs/php_codesniffer": "1.5.*"
|
30 |
+
},
|
31 |
+
"type": "library",
|
32 |
+
"autoload": {
|
33 |
+
"psr-0": {
|
34 |
+
"Sepia": "src/"
|
35 |
+
}
|
36 |
+
},
|
37 |
+
"notification-url": "https://packagist.org/downloads/",
|
38 |
+
"license": [
|
39 |
+
"MIT"
|
40 |
+
],
|
41 |
+
"authors": [
|
42 |
+
{
|
43 |
+
"name": "Raúl Ferrà s",
|
44 |
+
"email": "raul.ferras@gmail.com",
|
45 |
+
"role": "developer"
|
46 |
+
}
|
47 |
+
],
|
48 |
+
"description": "Gettext *.PO file parser for PHP.",
|
49 |
+
"homepage": "https://github.com/raulferras/PHP-po-parser",
|
50 |
+
"keywords": [
|
51 |
+
"gettext",
|
52 |
+
"i10n",
|
53 |
+
"i18n",
|
54 |
+
"po"
|
55 |
+
],
|
56 |
+
"time": "2015-06-09 08:01:21"
|
57 |
+
}
|
58 |
+
],
|
59 |
+
"packages-dev": [
|
60 |
+
{
|
61 |
+
"name": "doctrine/instantiator",
|
62 |
+
"version": "1.0.5",
|
63 |
+
"source": {
|
64 |
+
"type": "git",
|
65 |
+
"url": "https://github.com/doctrine/instantiator.git",
|
66 |
+
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
|
67 |
+
},
|
68 |
+
"dist": {
|
69 |
+
"type": "zip",
|
70 |
+
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
|
71 |
+
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
|
72 |
+
"shasum": ""
|
73 |
+
},
|
74 |
+
"require": {
|
75 |
+
"php": ">=5.3,<8.0-DEV"
|
76 |
+
},
|
77 |
+
"require-dev": {
|
78 |
+
"athletic/athletic": "~0.1.8",
|
79 |
+
"ext-pdo": "*",
|
80 |
+
"ext-phar": "*",
|
81 |
+
"phpunit/phpunit": "~4.0",
|
82 |
+
"squizlabs/php_codesniffer": "~2.0"
|
83 |
+
},
|
84 |
+
"type": "library",
|
85 |
+
"extra": {
|
86 |
+
"branch-alias": {
|
87 |
+
"dev-master": "1.0.x-dev"
|
88 |
+
}
|
89 |
+
},
|
90 |
+
"autoload": {
|
91 |
+
"psr-4": {
|
92 |
+
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
|
93 |
+
}
|
94 |
+
},
|
95 |
+
"notification-url": "https://packagist.org/downloads/",
|
96 |
+
"license": [
|
97 |
+
"MIT"
|
98 |
+
],
|
99 |
+
"authors": [
|
100 |
+
{
|
101 |
+
"name": "Marco Pivetta",
|
102 |
+
"email": "ocramius@gmail.com",
|
103 |
+
"homepage": "http://ocramius.github.com/"
|
104 |
+
}
|
105 |
+
],
|
106 |
+
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
|
107 |
+
"homepage": "https://github.com/doctrine/instantiator",
|
108 |
+
"keywords": [
|
109 |
+
"constructor",
|
110 |
+
"instantiate"
|
111 |
+
],
|
112 |
+
"time": "2015-06-14 21:17:01"
|
113 |
+
},
|
114 |
+
{
|
115 |
+
"name": "phpdocumentor/reflection-common",
|
116 |
+
"version": "1.0",
|
117 |
+
"source": {
|
118 |
+
"type": "git",
|
119 |
+
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
|
120 |
+
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
|
121 |
+
},
|
122 |
+
"dist": {
|
123 |
+
"type": "zip",
|
124 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
125 |
+
"reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
|
126 |
+
"shasum": ""
|
127 |
+
},
|
128 |
+
"require": {
|
129 |
+
"php": ">=5.5"
|
130 |
+
},
|
131 |
+
"require-dev": {
|
132 |
+
"phpunit/phpunit": "^4.6"
|
133 |
+
},
|
134 |
+
"type": "library",
|
135 |
+
"extra": {
|
136 |
+
"branch-alias": {
|
137 |
+
"dev-master": "1.0.x-dev"
|
138 |
+
}
|
139 |
+
},
|
140 |
+
"autoload": {
|
141 |
+
"psr-4": {
|
142 |
+
"phpDocumentor\\Reflection\\": [
|
143 |
+
"src"
|
144 |
+
]
|
145 |
+
}
|
146 |
+
},
|
147 |
+
"notification-url": "https://packagist.org/downloads/",
|
148 |
+
"license": [
|
149 |
+
"MIT"
|
150 |
+
],
|
151 |
+
"authors": [
|
152 |
+
{
|
153 |
+
"name": "Jaap van Otterdijk",
|
154 |
+
"email": "opensource@ijaap.nl"
|
155 |
+
}
|
156 |
+
],
|
157 |
+
"description": "Common reflection classes used by phpdocumentor to reflect the code structure",
|
158 |
+
"homepage": "http://www.phpdoc.org",
|
159 |
+
"keywords": [
|
160 |
+
"FQSEN",
|
161 |
+
"phpDocumentor",
|
162 |
+
"phpdoc",
|
163 |
+
"reflection",
|
164 |
+
"static analysis"
|
165 |
+
],
|
166 |
+
"time": "2015-12-27 11:43:31"
|
167 |
+
},
|
168 |
+
{
|
169 |
+
"name": "phpdocumentor/reflection-docblock",
|
170 |
+
"version": "3.1.0",
|
171 |
+
"source": {
|
172 |
+
"type": "git",
|
173 |
+
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
|
174 |
+
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd"
|
175 |
+
},
|
176 |
+
"dist": {
|
177 |
+
"type": "zip",
|
178 |
+
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd",
|
179 |
+
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd",
|
180 |
+
"shasum": ""
|
181 |
+
},
|
182 |
+
"require": {
|
183 |
+
"php": ">=5.5",
|
184 |
+
"phpdocumentor/reflection-common": "^1.0@dev",
|
185 |
+
"phpdocumentor/type-resolver": "^0.2.0",
|
186 |
+
"webmozart/assert": "^1.0"
|
187 |
+
},
|
188 |
+
"require-dev": {
|
189 |
+
"mockery/mockery": "^0.9.4",
|
190 |
+
"phpunit/phpunit": "^4.4"
|
191 |
+
},
|
192 |
+
"type": "library",
|
193 |
+
"autoload": {
|
194 |
+
"psr-4": {
|
195 |
+
"phpDocumentor\\Reflection\\": [
|
196 |
+
"src/"
|
197 |
+
]
|
198 |
+
}
|
199 |
+
},
|
200 |
+
"notification-url": "https://packagist.org/downloads/",
|
201 |
+
"license": [
|
202 |
+
"MIT"
|
203 |
+
],
|
204 |
+
"authors": [
|
205 |
+
{
|
206 |
+
"name": "Mike van Riel",
|
207 |
+
"email": "me@mikevanriel.com"
|
208 |
+
}
|
209 |
+
],
|
210 |
+
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
|
211 |
+
"time": "2016-06-10 09:48:41"
|
212 |
+
},
|
213 |
+
{
|
214 |
+
"name": "phpdocumentor/type-resolver",
|
215 |
+
"version": "0.2",
|
216 |
+
"source": {
|
217 |
+
"type": "git",
|
218 |
+
"url": "https://github.com/phpDocumentor/TypeResolver.git",
|
219 |
+
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443"
|
220 |
+
},
|
221 |
+
"dist": {
|
222 |
+
"type": "zip",
|
223 |
+
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443",
|
224 |
+
"reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443",
|
225 |
+
"shasum": ""
|
226 |
+
},
|
227 |
+
"require": {
|
228 |
+
"php": ">=5.5",
|
229 |
+
"phpdocumentor/reflection-common": "^1.0"
|
230 |
+
},
|
231 |
+
"require-dev": {
|
232 |
+
"mockery/mockery": "^0.9.4",
|
233 |
+
"phpunit/phpunit": "^5.2||^4.8.24"
|
234 |
+
},
|
235 |
+
"type": "library",
|
236 |
+
"extra": {
|
237 |
+
"branch-alias": {
|
238 |
+
"dev-master": "1.0.x-dev"
|
239 |
+
}
|
240 |
+
},
|
241 |
+
"autoload": {
|
242 |
+
"psr-4": {
|
243 |
+
"phpDocumentor\\Reflection\\": [
|
244 |
+
"src/"
|
245 |
+
]
|
246 |
+
}
|
247 |
+
},
|
248 |
+
"notification-url": "https://packagist.org/downloads/",
|
249 |
+
"license": [
|
250 |
+
"MIT"
|
251 |
+
],
|
252 |
+
"authors": [
|
253 |
+
{
|
254 |
+
"name": "Mike van Riel",
|
255 |
+
"email": "me@mikevanriel.com"
|
256 |
+
}
|
257 |
+
],
|
258 |
+
"time": "2016-06-10 07:14:17"
|
259 |
+
},
|
260 |
+
{
|
261 |
+
"name": "phpspec/prophecy",
|
262 |
+
"version": "v1.6.1",
|
263 |
+
"source": {
|
264 |
+
"type": "git",
|
265 |
+
"url": "https://github.com/phpspec/prophecy.git",
|
266 |
+
"reference": "58a8137754bc24b25740d4281399a4a3596058e0"
|
267 |
+
},
|
268 |
+
"dist": {
|
269 |
+
"type": "zip",
|
270 |
+
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0",
|
271 |
+
"reference": "58a8137754bc24b25740d4281399a4a3596058e0",
|
272 |
+
"shasum": ""
|
273 |
+
},
|
274 |
+
"require": {
|
275 |
+
"doctrine/instantiator": "^1.0.2",
|
276 |
+
"php": "^5.3|^7.0",
|
277 |
+
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
|
278 |
+
"sebastian/comparator": "^1.1",
|
279 |
+
"sebastian/recursion-context": "^1.0"
|
280 |
+
},
|
281 |
+
"require-dev": {
|
282 |
+
"phpspec/phpspec": "^2.0"
|
283 |
+
},
|
284 |
+
"type": "library",
|
285 |
+
"extra": {
|
286 |
+
"branch-alias": {
|
287 |
+
"dev-master": "1.6.x-dev"
|
288 |
+
}
|
289 |
+
},
|
290 |
+
"autoload": {
|
291 |
+
"psr-0": {
|
292 |
+
"Prophecy\\": "src/"
|
293 |
+
}
|
294 |
+
},
|
295 |
+
"notification-url": "https://packagist.org/downloads/",
|
296 |
+
"license": [
|
297 |
+
"MIT"
|
298 |
+
],
|
299 |
+
"authors": [
|
300 |
+
{
|
301 |
+
"name": "Konstantin Kudryashov",
|
302 |
+
"email": "ever.zet@gmail.com",
|
303 |
+
"homepage": "http://everzet.com"
|
304 |
+
},
|
305 |
+
{
|
306 |
+
"name": "Marcello Duarte",
|
307 |
+
"email": "marcello.duarte@gmail.com"
|
308 |
+
}
|
309 |
+
],
|
310 |
+
"description": "Highly opinionated mocking framework for PHP 5.3+",
|
311 |
+
"homepage": "https://github.com/phpspec/prophecy",
|
312 |
+
"keywords": [
|
313 |
+
"Double",
|
314 |
+
"Dummy",
|
315 |
+
"fake",
|
316 |
+
"mock",
|
317 |
+
"spy",
|
318 |
+
"stub"
|
319 |
+
],
|
320 |
+
"time": "2016-06-07 08:13:47"
|
321 |
+
},
|
322 |
+
{
|
323 |
+
"name": "phpunit/php-code-coverage",
|
324 |
+
"version": "2.2.4",
|
325 |
+
"source": {
|
326 |
+
"type": "git",
|
327 |
+
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
328 |
+
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
|
329 |
+
},
|
330 |
+
"dist": {
|
331 |
+
"type": "zip",
|
332 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
333 |
+
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
334 |
+
"shasum": ""
|
335 |
+
},
|
336 |
+
"require": {
|
337 |
+
"php": ">=5.3.3",
|
338 |
+
"phpunit/php-file-iterator": "~1.3",
|
339 |
+
"phpunit/php-text-template": "~1.2",
|
340 |
+
"phpunit/php-token-stream": "~1.3",
|
341 |
+
"sebastian/environment": "^1.3.2",
|
342 |
+
"sebastian/version": "~1.0"
|
343 |
+
},
|
344 |
+
"require-dev": {
|
345 |
+
"ext-xdebug": ">=2.1.4",
|
346 |
+
"phpunit/phpunit": "~4"
|
347 |
+
},
|
348 |
+
"suggest": {
|
349 |
+
"ext-dom": "*",
|
350 |
+
"ext-xdebug": ">=2.2.1",
|
351 |
+
"ext-xmlwriter": "*"
|
352 |
+
},
|
353 |
+
"type": "library",
|
354 |
+
"extra": {
|
355 |
+
"branch-alias": {
|
356 |
+
"dev-master": "2.2.x-dev"
|
357 |
+
}
|
358 |
+
},
|
359 |
+
"autoload": {
|
360 |
+
"classmap": [
|
361 |
+
"src/"
|
362 |
+
]
|
363 |
+
},
|
364 |
+
"notification-url": "https://packagist.org/downloads/",
|
365 |
+
"license": [
|
366 |
+
"BSD-3-Clause"
|
367 |
+
],
|
368 |
+
"authors": [
|
369 |
+
{
|
370 |
+
"name": "Sebastian Bergmann",
|
371 |
+
"email": "sb@sebastian-bergmann.de",
|
372 |
+
"role": "lead"
|
373 |
+
}
|
374 |
+
],
|
375 |
+
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
|
376 |
+
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
|
377 |
+
"keywords": [
|
378 |
+
"coverage",
|
379 |
+
"testing",
|
380 |
+
"xunit"
|
381 |
+
],
|
382 |
+
"time": "2015-10-06 15:47:00"
|
383 |
+
},
|
384 |
+
{
|
385 |
+
"name": "phpunit/php-file-iterator",
|
386 |
+
"version": "1.4.1",
|
387 |
+
"source": {
|
388 |
+
"type": "git",
|
389 |
+
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
390 |
+
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
|
391 |
+
},
|
392 |
+
"dist": {
|
393 |
+
"type": "zip",
|
394 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
395 |
+
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
396 |
+
"shasum": ""
|
397 |
+
},
|
398 |
+
"require": {
|
399 |
+
"php": ">=5.3.3"
|
400 |
+
},
|
401 |
+
"type": "library",
|
402 |
+
"extra": {
|
403 |
+
"branch-alias": {
|
404 |
+
"dev-master": "1.4.x-dev"
|
405 |
+
}
|
406 |
+
},
|
407 |
+
"autoload": {
|
408 |
+
"classmap": [
|
409 |
+
"src/"
|
410 |
+
]
|
411 |
+
},
|
412 |
+
"notification-url": "https://packagist.org/downloads/",
|
413 |
+
"license": [
|
414 |
+
"BSD-3-Clause"
|
415 |
+
],
|
416 |
+
"authors": [
|
417 |
+
{
|
418 |
+
"name": "Sebastian Bergmann",
|
419 |
+
"email": "sb@sebastian-bergmann.de",
|
420 |
+
"role": "lead"
|
421 |
+
}
|
422 |
+
],
|
423 |
+
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
|
424 |
+
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
|
425 |
+
"keywords": [
|
426 |
+
"filesystem",
|
427 |
+
"iterator"
|
428 |
+
],
|
429 |
+
"time": "2015-06-21 13:08:43"
|
430 |
+
},
|
431 |
+
{
|
432 |
+
"name": "phpunit/php-text-template",
|
433 |
+
"version": "1.2.1",
|
434 |
+
"source": {
|
435 |
+
"type": "git",
|
436 |
+
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
437 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
|
438 |
+
},
|
439 |
+
"dist": {
|
440 |
+
"type": "zip",
|
441 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
442 |
+
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
443 |
+
"shasum": ""
|
444 |
+
},
|
445 |
+
"require": {
|
446 |
+
"php": ">=5.3.3"
|
447 |
+
},
|
448 |
+
"type": "library",
|
449 |
+
"autoload": {
|
450 |
+
"classmap": [
|
451 |
+
"src/"
|
452 |
+
]
|
453 |
+
},
|
454 |
+
"notification-url": "https://packagist.org/downloads/",
|
455 |
+
"license": [
|
456 |
+
"BSD-3-Clause"
|
457 |
+
],
|
458 |
+
"authors": [
|
459 |
+
{
|
460 |
+
"name": "Sebastian Bergmann",
|
461 |
+
"email": "sebastian@phpunit.de",
|
462 |
+
"role": "lead"
|
463 |
+
}
|
464 |
+
],
|
465 |
+
"description": "Simple template engine.",
|
466 |
+
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
|
467 |
+
"keywords": [
|
468 |
+
"template"
|
469 |
+
],
|
470 |
+
"time": "2015-06-21 13:50:34"
|
471 |
+
},
|
472 |
+
{
|
473 |
+
"name": "phpunit/php-timer",
|
474 |
+
"version": "1.0.8",
|
475 |
+
"source": {
|
476 |
+
"type": "git",
|
477 |
+
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
478 |
+
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
|
479 |
+
},
|
480 |
+
"dist": {
|
481 |
+
"type": "zip",
|
482 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
483 |
+
"reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
|
484 |
+
"shasum": ""
|
485 |
+
},
|
486 |
+
"require": {
|
487 |
+
"php": ">=5.3.3"
|
488 |
+
},
|
489 |
+
"require-dev": {
|
490 |
+
"phpunit/phpunit": "~4|~5"
|
491 |
+
},
|
492 |
+
"type": "library",
|
493 |
+
"autoload": {
|
494 |
+
"classmap": [
|
495 |
+
"src/"
|
496 |
+
]
|
497 |
+
},
|
498 |
+
"notification-url": "https://packagist.org/downloads/",
|
499 |
+
"license": [
|
500 |
+
"BSD-3-Clause"
|
501 |
+
],
|
502 |
+
"authors": [
|
503 |
+
{
|
504 |
+
"name": "Sebastian Bergmann",
|
505 |
+
"email": "sb@sebastian-bergmann.de",
|
506 |
+
"role": "lead"
|
507 |
+
}
|
508 |
+
],
|
509 |
+
"description": "Utility class for timing",
|
510 |
+
"homepage": "https://github.com/sebastianbergmann/php-timer/",
|
511 |
+
"keywords": [
|
512 |
+
"timer"
|
513 |
+
],
|
514 |
+
"time": "2016-05-12 18:03:57"
|
515 |
+
},
|
516 |
+
{
|
517 |
+
"name": "phpunit/php-token-stream",
|
518 |
+
"version": "1.4.8",
|
519 |
+
"source": {
|
520 |
+
"type": "git",
|
521 |
+
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
|
522 |
+
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
|
523 |
+
},
|
524 |
+
"dist": {
|
525 |
+
"type": "zip",
|
526 |
+
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
527 |
+
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
|
528 |
+
"shasum": ""
|
529 |
+
},
|
530 |
+
"require": {
|
531 |
+
"ext-tokenizer": "*",
|
532 |
+
"php": ">=5.3.3"
|
533 |
+
},
|
534 |
+
"require-dev": {
|
535 |
+
"phpunit/phpunit": "~4.2"
|
536 |
+
},
|
537 |
+
"type": "library",
|
538 |
+
"extra": {
|
539 |
+
"branch-alias": {
|
540 |
+
"dev-master": "1.4-dev"
|
541 |
+
}
|
542 |
+
},
|
543 |
+
"autoload": {
|
544 |
+
"classmap": [
|
545 |
+
"src/"
|
546 |
+
]
|
547 |
+
},
|
548 |
+
"notification-url": "https://packagist.org/downloads/",
|
549 |
+
"license": [
|
550 |
+
"BSD-3-Clause"
|
551 |
+
],
|
552 |
+
"authors": [
|
553 |
+
{
|
554 |
+
"name": "Sebastian Bergmann",
|
555 |
+
"email": "sebastian@phpunit.de"
|
556 |
+
}
|
557 |
+
],
|
558 |
+
"description": "Wrapper around PHP's tokenizer extension.",
|
559 |
+
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
|
560 |
+
"keywords": [
|
561 |
+
"tokenizer"
|
562 |
+
],
|
563 |
+
"time": "2015-09-15 10:49:45"
|
564 |
+
},
|
565 |
+
{
|
566 |
+
"name": "phpunit/phpunit",
|
567 |
+
"version": "4.8.27",
|
568 |
+
"source": {
|
569 |
+
"type": "git",
|
570 |
+
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
571 |
+
"reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90"
|
572 |
+
},
|
573 |
+
"dist": {
|
574 |
+
"type": "zip",
|
575 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90",
|
576 |
+
"reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90",
|
577 |
+
"shasum": ""
|
578 |
+
},
|
579 |
+
"require": {
|
580 |
+
"ext-dom": "*",
|
581 |
+
"ext-json": "*",
|
582 |
+
"ext-pcre": "*",
|
583 |
+
"ext-reflection": "*",
|
584 |
+
"ext-spl": "*",
|
585 |
+
"php": ">=5.3.3",
|
586 |
+
"phpspec/prophecy": "^1.3.1",
|
587 |
+
"phpunit/php-code-coverage": "~2.1",
|
588 |
+
"phpunit/php-file-iterator": "~1.4",
|
589 |
+
"phpunit/php-text-template": "~1.2",
|
590 |
+
"phpunit/php-timer": "^1.0.6",
|
591 |
+
"phpunit/phpunit-mock-objects": "~2.3",
|
592 |
+
"sebastian/comparator": "~1.1",
|
593 |
+
"sebastian/diff": "~1.2",
|
594 |
+
"sebastian/environment": "~1.3",
|
595 |
+
"sebastian/exporter": "~1.2",
|
596 |
+
"sebastian/global-state": "~1.0",
|
597 |
+
"sebastian/version": "~1.0",
|
598 |
+
"symfony/yaml": "~2.1|~3.0"
|
599 |
+
},
|
600 |
+
"suggest": {
|
601 |
+
"phpunit/php-invoker": "~1.1"
|
602 |
+
},
|
603 |
+
"bin": [
|
604 |
+
"phpunit"
|
605 |
+
],
|
606 |
+
"type": "library",
|
607 |
+
"extra": {
|
608 |
+
"branch-alias": {
|
609 |
+
"dev-master": "4.8.x-dev"
|
610 |
+
}
|
611 |
+
},
|
612 |
+
"autoload": {
|
613 |
+
"classmap": [
|
614 |
+
"src/"
|
615 |
+
]
|
616 |
+
},
|
617 |
+
"notification-url": "https://packagist.org/downloads/",
|
618 |
+
"license": [
|
619 |
+
"BSD-3-Clause"
|
620 |
+
],
|
621 |
+
"authors": [
|
622 |
+
{
|
623 |
+
"name": "Sebastian Bergmann",
|
624 |
+
"email": "sebastian@phpunit.de",
|
625 |
+
"role": "lead"
|
626 |
+
}
|
627 |
+
],
|
628 |
+
"description": "The PHP Unit Testing framework.",
|
629 |
+
"homepage": "https://phpunit.de/",
|
630 |
+
"keywords": [
|
631 |
+
"phpunit",
|
632 |
+
"testing",
|
633 |
+
"xunit"
|
634 |
+
],
|
635 |
+
"time": "2016-07-21 06:48:14"
|
636 |
+
},
|
637 |
+
{
|
638 |
+
"name": "phpunit/phpunit-mock-objects",
|
639 |
+
"version": "2.3.8",
|
640 |
+
"source": {
|
641 |
+
"type": "git",
|
642 |
+
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
|
643 |
+
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
|
644 |
+
},
|
645 |
+
"dist": {
|
646 |
+
"type": "zip",
|
647 |
+
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
648 |
+
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
|
649 |
+
"shasum": ""
|
650 |
+
},
|
651 |
+
"require": {
|
652 |
+
"doctrine/instantiator": "^1.0.2",
|
653 |
+
"php": ">=5.3.3",
|
654 |
+
"phpunit/php-text-template": "~1.2",
|
655 |
+
"sebastian/exporter": "~1.2"
|
656 |
+
},
|
657 |
+
"require-dev": {
|
658 |
+
"phpunit/phpunit": "~4.4"
|
659 |
+
},
|
660 |
+
"suggest": {
|
661 |
+
"ext-soap": "*"
|
662 |
+
},
|
663 |
+
"type": "library",
|
664 |
+
"extra": {
|
665 |
+
"branch-alias": {
|
666 |
+
"dev-master": "2.3.x-dev"
|
667 |
+
}
|
668 |
+
},
|
669 |
+
"autoload": {
|
670 |
+
"classmap": [
|
671 |
+
"src/"
|
672 |
+
]
|
673 |
+
},
|
674 |
+
"notification-url": "https://packagist.org/downloads/",
|
675 |
+
"license": [
|
676 |
+
"BSD-3-Clause"
|
677 |
+
],
|
678 |
+
"authors": [
|
679 |
+
{
|
680 |
+
"name": "Sebastian Bergmann",
|
681 |
+
"email": "sb@sebastian-bergmann.de",
|
682 |
+
"role": "lead"
|
683 |
+
}
|
684 |
+
],
|
685 |
+
"description": "Mock Object library for PHPUnit",
|
686 |
+
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
|
687 |
+
"keywords": [
|
688 |
+
"mock",
|
689 |
+
"xunit"
|
690 |
+
],
|
691 |
+
"time": "2015-10-02 06:51:40"
|
692 |
+
},
|
693 |
+
{
|
694 |
+
"name": "sebastian/comparator",
|
695 |
+
"version": "1.2.0",
|
696 |
+
"source": {
|
697 |
+
"type": "git",
|
698 |
+
"url": "https://github.com/sebastianbergmann/comparator.git",
|
699 |
+
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
|
700 |
+
},
|
701 |
+
"dist": {
|
702 |
+
"type": "zip",
|
703 |
+
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
|
704 |
+
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
|
705 |
+
"shasum": ""
|
706 |
+
},
|
707 |
+
"require": {
|
708 |
+
"php": ">=5.3.3",
|
709 |
+
"sebastian/diff": "~1.2",
|
710 |
+
"sebastian/exporter": "~1.2"
|
711 |
+
},
|
712 |
+
"require-dev": {
|
713 |
+
"phpunit/phpunit": "~4.4"
|
714 |
+
},
|
715 |
+
"type": "library",
|
716 |
+
"extra": {
|
717 |
+
"branch-alias": {
|
718 |
+
"dev-master": "1.2.x-dev"
|
719 |
+
}
|
720 |
+
},
|
721 |
+
"autoload": {
|
722 |
+
"classmap": [
|
723 |
+
"src/"
|
724 |
+
]
|
725 |
+
},
|
726 |
+
"notification-url": "https://packagist.org/downloads/",
|
727 |
+
"license": [
|
728 |
+
"BSD-3-Clause"
|
729 |
+
],
|
730 |
+
"authors": [
|
731 |
+
{
|
732 |
+
"name": "Jeff Welch",
|
733 |
+
"email": "whatthejeff@gmail.com"
|
734 |
+
},
|
735 |
+
{
|
736 |
+
"name": "Volker Dusch",
|
737 |
+
"email": "github@wallbash.com"
|
738 |
+
},
|
739 |
+
{
|
740 |
+
"name": "Bernhard Schussek",
|
741 |
+
"email": "bschussek@2bepublished.at"
|
742 |
+
},
|
743 |
+
{
|
744 |
+
"name": "Sebastian Bergmann",
|
745 |
+
"email": "sebastian@phpunit.de"
|
746 |
+
}
|
747 |
+
],
|
748 |
+
"description": "Provides the functionality to compare PHP values for equality",
|
749 |
+
"homepage": "http://www.github.com/sebastianbergmann/comparator",
|
750 |
+
"keywords": [
|
751 |
+
"comparator",
|
752 |
+
"compare",
|
753 |
+
"equality"
|
754 |
+
],
|
755 |
+
"time": "2015-07-26 15:48:44"
|
756 |
+
},
|
757 |
+
{
|
758 |
+
"name": "sebastian/diff",
|
759 |
+
"version": "1.4.1",
|
760 |
+
"source": {
|
761 |
+
"type": "git",
|
762 |
+
"url": "https://github.com/sebastianbergmann/diff.git",
|
763 |
+
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
|
764 |
+
},
|
765 |
+
"dist": {
|
766 |
+
"type": "zip",
|
767 |
+
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
|
768 |
+
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
|
769 |
+
"shasum": ""
|
770 |
+
},
|
771 |
+
"require": {
|
772 |
+
"php": ">=5.3.3"
|
773 |
+
},
|
774 |
+
"require-dev": {
|
775 |
+
"phpunit/phpunit": "~4.8"
|
776 |
+
},
|
777 |
+
"type": "library",
|
778 |
+
"extra": {
|
779 |
+
"branch-alias": {
|
780 |
+
"dev-master": "1.4-dev"
|
781 |
+
}
|
782 |
+
},
|
783 |
+
"autoload": {
|
784 |
+
"classmap": [
|
785 |
+
"src/"
|
786 |
+
]
|
787 |
+
},
|
788 |
+
"notification-url": "https://packagist.org/downloads/",
|
789 |
+
"license": [
|
790 |
+
"BSD-3-Clause"
|
791 |
+
],
|
792 |
+
"authors": [
|
793 |
+
{
|
794 |
+
"name": "Kore Nordmann",
|
795 |
+
"email": "mail@kore-nordmann.de"
|
796 |
+
},
|
797 |
+
{
|
798 |
+
"name": "Sebastian Bergmann",
|
799 |
+
"email": "sebastian@phpunit.de"
|
800 |
+
}
|
801 |
+
],
|
802 |
+
"description": "Diff implementation",
|
803 |
+
"homepage": "https://github.com/sebastianbergmann/diff",
|
804 |
+
"keywords": [
|
805 |
+
"diff"
|
806 |
+
],
|
807 |
+
"time": "2015-12-08 07:14:41"
|
808 |
+
},
|
809 |
+
{
|
810 |
+
"name": "sebastian/environment",
|
811 |
+
"version": "1.3.8",
|
812 |
+
"source": {
|
813 |
+
"type": "git",
|
814 |
+
"url": "https://github.com/sebastianbergmann/environment.git",
|
815 |
+
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea"
|
816 |
+
},
|
817 |
+
"dist": {
|
818 |
+
"type": "zip",
|
819 |
+
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea",
|
820 |
+
"reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea",
|
821 |
+
"shasum": ""
|
822 |
+
},
|
823 |
+
"require": {
|
824 |
+
"php": "^5.3.3 || ^7.0"
|
825 |
+
},
|
826 |
+
"require-dev": {
|
827 |
+
"phpunit/phpunit": "^4.8 || ^5.0"
|
828 |
+
},
|
829 |
+
"type": "library",
|
830 |
+
"extra": {
|
831 |
+
"branch-alias": {
|
832 |
+
"dev-master": "1.3.x-dev"
|
833 |
+
}
|
834 |
+
},
|
835 |
+
"autoload": {
|
836 |
+
"classmap": [
|
837 |
+
"src/"
|
838 |
+
]
|
839 |
+
},
|
840 |
+
"notification-url": "https://packagist.org/downloads/",
|
841 |
+
"license": [
|
842 |
+
"BSD-3-Clause"
|
843 |
+
],
|
844 |
+
"authors": [
|
845 |
+
{
|
846 |
+
"name": "Sebastian Bergmann",
|
847 |
+
"email": "sebastian@phpunit.de"
|
848 |
+
}
|
849 |
+
],
|
850 |
+
"description": "Provides functionality to handle HHVM/PHP environments",
|
851 |
+
"homepage": "http://www.github.com/sebastianbergmann/environment",
|
852 |
+
"keywords": [
|
853 |
+
"Xdebug",
|
854 |
+
"environment",
|
855 |
+
"hhvm"
|
856 |
+
],
|
857 |
+
"time": "2016-08-18 05:49:44"
|
858 |
+
},
|
859 |
+
{
|
860 |
+
"name": "sebastian/exporter",
|
861 |
+
"version": "1.2.2",
|
862 |
+
"source": {
|
863 |
+
"type": "git",
|
864 |
+
"url": "https://github.com/sebastianbergmann/exporter.git",
|
865 |
+
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4"
|
866 |
+
},
|
867 |
+
"dist": {
|
868 |
+
"type": "zip",
|
869 |
+
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4",
|
870 |
+
"reference": "42c4c2eec485ee3e159ec9884f95b431287edde4",
|
871 |
+
"shasum": ""
|
872 |
+
},
|
873 |
+
"require": {
|
874 |
+
"php": ">=5.3.3",
|
875 |
+
"sebastian/recursion-context": "~1.0"
|
876 |
+
},
|
877 |
+
"require-dev": {
|
878 |
+
"ext-mbstring": "*",
|
879 |
+
"phpunit/phpunit": "~4.4"
|
880 |
+
},
|
881 |
+
"type": "library",
|
882 |
+
"extra": {
|
883 |
+
"branch-alias": {
|
884 |
+
"dev-master": "1.3.x-dev"
|
885 |
+
}
|
886 |
+
},
|
887 |
+
"autoload": {
|
888 |
+
"classmap": [
|
889 |
+
"src/"
|
890 |
+
]
|
891 |
+
},
|
892 |
+
"notification-url": "https://packagist.org/downloads/",
|
893 |
+
"license": [
|
894 |
+
"BSD-3-Clause"
|
895 |
+
],
|
896 |
+
"authors": [
|
897 |
+
{
|
898 |
+
"name": "Jeff Welch",
|
899 |
+
"email": "whatthejeff@gmail.com"
|
900 |
+
},
|
901 |
+
{
|
902 |
+
"name": "Volker Dusch",
|
903 |
+
"email": "github@wallbash.com"
|
904 |
+
},
|
905 |
+
{
|
906 |
+
"name": "Bernhard Schussek",
|
907 |
+
"email": "bschussek@2bepublished.at"
|
908 |
+
},
|
909 |
+
{
|
910 |
+
"name": "Sebastian Bergmann",
|
911 |
+
"email": "sebastian@phpunit.de"
|
912 |
+
},
|
913 |
+
{
|
914 |
+
"name": "Adam Harvey",
|
915 |
+
"email": "aharvey@php.net"
|
916 |
+
}
|
917 |
+
],
|
918 |
+
"description": "Provides the functionality to export PHP variables for visualization",
|
919 |
+
"homepage": "http://www.github.com/sebastianbergmann/exporter",
|
920 |
+
"keywords": [
|
921 |
+
"export",
|
922 |
+
"exporter"
|
923 |
+
],
|
924 |
+
"time": "2016-06-17 09:04:28"
|
925 |
+
},
|
926 |
+
{
|
927 |
+
"name": "sebastian/global-state",
|
928 |
+
"version": "1.1.1",
|
929 |
+
"source": {
|
930 |
+
"type": "git",
|
931 |
+
"url": "https://github.com/sebastianbergmann/global-state.git",
|
932 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
|
933 |
+
},
|
934 |
+
"dist": {
|
935 |
+
"type": "zip",
|
936 |
+
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
937 |
+
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
938 |
+
"shasum": ""
|
939 |
+
},
|
940 |
+
"require": {
|
941 |
+
"php": ">=5.3.3"
|
942 |
+
},
|
943 |
+
"require-dev": {
|
944 |
+
"phpunit/phpunit": "~4.2"
|
945 |
+
},
|
946 |
+
"suggest": {
|
947 |
+
"ext-uopz": "*"
|
948 |
+
},
|
949 |
+
"type": "library",
|
950 |
+
"extra": {
|
951 |
+
"branch-alias": {
|
952 |
+
"dev-master": "1.0-dev"
|
953 |
+
}
|
954 |
+
},
|
955 |
+
"autoload": {
|
956 |
+
"classmap": [
|
957 |
+
"src/"
|
958 |
+
]
|
959 |
+
},
|
960 |
+
"notification-url": "https://packagist.org/downloads/",
|
961 |
+
"license": [
|
962 |
+
"BSD-3-Clause"
|
963 |
+
],
|
964 |
+
"authors": [
|
965 |
+
{
|
966 |
+
"name": "Sebastian Bergmann",
|
967 |
+
"email": "sebastian@phpunit.de"
|
968 |
+
}
|
969 |
+
],
|
970 |
+
"description": "Snapshotting of global state",
|
971 |
+
"homepage": "http://www.github.com/sebastianbergmann/global-state",
|
972 |
+
"keywords": [
|
973 |
+
"global state"
|
974 |
+
],
|
975 |
+
"time": "2015-10-12 03:26:01"
|
976 |
+
},
|
977 |
+
{
|
978 |
+
"name": "sebastian/recursion-context",
|
979 |
+
"version": "1.0.2",
|
980 |
+
"source": {
|
981 |
+
"type": "git",
|
982 |
+
"url": "https://github.com/sebastianbergmann/recursion-context.git",
|
983 |
+
"reference": "913401df809e99e4f47b27cdd781f4a258d58791"
|
984 |
+
},
|
985 |
+
"dist": {
|
986 |
+
"type": "zip",
|
987 |
+
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
|
988 |
+
"reference": "913401df809e99e4f47b27cdd781f4a258d58791",
|
989 |
+
"shasum": ""
|
990 |
+
},
|
991 |
+
"require": {
|
992 |
+
"php": ">=5.3.3"
|
993 |
+
},
|
994 |
+
"require-dev": {
|
995 |
+
"phpunit/phpunit": "~4.4"
|
996 |
+
},
|
997 |
+
"type": "library",
|
998 |
+
"extra": {
|
999 |
+
"branch-alias": {
|
1000 |
+
"dev-master": "1.0.x-dev"
|
1001 |
+
}
|
1002 |
+
},
|
1003 |
+
"autoload": {
|
1004 |
+
"classmap": [
|
1005 |
+
"src/"
|
1006 |
+
]
|
1007 |
+
},
|
1008 |
+
"notification-url": "https://packagist.org/downloads/",
|
1009 |
+
"license": [
|
1010 |
+
"BSD-3-Clause"
|
1011 |
+
],
|
1012 |
+
"authors": [
|
1013 |
+
{
|
1014 |
+
"name": "Jeff Welch",
|
1015 |
+
"email": "whatthejeff@gmail.com"
|
1016 |
+
},
|
1017 |
+
{
|
1018 |
+
"name": "Sebastian Bergmann",
|
1019 |
+
"email": "sebastian@phpunit.de"
|
1020 |
+
},
|
1021 |
+
{
|
1022 |
+
"name": "Adam Harvey",
|
1023 |
+
"email": "aharvey@php.net"
|
1024 |
+
}
|
1025 |
+
],
|
1026 |
+
"description": "Provides functionality to recursively process PHP variables",
|
1027 |
+
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
1028 |
+
"time": "2015-11-11 19:50:13"
|
1029 |
+
},
|
1030 |
+
{
|
1031 |
+
"name": "sebastian/version",
|
1032 |
+
"version": "1.0.6",
|
1033 |
+
"source": {
|
1034 |
+
"type": "git",
|
1035 |
+
"url": "https://github.com/sebastianbergmann/version.git",
|
1036 |
+
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
|
1037 |
+
},
|
1038 |
+
"dist": {
|
1039 |
+
"type": "zip",
|
1040 |
+
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
1041 |
+
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
|
1042 |
+
"shasum": ""
|
1043 |
+
},
|
1044 |
+
"type": "library",
|
1045 |
+
"autoload": {
|
1046 |
+
"classmap": [
|
1047 |
+
"src/"
|
1048 |
+
]
|
1049 |
+
},
|
1050 |
+
"notification-url": "https://packagist.org/downloads/",
|
1051 |
+
"license": [
|
1052 |
+
"BSD-3-Clause"
|
1053 |
+
],
|
1054 |
+
"authors": [
|
1055 |
+
{
|
1056 |
+
"name": "Sebastian Bergmann",
|
1057 |
+
"email": "sebastian@phpunit.de",
|
1058 |
+
"role": "lead"
|
1059 |
+
}
|
1060 |
+
],
|
1061 |
+
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
|
1062 |
+
"homepage": "https://github.com/sebastianbergmann/version",
|
1063 |
+
"time": "2015-06-21 13:59:46"
|
1064 |
+
},
|
1065 |
+
{
|
1066 |
+
"name": "symfony/yaml",
|
1067 |
+
"version": "v3.1.4",
|
1068 |
+
"source": {
|
1069 |
+
"type": "git",
|
1070 |
+
"url": "https://github.com/symfony/yaml.git",
|
1071 |
+
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d"
|
1072 |
+
},
|
1073 |
+
"dist": {
|
1074 |
+
"type": "zip",
|
1075 |
+
"url": "https://api.github.com/repos/symfony/yaml/zipball/f291ed25eb1435bddbe8a96caaef16469c2a092d",
|
1076 |
+
"reference": "f291ed25eb1435bddbe8a96caaef16469c2a092d",
|
1077 |
+
"shasum": ""
|
1078 |
+
},
|
1079 |
+
"require": {
|
1080 |
+
"php": ">=5.5.9"
|
1081 |
+
},
|
1082 |
+
"type": "library",
|
1083 |
+
"extra": {
|
1084 |
+
"branch-alias": {
|
1085 |
+
"dev-master": "3.1-dev"
|
1086 |
+
}
|
1087 |
+
},
|
1088 |
+
"autoload": {
|
1089 |
+
"psr-4": {
|
1090 |
+
"Symfony\\Component\\Yaml\\": ""
|
1091 |
+
},
|
1092 |
+
"exclude-from-classmap": [
|
1093 |
+
"/Tests/"
|
1094 |
+
]
|
1095 |
+
},
|
1096 |
+
"notification-url": "https://packagist.org/downloads/",
|
1097 |
+
"license": [
|
1098 |
+
"MIT"
|
1099 |
+
],
|
1100 |
+
"authors": [
|
1101 |
+
{
|
1102 |
+
"name": "Fabien Potencier",
|
1103 |
+
"email": "fabien@symfony.com"
|
1104 |
+
},
|
1105 |
+
{
|
1106 |
+
"name": "Symfony Community",
|
1107 |
+
"homepage": "https://symfony.com/contributors"
|
1108 |
+
}
|
1109 |
+
],
|
1110 |
+
"description": "Symfony Yaml Component",
|
1111 |
+
"homepage": "https://symfony.com",
|
1112 |
+
"time": "2016-09-02 02:12:52"
|
1113 |
+
},
|
1114 |
+
{
|
1115 |
+
"name": "webmozart/assert",
|
1116 |
+
"version": "1.1.0",
|
1117 |
+
"source": {
|
1118 |
+
"type": "git",
|
1119 |
+
"url": "https://github.com/webmozart/assert.git",
|
1120 |
+
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308"
|
1121 |
+
},
|
1122 |
+
"dist": {
|
1123 |
+
"type": "zip",
|
1124 |
+
"url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308",
|
1125 |
+
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308",
|
1126 |
+
"shasum": ""
|
1127 |
+
},
|
1128 |
+
"require": {
|
1129 |
+
"php": "^5.3.3|^7.0"
|
1130 |
+
},
|
1131 |
+
"require-dev": {
|
1132 |
+
"phpunit/phpunit": "^4.6",
|
1133 |
+
"sebastian/version": "^1.0.1"
|
1134 |
+
},
|
1135 |
+
"type": "library",
|
1136 |
+
"extra": {
|
1137 |
+
"branch-alias": {
|
1138 |
+
"dev-master": "1.2-dev"
|
1139 |
+
}
|
1140 |
+
},
|
1141 |
+
"autoload": {
|
1142 |
+
"psr-4": {
|
1143 |
+
"Webmozart\\Assert\\": "src/"
|
1144 |
+
}
|
1145 |
+
},
|
1146 |
+
"notification-url": "https://packagist.org/downloads/",
|
1147 |
+
"license": [
|
1148 |
+
"MIT"
|
1149 |
+
],
|
1150 |
+
"authors": [
|
1151 |
+
{
|
1152 |
+
"name": "Bernhard Schussek",
|
1153 |
+
"email": "bschussek@gmail.com"
|
1154 |
+
}
|
1155 |
+
],
|
1156 |
+
"description": "Assertions to validate method input/output with nice error messages.",
|
1157 |
+
"keywords": [
|
1158 |
+
"assert",
|
1159 |
+
"check",
|
1160 |
+
"validate"
|
1161 |
+
],
|
1162 |
+
"time": "2016-08-09 15:02:57"
|
1163 |
+
}
|
1164 |
+
],
|
1165 |
+
"aliases": [],
|
1166 |
+
"minimum-stability": "stable",
|
1167 |
+
"stability-flags": [],
|
1168 |
+
"prefer-stable": false,
|
1169 |
+
"prefer-lowest": false,
|
1170 |
+
"platform": {
|
1171 |
+
"php": ">=5.3.0"
|
1172 |
+
},
|
1173 |
+
"platform-dev": []
|
1174 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/phpunit.xml
ADDED
@@ -0,0 +1,17 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<phpunit backupGlobals="false"
|
3 |
+
backupStaticAttributes="false"
|
4 |
+
bootstrap="vendor/autoload.php"
|
5 |
+
colors="true"
|
6 |
+
convertErrorsToExceptions="true"
|
7 |
+
convertNoticesToExceptions="true"
|
8 |
+
convertWarningsToExceptions="true"
|
9 |
+
processIsolation="false"
|
10 |
+
stopOnFailure="false"
|
11 |
+
syntaxCheck="false"
|
12 |
+
beStrictAboutTestsThatDoNotTestAnything="true"
|
13 |
+
checkForUnintentionallyCoveredCode="true"
|
14 |
+
beStrictAboutOutputDuringTests="true"
|
15 |
+
beStrictAboutTestSize="true"
|
16 |
+
beStrictAboutChangesToGlobalState="true">
|
17 |
+
</phpunit>
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/readme.md
ADDED
@@ -0,0 +1,25 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
Po To Json Converter
|
2 |
+
=========
|
3 |
+
|
4 |
+
Convert PO files to Jed-compatible JSON using PHP.
|
5 |
+
|
6 |
+
Inspired by:
|
7 |
+
- github.com/mikeedwards/po2json
|
8 |
+
|
9 |
+
Installation
|
10 |
+
=====
|
11 |
+
|
12 |
+
composer require charles-rumley/php-po-to-json
|
13 |
+
|
14 |
+
Usage
|
15 |
+
=====
|
16 |
+
|
17 |
+
use CharlesRumley\PoToJson;
|
18 |
+
|
19 |
+
$poToJson = new PoToJson();
|
20 |
+
|
21 |
+
// Convert a PO file to JSON
|
22 |
+
$rawJson = $poToJson->withPoFile($path)->toRawJson();
|
23 |
+
|
24 |
+
// Convert a PO file to Jed-compatible JSON
|
25 |
+
$jedJson = $poToJson->withPoFile($path)->toJedJson();
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/src/PoToJson.php
ADDED
@@ -0,0 +1,180 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php namespace CharlesRumley;
|
2 |
+
|
3 |
+
use Sepia\PoParser;
|
4 |
+
use Sepia\StringHandler;
|
5 |
+
|
6 |
+
class PoToJson
|
7 |
+
{
|
8 |
+
|
9 |
+
private $poFileContents;
|
10 |
+
|
11 |
+
public function __construct($poFileContents = null)
|
12 |
+
{
|
13 |
+
$this->poFileContents = $poFileContents;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function withPoFile($path)
|
17 |
+
{
|
18 |
+
return new self(file_get_contents($path));
|
19 |
+
}
|
20 |
+
|
21 |
+
public function withPoFileContents($string)
|
22 |
+
{
|
23 |
+
return new self($string);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function toRawJson($fuzzy = false)
|
27 |
+
{
|
28 |
+
$poParser = new PoParser(new StringHandler($this->poFileContents));
|
29 |
+
$entries = $poParser->parse();
|
30 |
+
$headers = $this->parseHeaders($poParser->getHeaders());
|
31 |
+
|
32 |
+
return json_encode($this->convertToGettextCompatibleTranslations($headers, $entries, $fuzzy));
|
33 |
+
}
|
34 |
+
|
35 |
+
public function toJedJson($fuzzy = false, $domain = 'messages')
|
36 |
+
{
|
37 |
+
$poParser = new PoParser(new StringHandler($this->poFileContents));
|
38 |
+
$entries = $poParser->parse();
|
39 |
+
$headers = $this->parseHeaders($poParser->getHeaders());
|
40 |
+
$gettextCompatibleJson = $this->convertToGettextCompatibleTranslations($headers, $entries, $fuzzy);
|
41 |
+
|
42 |
+
return json_encode($this->convertGettextTranslationsToJedSpec($domain, $gettextCompatibleJson));
|
43 |
+
}
|
44 |
+
|
45 |
+
private function parseHeaders($headers)
|
46 |
+
{
|
47 |
+
foreach ($headers as &$h) {
|
48 |
+
$h = trim($h, "\"\n");
|
49 |
+
}
|
50 |
+
$raw = implode("", $headers);
|
51 |
+
$raw = str_replace('\n', "\n", $raw);
|
52 |
+
return $this->parse_http_headers($raw);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* From http://stackoverflow.com/a/20933560/682317
|
57 |
+
* @param $raw_headers
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
+
private function parse_http_headers($raw_headers)
|
61 |
+
{
|
62 |
+
$headers = array();
|
63 |
+
$key = '';
|
64 |
+
foreach (explode("\n", $raw_headers) as $i => $h) {
|
65 |
+
$h = explode(':', $h, 2);
|
66 |
+
if (isset($h[1])) {
|
67 |
+
if (!isset($headers[$h[0]])) {
|
68 |
+
$headers[$h[0]] = trim($h[1]);
|
69 |
+
} elseif (is_array($headers[$h[0]])) {
|
70 |
+
$headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1])));
|
71 |
+
} else {
|
72 |
+
$headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1])));
|
73 |
+
}
|
74 |
+
$key = $h[0];
|
75 |
+
} else {
|
76 |
+
if (substr($h[0], 0, 1) == "\t") {
|
77 |
+
$headers[$key] .= "\r\n\t" . trim($h[0]);
|
78 |
+
} elseif (!$key) {
|
79 |
+
$headers[0] = trim($h[0]);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
return $headers;
|
84 |
+
}
|
85 |
+
|
86 |
+
private function convertToGettextCompatibleTranslations(
|
87 |
+
$_headers,
|
88 |
+
$translations,
|
89 |
+
$fuzzy = false
|
90 |
+
) {
|
91 |
+
$headers = array();
|
92 |
+
foreach ($_headers as $key => $value) {
|
93 |
+
$key = strtolower($key);
|
94 |
+
$headers[$key] = $value;
|
95 |
+
}
|
96 |
+
// Attach headers (overwrites any empty translation keys that may have somehow gotten in)
|
97 |
+
$result[""] = $headers;
|
98 |
+
// Create gettext/Jed compatible JSON from parsed data
|
99 |
+
foreach ($translations as $translationKey => $t) {
|
100 |
+
$entry = array();
|
101 |
+
if (isset($t["msgid_plural"])) {
|
102 |
+
$entry[0] = $t["msgid_plural"][0];
|
103 |
+
$entry[1] = $t["msgstr[0]"][0];
|
104 |
+
isset($t["msgstr[1]"]) ? ($entry[2] = $t["msgstr[1]"][0]) : null;
|
105 |
+
isset($t["msgstr[2]"]) ? ($entry[3] = $t["msgstr[2]"][0]) : null;
|
106 |
+
} else {
|
107 |
+
$entry[0] = null;
|
108 |
+
$entry[1] = implode("", $t["msgstr"]);
|
109 |
+
}
|
110 |
+
// msg id json format
|
111 |
+
if ($t["msgid"][0] == '' && isset($t["msgid"][1])) {
|
112 |
+
array_shift($t["msgid"]);
|
113 |
+
$msgid = implode("", $t["msgid"]);
|
114 |
+
} else {
|
115 |
+
$msgid = implode("", $t["msgid"]);
|
116 |
+
}
|
117 |
+
// json object key based on msd id and context
|
118 |
+
if (isset($t["msgctxt"][0])) {
|
119 |
+
$key = $t["msgctxt"][0] . json_decode('"' . '\u0004' . '"') . $msgid;
|
120 |
+
} else {
|
121 |
+
$key = $msgid;
|
122 |
+
}
|
123 |
+
|
124 |
+
if (!$fuzzy && $this->isFuzzy($t)) {
|
125 |
+
continue;
|
126 |
+
}
|
127 |
+
$result[$key] = $entry;
|
128 |
+
}
|
129 |
+
|
130 |
+
return $result;
|
131 |
+
}
|
132 |
+
|
133 |
+
private function convertGettextTranslationsToJedSpec($domain, $translations)
|
134 |
+
{
|
135 |
+
$jedCompatibleTranslations = [
|
136 |
+
"domain" => $domain,
|
137 |
+
"locale_data" => [],
|
138 |
+
];
|
139 |
+
|
140 |
+
// Jed 1.x compatibility
|
141 |
+
// todo refactor this out to allow Jed < 1.x compatibility
|
142 |
+
$translations = array_map(
|
143 |
+
function ($translation) {
|
144 |
+
if (!empty($translation)) {
|
145 |
+
for ($i = 2; $i < count($translation); $i++) {
|
146 |
+
if (isset($translation[$i]) && empty($translation[$i])) {
|
147 |
+
$translation[$i] = $translation[0];
|
148 |
+
}
|
149 |
+
}
|
150 |
+
array_shift($translation);
|
151 |
+
}
|
152 |
+
|
153 |
+
return $translation;
|
154 |
+
},
|
155 |
+
$translations
|
156 |
+
);
|
157 |
+
$jedCompatibleTranslations["locale_data"][$domain] = $translations;
|
158 |
+
$jedCompatibleTranslations["locale_data"][$domain][""] = [
|
159 |
+
"domain" => $domain,
|
160 |
+
"plural_forms" => isset($translations[""]["plural-forms"]) ? $translations[""]["plural-forms"] : null,
|
161 |
+
"lang" => $translations[""]["language"],
|
162 |
+
];
|
163 |
+
|
164 |
+
return $jedCompatibleTranslations;
|
165 |
+
}
|
166 |
+
|
167 |
+
private function isFuzzy($translation)
|
168 |
+
{
|
169 |
+
if (isset($translation['flags'])) {
|
170 |
+
$flags = $translation['flags'];
|
171 |
+
foreach ($flags as $index => $flag) {
|
172 |
+
if ($flag == 'fuzzy') {
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
return false;
|
178 |
+
}
|
179 |
+
|
180 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/PoToJsonTest.php
ADDED
@@ -0,0 +1,39 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php namespace CharlesRumley\Tests;
|
2 |
+
|
3 |
+
use CharlesRumley\PoToJson;
|
4 |
+
use PHPUnit_Framework_TestCase;
|
5 |
+
|
6 |
+
class PoToJsonTest extends PHPUnit_Framework_TestCase
|
7 |
+
{
|
8 |
+
public function testItConvertsPoToJson()
|
9 |
+
{
|
10 |
+
$expectedJson = file_get_contents($this->fixturePath('pl.json'));
|
11 |
+
|
12 |
+
// todo this API should expect a string, not a path
|
13 |
+
$poToJsonConverter = new PoToJson();
|
14 |
+
$actualJson = $poToJsonConverter->withPoFile($this->fixturePath('pl.po'))->toRawJson();
|
15 |
+
|
16 |
+
$this->assertEquals($this->reformatJson($expectedJson), $this->reformatJson($actualJson));
|
17 |
+
}
|
18 |
+
|
19 |
+
private function fixturePath($withFilename = null)
|
20 |
+
{
|
21 |
+
return sprintf('%s/%s/%s', __DIR__, 'fixtures', $withFilename);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function testItConvertsPoToJedCompatibleJson()
|
25 |
+
{
|
26 |
+
$expectedJson = file_get_contents($this->fixturePath('pl-jed.json'));
|
27 |
+
|
28 |
+
// todo this API should expect a string, not a path
|
29 |
+
$poToJsonConverter = new PoToJson($this->fixturePath('pl.po'));
|
30 |
+
$actualJson = $poToJsonConverter->withPoFile($this->fixturePath('pl.po'))->toJedJson();
|
31 |
+
|
32 |
+
$this->assertEquals($this->reformatJson($expectedJson), $this->reformatJson($actualJson));
|
33 |
+
}
|
34 |
+
|
35 |
+
private function reformatJson($json)
|
36 |
+
{
|
37 |
+
return json_encode(json_decode($json), JSON_PRETTY_PRINT);
|
38 |
+
}
|
39 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl-jed.json
ADDED
@@ -0,0 +1,34 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"domain": "messages",
|
3 |
+
"locale_data": {
|
4 |
+
"messages": {
|
5 |
+
"": {
|
6 |
+
"domain": "messages",
|
7 |
+
"plural_forms": "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",
|
8 |
+
"lang": "pl"
|
9 |
+
},
|
10 |
+
"Hello, world!\n": [
|
11 |
+
"Witaj, świecie!\n"
|
12 |
+
],
|
13 |
+
"this is the first line\nthis is the next one\nbut this is the last\n": [
|
14 |
+
"to jest pierwsza linia\nto jest następny\nale to jest ostatnia\n"
|
15 |
+
],
|
16 |
+
"one product": [
|
17 |
+
"jeden produkt",
|
18 |
+
"%d produkty",
|
19 |
+
"%d produktów"
|
20 |
+
],
|
21 |
+
"A sentence with \"quotation\" marks.": [
|
22 |
+
"Zdanie w \"cudzysłowie\"."
|
23 |
+
],
|
24 |
+
"string context\u0004the contextual phrase": [
|
25 |
+
"zwrot kontekstowe"
|
26 |
+
],
|
27 |
+
"a product": [
|
28 |
+
"",
|
29 |
+
"%d products",
|
30 |
+
"%d products"
|
31 |
+
]
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl.json
ADDED
@@ -0,0 +1,43 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"": {
|
3 |
+
"project-id-version": "po2json",
|
4 |
+
"pot-creation-date": "2012-10-26 12:00+0000",
|
5 |
+
"po-revision-date": "2013-11-08 09:09+0200",
|
6 |
+
"last-translator": "Illimar Tambek <illimar.tambek@gmail.com>",
|
7 |
+
"language-team": "po2json",
|
8 |
+
"mime-version": "1.0",
|
9 |
+
"plural-forms": "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",
|
10 |
+
"content-type": "text/plain; charset=UTF-8",
|
11 |
+
"content-transfer-encoding": "8bit",
|
12 |
+
"x-generator": "Poedit 1.5.7",
|
13 |
+
"language": "pl"
|
14 |
+
},
|
15 |
+
"Hello, world!\n": [
|
16 |
+
null,
|
17 |
+
"Witaj, świecie!\n"
|
18 |
+
],
|
19 |
+
"this is the first line\nthis is the next one\nbut this is the last\n": [
|
20 |
+
null,
|
21 |
+
"to jest pierwsza linia\nto jest następny\nale to jest ostatnia\n"
|
22 |
+
],
|
23 |
+
"one product": [
|
24 |
+
"%d products",
|
25 |
+
"jeden produkt",
|
26 |
+
"%d produkty",
|
27 |
+
"%d produktów"
|
28 |
+
],
|
29 |
+
"A sentence with \"quotation\" marks.": [
|
30 |
+
null,
|
31 |
+
"Zdanie w \"cudzysłowie\"."
|
32 |
+
],
|
33 |
+
"string context\u0004the contextual phrase": [
|
34 |
+
null,
|
35 |
+
"zwrot kontekstowe"
|
36 |
+
],
|
37 |
+
"a product": [
|
38 |
+
"%d products",
|
39 |
+
"",
|
40 |
+
"",
|
41 |
+
""
|
42 |
+
]
|
43 |
+
}
|
vendor/siteground/siteground-i18n/vendor/charles-rumley/php-po-to-json/tests/fixtures/pl.po
ADDED
@@ -0,0 +1,58 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
# Polish translation for po2json text fixture.
|
2 |
+
#
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: po2json\n"
|
6 |
+
"POT-Creation-Date: 2012-10-26 12:00+0000\n"
|
7 |
+
"PO-Revision-Date: 2013-11-08 09:09+0200\n"
|
8 |
+
"Last-Translator: Illimar Tambek <illimar.tambek@gmail.com>\n"
|
9 |
+
"Language-Team: po2json\n"
|
10 |
+
"MIME-Version: 1.0\n"
|
11 |
+
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
|
12 |
+
"|| n%100>=20) ? 1 : 2);\n"
|
13 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
+
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Poedit 1.5.7\n"
|
16 |
+
"Language: pl\n"
|
17 |
+
|
18 |
+
#: test.js:1
|
19 |
+
msgid "Hello, world!\n"
|
20 |
+
msgstr "Witaj, świecie!\n"
|
21 |
+
|
22 |
+
#: test.js:3
|
23 |
+
msgid ""
|
24 |
+
"this is the first line\n"
|
25 |
+
"this is the next one\n"
|
26 |
+
"but this is the last\n"
|
27 |
+
msgstr ""
|
28 |
+
"to jest pierwsza linia\n"
|
29 |
+
"to jest następny\n"
|
30 |
+
"ale to jest ostatnia\n"
|
31 |
+
|
32 |
+
#: test.js:4
|
33 |
+
msgid "one product"
|
34 |
+
msgid_plural "%d products"
|
35 |
+
msgstr[0] "jeden produkt"
|
36 |
+
msgstr[1] "%d produkty"
|
37 |
+
msgstr[2] "%d produktów"
|
38 |
+
|
39 |
+
#: test.js:5
|
40 |
+
msgid "A sentence with \"quotation\" marks."
|
41 |
+
msgstr "Zdanie w \"cudzysłowie\"."
|
42 |
+
|
43 |
+
#: test.js:2
|
44 |
+
msgctxt "string context"
|
45 |
+
msgid "the contextual phrase"
|
46 |
+
msgstr "zwrot kontekstowe"
|
47 |
+
|
48 |
+
#: test.js:7
|
49 |
+
msgid "a product"
|
50 |
+
msgid_plural "%d products"
|
51 |
+
msgstr[0] ""
|
52 |
+
msgstr[1] ""
|
53 |
+
msgstr[2] ""
|
54 |
+
|
55 |
+
#: test.js:6
|
56 |
+
#, fuzzy
|
57 |
+
msgid "A fuzzy translation"
|
58 |
+
msgstr "TÅ‚umaczenie rozmyta"
|
vendor/siteground/siteground-i18n/vendor/composer/ClassLoader.php
ADDED
@@ -0,0 +1,481 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer\Autoload;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
17 |
+
*
|
18 |
+
* $loader = new \Composer\Autoload\ClassLoader();
|
19 |
+
*
|
20 |
+
* // register classes with namespaces
|
21 |
+
* $loader->add('Symfony\Component', __DIR__.'/component');
|
22 |
+
* $loader->add('Symfony', __DIR__.'/framework');
|
23 |
+
*
|
24 |
+
* // activate the autoloader
|
25 |
+
* $loader->register();
|
26 |
+
*
|
27 |
+
* // to enable searching the include path (eg. for PEAR packages)
|
28 |
+
* $loader->setUseIncludePath(true);
|
29 |
+
*
|
30 |
+
* In this example, if you try to use a class in the Symfony\Component
|
31 |
+
* namespace or one of its children (Symfony\Component\Console for instance),
|
32 |
+
* the autoloader will first look for the class under the component/
|
33 |
+
* directory, and it will then fallback to the framework/ directory if not
|
34 |
+
* found before giving up.
|
35 |
+
*
|
36 |
+
* This class is loosely based on the Symfony UniversalClassLoader.
|
37 |
+
*
|
38 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
+
*/
|
43 |
+
class ClassLoader
|
44 |
+
{
|
45 |
+
private $vendorDir;
|
46 |
+
|
47 |
+
// PSR-4
|
48 |
+
private $prefixLengthsPsr4 = array();
|
49 |
+
private $prefixDirsPsr4 = array();
|
50 |
+
private $fallbackDirsPsr4 = array();
|
51 |
+
|
52 |
+
// PSR-0
|
53 |
+
private $prefixesPsr0 = array();
|
54 |
+
private $fallbackDirsPsr0 = array();
|
55 |
+
|
56 |
+
private $useIncludePath = false;
|
57 |
+
private $classMap = array();
|
58 |
+
private $classMapAuthoritative = false;
|
59 |
+
private $missingClasses = array();
|
60 |
+
private $apcuPrefix;
|
61 |
+
|
62 |
+
private static $registeredLoaders = array();
|
63 |
+
|
64 |
+
public function __construct($vendorDir = null)
|
65 |
+
{
|
66 |
+
$this->vendorDir = $vendorDir;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getPrefixes()
|
70 |
+
{
|
71 |
+
if (!empty($this->prefixesPsr0)) {
|
72 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
73 |
+
}
|
74 |
+
|
75 |
+
return array();
|
76 |
+
}
|
77 |
+
|
78 |
+
public function getPrefixesPsr4()
|
79 |
+
{
|
80 |
+
return $this->prefixDirsPsr4;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function getFallbackDirs()
|
84 |
+
{
|
85 |
+
return $this->fallbackDirsPsr0;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getFallbackDirsPsr4()
|
89 |
+
{
|
90 |
+
return $this->fallbackDirsPsr4;
|
91 |
+
}
|
92 |
+
|
93 |
+
public function getClassMap()
|
94 |
+
{
|
95 |
+
return $this->classMap;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @param array $classMap Class to filename map
|
100 |
+
*/
|
101 |
+
public function addClassMap(array $classMap)
|
102 |
+
{
|
103 |
+
if ($this->classMap) {
|
104 |
+
$this->classMap = array_merge($this->classMap, $classMap);
|
105 |
+
} else {
|
106 |
+
$this->classMap = $classMap;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Registers a set of PSR-0 directories for a given prefix, either
|
112 |
+
* appending or prepending to the ones previously set for this prefix.
|
113 |
+
*
|
114 |
+
* @param string $prefix The prefix
|
115 |
+
* @param array|string $paths The PSR-0 root directories
|
116 |
+
* @param bool $prepend Whether to prepend the directories
|
117 |
+
*/
|
118 |
+
public function add($prefix, $paths, $prepend = false)
|
119 |
+
{
|
120 |
+
if (!$prefix) {
|
121 |
+
if ($prepend) {
|
122 |
+
$this->fallbackDirsPsr0 = array_merge(
|
123 |
+
(array) $paths,
|
124 |
+
$this->fallbackDirsPsr0
|
125 |
+
);
|
126 |
+
} else {
|
127 |
+
$this->fallbackDirsPsr0 = array_merge(
|
128 |
+
$this->fallbackDirsPsr0,
|
129 |
+
(array) $paths
|
130 |
+
);
|
131 |
+
}
|
132 |
+
|
133 |
+
return;
|
134 |
+
}
|
135 |
+
|
136 |
+
$first = $prefix[0];
|
137 |
+
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
138 |
+
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
139 |
+
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
if ($prepend) {
|
143 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
144 |
+
(array) $paths,
|
145 |
+
$this->prefixesPsr0[$first][$prefix]
|
146 |
+
);
|
147 |
+
} else {
|
148 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
149 |
+
$this->prefixesPsr0[$first][$prefix],
|
150 |
+
(array) $paths
|
151 |
+
);
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Registers a set of PSR-4 directories for a given namespace, either
|
157 |
+
* appending or prepending to the ones previously set for this namespace.
|
158 |
+
*
|
159 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
160 |
+
* @param array|string $paths The PSR-4 base directories
|
161 |
+
* @param bool $prepend Whether to prepend the directories
|
162 |
+
*
|
163 |
+
* @throws \InvalidArgumentException
|
164 |
+
*/
|
165 |
+
public function addPsr4($prefix, $paths, $prepend = false)
|
166 |
+
{
|
167 |
+
if (!$prefix) {
|
168 |
+
// Register directories for the root namespace.
|
169 |
+
if ($prepend) {
|
170 |
+
$this->fallbackDirsPsr4 = array_merge(
|
171 |
+
(array) $paths,
|
172 |
+
$this->fallbackDirsPsr4
|
173 |
+
);
|
174 |
+
} else {
|
175 |
+
$this->fallbackDirsPsr4 = array_merge(
|
176 |
+
$this->fallbackDirsPsr4,
|
177 |
+
(array) $paths
|
178 |
+
);
|
179 |
+
}
|
180 |
+
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
181 |
+
// Register directories for a new namespace.
|
182 |
+
$length = strlen($prefix);
|
183 |
+
if ('\\' !== $prefix[$length - 1]) {
|
184 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
185 |
+
}
|
186 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
187 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
188 |
+
} elseif ($prepend) {
|
189 |
+
// Prepend directories for an already registered namespace.
|
190 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
191 |
+
(array) $paths,
|
192 |
+
$this->prefixDirsPsr4[$prefix]
|
193 |
+
);
|
194 |
+
} else {
|
195 |
+
// Append directories for an already registered namespace.
|
196 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
197 |
+
$this->prefixDirsPsr4[$prefix],
|
198 |
+
(array) $paths
|
199 |
+
);
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Registers a set of PSR-0 directories for a given prefix,
|
205 |
+
* replacing any others previously set for this prefix.
|
206 |
+
*
|
207 |
+
* @param string $prefix The prefix
|
208 |
+
* @param array|string $paths The PSR-0 base directories
|
209 |
+
*/
|
210 |
+
public function set($prefix, $paths)
|
211 |
+
{
|
212 |
+
if (!$prefix) {
|
213 |
+
$this->fallbackDirsPsr0 = (array) $paths;
|
214 |
+
} else {
|
215 |
+
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Registers a set of PSR-4 directories for a given namespace,
|
221 |
+
* replacing any others previously set for this namespace.
|
222 |
+
*
|
223 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
224 |
+
* @param array|string $paths The PSR-4 base directories
|
225 |
+
*
|
226 |
+
* @throws \InvalidArgumentException
|
227 |
+
*/
|
228 |
+
public function setPsr4($prefix, $paths)
|
229 |
+
{
|
230 |
+
if (!$prefix) {
|
231 |
+
$this->fallbackDirsPsr4 = (array) $paths;
|
232 |
+
} else {
|
233 |
+
$length = strlen($prefix);
|
234 |
+
if ('\\' !== $prefix[$length - 1]) {
|
235 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
236 |
+
}
|
237 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
238 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Turns on searching the include path for class files.
|
244 |
+
*
|
245 |
+
* @param bool $useIncludePath
|
246 |
+
*/
|
247 |
+
public function setUseIncludePath($useIncludePath)
|
248 |
+
{
|
249 |
+
$this->useIncludePath = $useIncludePath;
|
250 |
+
}
|
251 |
+
|
252 |
+
/**
|
253 |
+
* Can be used to check if the autoloader uses the include path to check
|
254 |
+
* for classes.
|
255 |
+
*
|
256 |
+
* @return bool
|
257 |
+
*/
|
258 |
+
public function getUseIncludePath()
|
259 |
+
{
|
260 |
+
return $this->useIncludePath;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Turns off searching the prefix and fallback directories for classes
|
265 |
+
* that have not been registered with the class map.
|
266 |
+
*
|
267 |
+
* @param bool $classMapAuthoritative
|
268 |
+
*/
|
269 |
+
public function setClassMapAuthoritative($classMapAuthoritative)
|
270 |
+
{
|
271 |
+
$this->classMapAuthoritative = $classMapAuthoritative;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Should class lookup fail if not found in the current class map?
|
276 |
+
*
|
277 |
+
* @return bool
|
278 |
+
*/
|
279 |
+
public function isClassMapAuthoritative()
|
280 |
+
{
|
281 |
+
return $this->classMapAuthoritative;
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
286 |
+
*
|
287 |
+
* @param string|null $apcuPrefix
|
288 |
+
*/
|
289 |
+
public function setApcuPrefix($apcuPrefix)
|
290 |
+
{
|
291 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* The APCu prefix in use, or null if APCu caching is not enabled.
|
296 |
+
*
|
297 |
+
* @return string|null
|
298 |
+
*/
|
299 |
+
public function getApcuPrefix()
|
300 |
+
{
|
301 |
+
return $this->apcuPrefix;
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* Registers this instance as an autoloader.
|
306 |
+
*
|
307 |
+
* @param bool $prepend Whether to prepend the autoloader or not
|
308 |
+
*/
|
309 |
+
public function register($prepend = false)
|
310 |
+
{
|
311 |
+
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
312 |
+
|
313 |
+
if (null === $this->vendorDir) {
|
314 |
+
return;
|
315 |
+
}
|
316 |
+
|
317 |
+
if ($prepend) {
|
318 |
+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
319 |
+
} else {
|
320 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
321 |
+
self::$registeredLoaders[$this->vendorDir] = $this;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Unregisters this instance as an autoloader.
|
327 |
+
*/
|
328 |
+
public function unregister()
|
329 |
+
{
|
330 |
+
spl_autoload_unregister(array($this, 'loadClass'));
|
331 |
+
|
332 |
+
if (null !== $this->vendorDir) {
|
333 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Loads the given class or interface.
|
339 |
+
*
|
340 |
+
* @param string $class The name of the class
|
341 |
+
* @return true|null True if loaded, null otherwise
|
342 |
+
*/
|
343 |
+
public function loadClass($class)
|
344 |
+
{
|
345 |
+
if ($file = $this->findFile($class)) {
|
346 |
+
includeFile($file);
|
347 |
+
|
348 |
+
return true;
|
349 |
+
}
|
350 |
+
|
351 |
+
return null;
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Finds the path to the file where the class is defined.
|
356 |
+
*
|
357 |
+
* @param string $class The name of the class
|
358 |
+
*
|
359 |
+
* @return string|false The path if found, false otherwise
|
360 |
+
*/
|
361 |
+
public function findFile($class)
|
362 |
+
{
|
363 |
+
// class map lookup
|
364 |
+
if (isset($this->classMap[$class])) {
|
365 |
+
return $this->classMap[$class];
|
366 |
+
}
|
367 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
368 |
+
return false;
|
369 |
+
}
|
370 |
+
if (null !== $this->apcuPrefix) {
|
371 |
+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
372 |
+
if ($hit) {
|
373 |
+
return $file;
|
374 |
+
}
|
375 |
+
}
|
376 |
+
|
377 |
+
$file = $this->findFileWithExtension($class, '.php');
|
378 |
+
|
379 |
+
// Search for Hack files if we are running on HHVM
|
380 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
381 |
+
$file = $this->findFileWithExtension($class, '.hh');
|
382 |
+
}
|
383 |
+
|
384 |
+
if (null !== $this->apcuPrefix) {
|
385 |
+
apcu_add($this->apcuPrefix.$class, $file);
|
386 |
+
}
|
387 |
+
|
388 |
+
if (false === $file) {
|
389 |
+
// Remember that this class does not exist.
|
390 |
+
$this->missingClasses[$class] = true;
|
391 |
+
}
|
392 |
+
|
393 |
+
return $file;
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
398 |
+
*
|
399 |
+
* @return self[]
|
400 |
+
*/
|
401 |
+
public static function getRegisteredLoaders()
|
402 |
+
{
|
403 |
+
return self::$registeredLoaders;
|
404 |
+
}
|
405 |
+
|
406 |
+
private function findFileWithExtension($class, $ext)
|
407 |
+
{
|
408 |
+
// PSR-4 lookup
|
409 |
+
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
410 |
+
|
411 |
+
$first = $class[0];
|
412 |
+
if (isset($this->prefixLengthsPsr4[$first])) {
|
413 |
+
$subPath = $class;
|
414 |
+
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
415 |
+
$subPath = substr($subPath, 0, $lastPos);
|
416 |
+
$search = $subPath . '\\';
|
417 |
+
if (isset($this->prefixDirsPsr4[$search])) {
|
418 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
419 |
+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
420 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
421 |
+
return $file;
|
422 |
+
}
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
|
428 |
+
// PSR-4 fallback dirs
|
429 |
+
foreach ($this->fallbackDirsPsr4 as $dir) {
|
430 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
431 |
+
return $file;
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
// PSR-0 lookup
|
436 |
+
if (false !== $pos = strrpos($class, '\\')) {
|
437 |
+
// namespaced class name
|
438 |
+
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
439 |
+
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
440 |
+
} else {
|
441 |
+
// PEAR-like class name
|
442 |
+
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
443 |
+
}
|
444 |
+
|
445 |
+
if (isset($this->prefixesPsr0[$first])) {
|
446 |
+
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
447 |
+
if (0 === strpos($class, $prefix)) {
|
448 |
+
foreach ($dirs as $dir) {
|
449 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
450 |
+
return $file;
|
451 |
+
}
|
452 |
+
}
|
453 |
+
}
|
454 |
+
}
|
455 |
+
}
|
456 |
+
|
457 |
+
// PSR-0 fallback dirs
|
458 |
+
foreach ($this->fallbackDirsPsr0 as $dir) {
|
459 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
460 |
+
return $file;
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
// PSR-0 include paths.
|
465 |
+
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
466 |
+
return $file;
|
467 |
+
}
|
468 |
+
|
469 |
+
return false;
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
/**
|
474 |
+
* Scope isolated include.
|
475 |
+
*
|
476 |
+
* Prevents access to $this/self from included files.
|
477 |
+
*/
|
478 |
+
function includeFile($file)
|
479 |
+
{
|
480 |
+
include $file;
|
481 |
+
}
|
vendor/siteground/siteground-i18n/vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,337 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
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Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer;
|
14 |
+
|
15 |
+
use Composer\Autoload\ClassLoader;
|
16 |
+
use Composer\Semver\VersionParser;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* This class is copied in every Composer installed project and available to all
|
20 |
+
*
|
21 |
+
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
+
*
|
23 |
+
* To require it's presence, you can require `composer-runtime-api ^2.0`
|
24 |
+
*/
|
25 |
+
class InstalledVersions
|
26 |
+
{
|
27 |
+
private static $installed;
|
28 |
+
private static $canGetVendors;
|
29 |
+
private static $installedByVendor = array();
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
33 |
+
*
|
34 |
+
* @return string[]
|
35 |
+
* @psalm-return list<string>
|
36 |
+
*/
|
37 |
+
public static function getInstalledPackages()
|
38 |
+
{
|
39 |
+
$packages = array();
|
40 |
+
foreach (self::getInstalled() as $installed) {
|
41 |
+
$packages[] = array_keys($installed['versions']);
|
42 |
+
}
|
43 |
+
|
44 |
+
if (1 === \count($packages)) {
|
45 |
+
return $packages[0];
|
46 |
+
}
|
47 |
+
|
48 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Returns a list of all package names with a specific type e.g. 'library'
|
53 |
+
*
|
54 |
+
* @param string $type
|
55 |
+
* @return string[]
|
56 |
+
* @psalm-return list<string>
|
57 |
+
*/
|
58 |
+
public static function getInstalledPackagesByType($type)
|
59 |
+
{
|
60 |
+
$packagesByType = array();
|
61 |
+
|
62 |
+
foreach (self::getInstalled() as $installed) {
|
63 |
+
foreach ($installed['versions'] as $name => $package) {
|
64 |
+
if (isset($package['type']) && $package['type'] === $type) {
|
65 |
+
$packagesByType[] = $name;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
return $packagesByType;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Checks whether the given package is installed
|
75 |
+
*
|
76 |
+
* This also returns true if the package name is provided or replaced by another package
|
77 |
+
*
|
78 |
+
* @param string $packageName
|
79 |
+
* @param bool $includeDevRequirements
|
80 |
+
* @return bool
|
81 |
+
*/
|
82 |
+
public static function isInstalled($packageName, $includeDevRequirements = true)
|
83 |
+
{
|
84 |
+
foreach (self::getInstalled() as $installed) {
|
85 |
+
if (isset($installed['versions'][$packageName])) {
|
86 |
+
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Checks whether the given package satisfies a version constraint
|
95 |
+
*
|
96 |
+
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
97 |
+
*
|
98 |
+
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
99 |
+
*
|
100 |
+
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
101 |
+
* @param string $packageName
|
102 |
+
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
103 |
+
* @return bool
|
104 |
+
*/
|
105 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
106 |
+
{
|
107 |
+
$constraint = $parser->parseConstraints($constraint);
|
108 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
109 |
+
|
110 |
+
return $provided->matches($constraint);
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Returns a version constraint representing all the range(s) which are installed for a given package
|
115 |
+
*
|
116 |
+
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
117 |
+
* whether a given version of a package is installed, and not just whether it exists
|
118 |
+
*
|
119 |
+
* @param string $packageName
|
120 |
+
* @return string Version constraint usable with composer/semver
|
121 |
+
*/
|
122 |
+
public static function getVersionRanges($packageName)
|
123 |
+
{
|
124 |
+
foreach (self::getInstalled() as $installed) {
|
125 |
+
if (!isset($installed['versions'][$packageName])) {
|
126 |
+
continue;
|
127 |
+
}
|
128 |
+
|
129 |
+
$ranges = array();
|
130 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
131 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
132 |
+
}
|
133 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
134 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
135 |
+
}
|
136 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
137 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
138 |
+
}
|
139 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
140 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
141 |
+
}
|
142 |
+
|
143 |
+
return implode(' || ', $ranges);
|
144 |
+
}
|
145 |
+
|
146 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* @param string $packageName
|
151 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
152 |
+
*/
|
153 |
+
public static function getVersion($packageName)
|
154 |
+
{
|
155 |
+
foreach (self::getInstalled() as $installed) {
|
156 |
+
if (!isset($installed['versions'][$packageName])) {
|
157 |
+
continue;
|
158 |
+
}
|
159 |
+
|
160 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
161 |
+
return null;
|
162 |
+
}
|
163 |
+
|
164 |
+
return $installed['versions'][$packageName]['version'];
|
165 |
+
}
|
166 |
+
|
167 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* @param string $packageName
|
172 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
173 |
+
*/
|
174 |
+
public static function getPrettyVersion($packageName)
|
175 |
+
{
|
176 |
+
foreach (self::getInstalled() as $installed) {
|
177 |
+
if (!isset($installed['versions'][$packageName])) {
|
178 |
+
continue;
|
179 |
+
}
|
180 |
+
|
181 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
182 |
+
return null;
|
183 |
+
}
|
184 |
+
|
185 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
186 |
+
}
|
187 |
+
|
188 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* @param string $packageName
|
193 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
194 |
+
*/
|
195 |
+
public static function getReference($packageName)
|
196 |
+
{
|
197 |
+
foreach (self::getInstalled() as $installed) {
|
198 |
+
if (!isset($installed['versions'][$packageName])) {
|
199 |
+
continue;
|
200 |
+
}
|
201 |
+
|
202 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
203 |
+
return null;
|
204 |
+
}
|
205 |
+
|
206 |
+
return $installed['versions'][$packageName]['reference'];
|
207 |
+
}
|
208 |
+
|
209 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @param string $packageName
|
214 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
215 |
+
*/
|
216 |
+
public static function getInstallPath($packageName)
|
217 |
+
{
|
218 |
+
foreach (self::getInstalled() as $installed) {
|
219 |
+
if (!isset($installed['versions'][$packageName])) {
|
220 |
+
continue;
|
221 |
+
}
|
222 |
+
|
223 |
+
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
224 |
+
}
|
225 |
+
|
226 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* @return array
|
231 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
|
232 |
+
*/
|
233 |
+
public static function getRootPackage()
|
234 |
+
{
|
235 |
+
$installed = self::getInstalled();
|
236 |
+
|
237 |
+
return $installed[0]['root'];
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Returns the raw installed.php data for custom implementations
|
242 |
+
*
|
243 |
+
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
244 |
+
* @return array[]
|
245 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
|
246 |
+
*/
|
247 |
+
public static function getRawData()
|
248 |
+
{
|
249 |
+
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
250 |
+
|
251 |
+
if (null === self::$installed) {
|
252 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
253 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
254 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
255 |
+
self::$installed = include __DIR__ . '/installed.php';
|
256 |
+
} else {
|
257 |
+
self::$installed = array();
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
return self::$installed;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
266 |
+
*
|
267 |
+
* @return array[]
|
268 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
269 |
+
*/
|
270 |
+
public static function getAllRawData()
|
271 |
+
{
|
272 |
+
return self::getInstalled();
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Lets you reload the static array from another file
|
277 |
+
*
|
278 |
+
* This is only useful for complex integrations in which a project needs to use
|
279 |
+
* this class but then also needs to execute another project's autoloader in process,
|
280 |
+
* and wants to ensure both projects have access to their version of installed.php.
|
281 |
+
*
|
282 |
+
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
283 |
+
* the data it needs from this class, then call reload() with
|
284 |
+
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
285 |
+
* the project in which it runs can then also use this class safely, without
|
286 |
+
* interference between PHPUnit's dependencies and the project's dependencies.
|
287 |
+
*
|
288 |
+
* @param array[] $data A vendor/composer/installed.php data set
|
289 |
+
* @return void
|
290 |
+
*
|
291 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
|
292 |
+
*/
|
293 |
+
public static function reload($data)
|
294 |
+
{
|
295 |
+
self::$installed = $data;
|
296 |
+
self::$installedByVendor = array();
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* @return array[]
|
301 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
|
302 |
+
*/
|
303 |
+
private static function getInstalled()
|
304 |
+
{
|
305 |
+
if (null === self::$canGetVendors) {
|
306 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
307 |
+
}
|
308 |
+
|
309 |
+
$installed = array();
|
310 |
+
|
311 |
+
if (self::$canGetVendors) {
|
312 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
313 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
314 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
315 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
316 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
317 |
+
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
318 |
+
self::$installed = $installed[count($installed) - 1];
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
if (null === self::$installed) {
|
325 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
326 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
327 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
328 |
+
self::$installed = require __DIR__ . '/installed.php';
|
329 |
+
} else {
|
330 |
+
self::$installed = array();
|
331 |
+
}
|
332 |
+
}
|
333 |
+
$installed[] = self::$installed;
|
334 |
+
|
335 |
+
return $installed;
|
336 |
+
}
|
337 |
+
}
|
vendor/siteground/siteground-i18n/vendor/composer/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
|
2 |
+
Copyright (c) Nils Adermann, Jordi Boggiano
|
3 |
+
|
4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
+
of this software and associated documentation files (the "Software"), to deal
|
6 |
+
in the Software without restriction, including without limitation the rights
|
7 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
9 |
+
to do so, subject to the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be included in all
|
12 |
+
copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
+
THE SOFTWARE.
|
21 |
+
|
vendor/siteground/siteground-i18n/vendor/composer/autoload_classmap.php
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_classmap.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
+
);
|
vendor/siteground/siteground-i18n/vendor/composer/autoload_namespaces.php
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_namespaces.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Sepia' => array($vendorDir . '/sepia/po-parser/src'),
|
10 |
+
);
|
vendor/siteground/siteground-i18n/vendor/composer/autoload_psr4.php
ADDED
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_psr4.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'SiteGround_i18n\\' => array($baseDir . '/src'),
|
10 |
+
'CharlesRumley\\Tests\\' => array($vendorDir . '/charles-rumley/php-po-to-json/tests'),
|
11 |
+
'CharlesRumley\\' => array($vendorDir . '/charles-rumley/php-po-to-json/src'),
|
12 |
+
);
|
vendor/siteground/siteground-i18n/vendor/composer/autoload_real.php
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_real.php @generated by Composer
|
4 |
+
|
5 |
+
class ComposerAutoloaderInit069af68d6e649077696a380a2ba6db6a
|
6 |
+
{
|
7 |
+
private static $loader;
|
8 |
+
|
9 |
+
public static function loadClassLoader($class)
|
10 |
+
{
|
11 |
+
if ('Composer\Autoload\ClassLoader' === $class) {
|
12 |
+
require __DIR__ . '/ClassLoader.php';
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
+
public static function getLoader()
|
20 |
+
{
|
21 |
+
if (null !== self::$loader) {
|
22 |
+
return self::$loader;
|
23 |
+
}
|
24 |
+
|
25 |
+
require __DIR__ . '/platform_check.php';
|
26 |
+
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit069af68d6e649077696a380a2ba6db6a', 'loadClassLoader'), true, true);
|
28 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit069af68d6e649077696a380a2ba6db6a', 'loadClassLoader'));
|
30 |
+
|
31 |
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
+
if ($useStaticLoader) {
|
33 |
+
require __DIR__ . '/autoload_static.php';
|
34 |
+
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit069af68d6e649077696a380a2ba6db6a::getInitializer($loader));
|
36 |
+
} else {
|
37 |
+
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
+
foreach ($map as $namespace => $path) {
|
39 |
+
$loader->set($namespace, $path);
|
40 |
+
}
|
41 |
+
|
42 |
+
$map = require __DIR__ . '/autoload_psr4.php';
|
43 |
+
foreach ($map as $namespace => $path) {
|
44 |
+
$loader->setPsr4($namespace, $path);
|
45 |
+
}
|
46 |
+
|
47 |
+
$classMap = require __DIR__ . '/autoload_classmap.php';
|
48 |
+
if ($classMap) {
|
49 |
+
$loader->addClassMap($classMap);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
$loader->register(true);
|
54 |
+
|
55 |
+
return $loader;
|
56 |
+
}
|
57 |
+
}
|
vendor/siteground/siteground-i18n/vendor/composer/autoload_static.php
ADDED
@@ -0,0 +1,60 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_static.php @generated by Composer
|
4 |
+
|
5 |
+
namespace Composer\Autoload;
|
6 |
+
|
7 |
+
class ComposerStaticInit069af68d6e649077696a380a2ba6db6a
|
8 |
+
{
|
9 |
+
public static $prefixLengthsPsr4 = array (
|
10 |
+
'S' =>
|
11 |
+
array (
|
12 |
+
'SiteGround_i18n\\' => 16,
|
13 |
+
),
|
14 |
+
'C' =>
|
15 |
+
array (
|
16 |
+
'CharlesRumley\\Tests\\' => 20,
|
17 |
+
'CharlesRumley\\' => 14,
|
18 |
+
),
|
19 |
+
);
|
20 |
+
|
21 |
+
public static $prefixDirsPsr4 = array (
|
22 |
+
'SiteGround_i18n\\' =>
|
23 |
+
array (
|
24 |
+
0 => __DIR__ . '/../..' . '/src',
|
25 |
+
),
|
26 |
+
'CharlesRumley\\Tests\\' =>
|
27 |
+
array (
|
28 |
+
0 => __DIR__ . '/..' . '/charles-rumley/php-po-to-json/tests',
|
29 |
+
),
|
30 |
+
'CharlesRumley\\' =>
|
31 |
+
array (
|
32 |
+
0 => __DIR__ . '/..' . '/charles-rumley/php-po-to-json/src',
|
33 |
+
),
|
34 |
+
);
|
35 |
+
|
36 |
+
public static $prefixesPsr0 = array (
|
37 |
+
'S' =>
|
38 |
+
array (
|
39 |
+
'Sepia' =>
|
40 |
+
array (
|
41 |
+
0 => __DIR__ . '/..' . '/sepia/po-parser/src',
|
42 |
+
),
|
43 |
+
),
|
44 |
+
);
|
45 |
+
|
46 |
+
public static $classMap = array (
|
47 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
48 |
+
);
|
49 |
+
|
50 |
+
public static function getInitializer(ClassLoader $loader)
|
51 |
+
{
|
52 |
+
return \Closure::bind(function () use ($loader) {
|
53 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit069af68d6e649077696a380a2ba6db6a::$prefixLengthsPsr4;
|
54 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit069af68d6e649077696a380a2ba6db6a::$prefixDirsPsr4;
|
55 |
+
$loader->prefixesPsr0 = ComposerStaticInit069af68d6e649077696a380a2ba6db6a::$prefixesPsr0;
|
56 |
+
$loader->classMap = ComposerStaticInit069af68d6e649077696a380a2ba6db6a::$classMap;
|
57 |
+
|
58 |
+
}, null, ClassLoader::class);
|
59 |
+
}
|
60 |
+
}
|
vendor/siteground/siteground-i18n/vendor/composer/installed.json
ADDED
@@ -0,0 +1,116 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"packages": [
|
3 |
+
{
|
4 |
+
"name": "charles-rumley/php-po-to-json",
|
5 |
+
"version": "dev-master",
|
6 |
+
"version_normalized": "dev-master",
|
7 |
+
"source": {
|
8 |
+
"type": "git",
|
9 |
+
"url": "https://github.com/charles-rumley/php-po-to-json.git",
|
10 |
+
"reference": "c2d228fbbb69b90b6c331141b89c4faf985e6152"
|
11 |
+
},
|
12 |
+
"dist": {
|
13 |
+
"type": "zip",
|
14 |
+
"url": "https://api.github.com/repos/charles-rumley/php-po-to-json/zipball/c2d228fbbb69b90b6c331141b89c4faf985e6152",
|
15 |
+
"reference": "c2d228fbbb69b90b6c331141b89c4faf985e6152",
|
16 |
+
"shasum": ""
|
17 |
+
},
|
18 |
+
"require": {
|
19 |
+
"php": ">=5.3.0",
|
20 |
+
"sepia/po-parser": "^4.2"
|
21 |
+
},
|
22 |
+
"require-dev": {
|
23 |
+
"phpunit/phpunit": "~4.0"
|
24 |
+
},
|
25 |
+
"time": "2016-09-08T12:53:20+00:00",
|
26 |
+
"default-branch": true,
|
27 |
+
"type": "package",
|
28 |
+
"installation-source": "dist",
|
29 |
+
"autoload": {
|
30 |
+
"psr-4": {
|
31 |
+
"CharlesRumley\\": "src/",
|
32 |
+
"CharlesRumley\\Tests\\": "tests/"
|
33 |
+
}
|
34 |
+
},
|
35 |
+
"notification-url": "https://packagist.org/downloads/",
|
36 |
+
"license": [
|
37 |
+
"MIT"
|
38 |
+
],
|
39 |
+
"authors": [
|
40 |
+
{
|
41 |
+
"name": "Charles Rumley",
|
42 |
+
"email": "charles.rumley@gmail.com"
|
43 |
+
}
|
44 |
+
],
|
45 |
+
"keywords": [
|
46 |
+
"i18n",
|
47 |
+
"jed",
|
48 |
+
"json",
|
49 |
+
"php",
|
50 |
+
"translation"
|
51 |
+
],
|
52 |
+
"support": {
|
53 |
+
"issues": "https://github.com/charles-rumley/php-po-to-json/issues",
|
54 |
+
"source": "https://github.com/charles-rumley/php-po-to-json/tree/master"
|
55 |
+
},
|
56 |
+
"install-path": "../charles-rumley/php-po-to-json"
|
57 |
+
},
|
58 |
+
{
|
59 |
+
"name": "sepia/po-parser",
|
60 |
+
"version": "4.2.2",
|
61 |
+
"version_normalized": "4.2.2.0",
|
62 |
+
"source": {
|
63 |
+
"type": "git",
|
64 |
+
"url": "https://github.com/raulferras/PHP-po-parser.git",
|
65 |
+
"reference": "8a6bbcd4a231b19e1b052c1c46b0fe2935331afe"
|
66 |
+
},
|
67 |
+
"dist": {
|
68 |
+
"type": "zip",
|
69 |
+
"url": "https://api.github.com/repos/raulferras/PHP-po-parser/zipball/8a6bbcd4a231b19e1b052c1c46b0fe2935331afe",
|
70 |
+
"reference": "8a6bbcd4a231b19e1b052c1c46b0fe2935331afe",
|
71 |
+
"shasum": ""
|
72 |
+
},
|
73 |
+
"require": {
|
74 |
+
"php": ">=5.3"
|
75 |
+
},
|
76 |
+
"require-dev": {
|
77 |
+
"phpunit/phpunit": "3.7.*",
|
78 |
+
"squizlabs/php_codesniffer": "1.5.*"
|
79 |
+
},
|
80 |
+
"time": "2017-09-15T10:55:43+00:00",
|
81 |
+
"type": "library",
|
82 |
+
"installation-source": "dist",
|
83 |
+
"autoload": {
|
84 |
+
"psr-0": {
|
85 |
+
"Sepia": "src/"
|
86 |
+
}
|
87 |
+
},
|
88 |
+
"notification-url": "https://packagist.org/downloads/",
|
89 |
+
"license": [
|
90 |
+
"MIT"
|
91 |
+
],
|
92 |
+
"authors": [
|
93 |
+
{
|
94 |
+
"name": "Raúl Ferrà s",
|
95 |
+
"email": "raul.ferras@gmail.com",
|
96 |
+
"role": "developer"
|
97 |
+
}
|
98 |
+
],
|
99 |
+
"description": "Gettext *.PO file parser for PHP.",
|
100 |
+
"homepage": "https://github.com/raulferras/PHP-po-parser",
|
101 |
+
"keywords": [
|
102 |
+
"gettext",
|
103 |
+
"i10n",
|
104 |
+
"i18n",
|
105 |
+
"po"
|
106 |
+
],
|
107 |
+
"support": {
|
108 |
+
"issues": "https://github.com/raulferras/PHP-po-parser/issues",
|
109 |
+
"source": "https://github.com/raulferras/PHP-po-parser/tree/master"
|
110 |
+
},
|
111 |
+
"install-path": "../sepia/po-parser"
|
112 |
+
}
|
113 |
+
],
|
114 |
+
"dev": true,
|
115 |
+
"dev-package-names": []
|
116 |
+
}
|
vendor/siteground/siteground-i18n/vendor/composer/installed.php
ADDED
@@ -0,0 +1,43 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php return array(
|
2 |
+
'root' => array(
|
3 |
+
'pretty_version' => 'dev-master',
|
4 |
+
'version' => 'dev-master',
|
5 |
+
'type' => 'library',
|
6 |
+
'install_path' => __DIR__ . '/../../',
|
7 |
+
'aliases' => array(),
|
8 |
+
'reference' => 'b242d643714a172f4d000e3b6a05a6069c8dd30b',
|
9 |
+
'name' => 'siteground/siteground-i18n',
|
10 |
+
'dev' => true,
|
11 |
+
),
|
12 |
+
'versions' => array(
|
13 |
+
'charles-rumley/php-po-to-json' => array(
|
14 |
+
'pretty_version' => 'dev-master',
|
15 |
+
'version' => 'dev-master',
|
16 |
+
'type' => 'package',
|
17 |
+
'install_path' => __DIR__ . '/../charles-rumley/php-po-to-json',
|
18 |
+
'aliases' => array(
|
19 |
+
0 => '9999999-dev',
|
20 |
+
),
|
21 |
+
'reference' => 'c2d228fbbb69b90b6c331141b89c4faf985e6152',
|
22 |
+
'dev_requirement' => false,
|
23 |
+
),
|
24 |
+
'sepia/po-parser' => array(
|
25 |
+
'pretty_version' => '4.2.2',
|
26 |
+
'version' => '4.2.2.0',
|
27 |
+
'type' => 'library',
|
28 |
+
'install_path' => __DIR__ . '/../sepia/po-parser',
|
29 |
+
'aliases' => array(),
|
30 |
+
'reference' => '8a6bbcd4a231b19e1b052c1c46b0fe2935331afe',
|
31 |
+
'dev_requirement' => false,
|
32 |
+
),
|
33 |
+
'siteground/siteground-i18n' => array(
|
34 |
+
'pretty_version' => 'dev-master',
|
35 |
+
'version' => 'dev-master',
|
36 |
+
'type' => 'library',
|
37 |
+
'install_path' => __DIR__ . '/../../',
|
38 |
+
'aliases' => array(),
|
39 |
+
'reference' => 'b242d643714a172f4d000e3b6a05a6069c8dd30b',
|
40 |
+
'dev_requirement' => false,
|
41 |
+
),
|
42 |
+
),
|
43 |
+
);
|
vendor/siteground/siteground-i18n/vendor/composer/platform_check.php
ADDED
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// platform_check.php @generated by Composer
|
4 |
+
|
5 |
+
$issues = array();
|
6 |
+
|
7 |
+
if (!(PHP_VERSION_ID >= 50300)) {
|
8 |
+
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.0". You are running ' . PHP_VERSION . '.';
|
9 |
+
}
|
10 |
+
|
11 |
+
if ($issues) {
|
12 |
+
if (!headers_sent()) {
|
13 |
+
header('HTTP/1.1 500 Internal Server Error');
|
14 |
+
}
|
15 |
+
if (!ini_get('display_errors')) {
|
16 |
+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
17 |
+
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
18 |
+
} elseif (!headers_sent()) {
|
19 |
+
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
trigger_error(
|
23 |
+
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
24 |
+
E_USER_ERROR
|
25 |
+
);
|
26 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
vendor
|
2 |
+
composer.phar
|
3 |
+
composer.lock
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.scrutinizer.yml
ADDED
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
before_commands:
|
2 |
+
- "composer install --prefer-source"
|
3 |
+
|
4 |
+
tools:
|
5 |
+
php_code_coverage:
|
6 |
+
enabled: true
|
7 |
+
php_code_sniffer:
|
8 |
+
enabled: true
|
9 |
+
config:
|
10 |
+
standard: PSR2
|
11 |
+
filter:
|
12 |
+
paths: ["src/*", "tests/*"]
|
13 |
+
php_cpd:
|
14 |
+
enabled: true
|
15 |
+
excluded_dirs: ["build/*", "tests", "vendor"]
|
16 |
+
php_analyzer:
|
17 |
+
enabled: true
|
18 |
+
filter:
|
19 |
+
paths: ["src/*", "tests/*"]
|
20 |
+
php_mess_detector:
|
21 |
+
enabled: true
|
22 |
+
filter:
|
23 |
+
paths: ["src/*"]
|
24 |
+
php_pdepend:
|
25 |
+
enabled: true
|
26 |
+
excluded_dirs: ["build", "tests", "vendor"]
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/.travis.yml
ADDED
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
language: php
|
2 |
+
|
3 |
+
php:
|
4 |
+
- 5.4
|
5 |
+
- 5.5
|
6 |
+
- 7.0
|
7 |
+
- 7.1
|
8 |
+
|
9 |
+
before_script:
|
10 |
+
- composer self-update
|
11 |
+
- composer update --prefer-source; composer install --dev --prefer-source;
|
12 |
+
|
13 |
+
script:
|
14 |
+
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/build/.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
*
|
2 |
+
!logs
|
3 |
+
!.gitignore
|
4 |
+
!coverage-checker.php
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/composer.json
ADDED
@@ -0,0 +1,30 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"name" : "sepia/po-parser",
|
3 |
+
"description" : "Gettext *.PO file parser for PHP.",
|
4 |
+
"type" : "library",
|
5 |
+
"keywords" : ["i18n","i10n","po","gettext"],
|
6 |
+
"homepage" : "https://github.com/raulferras/PHP-po-parser",
|
7 |
+
"license" : "MIT",
|
8 |
+
"authors" : [
|
9 |
+
{
|
10 |
+
"name": "Raúl Ferrà s",
|
11 |
+
"email": "raul.ferras@gmail.com",
|
12 |
+
"role" : "developer"
|
13 |
+
}
|
14 |
+
],
|
15 |
+
"support" : {
|
16 |
+
"issues" : "https://github.com/raulferras/PHP-po-parser/issues"
|
17 |
+
},
|
18 |
+
"require" : {
|
19 |
+
"php": ">=5.3"
|
20 |
+
},
|
21 |
+
"require-dev" : {
|
22 |
+
"phpunit/phpunit": "3.7.*",
|
23 |
+
"squizlabs/php_codesniffer": "1.5.*"
|
24 |
+
},
|
25 |
+
"autoload" : {
|
26 |
+
"psr-0" : {
|
27 |
+
"Sepia": "src/"
|
28 |
+
}
|
29 |
+
}
|
30 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/license.txt
ADDED
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com
|
4 |
+
All rights reserved.
|
5 |
+
|
6 |
+
Redistribution and use in source and binary forms, with or without
|
7 |
+
modification, are permitted provided that the following conditions
|
8 |
+
are met:
|
9 |
+
1. Redistributions of source code must retain the above copyright
|
10 |
+
notice, this list of conditions and the following disclaimer.
|
11 |
+
2. Redistributions in binary form must reproduce the above copyright
|
12 |
+
notice, this list of conditions and the following disclaimer in the
|
13 |
+
documentation and/or other materials provided with the distribution.
|
14 |
+
3. Neither the name of copyright holders nor the names of its
|
15 |
+
contributors may be used to endorse or promote products derived
|
16 |
+
from this software without specific prior written permission.
|
17 |
+
|
18 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19 |
+
''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
20 |
+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
21 |
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
|
22 |
+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
23 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
24 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
25 |
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
26 |
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
27 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 |
+
POSSIBILITY OF SUCH DAMAGE.
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/phpunit.xml
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<phpunit bootstrap="./vendor/autoload.php" colors="true">
|
3 |
+
<testsuites>
|
4 |
+
<testsuite name="Poparser test suite">
|
5 |
+
<directory>./tests</directory>
|
6 |
+
</testsuite>
|
7 |
+
</testsuites>
|
8 |
+
</phpunit>
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/readme.md
ADDED
@@ -0,0 +1,113 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
Po Parser
|
2 |
+
=========
|
3 |
+
|
4 |
+
[![Latest Stable Version](https://poser.pugx.org/sepia/po-parser/v/stable)](https://packagist.org/packages/sepia/po-parser)
|
5 |
+
[![Total Downloads](https://poser.pugx.org/sepia/po-parser/downloads)](https://packagist.org/packages/sepia/po-parser)
|
6 |
+
[![License](https://poser.pugx.org/sepia/po-parser/license)](https://packagist.org/packages/sepia/po-parser)
|
7 |
+
[![Build Status](https://travis-ci.org/raulferras/PHP-po-parser.png?branch=master)](https://travis-ci.org/raulferras/PHP-po-parser)
|
8 |
+
[![Code Coverage](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/coverage.png?s=a19ece2a8543b085ab1a5db319ded3bc4530b567)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/)
|
9 |
+
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/badges/quality-score.png?s=6aaf3c31ce15cebd1d4bed718cd41fd2d921fd31)](https://scrutinizer-ci.com/g/raulferras/PHP-po-parser/)
|
10 |
+
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/raulferras/PHP-po-parser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
11 |
+
|
12 |
+
|
13 |
+
PoParser is a personal project to fulfill a need I got: parse Gettext Portable files (*.po files) and edit its content using PHP.
|
14 |
+
|
15 |
+
PoParser will allow you to read PO Data from any source (files and strings built-in), update it and store back to a file (or get the compiled string).
|
16 |
+
|
17 |
+
It supports following parsing features:
|
18 |
+
|
19 |
+
- header section.
|
20 |
+
- msgid, both single and multiline.
|
21 |
+
- msgstr, both single and multiline.
|
22 |
+
- msgctxt (Message context).
|
23 |
+
- msgid_plural (plurals forms).
|
24 |
+
- #, keys (flags).
|
25 |
+
- # keys (translator comments).
|
26 |
+
- #. keys (Comments extracted from source code).
|
27 |
+
- #: keys (references).
|
28 |
+
- #| keys (previously untranslated), both single and multiline.
|
29 |
+
- #~ keys (old entries), both single and multiline.
|
30 |
+
|
31 |
+
Usage
|
32 |
+
=====
|
33 |
+
|
34 |
+
// Parse a po file
|
35 |
+
$fileHandler = new Sepia\FileHandler('es.po');
|
36 |
+
|
37 |
+
$poParser = new Sepia\PoParser($fileHandler);
|
38 |
+
$entries = $poParser->parse();
|
39 |
+
// $entries contains every entry in es.po file.
|
40 |
+
|
41 |
+
// Update entries
|
42 |
+
$msgid = 'Press this button to save';
|
43 |
+
$entries[$msgid]['msgstr'] = 'Pulsa este botón para guardar';
|
44 |
+
$poParser->setEntry($msgid, $entries[$msgid]);
|
45 |
+
// You can also change translator comments, code comments, flags...
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
Changelog
|
50 |
+
=========
|
51 |
+
v5.0 (WIP)
|
52 |
+
* Classes are now fluid.
|
53 |
+
* Namespaces reorganized.
|
54 |
+
* Removed `fuzzy` index in favour of `flags`.
|
55 |
+
* Display line number on parsing errors instead of line content.
|
56 |
+
* Adds compatibility with `#~|` entries.
|
57 |
+
* `parseString()` and `parseFile()` converted to factory methods.
|
58 |
+
* Removed method `updateEntry()` in favour of `setEntry()`.
|
59 |
+
|
60 |
+
v4.2.2
|
61 |
+
* More PHPDocs fixes
|
62 |
+
* Strict comparisons used where safe.
|
63 |
+
* Fix example for `writeFile`.
|
64 |
+
* Support for EOL line formatting.
|
65 |
+
|
66 |
+
v4.2.1
|
67 |
+
* Support multiline for plural entries (thanks @Ben-Ho)
|
68 |
+
|
69 |
+
v4.2.0
|
70 |
+
* Add function to add plural and context to existing entry (thanks @Ben-Ho)
|
71 |
+
* Add ability to change msg id of entry (thanks @wildex)
|
72 |
+
|
73 |
+
|
74 |
+
v4.1.1
|
75 |
+
* Fixes with multi-flags entries (thanks @gnouet)
|
76 |
+
|
77 |
+
v4.1
|
78 |
+
* Constructor now accepts options to define separator used in multiline msgid entries.
|
79 |
+
* New method `getOptions()`.
|
80 |
+
|
81 |
+
v4.0
|
82 |
+
|
83 |
+
* new methods parseString() and parseFile() replace the old parse()`
|
84 |
+
* new method writeFile() replaces the old write().
|
85 |
+
* new method compile() which takes all parsed entries and coverts back to a PO formatted string.
|
86 |
+
|
87 |
+
[See whole changelog](https://github.com/raulferras/PHP-po-parser/wiki/Changelog)
|
88 |
+
|
89 |
+
|
90 |
+
Documentation
|
91 |
+
=============
|
92 |
+
[See v4 documentation](https://github.com/raulferras/PHP-po-parser/wiki/Documentation-4.0)
|
93 |
+
|
94 |
+
|
95 |
+
Testing
|
96 |
+
=======
|
97 |
+
Tests are done using PHPUnit.
|
98 |
+
To execute tests, from command line type:
|
99 |
+
|
100 |
+
```
|
101 |
+
php vendor/bin/phpunit
|
102 |
+
```
|
103 |
+
|
104 |
+
|
105 |
+
Install via composer
|
106 |
+
====================
|
107 |
+
Edit your composer.json file to include the following:
|
108 |
+
|
109 |
+
{
|
110 |
+
"require": {
|
111 |
+
"sepia/po-parser": "dev-master"
|
112 |
+
}
|
113 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/FileHandler.php
ADDED
@@ -0,0 +1,74 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sepia;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com
|
7 |
+
* All rights reserved.
|
8 |
+
*
|
9 |
+
* Redistribution and use in source and binary forms, with or without
|
10 |
+
* modification, are permitted provided that the following conditions
|
11 |
+
* are met:
|
12 |
+
* 1. Redistributions of source code must retain the above copyright
|
13 |
+
* notice, this list of conditions and the following disclaimer.
|
14 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
15 |
+
* notice, this list of conditions and the following disclaimer in the
|
16 |
+
* documentation and/or other materials provided with the distribution.
|
17 |
+
* 3. Neither the name of copyright holders nor the names of its
|
18 |
+
* contributors may be used to endorse or promote products derived
|
19 |
+
* from this software without specific prior written permission.
|
20 |
+
*
|
21 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22 |
+
* ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
23 |
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
24 |
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
|
25 |
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26 |
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 |
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 |
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 |
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 |
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
+
* POSSIBILITY OF SUCH DAMAGE.
|
32 |
+
*
|
33 |
+
* https://github.com/raulferras/PHP-po-parser
|
34 |
+
*/
|
35 |
+
class FileHandler implements InterfaceHandler
|
36 |
+
{
|
37 |
+
protected $fileHandle;
|
38 |
+
|
39 |
+
public function __construct($filepath)
|
40 |
+
{
|
41 |
+
if (file_exists($filepath) === false) {
|
42 |
+
throw new \Exception('PoParser: Input File does not exists: "' . htmlspecialchars($filepath) . '"');
|
43 |
+
} elseif (is_readable($filepath) === false) {
|
44 |
+
throw new \Exception('PoParser: File is not readable: "' . htmlspecialchars($filepath) . '"');
|
45 |
+
}
|
46 |
+
|
47 |
+
$this->fileHandle = @fopen($filepath, "r");
|
48 |
+
if ($this->fileHandle===false) {
|
49 |
+
throw new \Exception('PoParser: Could not open file: "' . htmlspecialchars($filepath) . '"');
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
public function getNextLine()
|
55 |
+
{
|
56 |
+
return fgets($this->fileHandle);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function ended()
|
60 |
+
{
|
61 |
+
return feof($this->fileHandle);
|
62 |
+
}
|
63 |
+
|
64 |
+
public function close()
|
65 |
+
{
|
66 |
+
return @fclose($this->fileHandle);
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
public function save($outputFile)
|
71 |
+
{
|
72 |
+
|
73 |
+
}
|
74 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/InterfaceHandler.php
ADDED
@@ -0,0 +1,41 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sepia;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com
|
7 |
+
* All rights reserved.
|
8 |
+
*
|
9 |
+
* Redistribution and use in source and binary forms, with or without
|
10 |
+
* modification, are permitted provided that the following conditions
|
11 |
+
* are met:
|
12 |
+
* 1. Redistributions of source code must retain the above copyright
|
13 |
+
* notice, this list of conditions and the following disclaimer.
|
14 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
15 |
+
* notice, this list of conditions and the following disclaimer in the
|
16 |
+
* documentation and/or other materials provided with the distribution.
|
17 |
+
* 3. Neither the name of copyright holders nor the names of its
|
18 |
+
* contributors may be used to endorse or promote products derived
|
19 |
+
* from this software without specific prior written permission.
|
20 |
+
*
|
21 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22 |
+
* ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
23 |
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
24 |
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
|
25 |
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26 |
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 |
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 |
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 |
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 |
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
+
* POSSIBILITY OF SUCH DAMAGE.
|
32 |
+
*
|
33 |
+
* https://github.com/raulferras/PHP-po-parser
|
34 |
+
*/
|
35 |
+
interface InterfaceHandler
|
36 |
+
{
|
37 |
+
public function getNextLine();
|
38 |
+
public function ended();
|
39 |
+
public function close();
|
40 |
+
public function save($output);
|
41 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/PoParser.php
ADDED
@@ -0,0 +1,810 @@
|
|
Â
|
|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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sepia;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com
|
7 |
+
* All rights reserved.
|
8 |
+
*
|
9 |
+
* Redistribution and use in source and binary forms, with or without
|
10 |
+
* modification, are permitted provided that the following conditions
|
11 |
+
* are met:
|
12 |
+
* 1. Redistributions of source code must retain the above copyright
|
13 |
+
* notice, this list of conditions and the following disclaimer.
|
14 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
15 |
+
* notice, this list of conditions and the following disclaimer in the
|
16 |
+
* documentation and/or other materials provided with the distribution.
|
17 |
+
* 3. Neither the name of copyright holders nor the names of its
|
18 |
+
* contributors may be used to endorse or promote products derived
|
19 |
+
* from this software without specific prior written permission.
|
20 |
+
*
|
21 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22 |
+
* ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
23 |
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
24 |
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
|
25 |
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26 |
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 |
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 |
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 |
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 |
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
+
* POSSIBILITY OF SUCH DAMAGE.
|
32 |
+
*
|
33 |
+
* https://github.com/raulferras/PHP-po-parser
|
34 |
+
*
|
35 |
+
* Class to parse .po file and extract its strings.
|
36 |
+
*
|
37 |
+
* @version 4.2.2
|
38 |
+
*/
|
39 |
+
class PoParser
|
40 |
+
{
|
41 |
+
protected $entries = array();
|
42 |
+
protected $headers = array();
|
43 |
+
protected $sourceHandle = null;
|
44 |
+
protected $options = array();
|
45 |
+
protected $lineEndings = array('unix' => "\n", 'win' => "\r\n");
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Reads and parses a string
|
49 |
+
*
|
50 |
+
* @param string $string po content
|
51 |
+
* @param array $options
|
52 |
+
*
|
53 |
+
* @throws \Exception.
|
54 |
+
*Â @return PoParser
|
55 |
+
*/
|
56 |
+
public static function parseString($string, $options = array())
|
57 |
+
{
|
58 |
+
$parser = new PoParser(new StringHandler($string), $options);
|
59 |
+
$parser->parse();
|
60 |
+
|
61 |
+
return $parser;
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Reads and parses a file
|
67 |
+
*
|
68 |
+
* @param string $filepath
|
69 |
+
* @param array $options
|
70 |
+
*
|
71 |
+
* @throws \Exception.
|
72 |
+
*Â @return PoParser
|
73 |
+
*/
|
74 |
+
public static function parseFile($filepath, $options = array())
|
75 |
+
{
|
76 |
+
$parser = new PoParser(new FileHandler($filepath), $options);
|
77 |
+
$parser->parse();
|
78 |
+
|
79 |
+
return $parser;
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
public function __construct(InterfaceHandler $handler = null, $options = array())
|
84 |
+
{
|
85 |
+
$this->sourceHandle = $handler;
|
86 |
+
$defaultOptions = array(
|
87 |
+
'multiline-glue' => '<##EOL##>', // Token used to separate lines in msgid
|
88 |
+
'context-glue' => '<##EOC##>', // Token used to separate ctxt from msgid
|
89 |
+
'line-ending' => 'unix',
|
90 |
+
);
|
91 |
+
$this->options = array_merge($defaultOptions, $options);
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
public function getOptions()
|
98 |
+
{
|
99 |
+
return $this->options;
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @return array
|
104 |
+
*/
|
105 |
+
public function getEntries()
|
106 |
+
{
|
107 |
+
return $this->entries;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Reads and parses strings of a .po file.
|
112 |
+
*
|
113 |
+
* @param InterfaceHandler . Optional
|
114 |
+
*
|
115 |
+
* @throws \Exception, \InvalidArgumentException
|
116 |
+
* @return array. List of entries found in .po file.
|
117 |
+
*/
|
118 |
+
public function parse(InterfaceHandler $handle = null)
|
119 |
+
{
|
120 |
+
if ($handle === null) {
|
121 |
+
|
122 |
+
if ($this->sourceHandle === null) {
|
123 |
+
throw new \InvalidArgumentException('Must provide a valid InterfaceHandler');
|
124 |
+
}
|
125 |
+
|
126 |
+
$handle = $this->sourceHandle;
|
127 |
+
}
|
128 |
+
|
129 |
+
$headers = array();
|
130 |
+
$hash = array();
|
131 |
+
$entry = array();
|
132 |
+
$justNewEntry = false; // A new entry has been just inserted.
|
133 |
+
$firstLine = true;
|
134 |
+
$lastPreviousKey = null; // Used to remember last key in a multiline previous entry.
|
135 |
+
$state = null;
|
136 |
+
$lineNumber = 0;
|
137 |
+
|
138 |
+
while (!$handle->ended()) {
|
139 |
+
$line = trim($handle->getNextLine());
|
140 |
+
$split = preg_split('/\s+/ ', $line, 2);
|
141 |
+
$key = $split[0];
|
142 |
+
|
143 |
+
// If a blank line is found, or a new msgid when already got one
|
144 |
+
if ($line === '' || ($key === 'msgid' && isset($entry['msgid']))) {
|
145 |
+
// Two consecutive blank lines
|
146 |
+
if ($justNewEntry) {
|
147 |
+
$lineNumber++;
|
148 |
+
continue;
|
149 |
+
}
|
150 |
+
|
151 |
+
if ($firstLine) {
|
152 |
+
$firstLine = false;
|
153 |
+
if (self::isHeader($entry)) {
|
154 |
+
array_shift($entry['msgstr']);
|
155 |
+
$headers = $entry['msgstr'];
|
156 |
+
} else {
|
157 |
+
$hash[] = $entry;
|
158 |
+
}
|
159 |
+
} else {
|
160 |
+
// A new entry is found!
|
161 |
+
$hash[] = $entry;
|
162 |
+
}
|
163 |
+
|
164 |
+
$entry = array();
|
165 |
+
$state = null;
|
166 |
+
$justNewEntry = true;
|
167 |
+
$lastPreviousKey = null;
|
168 |
+
if ($line === '') {
|
169 |
+
$lineNumber++;
|
170 |
+
continue;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
$justNewEntry = false;
|
175 |
+
$data = isset($split[1]) ? $split[1] : null;
|
176 |
+
|
177 |
+
switch ($key) {
|
178 |
+
// Flagged translation
|
179 |
+
case '#,':
|
180 |
+
$entry['flags'] = preg_split('/,\s*/', $data);
|
181 |
+
break;
|
182 |
+
|
183 |
+
// # Translator comments
|
184 |
+
case '#':
|
185 |
+
$entry['tcomment'] = !isset($entry['tcomment']) ? array() : $entry['tcomment'];
|
186 |
+
$entry['tcomment'][] = $data;
|
187 |
+
break;
|
188 |
+
|
189 |
+
// #. Comments extracted from source code
|
190 |
+
case '#.':
|
191 |
+
$entry['ccomment'] = !isset($entry['ccomment']) ? array() : $entry['ccomment'];
|
192 |
+
$entry['ccomment'][] = $data;
|
193 |
+
break;
|
194 |
+
|
195 |
+
// Reference
|
196 |
+
case '#:':
|
197 |
+
$entry['reference'][] = addslashes($data);
|
198 |
+
break;
|
199 |
+
|
200 |
+
|
201 |
+
case '#|': // #| Previous untranslated string
|
202 |
+
case '#~': // #~Â Old entry
|
203 |
+
case '#~|': // #~| Previous-Old untranslated string. Reported by @Cellard
|
204 |
+
|
205 |
+
switch ($key) {
|
206 |
+
case '#|':
|
207 |
+
$key = 'previous';
|
208 |
+
break;
|
209 |
+
case '#~':
|
210 |
+
$key = 'obsolete';
|
211 |
+
break;
|
212 |
+
case '#~|':
|
213 |
+
$key = 'previous-obsolete';
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
|
217 |
+
$tmpParts = explode(' ', $data);
|
218 |
+
$tmpKey = $tmpParts[0];
|
219 |
+
|
220 |
+
if (!in_array($tmpKey, array('msgid', 'msgid_plural', 'msgstr', 'msgctxt'))) {
|
221 |
+
$tmpKey = $lastPreviousKey; // If there is a multiline previous string we must remember what key was first line.
|
222 |
+
$str = $data;
|
223 |
+
} else {
|
224 |
+
$str = implode(' ', array_slice($tmpParts, 1));
|
225 |
+
}
|
226 |
+
|
227 |
+
$entry[$key] = isset($entry[$key]) ? $entry[$key] : array('msgid' => array(), 'msgstr' => array());
|
228 |
+
|
229 |
+
if (strpos($key, 'obsolete') !== false) {
|
230 |
+
$entry['obsolete'] = true;
|
231 |
+
switch ($tmpKey) {
|
232 |
+
case 'msgid':
|
233 |
+
$entry['msgid'][] = $str;
|
234 |
+
$lastPreviousKey = $tmpKey;
|
235 |
+
break;
|
236 |
+
|
237 |
+
case 'msgstr':
|
238 |
+
if ($str === "\"\"") {
|
239 |
+
$entry['msgstr'][] = trim($str, '"');
|
240 |
+
} else {
|
241 |
+
$entry['msgstr'][] = $str;
|
242 |
+
}
|
243 |
+
$lastPreviousKey = $tmpKey;
|
244 |
+
break;
|
245 |
+
|
246 |
+
default:
|
247 |
+
break;
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
if ($key !== 'obsolete') {
|
252 |
+
switch ($tmpKey) {
|
253 |
+
case 'msgid':
|
254 |
+
case 'msgid_plural':
|
255 |
+
case 'msgstr':
|
256 |
+
$entry[$key][$tmpKey][] = $str;
|
257 |
+
$lastPreviousKey = $tmpKey;
|
258 |
+
break;
|
259 |
+
|
260 |
+
default:
|
261 |
+
$entry[$key][$tmpKey] = $str;
|
262 |
+
break;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
break;
|
266 |
+
|
267 |
+
|
268 |
+
// context
|
269 |
+
// Allows disambiguations of different messages that have same msgid.
|
270 |
+
// Example:
|
271 |
+
//
|
272 |
+
// #: tools/observinglist.cpp:700
|
273 |
+
// msgctxt "First letter in 'Scope'"
|
274 |
+
// msgid "S"
|
275 |
+
// msgstr ""
|
276 |
+
//
|
277 |
+
// #: skycomponents/horizoncomponent.cpp:429
|
278 |
+
// msgctxt "South"
|
279 |
+
// msgid "S"
|
280 |
+
// msgstr ""
|
281 |
+
case 'msgctxt':
|
282 |
+
// untranslated-string
|
283 |
+
case 'msgid':
|
284 |
+
// untranslated-string-plural
|
285 |
+
case 'msgid_plural':
|
286 |
+
$state = $key;
|
287 |
+
$entry[$state][] = $data;
|
288 |
+
break;
|
289 |
+
// translated-string
|
290 |
+
case 'msgstr':
|
291 |
+
$state = 'msgstr';
|
292 |
+
$entry[$state][] = $data;
|
293 |
+
break;
|
294 |
+
|
295 |
+
default:
|
296 |
+
if (strpos($key, 'msgstr[') !== false) {
|
297 |
+
// translated-string-case-n
|
298 |
+
$state = $key;
|
299 |
+
$entry[$state][] = $data;
|
300 |
+
} else {
|
301 |
+
// "multiline" lines
|
302 |
+
switch ($state) {
|
303 |
+
case 'msgctxt':
|
304 |
+
case 'msgid':
|
305 |
+
case 'msgid_plural':
|
306 |
+
case (strpos($state, 'msgstr[') !== false):
|
307 |
+
if (is_string($entry[$state])) {
|
308 |
+
// Convert it to array
|
309 |
+
$entry[$state] = array($entry[$state]);
|
310 |
+
}
|
311 |
+
$entry[$state][] = $line;
|
312 |
+
break;
|
313 |
+
|
314 |
+
case 'msgstr':
|
315 |
+
// Special fix where msgid is ""
|
316 |
+
if ($entry['msgid'] === "\"\"") {
|
317 |
+
$entry['msgstr'][] = trim($line, '"');
|
318 |
+
} else {
|
319 |
+
$entry['msgstr'][] = $line;
|
320 |
+
}
|
321 |
+
break;
|
322 |
+
|
323 |
+
default:
|
324 |
+
throw new \Exception(
|
325 |
+
'PoParser: Parse error! Unknown key "'.$key.'" on line '.($lineNumber + 1)
|
326 |
+
);
|
327 |
+
}
|
328 |
+
}
|
329 |
+
break;
|
330 |
+
}
|
331 |
+
|
332 |
+
$lineNumber++;
|
333 |
+
}
|
334 |
+
$handle->close();
|
335 |
+
|
336 |
+
// add final entry
|
337 |
+
if ($state === 'msgstr') {
|
338 |
+
$hash[] = $entry;
|
339 |
+
}
|
340 |
+
|
341 |
+
// - Cleanup header data
|
342 |
+
$this->headers = array();
|
343 |
+
foreach ($headers as $header) {
|
344 |
+
$header = $this->clean($header);
|
345 |
+
$this->headers[] = "\"".preg_replace("/\\n/", '\n', $header)."\"";
|
346 |
+
}
|
347 |
+
|
348 |
+
// - Cleanup data,
|
349 |
+
// - merge multiline entries
|
350 |
+
// - Reindex hash for ksort
|
351 |
+
$temp = $hash;
|
352 |
+
$this->entries = array();
|
353 |
+
foreach ($temp as $entry) {
|
354 |
+
foreach ($entry as &$v) {
|
355 |
+
$or = $v;
|
356 |
+
$v = $this->clean($v);
|
357 |
+
if ($v === false) {
|
358 |
+
// parse error
|
359 |
+
throw new \Exception(
|
360 |
+
'PoParser: Parse error! poparser::clean returned false on "'.htmlspecialchars($or).'"'
|
361 |
+
);
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
// check if msgid and a key starting with msgstr exists
|
366 |
+
if (isset($entry['msgid']) && count(preg_grep('/^msgstr/', array_keys($entry)))) {
|
367 |
+
$id = $this->getEntryId($entry);
|
368 |
+
$this->entries[$id] = $entry;
|
369 |
+
}
|
370 |
+
}
|
371 |
+
|
372 |
+
return $this->entries;
|
373 |
+
}
|
374 |
+
|
375 |
+
/**
|
376 |
+
* Get headers from .po file
|
377 |
+
*
|
378 |
+
* @return array
|
379 |
+
*/
|
380 |
+
public function getHeaders()
|
381 |
+
{
|
382 |
+
return $this->headers;
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Set new headers
|
387 |
+
*
|
388 |
+
* {code}
|
389 |
+
* array(
|
390 |
+
* '"Project-Id-Version: \n"',
|
391 |
+
* '"Report-Msgid-Bugs-To: \n"',
|
392 |
+
* '"POT-Creation-Date: \n"',
|
393 |
+
* '"PO-Revision-Date: \n"',
|
394 |
+
* '"Last-Translator: none\n"',
|
395 |
+
* '"Language-Team: \n"',
|
396 |
+
* '"MIME-Version: 1.0\n"',
|
397 |
+
* '"Content-Type: text/plain; charset=UTF-8\n"',
|
398 |
+
* );
|
399 |
+
* {code}
|
400 |
+
*
|
401 |
+
* @param array $newHeaders
|
402 |
+
*
|
403 |
+
* @return bool
|
404 |
+
*/
|
405 |
+
public function setHeaders($newHeaders)
|
406 |
+
{
|
407 |
+
if (!is_array($newHeaders)) {
|
408 |
+
return false;
|
409 |
+
} else {
|
410 |
+
$this->headers = $newHeaders;
|
411 |
+
|
412 |
+
return true;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Updates an entry.
|
419 |
+
* If entry not found returns false. If $createNew is true, a new entry will be created.
|
420 |
+
* $entry is an array that can contain following indexes:
|
421 |
+
* - msgid: String Array. Required.
|
422 |
+
* - msgstr: String Array. Required.
|
423 |
+
* - reference: String Array.
|
424 |
+
* - msgctxt: String. Disambiguating context.
|
425 |
+
* - tcomment: String Array. Translator comments.
|
426 |
+
* - ccomment: String Array. Source comments.
|
427 |
+
* - msgid_plural: String Array.
|
428 |
+
* - flags: Array. List of entry flags. Example: array('fuzzy','php-format')
|
429 |
+
* - previous: Array: Contains previous untranslated strings in a sub array with msgid and msgstr.
|
430 |
+
*
|
431 |
+
* @param String $msgid Id of entry. Be aware that some entries have a multiline msgid. In that case \n must
|
432 |
+
* be replaced by the value of 'multiline-glue' option (by default "<##EOL##>").
|
433 |
+
* @param Array $entry Array with all entry data. Fields not setted will be removed.
|
434 |
+
* @param boolean $createNew If msgid not found, it will create a new entry. By default true. You want to set this
|
435 |
+
* to false if need to change the msgid of an entry.
|
436 |
+
*/
|
437 |
+
public function setEntry($msgid, $entry, $createNew = true)
|
438 |
+
{
|
439 |
+
// In case of new entry
|
440 |
+
if (!isset($this->entries[$msgid])) {
|
441 |
+
|
442 |
+
if ($createNew == false) {
|
443 |
+
return;
|
444 |
+
}
|
445 |
+
|
446 |
+
$this->entries[$msgid] = $entry;
|
447 |
+
} else {
|
448 |
+
// Be able to change msgid.
|
449 |
+
if ($msgid !== $entry['msgid']) {
|
450 |
+
unset($this->entries[$msgid]);
|
451 |
+
$new_msgid = is_array($entry['msgid']) ? implode(
|
452 |
+
$this->options['multiline-glue'],
|
453 |
+
$entry['msgid']
|
454 |
+
) : $entry['msgid'];
|
455 |
+
$this->entries[$new_msgid] = $entry;
|
456 |
+
} else {
|
457 |
+
$this->entries[$msgid] = $entry;
|
458 |
+
}
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
|
463 |
+
public function setEntryPlural($msgid, $plural = false)
|
464 |
+
{
|
465 |
+
if ($plural) {
|
466 |
+
$this->entries[$msgid]['msgid_plural'] = $plural;
|
467 |
+
} else {
|
468 |
+
unset($this->entries[$msgid]['msgid_plural']);
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
public function setEntryContext($msgid, $context = false)
|
473 |
+
{
|
474 |
+
if ($context) {
|
475 |
+
$this->entries[$msgid]['msgctxt'][0] = $context;
|
476 |
+
} else {
|
477 |
+
unset($this->entries[$msgid]['msgctxt']);
|
478 |
+
}
|
479 |
+
}
|
480 |
+
|
481 |
+
|
482 |
+
/**
|
483 |
+
* Gets entries.
|
484 |
+
*/
|
485 |
+
public function entries()
|
486 |
+
{
|
487 |
+
return $this->entries;
|
488 |
+
}
|
489 |
+
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Writes entries to a po file
|
493 |
+
*
|
494 |
+
* @example
|
495 |
+
* $pofile = new PoParser();
|
496 |
+
* $pofile->parse('ca.po');
|
497 |
+
*
|
498 |
+
* // Modify an antry
|
499 |
+
* $pofile->setEntry( $msgid, $msgstr );
|
500 |
+
* // Save Changes back into `ca.po`
|
501 |
+
* $pofile->writeFile('ca.po');
|
502 |
+
*
|
503 |
+
* @param string $filepath
|
504 |
+
*
|
505 |
+
* @throws \Exception
|
506 |
+
* @return boolean
|
507 |
+
*/
|
508 |
+
public function writeFile($filepath)
|
509 |
+
{
|
510 |
+
$output = $this->compile();
|
511 |
+
$result = file_put_contents($filepath, $output);
|
512 |
+
if ($result === false) {
|
513 |
+
throw new \Exception('Could not write into file '.htmlspecialchars($filepath));
|
514 |
+
}
|
515 |
+
|
516 |
+
return true;
|
517 |
+
}
|
518 |
+
|
519 |
+
|
520 |
+
/**
|
521 |
+
* Compiles entries into a string
|
522 |
+
*
|
523 |
+
* @throws \Exception
|
524 |
+
* @return string
|
525 |
+
*/
|
526 |
+
public function compile()
|
527 |
+
{
|
528 |
+
$output = '';
|
529 |
+
|
530 |
+
if (count($this->headers) > 0) {
|
531 |
+
$output .= "msgid \"\"".$this->eol();
|
532 |
+
$output .= "msgstr \"\"".$this->eol();
|
533 |
+
foreach ($this->headers as $header) {
|
534 |
+
$output .= $header.$this->eol();
|
535 |
+
}
|
536 |
+
$output .= $this->eol();
|
537 |
+
}
|
538 |
+
|
539 |
+
|
540 |
+
$entriesCount = count($this->entries);
|
541 |
+
$counter = 0;
|
542 |
+
foreach ($this->entries as $entry) {
|
543 |
+
$isObsolete = isset($entry['obsolete']) && $entry['obsolete'];
|
544 |
+
$isPlural = isset($entry['msgid_plural']);
|
545 |
+
|
546 |
+
if (isset($entry['previous'])) {
|
547 |
+
foreach ($entry['previous'] as $key => $data) {
|
548 |
+
|
549 |
+
if (is_string($data)) {
|
550 |
+
$output .= "#| ".$key." ".$this->cleanExport($data).$this->eol();
|
551 |
+
} elseif (is_array($data) && count($data) > 0) {
|
552 |
+
foreach ($data as $line) {
|
553 |
+
$output .= "#| ".$key." ".$this->cleanExport($line).$this->eol();
|
554 |
+
}
|
555 |
+
}
|
556 |
+
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
if (isset($entry['tcomment'])) {
|
561 |
+
foreach ($entry['tcomment'] as $comment) {
|
562 |
+
$output .= "# ".$comment.$this->eol();
|
563 |
+
}
|
564 |
+
}
|
565 |
+
|
566 |
+
if (isset($entry['ccomment'])) {
|
567 |
+
foreach ($entry['ccomment'] as $comment) {
|
568 |
+
$output .= '#. '.$comment.$this->eol();
|
569 |
+
}
|
570 |
+
}
|
571 |
+
|
572 |
+
if (isset($entry['reference'])) {
|
573 |
+
foreach ($entry['reference'] as $ref) {
|
574 |
+
$output .= '#: '.$ref.$this->eol();
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
if (isset($entry['flags']) && !empty($entry['flags'])) {
|
579 |
+
$output .= "#, ".implode(', ', $entry['flags']).$this->eol();
|
580 |
+
}
|
581 |
+
|
582 |
+
if (isset($entry['@'])) {
|
583 |
+
$output .= "#@ ".$entry['@'].$this->eol();
|
584 |
+
}
|
585 |
+
|
586 |
+
if (isset($entry['msgctxt'])) {
|
587 |
+
$output .= 'msgctxt '.$this->cleanExport($entry['msgctxt'][0]).$this->eol();
|
588 |
+
}
|
589 |
+
|
590 |
+
|
591 |
+
if ($isObsolete) {
|
592 |
+
$output .= "#~ ";
|
593 |
+
}
|
594 |
+
|
595 |
+
if (isset($entry['msgid'])) {
|
596 |
+
// Special clean for msgid
|
597 |
+
if (is_string($entry['msgid'])) {
|
598 |
+
$msgid = explode($this->eol(), $entry['msgid']);
|
599 |
+
} elseif (is_array($entry['msgid'])) {
|
600 |
+
$msgid = $entry['msgid'];
|
601 |
+
} else {
|
602 |
+
throw new \Exception('msgid not string or array');
|
603 |
+
}
|
604 |
+
|
605 |
+
$output .= 'msgid ';
|
606 |
+
foreach ($msgid as $i => $id) {
|
607 |
+
if ($i > 0 && $isObsolete) {
|
608 |
+
$output .= "#~ ";
|
609 |
+
}
|
610 |
+
$output .= $this->cleanExport($id).$this->eol();
|
611 |
+
}
|
612 |
+
}
|
613 |
+
|
614 |
+
if (isset($entry['msgid_plural'])) {
|
615 |
+
// Special clean for msgid_plural
|
616 |
+
if (is_string($entry['msgid_plural'])) {
|
617 |
+
$msgidPlural = explode($this->eol(), $entry['msgid_plural']);
|
618 |
+
} elseif (is_array($entry['msgid_plural'])) {
|
619 |
+
$msgidPlural = $entry['msgid_plural'];
|
620 |
+
} else {
|
621 |
+
throw new \Exception('msgid_plural not string or array');
|
622 |
+
}
|
623 |
+
|
624 |
+
$output .= 'msgid_plural ';
|
625 |
+
foreach ($msgidPlural as $plural) {
|
626 |
+
$output .= $this->cleanExport($plural).$this->eol();
|
627 |
+
}
|
628 |
+
}
|
629 |
+
|
630 |
+
if (count(preg_grep('/^msgstr/', array_keys($entry)))) { // checks if there is a key starting with msgstr
|
631 |
+
if ($isPlural) {
|
632 |
+
$noTranslation = true;
|
633 |
+
foreach ($entry as $key => $value) {
|
634 |
+
if (strpos($key, 'msgstr[') === false) {
|
635 |
+
continue;
|
636 |
+
}
|
637 |
+
$output .= $key." ";
|
638 |
+
$noTranslation = false;
|
639 |
+
foreach ($value as $i => $t) {
|
640 |
+
$output .= $this->cleanExport($t).$this->eol();
|
641 |
+
}
|
642 |
+
}
|
643 |
+
if ($noTranslation) {
|
644 |
+
$output .= 'msgstr[0] '.$this->cleanExport('').$this->eol();
|
645 |
+
$output .= 'msgstr[1] '.$this->cleanExport('').$this->eol();
|
646 |
+
}
|
647 |
+
} else {
|
648 |
+
foreach ((array)$entry['msgstr'] as $i => $t) {
|
649 |
+
if ($i == 0) {
|
650 |
+
if ($isObsolete) {
|
651 |
+
$output .= "#~ ";
|
652 |
+
}
|
653 |
+
|
654 |
+
$output .= 'msgstr '.$this->cleanExport($t).$this->eol();
|
655 |
+
} else {
|
656 |
+
if ($isObsolete) {
|
657 |
+
$output .= "#~ ";
|
658 |
+
}
|
659 |
+
|
660 |
+
$output .= $this->cleanExport($t).$this->eol();
|
661 |
+
}
|
662 |
+
}
|
663 |
+
}
|
664 |
+
}
|
665 |
+
|
666 |
+
$counter++;
|
667 |
+
// Avoid inserting an extra newline at end of file
|
668 |
+
if ($counter < $entriesCount) {
|
669 |
+
$output .= $this->eol();
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
return $output;
|
674 |
+
}
|
675 |
+
|
676 |
+
/**
|
677 |
+
* Returns configured line ending (option 'line-ending' ['win', 'unix'])
|
678 |
+
*
|
679 |
+
* @return string
|
680 |
+
*/
|
681 |
+
protected function eol()
|
682 |
+
{
|
683 |
+
return $this->lineEndings[$this->options['line-ending']] ?: "\n";
|
684 |
+
}
|
685 |
+
|
686 |
+
/**
|
687 |
+
* Prepares a string to be outputed into a file.
|
688 |
+
*
|
689 |
+
* @param string $string The string to be converted.
|
690 |
+
*
|
691 |
+
* @return string
|
692 |
+
*/
|
693 |
+
protected function cleanExport($string)
|
694 |
+
{
|
695 |
+
$quote = '"';
|
696 |
+
$slash = '\\';
|
697 |
+
$newline = "\n";
|
698 |
+
|
699 |
+
$replaces = array(
|
700 |
+
"$slash" => "$slash$slash",
|
701 |
+
"$quote" => "$slash$quote",
|
702 |
+
"\t" => '\t',
|
703 |
+
);
|
704 |
+
|
705 |
+
$string = str_replace(array_keys($replaces), array_values($replaces), $string);
|
706 |
+
|
707 |
+
$po = $quote.implode("${slash}n$quote$newline$quote", explode($newline, $string)).$quote;
|
708 |
+
|
709 |
+
// remove empty strings
|
710 |
+
return str_replace("$newline$quote$quote", '', $po);
|
711 |
+
}
|
712 |
+
|
713 |
+
|
714 |
+
/**
|
715 |
+
* Generates the internal key for a msgid.
|
716 |
+
*
|
717 |
+
* @param array $entry
|
718 |
+
*
|
719 |
+
* @return string
|
720 |
+
*/
|
721 |
+
protected function getEntryId(array $entry)
|
722 |
+
{
|
723 |
+
if (isset($entry['msgctxt'])) {
|
724 |
+
$id = implode(
|
725 |
+
$this->options['multiline-glue'],
|
726 |
+
(array)$entry['msgctxt']
|
727 |
+
).$this->options['context-glue'].implode($this->options['multiline-glue'], (array)$entry['msgid']);
|
728 |
+
} else {
|
729 |
+
$id = implode($this->options['multiline-glue'], (array)$entry['msgid']);
|
730 |
+
}
|
731 |
+
|
732 |
+
return $id;
|
733 |
+
}
|
734 |
+
|
735 |
+
|
736 |
+
/**
|
737 |
+
* Undos `cleanExport` actions on a string.
|
738 |
+
*
|
739 |
+
* @param string|array $x
|
740 |
+
*
|
741 |
+
* @return string|array.
|
742 |
+
*/
|
743 |
+
protected function clean($x)
|
744 |
+
{
|
745 |
+
if (is_array($x)) {
|
746 |
+
foreach ($x as $k => $v) {
|
747 |
+
$x[$k] = $this->clean($v);
|
748 |
+
}
|
749 |
+
} else {
|
750 |
+
// Remove double quotes from start and end of string
|
751 |
+
if ($x == '') {
|
752 |
+
return '';
|
753 |
+
}
|
754 |
+
|
755 |
+
if ($x[0] == '"') {
|
756 |
+
$x = substr($x, 1, -1);
|
757 |
+
}
|
758 |
+
|
759 |
+
// Escapes C-style escape sequences (\a,\b,\f,\n,\r,\t,\v) and converts them to their actual meaning
|
760 |
+
$x = stripcslashes($x);
|
761 |
+
|
762 |
+
}
|
763 |
+
|
764 |
+
return $x;
|
765 |
+
}
|
766 |
+
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Checks if entry is a header by
|
770 |
+
*
|
771 |
+
* @param array $entry
|
772 |
+
*
|
773 |
+
* @return bool
|
774 |
+
*/
|
775 |
+
protected static function isHeader(array $entry)
|
776 |
+
{
|
777 |
+
if (empty($entry) || !isset($entry['msgstr'])) {
|
778 |
+
return false;
|
779 |
+
}
|
780 |
+
|
781 |
+
$headerKeys = array(
|
782 |
+
'Project-Id-Version:' => false,
|
783 |
+
// 'Report-Msgid-Bugs-To:' => false,
|
784 |
+
// 'POT-Creation-Date:' => false,
|
785 |
+
'PO-Revision-Date:' => false,
|
786 |
+
// 'Last-Translator:' => false,
|
787 |
+
// 'Language-Team:' => false,
|
788 |
+
'MIME-Version:' => false,
|
789 |
+
// 'Content-Type:' => false,
|
790 |
+
// 'Content-Transfer-Encoding:' => false,
|
791 |
+
// 'Plural-Forms:' => false
|
792 |
+
);
|
793 |
+
$count = count($headerKeys);
|
794 |
+
$keys = array_keys($headerKeys);
|
795 |
+
|
796 |
+
$headerItems = 0;
|
797 |
+
foreach ($entry['msgstr'] as $str) {
|
798 |
+
$tokens = explode(':', $str);
|
799 |
+
$tokens[0] = trim($tokens[0], "\"").':';
|
800 |
+
|
801 |
+
if (in_array($tokens[0], $keys)) {
|
802 |
+
$headerItems++;
|
803 |
+
unset($headerKeys[$tokens[0]]);
|
804 |
+
$keys = array_keys($headerKeys);
|
805 |
+
}
|
806 |
+
}
|
807 |
+
|
808 |
+
return ($headerItems == $count) ? true : false;
|
809 |
+
}
|
810 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/src/Sepia/StringHandler.php
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sepia;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Copyright (c) 2012 Raúl Ferràs raul.ferras@gmail.com
|
7 |
+
* All rights reserved.
|
8 |
+
*
|
9 |
+
* Redistribution and use in source and binary forms, with or without
|
10 |
+
* modification, are permitted provided that the following conditions
|
11 |
+
* are met:
|
12 |
+
* 1. Redistributions of source code must retain the above copyright
|
13 |
+
* notice, this list of conditions and the following disclaimer.
|
14 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
15 |
+
* notice, this list of conditions and the following disclaimer in the
|
16 |
+
* documentation and/or other materials provided with the distribution.
|
17 |
+
* 3. Neither the name of copyright holders nor the names of its
|
18 |
+
* contributors may be used to endorse or promote products derived
|
19 |
+
* from this software without specific prior written permission.
|
20 |
+
*
|
21 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22 |
+
* ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
23 |
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
24 |
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
|
25 |
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26 |
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 |
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 |
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 |
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 |
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 |
+
* POSSIBILITY OF SUCH DAMAGE.
|
32 |
+
*
|
33 |
+
* https://github.com/raulferras/PHP-po-parser
|
34 |
+
*/
|
35 |
+
class StringHandler implements InterfaceHandler
|
36 |
+
{
|
37 |
+
protected $strings;
|
38 |
+
protected $line;
|
39 |
+
protected $total;
|
40 |
+
|
41 |
+
public function __construct( $string )
|
42 |
+
{
|
43 |
+
$this->line = 0;
|
44 |
+
$this->strings = explode("\n",$string);
|
45 |
+
$this->total = count($this->strings);
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getNextLine()
|
49 |
+
{
|
50 |
+
if (isset($this->strings[$this->line])) {
|
51 |
+
$result = $this->strings[$this->line];
|
52 |
+
$this->line++;
|
53 |
+
} else {
|
54 |
+
$result = false;
|
55 |
+
}
|
56 |
+
return $result;
|
57 |
+
}
|
58 |
+
|
59 |
+
public function ended()
|
60 |
+
{
|
61 |
+
return ($this->line>=$this->total);
|
62 |
+
}
|
63 |
+
|
64 |
+
public function close()
|
65 |
+
{
|
66 |
+
$this->line = 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function save($ignore)
|
70 |
+
{
|
71 |
+
|
72 |
+
}
|
73 |
+
}
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/context.po
ADDED
@@ -0,0 +1,59 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
|
19 |
+
#: wp-admin/custom-background.php:305
|
20 |
+
msgctxt "Background Attachment"
|
21 |
+
msgid "Attachment"
|
22 |
+
msgstr "Adjunto"
|
23 |
+
|
24 |
+
#: wp-admin/includes/schema.php:369
|
25 |
+
msgctxt "start of week"
|
26 |
+
msgid "1"
|
27 |
+
msgstr "1"
|
28 |
+
|
29 |
+
#: wp-admin/includes/screen.php:956
|
30 |
+
msgctxt "Welcome panel"
|
31 |
+
msgid "Welcome"
|
32 |
+
msgstr "Hola"
|
33 |
+
|
34 |
+
#: wp-admin/includes/schema.php:355
|
35 |
+
msgctxt "default GMT offset or timezone string"
|
36 |
+
msgid "0"
|
37 |
+
msgstr "0"
|
38 |
+
|
39 |
+
#: wp-admin/includes/template.php:662
|
40 |
+
#, fuzzy
|
41 |
+
msgid "%1$s-%2$s"
|
42 |
+
msgstr "%1$s-%2$s"
|
43 |
+
|
44 |
+
#: wp-admin/custom-header.php:506
|
45 |
+
msgid "Images should be at least <strong>%1$d pixels</strong> wide."
|
46 |
+
msgstr "Las imágenes deben ser de al menos <strong>%1$d pixels</strong> de ancho."
|
47 |
+
|
48 |
+
#: wp-admin/custom-header.php:515
|
49 |
+
msgid "Suggested height is <strong>%1$d pixels</strong>."
|
50 |
+
msgstr "La altura sugerida es de <strong>%1$d pixels</strong>."
|
51 |
+
|
52 |
+
#: wp-admin/custom-header.php:509
|
53 |
+
msgid "Images should be at least <strong>%1$d pixels</strong> tall."
|
54 |
+
msgstr "Las imágenes deben ser de al menos <strong>%1$d pixels</strong> de altura."
|
55 |
+
|
56 |
+
#: wp-admin/install.php:177
|
57 |
+
msgctxt "Howdy"
|
58 |
+
msgid "Welcome"
|
59 |
+
msgstr "Hola"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/flags-phpformat-fuzzy.po
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
|
19 |
+
#: wp-admin/custom-background.php:305
|
20 |
+
#, php-format, fuzzy
|
21 |
+
msgctxt "Background Attachment"
|
22 |
+
msgid "Attachment"
|
23 |
+
msgstr "Adjunto"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/flags-phpformat.po
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
|
19 |
+
#: wp-admin/custom-background.php:305
|
20 |
+
#, php-format
|
21 |
+
msgctxt "Background Attachment"
|
22 |
+
msgid "Attachment"
|
23 |
+
msgstr "Adjunto"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/healthy.po
ADDED
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
"X-Poedit-SearchPath-1: ../..\n"
|
20 |
+
"X-Poedit-SearchPath-2: ../../../modules\n"
|
21 |
+
|
22 |
+
#: ../../classes/dddddd.php:33
|
23 |
+
msgid "Lo sentimos, ha ocurrido un error..."
|
24 |
+
msgstr "Ho sentim, s'ha produït un error"
|
25 |
+
|
26 |
+
#: ../../classes/xxxxx.php:96 ../../classes/controller/iiiiiii.php:107
|
27 |
+
#: ../../classes/controller/yyyyyyy/zzzzzz.php:288
|
28 |
+
msgid "Debes indicar un nombre."
|
29 |
+
msgstr "Has d'indicar un nom."
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/multiflags.po
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
|
19 |
+
#: wp-admin/custom-background.php:305
|
20 |
+
#, php-format, fuzzy
|
21 |
+
msgctxt "Background Attachment"
|
22 |
+
msgid "Attachment"
|
23 |
+
msgstr "Adjunto"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/multilines.po
ADDED
@@ -0,0 +1,78 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2013-09-25 15:55+0100\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n;_t\n"
|
15 |
+
"X-Textdomain-Support: yes\n"
|
16 |
+
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.5.7\n"
|
18 |
+
"X-Poedit-SearchPath-0: .\n"
|
19 |
+
"X-Poedit-SearchPath-1: ../..\n"
|
20 |
+
"X-Poedit-SearchPath-2: ../../../modules\n"
|
21 |
+
|
22 |
+
# @ default
|
23 |
+
#: ../../classes/dddddd.php:33
|
24 |
+
msgid "Lo sentimos, ha ocurrido un error..."
|
25 |
+
msgstr "Ho sentim, s'ha produït un error"
|
26 |
+
|
27 |
+
#: ../../classes/xxxxx.php:96 ../../classes/controller/iiiiiii.php:107
|
28 |
+
#: ../../classes/controller/yyyyyyy/zzzzzz.php:288
|
29 |
+
msgid "Debes indicar un nombre."
|
30 |
+
msgstr "Has d'indicar un nom."
|
31 |
+
|
32 |
+
#: ../../classes/ccccc.php:100 ../../classes/cccc.php:104
|
33 |
+
#: ../../classes/controller/cccc/mmmmm.php:295
|
34 |
+
#: ../../classes/controller/cccc/mmmmm.php:513
|
35 |
+
msgid "Ya existe otro usuario con este mismo nombre."
|
36 |
+
msgstr "Ja existeix un altre usuari amb aquest nom."
|
37 |
+
|
38 |
+
#: ../../classes/ccccc.php:108 ../../classes/controller/cccc/mmmmm.php:305
|
39 |
+
#: ../../classes/controller/ccccc/mmmmm.php:518
|
40 |
+
msgid "Debes indicar una dirección web!"
|
41 |
+
msgstr "Has d'indicar una direcció web!"
|
42 |
+
|
43 |
+
# @ default
|
44 |
+
#: ../../classes/uuuuuuu.php:175
|
45 |
+
#, fuzzy
|
46 |
+
msgid "El archivo supera el tamaño máximo permitido: %size%MB"
|
47 |
+
msgstr ""
|
48 |
+
"El fitxer {file} es massa gran, el tamany máxim de fitxer es {sizeLimit}."
|
49 |
+
|
50 |
+
#: ../../classes/controller/ccccc.php:361
|
51 |
+
msgid ""
|
52 |
+
"%user% acaba de responder tu comentario.<br>Consulta que te ha "
|
53 |
+
"dicho %link%aquÃ</a>."
|
54 |
+
msgstr ""
|
55 |
+
"%user% acaba de respondre el teu comentari.<br>Consulta que t'ha "
|
56 |
+
"dit %link%aquÃ</a>."
|
57 |
+
|
58 |
+
#: ../../classes/controller/eeee.php:786
|
59 |
+
msgid ""
|
60 |
+
"Atención, para finalizar el proceso debes iniciar sesión con tu usuario "
|
61 |
+
".<br/>No sufras, hemos guardado los datos introducidos, una vez "
|
62 |
+
"te autentifiques te redirigiremos al paso final."
|
63 |
+
msgstr ""
|
64 |
+
"Atenció, per finalitzar el procés has de iniciar sessió amb el teu usuari "
|
65 |
+
".<br/>No pateixis, hem desat les teves dades, un cop "
|
66 |
+
"t'autentifiquis finalitzarem el procés."
|
67 |
+
|
68 |
+
# @ default
|
69 |
+
#~ msgid "Arrastra imagenes aquà para subirlas."
|
70 |
+
#~ msgstr "Arrossega les teves imatges aquà per pujarles."
|
71 |
+
|
72 |
+
# @ default
|
73 |
+
#~ msgid ""
|
74 |
+
#~ "El archivo {file} es demasiado pequeño, el tamaño mÃnimo de archivo es "
|
75 |
+
#~ "{minSizeLimit}."
|
76 |
+
#~ msgstr ""
|
77 |
+
#~ "El fitxer {file} es massa petit, el tamany mÃnim de fitxer es "
|
78 |
+
#~ "{minSizeLimit}."
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/noblankline.po
ADDED
@@ -0,0 +1,4 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid "one"
|
2 |
+
msgstr "uno"
|
3 |
+
msgid "two"
|
4 |
+
msgstr "dos"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/noheader.po
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
#: tmp/cache/00/78/1d67cd3f64c5469c21cb05e6fd0a.php:32
|
2 |
+
#: tmp/cache/07/0a/9136032d279c7c9bb536e108fced.php:58
|
3 |
+
#: tmp/cache/0b/da/a019bff51aa8a932ec179398dc43.php:65
|
4 |
+
#: tmp/cache/18/41/43e62ed075451a77574351278bf2.php:58
|
5 |
+
#: tmp/cache/1d/81/2af439d1ee9aac469ff66b2173d0.php:58
|
6 |
+
#: tmp/cache/32/46/d22400dcca2bfe7f4e4afd39fd01.php:65
|
7 |
+
#: tmp/cache/32/da/138149be12bf58b7fa8b621abcf4.php:35
|
8 |
+
#: tmp/cache/35/77/88dcd5f3a90a7842ea85959569c9.php:58
|
9 |
+
#: tmp/cache/69/1c/68c94bb5f661f65ef796afc069a9.php:58
|
10 |
+
#: tmp/cache/95/14/b34e21f518a52d77109ed535cb5f.php:59
|
11 |
+
#: tmp/cache/9e/6d/48f3a91d014c76613583be955d63.php:58
|
12 |
+
#: tmp/cache/ac/e0/356f9dc6499cc1b18453093a79f3.php:58
|
13 |
+
#: tmp/cache/b1/10/16e1bfb77387f1ca7d0ff4c67a64.php:57
|
14 |
+
#: tmp/cache/fe/91/b339a580bcf69b609d15988a1b42.php:58
|
15 |
+
msgid "Membership"
|
16 |
+
msgstr ""
|
17 |
+
|
18 |
+
#: tmp/cache/00/78/1d67cd3f64c5469c21cb05e6fd0a.php:45
|
19 |
+
#: tmp/cache/18/05/1489b493d73a1596584807221eb9.php:40
|
20 |
+
#: tmp/cache/27/73/8503d0d9f20aabc08a6372c67dba.php:49
|
21 |
+
#: tmp/cache/7a/e7/9b68911bacf2b1ef75790f07bff8.php:23
|
22 |
+
msgid "New membership type"
|
23 |
+
msgstr ""
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/plurals.po
ADDED
@@ -0,0 +1,90 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
# Translation of Administration in Spanish (Spain)
|
2 |
+
# This file is distributed under the same license as the Administration package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"PO-Revision-Date: 2013-10-23 09:51:48+0000\n"
|
6 |
+
"MIME-Version: 1.0\n"
|
7 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
+
"Content-Transfer-Encoding: 8bit\n"
|
9 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
10 |
+
"X-Generator: GlotPress/0.1\n"
|
11 |
+
"Project-Id-Version: Administration\n"
|
12 |
+
|
13 |
+
|
14 |
+
#: wp-admin/edit.php:238
|
15 |
+
msgid "%s post not updated, somebody is editing it."
|
16 |
+
msgid_plural "%s posts not updated, somebody is editing them."
|
17 |
+
msgstr[0] "%s entrada no actualizada, alguien la está editando."
|
18 |
+
msgstr[1] "%s entradas no actualizadas, alguien las está editando."
|
19 |
+
|
20 |
+
#: wp-admin/edit.php:239
|
21 |
+
msgid "%s post permanently deleted."
|
22 |
+
msgid_plural "%s posts permanently deleted."
|
23 |
+
msgstr[0] "%s entrada borrada permanentemente."
|
24 |
+
msgstr[1] "%s entradas borradas permanentemente."
|
25 |
+
|
26 |
+
#: wp-admin/edit.php:240
|
27 |
+
msgid "%s post moved to the Trash."
|
28 |
+
msgid_plural "%s posts moved to the Trash."
|
29 |
+
msgstr[0] "%s entrada movida a la Papelera."
|
30 |
+
msgstr[1] "%s entradas movidas a la Papelera."
|
31 |
+
|
32 |
+
#: wp-admin/edit.php:241
|
33 |
+
msgid "%s post restored from the Trash."
|
34 |
+
msgid_plural "%s posts restored from the Trash."
|
35 |
+
msgstr[0] "%s entrada restaurada desde la Papelera."
|
36 |
+
msgstr[1] "%s entradas restauradas desde la Papelera."
|
37 |
+
|
38 |
+
#: wp-admin/edit.php:244
|
39 |
+
msgid "%s page updated."
|
40 |
+
msgid_plural "%s pages updated."
|
41 |
+
msgstr[0] "%s página actualizada."
|
42 |
+
msgstr[1] "%s páginas actualizadas."
|
43 |
+
|
44 |
+
#: wp-admin/edit.php:245
|
45 |
+
msgid "%s page not updated, somebody is editing it."
|
46 |
+
msgid_plural "%s pages not updated, somebody is editing them."
|
47 |
+
msgstr[0] "%s página no actualizada, alguien la está editando."
|
48 |
+
msgstr[1] "%s páginas no actualizadas, alguien las está editando."
|
49 |
+
|
50 |
+
#: wp-admin/edit.php:246
|
51 |
+
msgid "%s page permanently deleted."
|
52 |
+
msgid_plural "%s pages permanently deleted."
|
53 |
+
msgstr[0] "%s página borrada permanentemente."
|
54 |
+
msgstr[1] "%s páginas borradas permanentemente."
|
55 |
+
|
56 |
+
#: wp-admin/edit.php:247
|
57 |
+
msgid "%s page moved to the Trash."
|
58 |
+
msgid_plural "%s pages moved to the Trash."
|
59 |
+
msgstr[0] "%s página movida a la Papelera."
|
60 |
+
msgstr[1] "%s páginas movidas a la Papelera."
|
61 |
+
|
62 |
+
#: wp-admin/edit.php:248
|
63 |
+
msgid "%s page restored from the Trash."
|
64 |
+
msgid_plural "%s pages restored from the Trash."
|
65 |
+
msgstr[0] "%s página restaurada desde la Papelera."
|
66 |
+
msgstr[1] "%s páginas restauradas desde la Papelera."
|
67 |
+
|
68 |
+
#: wp-admin/revision.php:107
|
69 |
+
msgid "Compare two different revisions by <strong>selecting the “Compare any two revisions” box</strong> to the side."
|
70 |
+
msgstr "Compara dos revisiones <strong>seleccionando “Compara dos revisiones cualquiera”</strong> en el lateral."
|
71 |
+
|
72 |
+
#: wp-admin/includes/template.php:1891
|
73 |
+
msgid "Compare Revisions"
|
74 |
+
msgstr "Comparar revisiones"
|
75 |
+
|
76 |
+
#: wp-admin/includes/class-wp-ms-themes-list-table.php:207
|
77 |
+
msgid "Broken <span class=\"count\">(%s)</span>"
|
78 |
+
msgid_plural "Broken <span class=\"count\">(%s)</span>"
|
79 |
+
msgstr[0] "Roto <span class=\"count\">(%s)</span>"
|
80 |
+
msgstr[1] "Rotos <span class=\"count\">(%s)</span>"
|
81 |
+
|
82 |
+
#: wp-admin/includes/theme.php:169
|
83 |
+
msgid "Light"
|
84 |
+
msgstr "Ligero"
|
85 |
+
|
86 |
+
msgid "http://akismet.com/?return=true"
|
87 |
+
msgstr "http://akismet.com/?return=true"
|
88 |
+
|
89 |
+
msgid "Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the \"Activate\" link to the left of this description, 2) <a href=\"http://akismet.com/get/?return=true\">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key."
|
90 |
+
msgstr "Utilizado por millones de usuarios, Akismet es probablemente el mejor modo que hay en el mundo para <strong>proteger tu sitio de spam en comentarios y trackbacks</strong>. Mantiene tu sitio protegido de spam incluso mientras duermes. Para empezar: 1) Haz clic en el enlace \"Activar\" a la izquierda de la descripción, 2) <a href=\"http://akismet.com/get/?return=true\">RegÃstrate para obtener una clave API de Akismet</a>, y 3) Ve a tu página de <a href=\"admin.php?page=akismet-key-config\">configuración de Akismet</a> y guarda tu clave API."
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/pluralsMultiline.po
ADDED
@@ -0,0 +1,33 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
# Translation of Administration in Spanish (Spain)
|
2 |
+
# This file is distributed under the same license as the Administration package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"PO-Revision-Date: 2013-10-23 09:51:48+0000\n"
|
6 |
+
"MIME-Version: 1.0\n"
|
7 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
8 |
+
"Content-Transfer-Encoding: 8bit\n"
|
9 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
10 |
+
"X-Generator: GlotPress/0.1\n"
|
11 |
+
"Project-Id-Version: Administration\n"
|
12 |
+
|
13 |
+
|
14 |
+
#: wp-admin/edit.php:238
|
15 |
+
msgid "%s post not updated,"
|
16 |
+
"somebody is editing it."
|
17 |
+
msgid_plural "%s posts not updated,"
|
18 |
+
"somebody is editing them."
|
19 |
+
msgstr[0] "%s entrada no actualizada,"
|
20 |
+
"alguien la está editando."
|
21 |
+
msgstr[1] "%s entradas no actualizadas,"
|
22 |
+
"alguien las está editando."
|
23 |
+
|
24 |
+
#: wp-admin/edit.php:239
|
25 |
+
msgid ""
|
26 |
+
"%s post permanently deleted."
|
27 |
+
msgid_plural "%s posts permanently deleted."
|
28 |
+
msgstr[0] ""
|
29 |
+
"%s entrada borrada"
|
30 |
+
"permanentemente."
|
31 |
+
msgstr[1] ""
|
32 |
+
"%s entradas borradas"
|
33 |
+
"permanentemente."
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/pofiles/previous_unstranslated.po
ADDED
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: volga-volga.local\n"
|
4 |
+
"Report-Msgid-Bugs-To: pm@101media.ru\n"
|
5 |
+
"POT-Creation-Date: 2014-07-08 07:51+0400\n"
|
6 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
7 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
12 |
+
|
13 |
+
#| msgid "this is a previous string"
|
14 |
+
#| msgstr "this is a previous translation string"
|
15 |
+
msgid "this is a string"
|
16 |
+
msgstr "this is a translation"
|
vendor/siteground/siteground-i18n/vendor/sepia/po-parser/tests/poparserTest.php
ADDED
@@ -0,0 +1,348 @@
|
|
Â
|
|
Â
|
|
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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sepia;
|
4 |
+
|
5 |
+
class PoParserTest extends \PHPUnit_Framework_TestCase
|
6 |
+
{
|
7 |
+
|
8 |
+
public function tearDown() {
|
9 |
+
parent::tearDown();
|
10 |
+
|
11 |
+
if (file_exists(__DIR__ . '/pofiles/temp.po')) {
|
12 |
+
unlink(__DIR__ . '/pofiles/temp.po');
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
public function testRead()
|
17 |
+
{
|
18 |
+
try {
|
19 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/healthy.po');
|
20 |
+
$result = $parser->getEntries();
|
21 |
+
} catch (\Exception $e) {
|
22 |
+
$result = array();
|
23 |
+
$this->fail($e->getMessage());
|
24 |
+
}
|
25 |
+
|
26 |
+
$this->assertCount(2, $result);
|
27 |
+
|
28 |
+
|
29 |
+
// Read file without headers.
|
30 |
+
// It should not skip first entry
|
31 |
+
try {
|
32 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/noheader.po');
|
33 |
+
$result = $parser->getEntries();
|
34 |
+
} catch (\Exception $e) {
|
35 |
+
$result = array();
|
36 |
+
$this->fail($e->getMessage());
|
37 |
+
}
|
38 |
+
|
39 |
+
$this->assertCount(2, $result, 'Did not read properly po file without headers.');
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Tests reading the headers.
|
45 |
+
*
|
46 |
+
*/
|
47 |
+
public function testHeaders()
|
48 |
+
{
|
49 |
+
try {
|
50 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/healthy.po');
|
51 |
+
$headers = $parser->getHeaders();
|
52 |
+
|
53 |
+
$this->assertCount(18, $headers);
|
54 |
+
$this->assertEquals("\"Project-Id-Version: \\n\"", $headers[0]);
|
55 |
+
$this->assertEquals("\"Report-Msgid-Bugs-To: \\n\"", $headers[1]);
|
56 |
+
$this->assertEquals("\"POT-Creation-Date: 2013-09-25 15:55+0100\\n\"", $headers[2]);
|
57 |
+
$this->assertEquals("\"PO-Revision-Date: \\n\"", $headers[3]);
|
58 |
+
$this->assertEquals("\"Last-Translator: Raúl Ferràs <xxxxxxxxxx@xxxxxxx.xxxxx>\\n\"", $headers[4]);
|
59 |
+
$this->assertEquals("\"Language-Team: \\n\"", $headers[5]);
|
60 |
+
$this->assertEquals("\"MIME-Version: 1.0\\n\"", $headers[6]);
|
61 |
+
$this->assertEquals("\"Content-Type: text/plain; charset=UTF-8\\n\"", $headers[7]);
|
62 |
+
$this->assertEquals("\"Content-Transfer-Encoding: 8bit\\n\"", $headers[8]);
|
63 |
+
$this->assertEquals("\"Plural-Forms: nplurals=2; plural=n != 1;\\n\"", $headers[9]);
|
64 |
+
$this->assertEquals("\"X-Poedit-SourceCharset: UTF-8\\n\"", $headers[10]);
|
65 |
+
$this->assertEquals("\"X-Poedit-KeywordsList: __;_e;_n;_t\\n\"", $headers[11]);
|
66 |
+
$this->assertEquals("\"X-Textdomain-Support: yes\\n\"", $headers[12]);
|
67 |
+
$this->assertEquals("\"X-Poedit-Basepath: .\\n\"", $headers[13]);
|
68 |
+
$this->assertEquals("\"X-Generator: Poedit 1.5.7\\n\"", $headers[14]);
|
69 |
+
$this->assertEquals("\"X-Poedit-SearchPath-0: .\\n\"", $headers[15]);
|
70 |
+
$this->assertEquals("\"X-Poedit-SearchPath-1: ../..\\n\"", $headers[16]);
|
71 |
+
$this->assertEquals("\"X-Poedit-SearchPath-2: ../../../modules\\n\"", $headers[17]);
|
72 |
+
} catch (\Exception $e) {
|
73 |
+
$this->fail($e->getMessage());
|
74 |
+
// $this->assertTrue( false, $e->getMessage() );
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
public function testMultilineId()
|
80 |
+
{
|
81 |
+
try {
|
82 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/multilines.po');
|
83 |
+
$result = $parser->getEntries();
|
84 |
+
$headers = $parser->getHeaders();
|
85 |
+
|
86 |
+
$this->assertCount(18, $headers);
|
87 |
+
$this->assertCount(9, $result);
|
88 |
+
} catch (\Exception $e) {
|
89 |
+
$this->fail($e->getMessage());
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
/**
|
95 |
+
*
|
96 |
+
*
|
97 |
+
*/
|
98 |
+
public function testPlurals()
|
99 |
+
{
|
100 |
+
try {
|
101 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/plurals.po');
|
102 |
+
$headers = $parser->getHeaders();
|
103 |
+
$result = $parser->getEntries();
|
104 |
+
|
105 |
+
$this->assertCount(7, $headers);
|
106 |
+
$this->assertCount(15, $result);
|
107 |
+
} catch (\Exception $e) {
|
108 |
+
$this->fail($e->getMessage());
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
public function testPluralsMultiline()
|
113 |
+
{
|
114 |
+
try {
|
115 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/pluralsMultiline.po');
|
116 |
+
$this->assertCount(2, $parser->getEntries());
|
117 |
+
$entries = $parser->getEntries();
|
118 |
+
$msgStringZero = "";
|
119 |
+
$msgStringOne = "";
|
120 |
+
foreach ($entries as $id => $entry) {
|
121 |
+
$this->assertTrue(isset($entry['msgstr[0]']));
|
122 |
+
$this->assertTrue(isset($entry['msgstr[1]']));
|
123 |
+
}
|
124 |
+
} catch (\Exception $e) {
|
125 |
+
$this->fail($e->getMessage());
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Test Writing file
|
132 |
+
*/
|
133 |
+
public function testWrite()
|
134 |
+
{
|
135 |
+
// Read & write a simple file
|
136 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/healthy.po');
|
137 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
138 |
+
|
139 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/healthy.po', __DIR__ . '/pofiles/temp.po');
|
140 |
+
|
141 |
+
// Read & write a file with no headers
|
142 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/noheader.po');
|
143 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
144 |
+
|
145 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/noheader.po', __DIR__ . '/pofiles/temp.po');
|
146 |
+
|
147 |
+
// Read & write a po file with multilines
|
148 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/multilines.po');
|
149 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
150 |
+
|
151 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/multilines.po', __DIR__ . '/pofiles/temp.po');
|
152 |
+
|
153 |
+
// Read & write a po file with contexts
|
154 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/context.po');
|
155 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
156 |
+
|
157 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/context.po', __DIR__ . '/pofiles/temp.po');
|
158 |
+
|
159 |
+
|
160 |
+
// Read & write a po file with previous unstranslated strings
|
161 |
+
$parser = PoParser::parseFile( __DIR__ . '/pofiles/previous_unstranslated.po' );
|
162 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
163 |
+
|
164 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/previous_unstranslated.po', __DIR__.'/pofiles/temp.po');
|
165 |
+
|
166 |
+
// Read & write a po file with multiple flags
|
167 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/multiflags.po');
|
168 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
169 |
+
|
170 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/multiflags.po', __DIR__.'/pofiles/temp.po');
|
171 |
+
|
172 |
+
|
173 |
+
unlink(__DIR__ . '/pofiles/temp.po');
|
174 |
+
}
|
175 |
+
|
176 |
+
/**
|
177 |
+
* Test update entry, update plural forms
|
178 |
+
*/
|
179 |
+
public function testUpdatePlurals()
|
180 |
+
{
|
181 |
+
$msgid = '%s post not updated, somebody is editing it.';
|
182 |
+
$msgstr = array(
|
183 |
+
"%s entrada no actualizada, alguien la está editando...",
|
184 |
+
"%s entradas no actualizadas, alguien las está editando..."
|
185 |
+
);
|
186 |
+
|
187 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/plurals.po');
|
188 |
+
|
189 |
+
$parser->setEntry($msgid, array(
|
190 |
+
'msgid' => $msgid,
|
191 |
+
'msgstr' => $msgstr
|
192 |
+
));
|
193 |
+
|
194 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
195 |
+
|
196 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/temp.po');
|
197 |
+
$newPlurals = $parser->getEntries();
|
198 |
+
$this->assertEquals($newPlurals[$msgid]['msgstr'], $msgstr);
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Test update comments
|
203 |
+
*/
|
204 |
+
public function testUpdateComments()
|
205 |
+
{
|
206 |
+
$fileHandler = new FileHandler(__DIR__ . '/pofiles/context.po');
|
207 |
+
$parser = new PoParser($fileHandler);
|
208 |
+
$entries = $parser->parse();
|
209 |
+
$options = $parser->getOptions();
|
210 |
+
$ctxtGlue = $options['context-glue'];
|
211 |
+
|
212 |
+
$msgid = 'Background Attachment'.$ctxtGlue.'Attachment';
|
213 |
+
$entry = $entries[$msgid];
|
214 |
+
|
215 |
+
$entry['ccomment'] = array('Test write ccomment');
|
216 |
+
$entry['tcomment'] = array('Test write tcomment');
|
217 |
+
|
218 |
+
$parser->setEntry($msgid, $entry);
|
219 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
220 |
+
|
221 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/temp.po');
|
222 |
+
$entries = $parser->getEntries();
|
223 |
+
|
224 |
+
$this->assertEquals($entries[$msgid]['tcomment'][0], $entry['tcomment'][0]);
|
225 |
+
$this->assertEquals($entries[$msgid]['ccomment'][0], $entry['ccomment'][0]);
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Test update with fuzzy flag.
|
230 |
+
* @todo
|
231 |
+
*/
|
232 |
+
public function testUpdateWithFuzzy()
|
233 |
+
{
|
234 |
+
$msgid = '%1$s-%2$s';
|
235 |
+
|
236 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/context.po');
|
237 |
+
$entries = $parser->getEntries();
|
238 |
+
|
239 |
+
$entries[$msgid]['msgstr'] = array('translate');
|
240 |
+
$parser->setEntry($msgid, $entries[$msgid]);
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Test for success update headers
|
245 |
+
*/
|
246 |
+
public function testUpdateHeaders()
|
247 |
+
{
|
248 |
+
$parser = PoParser::parseFile(__DIR__.'/pofiles/context.po');
|
249 |
+
|
250 |
+
$newHeaders = array(
|
251 |
+
'"Project-Id-Version: \n"',
|
252 |
+
'"Report-Msgid-Bugs-To: \n"',
|
253 |
+
'"POT-Creation-Date: \n"',
|
254 |
+
'"PO-Revision-Date: \n"',
|
255 |
+
'"Last-Translator: none\n"',
|
256 |
+
'"Language-Team: \n"',
|
257 |
+
'"MIME-Version: 1.0\n"',
|
258 |
+
'"Content-Type: text/plain; charset=UTF-8\n"',
|
259 |
+
'"Content-Transfer-Encoding: 8bit\n"',
|
260 |
+
'"Plural-Forms: nplurals=2; plural=n != 1;\n"'
|
261 |
+
);
|
262 |
+
|
263 |
+
$result = $parser->setHeaders($newHeaders);
|
264 |
+
$this->assertTrue($result);
|
265 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
266 |
+
|
267 |
+
$newPoFile = PoParser::parseFile(__DIR__ . '/pofiles/temp.po');
|
268 |
+
$readHeaders = $newPoFile->getHeaders();
|
269 |
+
$this->assertEquals($newHeaders, $readHeaders);
|
270 |
+
}
|
271 |
+
|
272 |
+
/**
|
273 |
+
* Test for fail update headers
|
274 |
+
*/
|
275 |
+
public function testUpdateHeadersWrong()
|
276 |
+
{
|
277 |
+
$pofile = new PoParser(new StringHandler(''));
|
278 |
+
$result = $pofile->setHeaders('header');
|
279 |
+
$this->assertFalse($result);
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Test for po files with no blank lines between entries
|
284 |
+
*/
|
285 |
+
public function testNoBlankLines()
|
286 |
+
{
|
287 |
+
$parser = PoParser::parseFile( __DIR__ . '/pofiles/noblankline.po' );
|
288 |
+
$entries = $parser->getEntries();
|
289 |
+
|
290 |
+
$expected = array(
|
291 |
+
'one' => array(
|
292 |
+
'msgid' => array(0 => 'one'),
|
293 |
+
'msgstr' => array(0 => 'uno'),
|
294 |
+
),
|
295 |
+
'two' => array(
|
296 |
+
'msgid' => array( 0 => 'two'),
|
297 |
+
'msgstr' => array( 0 => 'dos')
|
298 |
+
)
|
299 |
+
);
|
300 |
+
|
301 |
+
$this->assertEquals( $entries, $expected );
|
302 |
+
}
|
303 |
+
|
304 |
+
|
305 |
+
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Test for entries with multiple flags
|
309 |
+
*/
|
310 |
+
public function testFlags()
|
311 |
+
{
|
312 |
+
// Read po file with 'php-format' flag. Add 'fuzzy' flag.
|
313 |
+
// Compare the result with the version that has 'php-format' and 'fuzzy' flags
|
314 |
+
$parser = PoParser::parseFile(__DIR__ . '/pofiles/flags-phpformat.po');
|
315 |
+
$entries = $parser->getEntries();
|
316 |
+
|
317 |
+
foreach($entries as $msgid => $entry){
|
318 |
+
$entry['flags'][] = 'fuzzy';
|
319 |
+
$parser->setEntry($msgid, $entry);
|
320 |
+
}
|
321 |
+
|
322 |
+
$parser->writeFile(__DIR__ . '/pofiles/temp.po');
|
323 |
+
$this->assertFileEquals(__DIR__ . '/pofiles/flags-phpformat-fuzzy.po', __DIR__.'/pofiles/temp.po');
|
324 |
+
}
|
325 |
+
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Test for reading previous unstranslated strings
|
329 |
+
*/
|
330 |
+
public function testPreviousUnstranslated()
|
331 |
+
{
|
332 |
+
$parser = PoParser::parseFile( __DIR__ . '/pofiles/previous_unstranslated.po' );
|
333 |
+
$entries= $parser->getEntries();
|
334 |
+
|
335 |
+
$expected = array(
|
336 |
+
'this is a string' => array(
|
337 |
+
'msgid' => array('this is a string'),
|
338 |
+
'msgstr'=> array('this is a translation'),
|
339 |
+
'previous' => array(
|
340 |
+
'msgid' => array('this is a previous string'),
|
341 |
+
'msgstr'=> array('this is a previous translation string')
|
342 |
+
)
|
343 |
+
)
|
344 |
+
);
|
345 |
+
|
346 |
+
$this->assertEquals( $entries, $expected );
|
347 |
+
}
|
348 |
+
}
|