diff options
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler')
2 files changed, 0 insertions, 100 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php deleted file mode 100644 index 174aa179..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Intl\ResourceBundle\Compiler; | ||
13 | |||
14 | use Symfony\Component\Intl\Exception\RuntimeException; | ||
15 | |||
16 | /** | ||
17 | * Compiles .txt resource bundles to binary .res files. | ||
18 | * | ||
19 | * @author Bernhard Schussek <bschussek@gmail.com> | ||
20 | */ | ||
21 | class BundleCompiler implements BundleCompilerInterface | ||
22 | { | ||
23 | /** | ||
24 | * @var string The path to the "genrb" executable. | ||
25 | */ | ||
26 | private $genrb; | ||
27 | |||
28 | /** | ||
29 | * Creates a new compiler based on the "genrb" executable. | ||
30 | * | ||
31 | * @param string $genrb Optional. The path to the "genrb" executable. | ||
32 | * @param string $envVars Optional. Environment variables to be loaded when | ||
33 | * running "genrb". | ||
34 | * | ||
35 | * @throws RuntimeException If the "genrb" cannot be found. | ||
36 | */ | ||
37 | public function __construct($genrb = 'genrb', $envVars = '') | ||
38 | { | ||
39 | exec('which ' . $genrb, $output, $status); | ||
40 | |||
41 | if (0 !== $status) { | ||
42 | throw new RuntimeException(sprintf( | ||
43 | 'The command "%s" is not installed', | ||
44 | $genrb | ||
45 | )); | ||
46 | } | ||
47 | |||
48 | $this->genrb = ($envVars ? $envVars . ' ' : '') . $genrb; | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * {@inheritdoc} | ||
53 | */ | ||
54 | public function compile($sourcePath, $targetDir) | ||
55 | { | ||
56 | if (is_dir($sourcePath)) { | ||
57 | $sourcePath .= '/*.txt'; | ||
58 | } | ||
59 | |||
60 | exec($this->genrb.' --quiet -e UTF-8 -d '.$targetDir.' '.$sourcePath, $output, $status); | ||
61 | |||
62 | if ($status !== 0) { | ||
63 | throw new RuntimeException(sprintf( | ||
64 | 'genrb failed with status %d while compiling %s to %s.', | ||
65 | $status, | ||
66 | $sourcePath, | ||
67 | $targetDir | ||
68 | )); | ||
69 | } | ||
70 | } | ||
71 | } | ||
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompilerInterface.php b/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompilerInterface.php deleted file mode 100644 index 6184ea3e..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompilerInterface.php +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Intl\ResourceBundle\Compiler; | ||
13 | |||
14 | /** | ||
15 | * Compiles a resource bundle. | ||
16 | * | ||
17 | * @author Bernhard Schussek <bschussek@gmail.com> | ||
18 | */ | ||
19 | interface BundleCompilerInterface | ||
20 | { | ||
21 | /** | ||
22 | * Compiles a resource bundle at the given source to the given target | ||
23 | * directory. | ||
24 | * | ||
25 | * @param string $sourcePath | ||
26 | * @param string $targetDir | ||
27 | */ | ||
28 | public function compile($sourcePath, $targetDir); | ||
29 | } | ||