PK ?V_A43 3 phpunit.xml.distnu W+A
./Goutte/Tests
PK ?VN#6 #6
composer.locknu W+A {
"hash": "62ed4b74fc5e6c55b519cc3fa45208f1",
"packages": [
{
"name": "guzzle/guzzle",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "v3.3.0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/v3.3.0",
"reference": "v3.3.0",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=5.3.2",
"symfony/event-dispatcher": ">=2.1"
},
"replace": {
"guzzle/batch": "self.version",
"guzzle/cache": "self.version",
"guzzle/common": "self.version",
"guzzle/http": "self.version",
"guzzle/inflection": "self.version",
"guzzle/iterator": "self.version",
"guzzle/log": "self.version",
"guzzle/parser": "self.version",
"guzzle/plugin": "self.version",
"guzzle/plugin-async": "self.version",
"guzzle/plugin-backoff": "self.version",
"guzzle/plugin-cache": "self.version",
"guzzle/plugin-cookie": "self.version",
"guzzle/plugin-curlauth": "self.version",
"guzzle/plugin-error-response": "self.version",
"guzzle/plugin-history": "self.version",
"guzzle/plugin-log": "self.version",
"guzzle/plugin-md5": "self.version",
"guzzle/plugin-mock": "self.version",
"guzzle/plugin-oauth": "self.version",
"guzzle/service": "self.version",
"guzzle/stream": "self.version"
},
"require-dev": {
"doctrine/cache": "*",
"monolog/monolog": "1.*",
"phpunit/phpunit": "3.7.*",
"symfony/class-loader": "*",
"zend/zend-cache1": "1.12",
"zend/zend-log1": "1.12",
"zendframework/zend-cache": "2.0.*",
"zendframework/zend-log": "2.0.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
}
},
"autoload": {
"psr-0": {
"Guzzle\\Tests": "tests/",
"Guzzle": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Guzzle Community",
"homepage": "https://github.com/guzzle/guzzle/contributors"
}
],
"description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2013-03-04 00:41:45"
},
{
"name": "symfony/browser-kit",
"version": "v2.2.0",
"target-dir": "Symfony/Component/BrowserKit",
"source": {
"type": "git",
"url": "https://github.com/symfony/BrowserKit.git",
"reference": "v2.2.0-RC3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/BrowserKit/zipball/v2.2.0-RC3",
"reference": "v2.2.0-RC3",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/dom-crawler": ">=2.0,<3.0"
},
"require-dev": {
"symfony/css-selector": ">=2.0,<3.0",
"symfony/process": ">=2.0,<3.0"
},
"suggest": {
"symfony/process": "2.2.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\BrowserKit\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony BrowserKit Component",
"homepage": "http://symfony.com",
"time": "2013-02-23 06:46:07"
},
{
"name": "symfony/css-selector",
"version": "v2.2.0",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
"reference": "v2.2.0-RC3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/CssSelector/zipball/v2.2.0-RC3",
"reference": "v2.2.0-RC3",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\CssSelector\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
"time": "2013-01-17 15:25:59"
},
{
"name": "symfony/dom-crawler",
"version": "v2.2.0",
"target-dir": "Symfony/Component/DomCrawler",
"source": {
"type": "git",
"url": "https://github.com/symfony/DomCrawler.git",
"reference": "v2.2.0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.2.0",
"reference": "v2.2.0",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/css-selector": ">=2.0,<3.0"
},
"suggest": {
"symfony/css-selector": "2.2.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\DomCrawler\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DomCrawler Component",
"homepage": "http://symfony.com",
"time": "2013-03-01 06:43:14"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.2.0",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
"reference": "v2.2.0-RC3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.0-RC3",
"reference": "v2.2.0-RC3",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/dependency-injection": ">=2.0,<3.0"
},
"suggest": {
"symfony/dependency-injection": "2.2.*",
"symfony/http-kernel": "2.2.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\EventDispatcher\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
"time": "2013-02-11 11:26:43"
},
{
"name": "symfony/finder",
"version": "v2.2.0",
"target-dir": "Symfony/Component/Finder",
"source": {
"type": "git",
"url": "https://github.com/symfony/Finder.git",
"reference": "v2.2.0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Finder/zipball/v2.2.0",
"reference": "v2.2.0",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Finder\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Finder Component",
"homepage": "http://symfony.com",
"time": "2013-02-28 14:06:36"
},
{
"name": "symfony/process",
"version": "v2.2.0",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
"reference": "v2.2.0-RC3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Process/zipball/v2.2.0-RC3",
"reference": "v2.2.0-RC3",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Process\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
"time": "2013-02-18 21:28:10"
}
],
"packages-dev": [
],
"aliases": [
],
"minimum-stability": "stable",
"stability-flags": [
],
"platform": {
"php": ">=5.3.0",
"ext-curl": "*"
},
"platform-dev": [
]
}
PK ?VT) ) LICENSEnu W+A Copyright (c) 2010-2013 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
PK ?V6G Goutte/Tests/ClientTest.phpnu W+A
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Goutte\Tests;
use Goutte\Client;
use Symfony\Component\BrowserKit\Cookie;
use Guzzle\Http\Message\Response as GuzzleResponse;
use Guzzle\Http\Client as GuzzleClient;
use Guzzle\Plugin\Mock\MockPlugin;
use Guzzle\Plugin\History\HistoryPlugin;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Message\PostFile;
/**
* Goutte Client Test
*
* @author Michael Dowling
*/
class ClientTest extends \PHPUnit_Framework_TestCase
{
protected $history;
protected $mockPlugin;
protected function getGuzzle()
{
$this->historyPlugin = new HistoryPlugin();
$this->mockPlugin = new MockPlugin();
$this->mockPlugin->addResponse(new GuzzleResponse(200, null, 'Hi
'));
$guzzle = new GuzzleClient('', array('redirect.disable' => true));
$guzzle->getEventDispatcher()->addSubscriber($this->mockPlugin);
$guzzle->getEventDispatcher()->addSubscriber($this->historyPlugin);
return $guzzle;
}
public function testCreatesDefaultClient()
{
$client = new Client();
$this->assertInstanceOf('Guzzle\\Http\\ClientInterface', $client->getClient());
}
public function testUsesCustomClient()
{
$guzzle = new GuzzleClient();
$client = new Client();
$this->assertSame($client, $client->setClient($guzzle));
$this->assertSame($guzzle, $client->getClient());
}
public function testUsesCustomHeaders()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setHeader('X-Test', 'test');
$crawler = $client->request('GET', 'http://www.example.com/');
$this->assertEquals('test', $this->historyPlugin->getLastRequest()->getHeader('X-Test'));
}
public function testCustomUserAgent()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setHeader('User-Agent', 'foo');
$crawler = $client->request('GET', 'http://www.example.com/');
$this->assertEquals('foo', $this->historyPlugin->getLastRequest()->getHeader('User-Agent'));
}
public function testUsesAuth()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->setAuth('me', '**');
$crawler = $client->request('GET', 'http://www.example.com/');
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals('me', $request->getUsername());
$this->assertEquals('**', $request->getPassword());
}
public function testUsesCookies()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$client->getCookieJar()->set(new Cookie('test', '123'));
$crawler = $client->request('GET', 'http://www.example.com/');
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals('123', $request->getCookie('test'));
}
public function testUsesPostFiles()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$files = array(
'test' => array(
'name' => 'test.txt',
'tmp_name' => __FILE__
)
);
$crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(array(
'test' => array(
new PostFile('test', __FILE__, 'text/x-php')
)
), $request->getPostFiles());
}
public function testUsesPostNamedFiles()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$files = array(
'test' => __FILE__
);
$crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(array(
'test' => array(
new PostFile('test', __FILE__, 'text/x-php')
)
), $request->getPostFiles());
}
public function testUsesPostFilesNestedFields()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$files = array(
'form' => array(
'test' => array(
'name' => 'test.txt',
'tmp_name' => __FILE__
),
),
);
$crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(array(
'form[test]' => array(
new PostFile('form[test]', __FILE__, 'text/x-php')
)
), $request->getPostFiles());
}
public function testUsesPostFilesOnClientSide()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$files = array(
'test' => __FILE__,
);
$crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(array(
'test' => array(
new PostFile('test', __FILE__, 'text/x-php')
)
), $request->getPostFiles());
}
public function testUsesPostFilesUploadError()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$files = array(
'test' => array(
'name' => '',
'type' => '',
'tmp_name' => '',
'error' => 4,
'size' => 0,
),
);
$crawler = $client->request('POST', 'http://www.example.com/', array(), $files);
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(array(), $request->getPostFiles());
}
public function testUsesCurlOptions()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$crawler = $client->request('GET', 'http://www.example.com/');
$request = $this->historyPlugin->getLastRequest();
$this->assertEquals(0, $request->getCurlOptions()->get(CURLOPT_MAXREDIRS));
$this->assertEquals(30, $request->getCurlOptions()->get(CURLOPT_TIMEOUT));
}
public function testCreatesResponse()
{
$guzzle = $this->getGuzzle();
$client = new Client();
$client->setClient($guzzle);
$crawler = $client->request('GET', 'http://www.example.com/');
$this->assertEquals('Hi', $crawler->filter('p')->text());
}
public function testHandlesRedirectsCorrectly()
{
$guzzle = $this->getGuzzle();
$this->mockPlugin->clearQueue();
$this->mockPlugin->addResponse(new GuzzleResponse(301, array(
'Location' => 'http://www.example.com/'
)));
$this->mockPlugin->addResponse(new GuzzleResponse(200, null, 'Test
'));
$client = new Client();
$client->setClient($guzzle);
$crawler = $client->request('GET', 'http://www.example.com/');
$this->assertEquals('Test', $crawler->filter('p')->text());
// Ensure that two requests were sent
$this->assertEquals(2, count($this->historyPlugin));
}
}
PK ?V}^ Goutte/Client.phpnu W+A
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Goutte;
use Symfony\Component\BrowserKit\Client as BaseClient;
use Symfony\Component\BrowserKit\Response;
use Guzzle\Http\Exception\CurlException;
use Guzzle\Http\Exception\BadResponseException;
use Guzzle\Http\Message\Response as GuzzleResponse;
use Guzzle\Http\ClientInterface as GuzzleClientInterface;
use Guzzle\Http\Client as GuzzleClient;
use Guzzle\Http\Message\EntityEnclosingRequestInterface;
/**
* Client.
*
* @package Goutte
* @author Fabien Potencier
* @author Michael Dowling
*/
class Client extends BaseClient
{
const VERSION = '0.2';
protected $headers = array();
protected $auth = null;
protected $client;
public function setClient(GuzzleClientInterface $client)
{
$this->client = $client;
return $this;
}
public function getClient()
{
if (!$this->client) {
$this->client = new GuzzleClient('', array('redirect.disable' => true));
}
return $this->client;
}
public function setHeader($name, $value)
{
$this->headers[$name] = $value;
return $this;
}
public function setAuth($user, $password = '', $type = CURLAUTH_BASIC)
{
$this->auth = array(
'user' => $user,
'password' => $password,
'type' => $type
);
return $this;
}
protected function doRequest($request)
{
$headers = array();
foreach ($request->getServer() as $key => $val) {
$key = ucfirst(strtolower(str_replace(array('_', 'HTTP-'), array('-', ''), $key)));
if (!isset($headers[$key])) {
$headers[$key] = $val;
}
}
$body = null;
if (!in_array($request->getMethod(), array('GET','HEAD'))) {
if (null !== $request->getContent()) {
$body = $request->getContent();
} else {
$body = $request->getParameters();
}
}
$guzzleRequest = $this->getClient()->createRequest(
$request->getMethod(),
$request->getUri(),
$headers,
$body
);
foreach ($this->headers as $name => $value) {
$guzzleRequest->setHeader($name, $value);
}
if ($this->auth !== null) {
$guzzleRequest->setAuth(
$this->auth['user'],
$this->auth['password'],
$this->auth['type']
);
}
foreach ($this->getCookieJar()->allRawValues($request->getUri()) as $name => $value) {
$guzzleRequest->addCookie($name, $value);
}
if ('POST' == $request->getMethod()) {
$this->addPostFiles($guzzleRequest, $request->getFiles());
}
$guzzleRequest->getParams()->set('redirect.disable', true);
$curlOptions = $guzzleRequest->getCurlOptions();
if (!$curlOptions->hasKey(CURLOPT_TIMEOUT)) {
$curlOptions->set(CURLOPT_TIMEOUT, 30);
}
// Let BrowserKit handle redirects
try {
$response = $guzzleRequest->send();
} catch (CurlException $e) {
if (!strpos($e->getMessage(), 'redirects')) {
throw $e;
}
$response = $e->getResponse();
} catch (BadResponseException $e) {
$response = $e->getResponse();
}
return $this->createResponse($response);
}
protected function addPostFiles($request, array $files, $arrayName = '')
{
if (!$request instanceof EntityEnclosingRequestInterface) {
return;
}
foreach ($files as $name => $info) {
if (!empty($arrayName)) {
$name = $arrayName . '[' . $name . ']';
}
if (is_array($info)) {
if (isset($info['tmp_name'])) {
if ('' !== $info['tmp_name']) {
$request->addPostFile($name, $info['tmp_name']);
} else {
continue;
}
} else {
$this->addPostFiles($request, $info, $name);
}
} else {
$request->addPostFile($name, $info);
}
}
}
protected function createResponse(GuzzleResponse $response)
{
return new Response($response->getBody(true), $response->getStatusCode(), $response->getHeaders()->getAll());
}
}
PK ?V8 Goutte/Compiler.phpnu W+A
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Goutte;
use Symfony\Component\Finder\Finder;
/**
* The Compiler class compiles the Goutte utility.
*
* @author Fabien Potencier
*/
class Compiler
{
public function compile($pharFile = 'goutte.phar')
{
if (file_exists($pharFile)) {
unlink($pharFile);
}
$phar = new \Phar($pharFile, 0, 'Goutte');
$phar->setSignatureAlgorithm(\Phar::SHA1);
$phar->startBuffering();
// CLI Component files
foreach ($this->getFiles() as $file) {
$path = str_replace(__DIR__.'/', '', $file);
$phar->addFromString($path, file_get_contents($file));
}
// Stubs
$phar['_cli_stub.php'] = $this->getCliStub();
$phar['_web_stub.php'] = $this->getWebStub();
$phar->setDefaultStub('_cli_stub.php', '_web_stub.php');
$phar->stopBuffering();
// $phar->compressFiles(\Phar::GZ);
unset($phar);
}
protected function getCliStub()
{
return "getLicense()." require_once __DIR__.'/vendor/autoload.php'; __HALT_COMPILER();";
}
protected function getWebStub()
{
return "
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/';
}
protected function getFiles()
{
$files = array(
'LICENSE',
'vendor/autoload.php',
'Goutte/Client.php',
);
$dirs = array(
'vendor/composer',
'vendor/symfony',
'vendor/guzzle'
);
$iterator = Finder::create()->files()->name('*.php')->in($dirs);
return array_merge($files, iterator_to_array($iterator));
}
}
PK ?V|ʼnh h .travis.ymlnu W+A language: php
php:
- "5.4"
- "5.3"
before_script:
- composer install -n --dev
script:
- phpunit
PK ?V\aR7 R7 goutte.pharnu W+A 2,
'c' => 'text/plain',
'cc' => 'text/plain',
'cpp' => 'text/plain',
'c++' => 'text/plain',
'dtd' => 'text/plain',
'h' => 'text/plain',
'log' => 'text/plain',
'rng' => 'text/plain',
'txt' => 'text/plain',
'xsd' => 'text/plain',
'php' => 1,
'inc' => 1,
'avi' => 'video/avi',
'bmp' => 'image/bmp',
'css' => 'text/css',
'gif' => 'image/gif',
'htm' => 'text/html',
'html' => 'text/html',
'htmls' => 'text/html',
'ico' => 'image/x-ico',
'jpe' => 'image/jpeg',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
'js' => 'application/x-javascript',
'midi' => 'audio/midi',
'mid' => 'audio/midi',
'mod' => 'audio/mod',
'mov' => 'movie/quicktime',
'mp3' => 'audio/mp3',
'mpg' => 'video/mpeg',
'mpeg' => 'video/mpeg',
'pdf' => 'application/pdf',
'png' => 'image/png',
'swf' => 'application/shockwave-flash',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'wav' => 'audio/wav',
'xbm' => 'image/xbm',
'xml' => 'text/xml',
);
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$basename = basename(__FILE__);
if (!strpos($_SERVER['REQUEST_URI'], $basename)) {
chdir(Extract_Phar::$temp);
include $web;
return;
}
$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));
if (!$pt || $pt == '/') {
$pt = $web;
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);
exit;
}
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
header('HTTP/1.0 404 Not Found');
echo "\n \n File Not Found\n \n \n 404 - File ", $pt, " Not Found
\n \n";
exit;
}
$b = pathinfo($a);
if (!isset($b['extension'])) {
header('Content-Type: text/plain');
header('Content-Length: ' . filesize($a));
readfile($a);
exit;
}
if (isset($mimes[$b['extension']])) {
if ($mimes[$b['extension']] === 1) {
include $a;
exit;
}
if ($mimes[$b['extension']] === 2) {
highlight_file($a);
exit;
}
header('Content-Type: ' .$mimes[$b['extension']]);
header('Content-Length: ' . filesize($a));
readfile($a);
exit;
}
}
class Extract_Phar
{
static $temp;
static $origdir;
const GZ = 0x1000;
const BZ2 = 0x2000;
const MASK = 0x3000;
const START = '_cli_stub.php';
const LEN = 6693;
static function go($return = false)
{
$fp = fopen(__FILE__, 'rb');
fseek($fp, self::LEN);
$L = unpack('V', $a = (binary)fread($fp, 4));
$m = (binary)'';
do {
$read = 8192;
if ($L[1] - strlen($m) < 8192) {
$read = $L[1] - strlen($m);
}
$last = (binary)fread($fp, $read);
$m .= $last;
} while (strlen($last) && strlen($m) < $L[1]);
if (strlen($m) < $L[1]) {
die('ERROR: manifest length read was "' .
strlen($m) .'" should be "' .
$L[1] . '"');
}
$info = self::_unpack($m);
$f = $info['c'];
if ($f & self::GZ) {
if (!function_exists('gzinflate')) {
die('Error: zlib extension is not enabled -' .
' gzinflate() function needed for zlib-compressed .phars');
}
}
if ($f & self::BZ2) {
if (!function_exists('bzdecompress')) {
die('Error: bzip2 extension is not enabled -' .
' bzdecompress() function needed for bz2-compressed .phars');
}
}
$temp = self::tmpdir();
if (!$temp || !is_writable($temp)) {
$sessionpath = session_save_path();
if (strpos ($sessionpath, ";") !== false)
$sessionpath = substr ($sessionpath, strpos ($sessionpath, ";")+1);
if (!file_exists($sessionpath) || !is_dir($sessionpath)) {
die('Could not locate temporary directory to extract phar');
}
$temp = $sessionpath;
}
$temp .= '/pharextract/'.basename(__FILE__, '.phar');
self::$temp = $temp;
self::$origdir = getcwd();
@mkdir($temp, 0777, true);
$temp = realpath($temp);
if (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {
self::_removeTmpFiles($temp, getcwd());
@mkdir($temp, 0777, true);
@file_put_contents($temp . '/' . md5_file(__FILE__), '');
foreach ($info['m'] as $path => $file) {
$a = !file_exists(dirname($temp . '/' . $path));
@mkdir(dirname($temp . '/' . $path), 0777, true);
clearstatcache();
if ($path[strlen($path) - 1] == '/') {
@mkdir($temp . '/' . $path, 0777);
} else {
file_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));
@chmod($temp . '/' . $path, 0666);
}
}
}
chdir($temp);
if (!$return) {
include self::START;
}
}
static function tmpdir()
{
if (strpos(PHP_OS, 'WIN') !== false) {
if ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {
return $var;
}
if (is_dir('/temp') || mkdir('/temp')) {
return realpath('/temp');
}
return false;
}
if ($var = getenv('TMPDIR')) {
return $var;
}
return realpath('/tmp');
}
static function _unpack($m)
{
$info = unpack('V', substr($m, 0, 4));
$l = unpack('V', substr($m, 10, 4));
$m = substr($m, 14 + $l[1]);
$s = unpack('V', substr($m, 0, 4));
$o = 0;
$start = 4 + $s[1];
$ret['c'] = 0;
for ($i = 0; $i < $info[1]; $i++) {
$len = unpack('V', substr($m, $start, 4));
$start += 4;
$savepath = substr($m, $start, $len[1]);
$start += $len[1];
$ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));
$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]
& 0xffffffff);
$ret['m'][$savepath][7] = $o;
$o += $ret['m'][$savepath][2];
$start += 24 + $ret['m'][$savepath][5];
$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;
}
return $ret;
}
static function extractFile($path, $entry, $fp)
{
$data = '';
$c = $entry[2];
while ($c) {
if ($c < 8192) {
$data .= @fread($fp, $c);
$c = 0;
} else {
$c -= 8192;
$data .= @fread($fp, 8192);
}
}
if ($entry[4] & self::GZ) {
$data = gzinflate($data);
} elseif ($entry[4] & self::BZ2) {
$data = bzdecompress($data);
}
if (strlen($data) != $entry[0]) {
die("Invalid internal .phar file (size error " . strlen($data) . " != " .
$stat[7] . ")");
}
if ($entry[3] != sprintf("%u", crc32((binary)$data) & 0xffffffff)) {
die("Invalid internal .phar file (checksum error)");
}
return $data;
}
static function _removeTmpFiles($temp, $origdir)
{
chdir($temp);
foreach (glob('*') as $f) {
if (file_exists($f)) {
is_dir($f) ? @rmdir($f) : @unlink($f);
if (file_exists($f) && is_dir($f)) {
self::_removeTmpFiles($f, getcwd());
}
}
}
@rmdir($temp);
clearstatcache();
chdir($origdir);
}
}
Extract_Phar::go();
__HALT_COMPILER(); ?>
Goutte LICENSE) 9Q) T vendor/autoload.php 9Q !< Goutte/Client.php 9Q }^ % vendor/composer/autoload_classmap.php 9Q ^V ' vendor/composer/autoload_namespaces.php 9Q " ! vendor/composer/autoload_real.php 9Q T'4 vendor/composer/ClassLoader.php 9Q ;yi B vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Client.php3 9Q3 'v B vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Cookie.php! 9Q! v E vendor/symfony/browser-kit/Symfony/Component/BrowserKit/CookieJar.php] 9Q] 2 C vendor/symfony/browser-kit/Symfony/Component/BrowserKit/History.php 9Q
Zڶ C vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Request.php
9Q
D vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Response.php-
9Q-
l L vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/ClientTest.phpI 9QI bݶ O vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/CookieJarTest.php 9Q p/V L vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/CookieTest.php 9Q ն M vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/HistoryTest.php 9Q K M vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/RequestTest.php 9Q |ƶ N vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Tests/ResponseTest.php 9Q {2w I vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php( 9Q( =fZ V vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.phpN 9QN uZ M vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttribNode.phpw 9Qw