├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── phpunit.xml.dist ├── src └── Ghostscript │ ├── Exception │ ├── ExceptionInterface.php │ └── RuntimeException.php │ ├── GhostscriptServiceProvider.php │ └── Transcoder.php └── tests ├── Ghostscript └── Tests │ ├── GhostscriptServiceProviderTest.php │ └── TranscoderTest.php ├── bootstrap.php └── files ├── plane.ai ├── test.pdf ├── test2.pdf └── test3.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | before_script: 4 | - sudo apt-get install -y ghostscript 5 | - composer install --dev --prefer-source 6 | 7 | php: 8 | - 5.3.3 9 | - 5.3 10 | - 5.4 11 | - 5.5 12 | 13 | script: 14 | - phpunit 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | --------- 3 | 4 | * 0.4.0 (06-25-2013) 5 | 6 | * BC Break : Transcoder::create arguments have been inverted. 7 | * BC Break : Service provider configuration has been updated. 8 | 9 | * 0.3.0 (04-24-2013) 10 | 11 | * Use Alchemy\BinaryDriver as driver base. 12 | * BC Break : remove methods `open` and `close`. Methods `toImage` and `toPDF` 13 | now take the input file as first argument. 14 | * Code cleanup 15 | 16 | * 0.2.0 (02-01-2013) 17 | 18 | * Update API, BC break : rename PDFTranscoder to Transcoder 19 | 20 | * 0.1.1 (11-27-2012) 21 | 22 | * First stable version. 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Ghostscript-PHP is released with MIT License : 2 | 3 | Copyright (c) 2012 Alchemy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 | IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ghostscript PHP driver 2 | 3 | [![Build Status](https://secure.travis-ci.org/alchemy-fr/Ghostscript-PHP.png)](http://travis-ci.org/alchemy-fr/Ghostscript-PHP) 4 | 5 | # API usage 6 | 7 | To instantiate Ghostscript driver, the easiest way is : 8 | 9 | ```php 10 | $transcoder = Ghostscript\Transcoder::create(); 11 | ``` 12 | 13 | You can customize your driver by passing a `Psr\Log\LoggerInterface` or 14 | configuration options. 15 | 16 | Available options are : 17 | 18 | - `gs.binaries` : the path (or an array of potential paths) to the ghostscript binary. 19 | - `timeout` : the timeout for the underlying process. 20 | 21 | ```php 22 | $transcoder = Ghostscript\Transcoder::create(array( 23 | 'timeout' => 42, 24 | 'gs.binaries' => '/opt/local/gs/bin/gs', 25 | ), $logger); 26 | ``` 27 | 28 | To process a file to PDF format, use the `toPDF` method : 29 | 30 | Third and fourth arguments are respectively the first page and the number of 31 | page to transcode. 32 | 33 | ```php 34 | $transcoder->toPDF('document.pdf', 'first-page.pdf', 1, 1); 35 | ``` 36 | 37 | To render a file to Image, use the `toImage` method : 38 | 39 | ```php 40 | $transcoder->toImage('document.pdf', 'output.jpg'); 41 | ``` 42 | 43 | ## Silex service provider : 44 | 45 | A [Silex](silex.sensiolabs.org) Service Provider is available, all parameters 46 | are optionals : 47 | 48 | ```php 49 | $app = new Silex\Application(); 50 | $app->register(new Ghostscript\GhostscriptServiceProvider(), array( 51 | 'ghostscript.configuration' => array( 52 | 'gs.binaries' => '/usr/bin/gs', 53 | 'timeout' => 42, 54 | ), 55 | 'ghostscript.logger' => $app->share(function () use ($app) { 56 | return $app['monolog']; // use Monolog service provider 57 | }), 58 | )); 59 | 60 | $app['ghostscript.transcoder']->toImage('document.pdf', 'image.jpg'); 61 | ``` 62 | 63 | # License 64 | 65 | Released under the MIT License 66 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "alchemy/ghostscript", 3 | "type": "library", 4 | "description": "Ghostscript PDF, a library to handle PDF through ghostscript", 5 | "keywords": ["ghostscript", "pdf"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Romain Neutron", 10 | "email": "imprec@gmail.com", 11 | "homepage": "http://www.lickmychip.com/" 12 | }, 13 | { 14 | "name": "Phraseanet Team", 15 | "email": "info@alchemy.fr", 16 | "homepage": "http://www.phraseanet.com/" 17 | } 18 | ], 19 | "require": { 20 | "php" : ">=5.3.3", 21 | "alchemy/binary-driver" : "~1.5" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit" : "~3.7", 25 | "sami/sami" : "~1.0", 26 | "silex/silex" : "~1.0" 27 | }, 28 | "autoload": { 29 | "psr-0": { 30 | "Ghostscript" : "src" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" 5 | ], 6 | "hash": "3c5767176568164b45154ce2288cb0ab", 7 | "packages": [ 8 | { 9 | "name": "alchemy/binary-driver", 10 | "version": "1.5.0", 11 | "source": { 12 | "type": "git", 13 | "url": "https://github.com/alchemy-fr/BinaryDriver.git", 14 | "reference": "1.5.0" 15 | }, 16 | "dist": { 17 | "type": "zip", 18 | "url": "https://api.github.com/repos/alchemy-fr/BinaryDriver/zipball/1.5.0", 19 | "reference": "1.5.0", 20 | "shasum": "" 21 | }, 22 | "require": { 23 | "evenement/evenement": ">=1.0,<2.0", 24 | "monolog/monolog": ">=1.3,<2.0", 25 | "php": ">=5.3.3", 26 | "psr/log": ">=1.0,<2.0", 27 | "symfony/process": ">=2.0,<3.0" 28 | }, 29 | "require-dev": { 30 | "phpunit/phpunit": ">=3.7,<4.0" 31 | }, 32 | "type": "library", 33 | "autoload": { 34 | "psr-0": { 35 | "Alchemy": "src" 36 | } 37 | }, 38 | "notification-url": "https://packagist.org/downloads/", 39 | "license": [ 40 | "MIT" 41 | ], 42 | "authors": [ 43 | { 44 | "name": "Romain Neutron", 45 | "email": "imprec@gmail.com", 46 | "homepage": "http://www.lickmychip.com/" 47 | }, 48 | { 49 | "name": "Nicolas Le Goff", 50 | "email": "legoff.n@gmail.com" 51 | }, 52 | { 53 | "name": "Phraseanet Team", 54 | "email": "info@alchemy.fr", 55 | "homepage": "http://www.phraseanet.com/" 56 | } 57 | ], 58 | "description": "A set of tools to build binary drivers", 59 | "keywords": [ 60 | "binary", 61 | "driver" 62 | ], 63 | "time": "2013-06-21 15:51:20" 64 | }, 65 | { 66 | "name": "evenement/evenement", 67 | "version": "v1.0.0", 68 | "source": { 69 | "type": "git", 70 | "url": "https://github.com/igorw/evenement", 71 | "reference": "v1.0.0" 72 | }, 73 | "dist": { 74 | "type": "zip", 75 | "url": "https://github.com/igorw/evenement/zipball/v1.0.0", 76 | "reference": "v1.0.0", 77 | "shasum": "" 78 | }, 79 | "require": { 80 | "php": ">=5.3.0" 81 | }, 82 | "type": "library", 83 | "autoload": { 84 | "psr-0": { 85 | "Evenement": "src" 86 | } 87 | }, 88 | "notification-url": "https://packagist.org/downloads/", 89 | "license": [ 90 | "MIT" 91 | ], 92 | "authors": [ 93 | { 94 | "name": "Igor Wiedler", 95 | "email": "igor@wiedler.ch", 96 | "homepage": "http://wiedler.ch/igor/" 97 | } 98 | ], 99 | "description": "Événement is a very simple event dispatching library for PHP 5.3", 100 | "keywords": [ 101 | "event-dispatcher" 102 | ], 103 | "time": "2012-05-30 08:01:08" 104 | }, 105 | { 106 | "name": "monolog/monolog", 107 | "version": "1.5.0", 108 | "source": { 109 | "type": "git", 110 | "url": "https://github.com/Seldaek/monolog.git", 111 | "reference": "1.5.0" 112 | }, 113 | "dist": { 114 | "type": "zip", 115 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1.5.0", 116 | "reference": "1.5.0", 117 | "shasum": "" 118 | }, 119 | "require": { 120 | "php": ">=5.3.0", 121 | "psr/log": ">=1.0,<2.0" 122 | }, 123 | "require-dev": { 124 | "doctrine/couchdb": "dev-master", 125 | "mlehner/gelf-php": "1.0.*", 126 | "raven/raven": "0.3.*" 127 | }, 128 | "suggest": { 129 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 130 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 131 | "ext-mongo": "Allow sending log messages to a MongoDB server", 132 | "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", 133 | "raven/raven": "Allow sending log messages to a Sentry server" 134 | }, 135 | "type": "library", 136 | "extra": { 137 | "branch-alias": { 138 | "dev-master": "1.4.x-dev" 139 | } 140 | }, 141 | "autoload": { 142 | "psr-0": { 143 | "Monolog": "src/" 144 | } 145 | }, 146 | "notification-url": "https://packagist.org/downloads/", 147 | "license": [ 148 | "MIT" 149 | ], 150 | "authors": [ 151 | { 152 | "name": "Jordi Boggiano", 153 | "email": "j.boggiano@seld.be", 154 | "homepage": "http://seld.be", 155 | "role": "Developer" 156 | } 157 | ], 158 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 159 | "homepage": "http://github.com/Seldaek/monolog", 160 | "keywords": [ 161 | "log", 162 | "logging", 163 | "psr-3" 164 | ], 165 | "time": "2013-04-23 10:09:48" 166 | }, 167 | { 168 | "name": "psr/log", 169 | "version": "1.0.0", 170 | "source": { 171 | "type": "git", 172 | "url": "https://github.com/php-fig/log", 173 | "reference": "1.0.0" 174 | }, 175 | "dist": { 176 | "type": "zip", 177 | "url": "https://github.com/php-fig/log/archive/1.0.0.zip", 178 | "reference": "1.0.0", 179 | "shasum": "" 180 | }, 181 | "type": "library", 182 | "autoload": { 183 | "psr-0": { 184 | "Psr\\Log\\": "" 185 | } 186 | }, 187 | "notification-url": "https://packagist.org/downloads/", 188 | "license": [ 189 | "MIT" 190 | ], 191 | "authors": [ 192 | { 193 | "name": "PHP-FIG", 194 | "homepage": "http://www.php-fig.org/" 195 | } 196 | ], 197 | "description": "Common interface for logging libraries", 198 | "keywords": [ 199 | "log", 200 | "psr", 201 | "psr-3" 202 | ], 203 | "time": "2012-12-21 11:40:51" 204 | }, 205 | { 206 | "name": "symfony/process", 207 | "version": "v2.3.1", 208 | "target-dir": "Symfony/Component/Process", 209 | "source": { 210 | "type": "git", 211 | "url": "https://github.com/symfony/Process.git", 212 | "reference": "v2.3.1" 213 | }, 214 | "dist": { 215 | "type": "zip", 216 | "url": "https://api.github.com/repos/symfony/Process/zipball/v2.3.1", 217 | "reference": "v2.3.1", 218 | "shasum": "" 219 | }, 220 | "require": { 221 | "php": ">=5.3.3" 222 | }, 223 | "type": "library", 224 | "extra": { 225 | "branch-alias": { 226 | "dev-master": "2.3-dev" 227 | } 228 | }, 229 | "autoload": { 230 | "psr-0": { 231 | "Symfony\\Component\\Process\\": "" 232 | } 233 | }, 234 | "notification-url": "https://packagist.org/downloads/", 235 | "license": [ 236 | "MIT" 237 | ], 238 | "authors": [ 239 | { 240 | "name": "Fabien Potencier", 241 | "email": "fabien@symfony.com" 242 | }, 243 | { 244 | "name": "Symfony Community", 245 | "homepage": "http://symfony.com/contributors" 246 | } 247 | ], 248 | "description": "Symfony Process Component", 249 | "homepage": "http://symfony.com", 250 | "time": "2013-05-06 20:03:44" 251 | } 252 | ], 253 | "packages-dev": [ 254 | { 255 | "name": "nikic/php-parser", 256 | "version": "v0.9.3", 257 | "source": { 258 | "type": "git", 259 | "url": "https://github.com/nikic/PHP-Parser", 260 | "reference": "v0.9.3" 261 | }, 262 | "dist": { 263 | "type": "zip", 264 | "url": "https://github.com/nikic/PHP-Parser/archive/v0.9.3.zip", 265 | "reference": "v0.9.3", 266 | "shasum": "" 267 | }, 268 | "require": { 269 | "php": ">=5.2" 270 | }, 271 | "type": "library", 272 | "autoload": { 273 | "psr-0": { 274 | "PHPParser": "lib/" 275 | } 276 | }, 277 | "notification-url": "https://packagist.org/downloads/", 278 | "license": [ 279 | "BSD-3-Clause" 280 | ], 281 | "authors": [ 282 | { 283 | "name": "Nikita Popov" 284 | } 285 | ], 286 | "description": "A PHP parser written in PHP", 287 | "keywords": [ 288 | "parser", 289 | "php" 290 | ], 291 | "time": "2012-11-22 18:54:05" 292 | }, 293 | { 294 | "name": "phpunit/php-code-coverage", 295 | "version": "1.2.11", 296 | "source": { 297 | "type": "git", 298 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 299 | "reference": "1.2.11" 300 | }, 301 | "dist": { 302 | "type": "zip", 303 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.11", 304 | "reference": "1.2.11", 305 | "shasum": "" 306 | }, 307 | "require": { 308 | "php": ">=5.3.3", 309 | "phpunit/php-file-iterator": ">=1.3.0@stable", 310 | "phpunit/php-text-template": ">=1.1.1@stable", 311 | "phpunit/php-token-stream": ">=1.1.3@stable" 312 | }, 313 | "require-dev": { 314 | "phpunit/phpunit": "3.7.*" 315 | }, 316 | "suggest": { 317 | "ext-dom": "*", 318 | "ext-xdebug": ">=2.0.5" 319 | }, 320 | "type": "library", 321 | "autoload": { 322 | "classmap": [ 323 | "PHP/" 324 | ] 325 | }, 326 | "notification-url": "https://packagist.org/downloads/", 327 | "include-path": [ 328 | "" 329 | ], 330 | "license": [ 331 | "BSD-3-Clause" 332 | ], 333 | "authors": [ 334 | { 335 | "name": "Sebastian Bergmann", 336 | "email": "sb@sebastian-bergmann.de", 337 | "role": "lead" 338 | } 339 | ], 340 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 341 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 342 | "keywords": [ 343 | "coverage", 344 | "testing", 345 | "xunit" 346 | ], 347 | "time": "2013-05-23 18:23:24" 348 | }, 349 | { 350 | "name": "phpunit/php-file-iterator", 351 | "version": "1.3.3", 352 | "source": { 353 | "type": "git", 354 | "url": "git://github.com/sebastianbergmann/php-file-iterator.git", 355 | "reference": "1.3.3" 356 | }, 357 | "dist": { 358 | "type": "zip", 359 | "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3", 360 | "reference": "1.3.3", 361 | "shasum": "" 362 | }, 363 | "require": { 364 | "php": ">=5.3.3" 365 | }, 366 | "type": "library", 367 | "autoload": { 368 | "classmap": [ 369 | "File/" 370 | ] 371 | }, 372 | "notification-url": "https://packagist.org/downloads/", 373 | "include-path": [ 374 | "" 375 | ], 376 | "license": [ 377 | "BSD-3-Clause" 378 | ], 379 | "authors": [ 380 | { 381 | "name": "Sebastian Bergmann", 382 | "email": "sb@sebastian-bergmann.de", 383 | "role": "lead" 384 | } 385 | ], 386 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 387 | "homepage": "http://www.phpunit.de/", 388 | "keywords": [ 389 | "filesystem", 390 | "iterator" 391 | ], 392 | "time": "2012-10-11 04:44:38" 393 | }, 394 | { 395 | "name": "phpunit/php-text-template", 396 | "version": "1.1.4", 397 | "source": { 398 | "type": "git", 399 | "url": "git://github.com/sebastianbergmann/php-text-template.git", 400 | "reference": "1.1.4" 401 | }, 402 | "dist": { 403 | "type": "zip", 404 | "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", 405 | "reference": "1.1.4", 406 | "shasum": "" 407 | }, 408 | "require": { 409 | "php": ">=5.3.3" 410 | }, 411 | "type": "library", 412 | "autoload": { 413 | "classmap": [ 414 | "Text/" 415 | ] 416 | }, 417 | "notification-url": "https://packagist.org/downloads/", 418 | "include-path": [ 419 | "" 420 | ], 421 | "license": [ 422 | "BSD-3-Clause" 423 | ], 424 | "authors": [ 425 | { 426 | "name": "Sebastian Bergmann", 427 | "email": "sb@sebastian-bergmann.de", 428 | "role": "lead" 429 | } 430 | ], 431 | "description": "Simple template engine.", 432 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 433 | "keywords": [ 434 | "template" 435 | ], 436 | "time": "2012-10-31 11:15:28" 437 | }, 438 | { 439 | "name": "phpunit/php-timer", 440 | "version": "1.0.4", 441 | "source": { 442 | "type": "git", 443 | "url": "git://github.com/sebastianbergmann/php-timer.git", 444 | "reference": "1.0.4" 445 | }, 446 | "dist": { 447 | "type": "zip", 448 | "url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", 449 | "reference": "1.0.4", 450 | "shasum": "" 451 | }, 452 | "require": { 453 | "php": ">=5.3.3" 454 | }, 455 | "type": "library", 456 | "autoload": { 457 | "classmap": [ 458 | "PHP/" 459 | ] 460 | }, 461 | "notification-url": "https://packagist.org/downloads/", 462 | "include-path": [ 463 | "" 464 | ], 465 | "license": [ 466 | "BSD-3-Clause" 467 | ], 468 | "authors": [ 469 | { 470 | "name": "Sebastian Bergmann", 471 | "email": "sb@sebastian-bergmann.de", 472 | "role": "lead" 473 | } 474 | ], 475 | "description": "Utility class for timing", 476 | "homepage": "http://www.phpunit.de/", 477 | "keywords": [ 478 | "timer" 479 | ], 480 | "time": "2012-10-11 04:45:58" 481 | }, 482 | { 483 | "name": "phpunit/php-token-stream", 484 | "version": "1.1.5", 485 | "source": { 486 | "type": "git", 487 | "url": "git://github.com/sebastianbergmann/php-token-stream.git", 488 | "reference": "1.1.5" 489 | }, 490 | "dist": { 491 | "type": "zip", 492 | "url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", 493 | "reference": "1.1.5", 494 | "shasum": "" 495 | }, 496 | "require": { 497 | "ext-tokenizer": "*", 498 | "php": ">=5.3.3" 499 | }, 500 | "type": "library", 501 | "autoload": { 502 | "classmap": [ 503 | "PHP/" 504 | ] 505 | }, 506 | "notification-url": "https://packagist.org/downloads/", 507 | "include-path": [ 508 | "" 509 | ], 510 | "license": [ 511 | "BSD-3-Clause" 512 | ], 513 | "authors": [ 514 | { 515 | "name": "Sebastian Bergmann", 516 | "email": "sb@sebastian-bergmann.de", 517 | "role": "lead" 518 | } 519 | ], 520 | "description": "Wrapper around PHP's tokenizer extension.", 521 | "homepage": "http://www.phpunit.de/", 522 | "keywords": [ 523 | "tokenizer" 524 | ], 525 | "time": "2012-10-11 04:47:14" 526 | }, 527 | { 528 | "name": "phpunit/phpunit", 529 | "version": "3.7.21", 530 | "source": { 531 | "type": "git", 532 | "url": "https://github.com/sebastianbergmann/phpunit.git", 533 | "reference": "3.7.21" 534 | }, 535 | "dist": { 536 | "type": "zip", 537 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.21", 538 | "reference": "3.7.21", 539 | "shasum": "" 540 | }, 541 | "require": { 542 | "ext-dom": "*", 543 | "ext-pcre": "*", 544 | "ext-reflection": "*", 545 | "ext-spl": "*", 546 | "php": ">=5.3.3", 547 | "phpunit/php-code-coverage": ">=1.2.1,<1.3.0", 548 | "phpunit/php-file-iterator": ">=1.3.1", 549 | "phpunit/php-text-template": ">=1.1.1", 550 | "phpunit/php-timer": ">=1.0.2,<1.1.0", 551 | "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", 552 | "symfony/yaml": ">=2.0,<3.0" 553 | }, 554 | "require-dev": { 555 | "pear-pear/pear": "1.9.4" 556 | }, 557 | "suggest": { 558 | "ext-json": "*", 559 | "ext-simplexml": "*", 560 | "ext-tokenizer": "*", 561 | "phpunit/php-invoker": ">=1.1.0,<1.2.0" 562 | }, 563 | "bin": [ 564 | "composer/bin/phpunit" 565 | ], 566 | "type": "library", 567 | "extra": { 568 | "branch-alias": { 569 | "dev-master": "3.7.x-dev" 570 | } 571 | }, 572 | "autoload": { 573 | "classmap": [ 574 | "PHPUnit/" 575 | ] 576 | }, 577 | "notification-url": "https://packagist.org/downloads/", 578 | "include-path": [ 579 | "", 580 | "../../symfony/yaml/" 581 | ], 582 | "license": [ 583 | "BSD-3-Clause" 584 | ], 585 | "authors": [ 586 | { 587 | "name": "Sebastian Bergmann", 588 | "email": "sebastian@phpunit.de", 589 | "role": "lead" 590 | } 591 | ], 592 | "description": "The PHP Unit Testing framework.", 593 | "homepage": "http://www.phpunit.de/", 594 | "keywords": [ 595 | "phpunit", 596 | "testing", 597 | "xunit" 598 | ], 599 | "time": "2013-05-23 18:54:29" 600 | }, 601 | { 602 | "name": "phpunit/phpunit-mock-objects", 603 | "version": "1.2.3", 604 | "source": { 605 | "type": "git", 606 | "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", 607 | "reference": "1.2.3" 608 | }, 609 | "dist": { 610 | "type": "zip", 611 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip", 612 | "reference": "1.2.3", 613 | "shasum": "" 614 | }, 615 | "require": { 616 | "php": ">=5.3.3", 617 | "phpunit/php-text-template": ">=1.1.1@stable" 618 | }, 619 | "suggest": { 620 | "ext-soap": "*" 621 | }, 622 | "type": "library", 623 | "autoload": { 624 | "classmap": [ 625 | "PHPUnit/" 626 | ] 627 | }, 628 | "notification-url": "https://packagist.org/downloads/", 629 | "include-path": [ 630 | "" 631 | ], 632 | "license": [ 633 | "BSD-3-Clause" 634 | ], 635 | "authors": [ 636 | { 637 | "name": "Sebastian Bergmann", 638 | "email": "sb@sebastian-bergmann.de", 639 | "role": "lead" 640 | } 641 | ], 642 | "description": "Mock Object library for PHPUnit", 643 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 644 | "keywords": [ 645 | "mock", 646 | "xunit" 647 | ], 648 | "time": "2013-01-13 10:24:48" 649 | }, 650 | { 651 | "name": "pimple/pimple", 652 | "version": "v1.0.2", 653 | "source": { 654 | "type": "git", 655 | "url": "https://github.com/fabpot/Pimple.git", 656 | "reference": "v1.0.2" 657 | }, 658 | "dist": { 659 | "type": "zip", 660 | "url": "https://api.github.com/repos/fabpot/Pimple/zipball/v1.0.2", 661 | "reference": "v1.0.2", 662 | "shasum": "" 663 | }, 664 | "require": { 665 | "php": ">=5.3.0" 666 | }, 667 | "type": "library", 668 | "extra": { 669 | "branch-alias": { 670 | "dev-master": "1.0.x-dev" 671 | } 672 | }, 673 | "autoload": { 674 | "psr-0": { 675 | "Pimple": "lib/" 676 | } 677 | }, 678 | "notification-url": "https://packagist.org/downloads/", 679 | "license": [ 680 | "MIT" 681 | ], 682 | "authors": [ 683 | { 684 | "name": "Fabien Potencier", 685 | "email": "fabien@symfony.com" 686 | } 687 | ], 688 | "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", 689 | "homepage": "http://pimple.sensiolabs.org", 690 | "keywords": [ 691 | "container", 692 | "dependency injection" 693 | ], 694 | "time": "2013-03-08 08:21:40" 695 | }, 696 | { 697 | "name": "sami/sami", 698 | "version": "v1.0", 699 | "source": { 700 | "type": "git", 701 | "url": "https://github.com/fabpot/Sami.git", 702 | "reference": "v1.0" 703 | }, 704 | "dist": { 705 | "type": "zip", 706 | "url": "https://api.github.com/repos/fabpot/Sami/zipball/v1.0", 707 | "reference": "v1.0", 708 | "shasum": "" 709 | }, 710 | "require": { 711 | "nikic/php-parser": "0.9.*", 712 | "php": ">=5.3.0", 713 | "pimple/pimple": "1.0.*", 714 | "symfony/console": ">=2.1,<3.0", 715 | "symfony/filesystem": ">=2.1,<3.0", 716 | "symfony/finder": ">=2.1,<3.0", 717 | "symfony/process": ">=2.1,<3.0", 718 | "symfony/yaml": ">=2.1,<3.0", 719 | "twig/twig": "1.*" 720 | }, 721 | "bin": [ 722 | "sami.php" 723 | ], 724 | "type": "application", 725 | "extra": { 726 | "branch-alias": { 727 | "dev-master": "1.0-dev" 728 | } 729 | }, 730 | "autoload": { 731 | "psr-0": { 732 | "Sami": "." 733 | } 734 | }, 735 | "notification-url": "https://packagist.org/downloads/", 736 | "license": [ 737 | "MIT" 738 | ], 739 | "authors": [ 740 | { 741 | "name": "Fabien Potencier", 742 | "email": "fabien@symfony.com" 743 | } 744 | ], 745 | "description": "Sami, an API documentation generator", 746 | "homepage": "http://sami.sensiolabs.org", 747 | "keywords": [ 748 | "phpdoc" 749 | ], 750 | "time": "2013-04-05 13:01:32" 751 | }, 752 | { 753 | "name": "silex/silex", 754 | "version": "v1.0.0", 755 | "source": { 756 | "type": "git", 757 | "url": "https://github.com/fabpot/Silex.git", 758 | "reference": "v1.0.0" 759 | }, 760 | "dist": { 761 | "type": "zip", 762 | "url": "https://api.github.com/repos/fabpot/Silex/zipball/v1.0.0", 763 | "reference": "v1.0.0", 764 | "shasum": "" 765 | }, 766 | "require": { 767 | "php": ">=5.3.3", 768 | "pimple/pimple": "1.*", 769 | "symfony/event-dispatcher": ">=2.1,<2.4-dev", 770 | "symfony/http-foundation": ">=2.1,<2.4-dev", 771 | "symfony/http-kernel": ">=2.1,<2.4-dev", 772 | "symfony/routing": ">=2.1,<2.4-dev" 773 | }, 774 | "require-dev": { 775 | "doctrine/dbal": ">=2.2.0,<2.4.0-dev", 776 | "monolog/monolog": ">=1.4,<2.0,>=1.4.1", 777 | "swiftmailer/swiftmailer": "5.*", 778 | "symfony/browser-kit": ">=2.1,<2.4-dev", 779 | "symfony/config": ">=2.1,<2.4-dev", 780 | "symfony/css-selector": ">=2.1,<2.4-dev", 781 | "symfony/dom-crawler": ">=2.1,<2.4-dev", 782 | "symfony/finder": ">=2.1,<2.4-dev", 783 | "symfony/form": ">=2.1.4,<2.4-dev", 784 | "symfony/locale": ">=2.1,<2.4-dev", 785 | "symfony/monolog-bridge": ">=2.1,<2.4-dev", 786 | "symfony/options-resolver": ">=2.1,<2.4-dev", 787 | "symfony/process": ">=2.1,<2.4-dev", 788 | "symfony/security": ">=2.1,<2.4-dev", 789 | "symfony/serializer": ">=2.1,<2.4-dev", 790 | "symfony/translation": ">=2.1,<2.4-dev", 791 | "symfony/twig-bridge": ">=2.1,<2.4-dev", 792 | "symfony/validator": ">=2.1,<2.4-dev", 793 | "twig/twig": ">=1.8.0,<2.0-dev" 794 | }, 795 | "suggest": { 796 | "symfony/browser-kit": ">=2.1,<2.4-dev", 797 | "symfony/css-selector": ">=2.1,<2.4-dev", 798 | "symfony/dom-crawler": ">=2.1,<2.4-dev", 799 | "symfony/form": ">= 2.1.4,<2.4-dev" 800 | }, 801 | "type": "library", 802 | "extra": { 803 | "branch-alias": { 804 | "dev-master": "1.0.x-dev" 805 | } 806 | }, 807 | "autoload": { 808 | "psr-0": { 809 | "Silex": "src/" 810 | } 811 | }, 812 | "notification-url": "https://packagist.org/downloads/", 813 | "license": [ 814 | "MIT" 815 | ], 816 | "authors": [ 817 | { 818 | "name": "Fabien Potencier", 819 | "email": "fabien@symfony.com" 820 | }, 821 | { 822 | "name": "Igor Wiedler", 823 | "email": "igor@wiedler.ch", 824 | "homepage": "http://wiedler.ch/igor/" 825 | } 826 | ], 827 | "description": "The PHP micro-framework based on the Symfony2 Components", 828 | "homepage": "http://silex.sensiolabs.org", 829 | "keywords": [ 830 | "microframework" 831 | ], 832 | "time": "2013-05-03 16:49:57" 833 | }, 834 | { 835 | "name": "symfony/console", 836 | "version": "v2.3.1", 837 | "target-dir": "Symfony/Component/Console", 838 | "source": { 839 | "type": "git", 840 | "url": "https://github.com/symfony/Console.git", 841 | "reference": "v2.3.1" 842 | }, 843 | "dist": { 844 | "type": "zip", 845 | "url": "https://api.github.com/repos/symfony/Console/zipball/v2.3.1", 846 | "reference": "v2.3.1", 847 | "shasum": "" 848 | }, 849 | "require": { 850 | "php": ">=5.3.3" 851 | }, 852 | "require-dev": { 853 | "symfony/event-dispatcher": ">=2.1,<3.0" 854 | }, 855 | "suggest": { 856 | "symfony/event-dispatcher": "" 857 | }, 858 | "type": "library", 859 | "extra": { 860 | "branch-alias": { 861 | "dev-master": "2.3-dev" 862 | } 863 | }, 864 | "autoload": { 865 | "psr-0": { 866 | "Symfony\\Component\\Console\\": "" 867 | } 868 | }, 869 | "notification-url": "https://packagist.org/downloads/", 870 | "license": [ 871 | "MIT" 872 | ], 873 | "authors": [ 874 | { 875 | "name": "Fabien Potencier", 876 | "email": "fabien@symfony.com" 877 | }, 878 | { 879 | "name": "Symfony Community", 880 | "homepage": "http://symfony.com/contributors" 881 | } 882 | ], 883 | "description": "Symfony Console Component", 884 | "homepage": "http://symfony.com", 885 | "time": "2013-06-11 07:15:14" 886 | }, 887 | { 888 | "name": "symfony/debug", 889 | "version": "v2.3.1", 890 | "target-dir": "Symfony/Component/Debug", 891 | "source": { 892 | "type": "git", 893 | "url": "https://github.com/symfony/Debug.git", 894 | "reference": "v2.3.1" 895 | }, 896 | "dist": { 897 | "type": "zip", 898 | "url": "https://api.github.com/repos/symfony/Debug/zipball/v2.3.1", 899 | "reference": "v2.3.1", 900 | "shasum": "" 901 | }, 902 | "require": { 903 | "php": ">=5.3.3" 904 | }, 905 | "require-dev": { 906 | "symfony/http-foundation": ">=2.1,<3.0", 907 | "symfony/http-kernel": ">=2.1,<3.0" 908 | }, 909 | "suggest": { 910 | "symfony/class-loader": "", 911 | "symfony/http-foundation": "", 912 | "symfony/http-kernel": "" 913 | }, 914 | "type": "library", 915 | "extra": { 916 | "branch-alias": { 917 | "dev-master": "2.3-dev" 918 | } 919 | }, 920 | "autoload": { 921 | "psr-0": { 922 | "Symfony\\Component\\Debug\\": "" 923 | } 924 | }, 925 | "notification-url": "https://packagist.org/downloads/", 926 | "license": [ 927 | "MIT" 928 | ], 929 | "authors": [ 930 | { 931 | "name": "Fabien Potencier", 932 | "email": "fabien@symfony.com" 933 | }, 934 | { 935 | "name": "Symfony Community", 936 | "homepage": "http://symfony.com/contributors" 937 | } 938 | ], 939 | "description": "Symfony Debug Component", 940 | "homepage": "http://symfony.com", 941 | "time": "2013-06-02 11:58:44" 942 | }, 943 | { 944 | "name": "symfony/event-dispatcher", 945 | "version": "v2.3.1", 946 | "target-dir": "Symfony/Component/EventDispatcher", 947 | "source": { 948 | "type": "git", 949 | "url": "https://github.com/symfony/EventDispatcher.git", 950 | "reference": "v2.3.1" 951 | }, 952 | "dist": { 953 | "type": "zip", 954 | "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.1", 955 | "reference": "v2.3.1", 956 | "shasum": "" 957 | }, 958 | "require": { 959 | "php": ">=5.3.3" 960 | }, 961 | "require-dev": { 962 | "symfony/dependency-injection": ">=2.0,<3.0" 963 | }, 964 | "suggest": { 965 | "symfony/dependency-injection": "", 966 | "symfony/http-kernel": "" 967 | }, 968 | "type": "library", 969 | "extra": { 970 | "branch-alias": { 971 | "dev-master": "2.3-dev" 972 | } 973 | }, 974 | "autoload": { 975 | "psr-0": { 976 | "Symfony\\Component\\EventDispatcher\\": "" 977 | } 978 | }, 979 | "notification-url": "https://packagist.org/downloads/", 980 | "license": [ 981 | "MIT" 982 | ], 983 | "authors": [ 984 | { 985 | "name": "Fabien Potencier", 986 | "email": "fabien@symfony.com" 987 | }, 988 | { 989 | "name": "Symfony Community", 990 | "homepage": "http://symfony.com/contributors" 991 | } 992 | ], 993 | "description": "Symfony EventDispatcher Component", 994 | "homepage": "http://symfony.com", 995 | "time": "2013-05-13 14:36:40" 996 | }, 997 | { 998 | "name": "symfony/filesystem", 999 | "version": "v2.3.1", 1000 | "target-dir": "Symfony/Component/Filesystem", 1001 | "source": { 1002 | "type": "git", 1003 | "url": "https://github.com/symfony/Filesystem.git", 1004 | "reference": "v2.3.1" 1005 | }, 1006 | "dist": { 1007 | "type": "zip", 1008 | "url": "https://api.github.com/repos/symfony/Filesystem/zipball/v2.3.1", 1009 | "reference": "v2.3.1", 1010 | "shasum": "" 1011 | }, 1012 | "require": { 1013 | "php": ">=5.3.3" 1014 | }, 1015 | "type": "library", 1016 | "extra": { 1017 | "branch-alias": { 1018 | "dev-master": "2.3-dev" 1019 | } 1020 | }, 1021 | "autoload": { 1022 | "psr-0": { 1023 | "Symfony\\Component\\Filesystem\\": "" 1024 | } 1025 | }, 1026 | "notification-url": "https://packagist.org/downloads/", 1027 | "license": [ 1028 | "MIT" 1029 | ], 1030 | "authors": [ 1031 | { 1032 | "name": "Fabien Potencier", 1033 | "email": "fabien@symfony.com" 1034 | }, 1035 | { 1036 | "name": "Symfony Community", 1037 | "homepage": "http://symfony.com/contributors" 1038 | } 1039 | ], 1040 | "description": "Symfony Filesystem Component", 1041 | "homepage": "http://symfony.com", 1042 | "time": "2013-06-04 15:02:05" 1043 | }, 1044 | { 1045 | "name": "symfony/finder", 1046 | "version": "v2.3.1", 1047 | "target-dir": "Symfony/Component/Finder", 1048 | "source": { 1049 | "type": "git", 1050 | "url": "https://github.com/symfony/Finder.git", 1051 | "reference": "v2.3.1" 1052 | }, 1053 | "dist": { 1054 | "type": "zip", 1055 | "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.3.1", 1056 | "reference": "v2.3.1", 1057 | "shasum": "" 1058 | }, 1059 | "require": { 1060 | "php": ">=5.3.3" 1061 | }, 1062 | "type": "library", 1063 | "extra": { 1064 | "branch-alias": { 1065 | "dev-master": "2.3-dev" 1066 | } 1067 | }, 1068 | "autoload": { 1069 | "psr-0": { 1070 | "Symfony\\Component\\Finder\\": "" 1071 | } 1072 | }, 1073 | "notification-url": "https://packagist.org/downloads/", 1074 | "license": [ 1075 | "MIT" 1076 | ], 1077 | "authors": [ 1078 | { 1079 | "name": "Fabien Potencier", 1080 | "email": "fabien@symfony.com" 1081 | }, 1082 | { 1083 | "name": "Symfony Community", 1084 | "homepage": "http://symfony.com/contributors" 1085 | } 1086 | ], 1087 | "description": "Symfony Finder Component", 1088 | "homepage": "http://symfony.com", 1089 | "time": "2013-06-02 12:05:51" 1090 | }, 1091 | { 1092 | "name": "symfony/http-foundation", 1093 | "version": "v2.3.1", 1094 | "target-dir": "Symfony/Component/HttpFoundation", 1095 | "source": { 1096 | "type": "git", 1097 | "url": "https://github.com/symfony/HttpFoundation.git", 1098 | "reference": "v2.3.1" 1099 | }, 1100 | "dist": { 1101 | "type": "zip", 1102 | "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.3.1", 1103 | "reference": "v2.3.1", 1104 | "shasum": "" 1105 | }, 1106 | "require": { 1107 | "php": ">=5.3.3" 1108 | }, 1109 | "type": "library", 1110 | "extra": { 1111 | "branch-alias": { 1112 | "dev-master": "2.3-dev" 1113 | } 1114 | }, 1115 | "autoload": { 1116 | "psr-0": { 1117 | "Symfony\\Component\\HttpFoundation\\": "" 1118 | }, 1119 | "classmap": [ 1120 | "Symfony/Component/HttpFoundation/Resources/stubs" 1121 | ] 1122 | }, 1123 | "notification-url": "https://packagist.org/downloads/", 1124 | "license": [ 1125 | "MIT" 1126 | ], 1127 | "authors": [ 1128 | { 1129 | "name": "Fabien Potencier", 1130 | "email": "fabien@symfony.com" 1131 | }, 1132 | { 1133 | "name": "Symfony Community", 1134 | "homepage": "http://symfony.com/contributors" 1135 | } 1136 | ], 1137 | "description": "Symfony HttpFoundation Component", 1138 | "homepage": "http://symfony.com", 1139 | "time": "2013-05-10 06:00:03" 1140 | }, 1141 | { 1142 | "name": "symfony/http-kernel", 1143 | "version": "v2.3.1", 1144 | "target-dir": "Symfony/Component/HttpKernel", 1145 | "source": { 1146 | "type": "git", 1147 | "url": "https://github.com/symfony/HttpKernel.git", 1148 | "reference": "v2.3.1" 1149 | }, 1150 | "dist": { 1151 | "type": "zip", 1152 | "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/v2.3.1", 1153 | "reference": "v2.3.1", 1154 | "shasum": "" 1155 | }, 1156 | "require": { 1157 | "php": ">=5.3.3", 1158 | "psr/log": ">=1.0,<2.0", 1159 | "symfony/debug": ">=2.3,<3.0", 1160 | "symfony/event-dispatcher": ">=2.1,<3.0", 1161 | "symfony/http-foundation": ">=2.2,<3.0" 1162 | }, 1163 | "require-dev": { 1164 | "symfony/browser-kit": "2.2.*", 1165 | "symfony/class-loader": ">=2.1,<3.0", 1166 | "symfony/config": ">=2.0,<3.0", 1167 | "symfony/console": "2.2.*", 1168 | "symfony/dependency-injection": ">=2.0,<3.0", 1169 | "symfony/finder": ">=2.0,<3.0", 1170 | "symfony/process": ">=2.0,<3.0", 1171 | "symfony/routing": ">=2.2,<3.0", 1172 | "symfony/stopwatch": ">=2.2,<3.0" 1173 | }, 1174 | "suggest": { 1175 | "symfony/browser-kit": "", 1176 | "symfony/class-loader": "", 1177 | "symfony/config": "", 1178 | "symfony/console": "", 1179 | "symfony/dependency-injection": "", 1180 | "symfony/finder": "" 1181 | }, 1182 | "type": "library", 1183 | "extra": { 1184 | "branch-alias": { 1185 | "dev-master": "2.3-dev" 1186 | } 1187 | }, 1188 | "autoload": { 1189 | "psr-0": { 1190 | "Symfony\\Component\\HttpKernel\\": "" 1191 | } 1192 | }, 1193 | "notification-url": "https://packagist.org/downloads/", 1194 | "license": [ 1195 | "MIT" 1196 | ], 1197 | "authors": [ 1198 | { 1199 | "name": "Fabien Potencier", 1200 | "email": "fabien@symfony.com" 1201 | }, 1202 | { 1203 | "name": "Symfony Community", 1204 | "homepage": "http://symfony.com/contributors" 1205 | } 1206 | ], 1207 | "description": "Symfony HttpKernel Component", 1208 | "homepage": "http://symfony.com", 1209 | "time": "2013-06-11 11:46:38" 1210 | }, 1211 | { 1212 | "name": "symfony/routing", 1213 | "version": "v2.3.1", 1214 | "target-dir": "Symfony/Component/Routing", 1215 | "source": { 1216 | "type": "git", 1217 | "url": "https://github.com/symfony/Routing.git", 1218 | "reference": "v2.3.1" 1219 | }, 1220 | "dist": { 1221 | "type": "zip", 1222 | "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.3.1", 1223 | "reference": "v2.3.1", 1224 | "shasum": "" 1225 | }, 1226 | "require": { 1227 | "php": ">=5.3.3" 1228 | }, 1229 | "require-dev": { 1230 | "doctrine/common": ">=2.2,<3.0", 1231 | "psr/log": ">=1.0,<2.0", 1232 | "symfony/config": ">=2.2,<3.0", 1233 | "symfony/yaml": ">=2.0,<3.0" 1234 | }, 1235 | "suggest": { 1236 | "doctrine/common": "", 1237 | "symfony/config": "", 1238 | "symfony/yaml": "" 1239 | }, 1240 | "type": "library", 1241 | "extra": { 1242 | "branch-alias": { 1243 | "dev-master": "2.3-dev" 1244 | } 1245 | }, 1246 | "autoload": { 1247 | "psr-0": { 1248 | "Symfony\\Component\\Routing\\": "" 1249 | } 1250 | }, 1251 | "notification-url": "https://packagist.org/downloads/", 1252 | "license": [ 1253 | "MIT" 1254 | ], 1255 | "authors": [ 1256 | { 1257 | "name": "Fabien Potencier", 1258 | "email": "fabien@symfony.com" 1259 | }, 1260 | { 1261 | "name": "Symfony Community", 1262 | "homepage": "http://symfony.com/contributors" 1263 | } 1264 | ], 1265 | "description": "Symfony Routing Component", 1266 | "homepage": "http://symfony.com", 1267 | "time": "2013-05-20 08:57:26" 1268 | }, 1269 | { 1270 | "name": "symfony/yaml", 1271 | "version": "v2.3.1", 1272 | "target-dir": "Symfony/Component/Yaml", 1273 | "source": { 1274 | "type": "git", 1275 | "url": "https://github.com/symfony/Yaml.git", 1276 | "reference": "v2.3.1" 1277 | }, 1278 | "dist": { 1279 | "type": "zip", 1280 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.1", 1281 | "reference": "v2.3.1", 1282 | "shasum": "" 1283 | }, 1284 | "require": { 1285 | "php": ">=5.3.3" 1286 | }, 1287 | "type": "library", 1288 | "extra": { 1289 | "branch-alias": { 1290 | "dev-master": "2.3-dev" 1291 | } 1292 | }, 1293 | "autoload": { 1294 | "psr-0": { 1295 | "Symfony\\Component\\Yaml\\": "" 1296 | } 1297 | }, 1298 | "notification-url": "https://packagist.org/downloads/", 1299 | "license": [ 1300 | "MIT" 1301 | ], 1302 | "authors": [ 1303 | { 1304 | "name": "Fabien Potencier", 1305 | "email": "fabien@symfony.com" 1306 | }, 1307 | { 1308 | "name": "Symfony Community", 1309 | "homepage": "http://symfony.com/contributors" 1310 | } 1311 | ], 1312 | "description": "Symfony Yaml Component", 1313 | "homepage": "http://symfony.com", 1314 | "time": "2013-05-10 18:12:13" 1315 | }, 1316 | { 1317 | "name": "twig/twig", 1318 | "version": "v1.13.1", 1319 | "source": { 1320 | "type": "git", 1321 | "url": "https://github.com/fabpot/Twig.git", 1322 | "reference": "v1.13.1" 1323 | }, 1324 | "dist": { 1325 | "type": "zip", 1326 | "url": "https://api.github.com/repos/fabpot/Twig/zipball/v1.13.1", 1327 | "reference": "v1.13.1", 1328 | "shasum": "" 1329 | }, 1330 | "require": { 1331 | "php": ">=5.2.4" 1332 | }, 1333 | "type": "library", 1334 | "extra": { 1335 | "branch-alias": { 1336 | "dev-master": "1.13-dev" 1337 | } 1338 | }, 1339 | "autoload": { 1340 | "psr-0": { 1341 | "Twig_": "lib/" 1342 | } 1343 | }, 1344 | "notification-url": "https://packagist.org/downloads/", 1345 | "license": [ 1346 | "BSD-3" 1347 | ], 1348 | "authors": [ 1349 | { 1350 | "name": "Fabien Potencier", 1351 | "email": "fabien@symfony.com" 1352 | }, 1353 | { 1354 | "name": "Armin Ronacher", 1355 | "email": "armin.ronacher@active-4.com" 1356 | } 1357 | ], 1358 | "description": "Twig, the flexible, fast, and secure template language for PHP", 1359 | "homepage": "http://twig.sensiolabs.org", 1360 | "keywords": [ 1361 | "templating" 1362 | ], 1363 | "time": "2013-06-06 06:06:01" 1364 | } 1365 | ], 1366 | "aliases": [ 1367 | 1368 | ], 1369 | "minimum-stability": "stable", 1370 | "stability-flags": [ 1371 | 1372 | ], 1373 | "platform": { 1374 | "php": ">=5.3.3" 1375 | }, 1376 | "platform-dev": [ 1377 | 1378 | ] 1379 | } 1380 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | tests 21 | 22 | 23 | 24 | 25 | vendor 26 | tests 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/Ghostscript/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 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 Ghostscript\Exception; 13 | 14 | interface ExceptionInterface 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/Ghostscript/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | 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 Ghostscript\Exception; 13 | 14 | class RuntimeException extends \RuntimeException implements ExceptionInterface 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/Ghostscript/GhostscriptServiceProvider.php: -------------------------------------------------------------------------------- 1 | 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 Ghostscript; 13 | 14 | use Silex\ServiceProviderInterface; 15 | use Silex\Application; 16 | 17 | class GhostscriptServiceProvider implements ServiceProviderInterface 18 | { 19 | public function register(Application $app) 20 | { 21 | $app['ghostscript.default.configuration'] = array( 22 | 'gs.binaries' => array('gs'), 23 | 'timeout' => 60, 24 | ); 25 | $app['ghostscript.configuration'] = array(); 26 | $app['ghostscript.logger'] = null; 27 | 28 | $app['ghostscript.transcoder'] = $app->share(function(Application $app) { 29 | $app['ghostscript.configuration'] = array_replace( 30 | $app['ghostscript.default.configuration'], $app['ghostscript.configuration'] 31 | ); 32 | 33 | return Transcoder::create($app['ghostscript.configuration'], $app['ghostscript.logger']); 34 | }); 35 | } 36 | 37 | public function boot(Application $app) 38 | { 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Ghostscript/Transcoder.php: -------------------------------------------------------------------------------- 1 | command(array( 36 | '-sDEVICE=jpeg', 37 | '-dNOPAUSE', 38 | '-dBATCH', 39 | '-dSAFER', 40 | '-sOutputFile=' . $destination, 41 | $input, 42 | )); 43 | } catch (ExecutionFailureException $e) { 44 | throw new RuntimeException('Ghostscript was unable to transcode to Image', $e->getCode(), $e); 45 | } 46 | 47 | if (!file_exists($destination)) { 48 | throw new RuntimeException('Ghostscript was unable to transcode to Image'); 49 | } 50 | 51 | return $this; 52 | } 53 | 54 | /** 55 | * Transcode a PDF to another PDF 56 | * 57 | * @param string|array $input The path to the input file(s). 58 | * @param string $destination The path to the output file. 59 | * @param integer $pageStart The number of the first page. 60 | * @param integer $pageQuantity The number of page to include. 61 | * 62 | * @return Transcoder 63 | * 64 | * @throws RuntimeException In case of failure 65 | */ 66 | public function toPDF($input, $destination, $pageStart, $pageQuantity) 67 | { 68 | try { 69 | $this->command( 70 | array_merge( 71 | array( 72 | '-sDEVICE=pdfwrite', 73 | '-dNOPAUSE', 74 | '-dBATCH', 75 | '-dSAFER', 76 | sprintf('-dFirstPage=%d', $pageStart), 77 | sprintf('-dLastPage=%d', ($pageStart + $pageQuantity - 1)), 78 | '-sOutputFile=' . $destination, 79 | ), 80 | (is_array($input) ? $input : array($input)) 81 | ) 82 | ); 83 | } catch (ExecutionFailureException $e) { 84 | throw new RuntimeException('Ghostscript was unable to transcode to PDF', $e->getCode(), $e); 85 | } 86 | 87 | if (!file_exists($destination)) { 88 | throw new RuntimeException('Ghostscript was unable to transcode to PDF'); 89 | } 90 | 91 | return $this; 92 | } 93 | 94 | /** 95 | * Creates a Transcoder. 96 | * 97 | * @param array|ConfigurationInterface $configuration 98 | * @param LoggerInterface $logger 99 | * 100 | * @return Transcoder 101 | */ 102 | public static function create($configuration = array(), LoggerInterface $logger = null) 103 | { 104 | if (!$configuration instanceof ConfigurationInterface) { 105 | $configuration = new Configuration($configuration); 106 | } 107 | 108 | $binaries = $configuration->get('gs.binaries', array('gs')); 109 | 110 | return static::load($binaries, $logger, $configuration); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /tests/Ghostscript/Tests/GhostscriptServiceProviderTest.php: -------------------------------------------------------------------------------- 1 | register(new GhostscriptServiceProvider()); 15 | 16 | $this->assertInstanceOf('\\Ghostscript\\Transcoder', $app['ghostscript.transcoder']); 17 | } 18 | 19 | public function testRegisterWithCustomTimeout() 20 | { 21 | $app = new Application; 22 | $app->register(new GhostscriptServiceProvider(), array( 23 | 'ghostscript.configuration' => array( 24 | 'timeout' => 42 25 | ), 26 | )); 27 | 28 | $this->assertEquals(42, $app['ghostscript.transcoder']->getProcessBuilderfactory()->getTimeout()); 29 | } 30 | 31 | public function testRegisterWithCustomBinary() 32 | { 33 | $finder = new ExecutableFinder(); 34 | $MP4Box = $finder->find('MP4Box'); 35 | 36 | if (null === $MP4Box) { 37 | $this->markTestSkipped('Unable to detect MP4Box, required for this test'); 38 | } 39 | 40 | $app = new Application; 41 | $app->register(new GhostscriptServiceProvider(), array( 42 | 'ghostscript.configuration' => array( 43 | 'gs.binaries' => $MP4Box 44 | ), 45 | )); 46 | 47 | $this->assertEquals($MP4Box, $app['ghostscript.transcoder']->getProcessBuilderfactory()->getBinary()); 48 | } 49 | 50 | public function testRegisterWithCustomLogger() 51 | { 52 | $logger = $this->getMock('Psr\Log\LoggerInterface'); 53 | 54 | $app = new Application; 55 | $app->register(new GhostscriptServiceProvider(), array( 56 | 'ghostscript.logger' => $logger, 57 | )); 58 | 59 | $this->assertEquals($logger, $app['ghostscript.transcoder']->getProcessRunner()->getLogger()); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /tests/Ghostscript/Tests/TranscoderTest.php: -------------------------------------------------------------------------------- 1 | object = Transcoder::create(); 15 | } 16 | 17 | public function testTranscodeToPdf() 18 | { 19 | $dest = tempnam(sys_get_temp_dir(), 'gs_temp') . '.pdf'; 20 | $this->object->toPDF(__DIR__ . '/../../files/test.pdf', $dest, 1, 1); 21 | 22 | $this->assertTrue(file_exists($dest)); 23 | $this->assertGreaterThan(0, filesize($dest)); 24 | 25 | unlink($dest); 26 | } 27 | 28 | public function testTranscodeMergeMultiplePdfsToPdf() 29 | { 30 | $dest = tempnam(sys_get_temp_dir(), 'gs_temp') . '.pdf'; 31 | 32 | $inputFile1 = __DIR__ . '/../../files/test2.pdf'; 33 | $inputFile2 = __DIR__ . '/../../files/test3.pdf'; 34 | 35 | $this->object->toPDF(array($inputFile1, $inputFile2), $dest, 1, 1); 36 | 37 | $this->assertTrue(file_exists($dest)); 38 | $this->assertGreaterThan(max(filesize($inputFile1), filesize($inputFile2)), filesize($dest)); 39 | 40 | unlink($dest); 41 | } 42 | 43 | public function testTranscodeAIToImage() 44 | { 45 | $dest = tempnam(sys_get_temp_dir(), 'gs_temp') . '.jpg'; 46 | $this->object->toImage(__DIR__ . '/../../files/test.pdf', $dest); 47 | 48 | $this->assertTrue(file_exists($dest)); 49 | $this->assertGreaterThan(0, filesize($dest)); 50 | 51 | unlink($dest); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | add('Ghostscript\Tests', __DIR__); 5 | -------------------------------------------------------------------------------- /tests/files/plane.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alchemy-fr/Ghostscript-PHP/e851dce86f01523ef629a423dcf1700b349e1462/tests/files/plane.ai -------------------------------------------------------------------------------- /tests/files/test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alchemy-fr/Ghostscript-PHP/e851dce86f01523ef629a423dcf1700b349e1462/tests/files/test.pdf -------------------------------------------------------------------------------- /tests/files/test2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alchemy-fr/Ghostscript-PHP/e851dce86f01523ef629a423dcf1700b349e1462/tests/files/test2.pdf -------------------------------------------------------------------------------- /tests/files/test3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alchemy-fr/Ghostscript-PHP/e851dce86f01523ef629a423dcf1700b349e1462/tests/files/test3.pdf --------------------------------------------------------------------------------