Skip to content

Commit

Permalink
updated project
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Mar 27, 2011
1 parent 40fbba3 commit 488e9dc
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 50 deletions.
21 changes: 21 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[submodule "vendor/Symfony/Component/BrowserKit"]
path = vendor/Symfony/Component/BrowserKit
url = https://github.com/symfony/BrowserKit
[submodule "vendor/Symfony/Component/DomCrawler"]
path = vendor/Symfony/Component/DomCrawler
url = https://github.com/symfony/DomCrawler
[submodule "vendor/Symfony/Component/CssSelector"]
path = vendor/Symfony/Component/CssSelector
url = https://github.com/symfony/CssSelector
[submodule "vendor/Symfony/Component/Process"]
path = vendor/Symfony/Component/Process
url = https://github.com/symfony/Process
[submodule "vendor/zend"]
path = vendor/zend
url = https://github.com/zendframework/zf2
[submodule "vendor/Symfony/Component/ClassLoader"]
path = vendor/Symfony/Component/ClassLoader
url = https://github.com/symfony/ClassLoader
[submodule "vendor/Symfony/Component/Finder"]
path = vendor/Symfony/Component/Finder
url = https://github.com/symfony/Finder
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010 Fabien Potencier
Copyright (c) 2010,2011 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
Expand Down
6 changes: 3 additions & 3 deletions src/autoload.php → autoload.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

require_once __DIR__.'/vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__.'/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => __DIR__.'/vendor/symfony/src',
'Symfony' => __DIR__.'/vendor',
'Zend' => __DIR__.'/vendor/zend/library',
'Goutte' => __DIR__,
'Goutte' => __DIR__.'/src',
));
$loader->register();
2 changes: 1 addition & 1 deletion compile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

require_once __DIR__.'/src/autoload.php';
require_once __DIR__.'/autoload.php';

use Goutte\Compiler;

Expand Down
Binary file modified goutte.phar
Binary file not shown.
9 changes: 0 additions & 9 deletions install_vendors.sh

This file was deleted.

2 changes: 1 addition & 1 deletion src/Goutte/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/*
* This file is part of the Goutte package.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down
50 changes: 24 additions & 26 deletions src/Goutte/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Goutte;

use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\Kernel;

/*
* This file is part of the Goutte utility.
Expand All @@ -18,7 +17,7 @@
* The Compiler class compiles the Goutte utility.
*
* @package Goutte
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
class Compiler
{
Expand All @@ -38,8 +37,7 @@ public function compile($pharFile = 'goutte.phar')
foreach ($this->getFiles() as $file)
{
$path = str_replace(__DIR__.'/', '', $file);
$content = Kernel::stripComments(file_get_contents($file));
$content = preg_replace("#require_once 'Zend/.*?';#", '', $content);
$content = preg_replace("#require_once 'Zend/.*?';#", '', php_strip_whitespace($file));

$phar->addFromString($path, $content);
}
Expand All @@ -58,7 +56,7 @@ public function compile($pharFile = 'goutte.phar')

protected function getCliStub()
{
return "<?php ".$this->getLicense()." require_once __DIR__.'/src/autoload.php'; __HALT_COMPILER();";
return "<?php ".$this->getLicense()." require_once __DIR__.'/autoload.php'; __HALT_COMPILER();";
}

protected function getWebStub()
Expand All @@ -72,7 +70,7 @@ protected function getLicense()
/*
* This file is part of the Goutte utility.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
Expand All @@ -83,30 +81,30 @@ protected function getFiles()
{
$files = array(
'LICENSE',
'src/autoload.php',
'src/vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php',
'src/vendor/zend/library/Zend/Exception.php',
//'src/vendor/zend/library/Zend/Date.php',
'src/vendor/zend/library/Zend/Uri/Uri.php',
'src/vendor/zend/library/Zend/Validator/Validator.php',
'src/vendor/zend/library/Zend/Validator/AbstractValidator.php',
'src/vendor/zend/library/Zend/Validator/Hostname.php',
'src/vendor/zend/library/Zend/Validator/Ip.php',
//'src/vendor/zend/library/Zend/Validator/Hostname/Biz.php',
//'src/vendor/zend/library/Zend/Validator/Hostname/Cn.php',
'src/vendor/zend/library/Zend/Validator/Hostname/Com.php',
'src/vendor/zend/library/Zend/Validator/Hostname/Jp.php',
'autoload.php',
'vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php',
'vendor/zend/library/Zend/Exception.php',
//'vendor/zend/library/Zend/Date.php',
'vendor/zend/library/Zend/Uri/Uri.php',
'vendor/zend/library/Zend/Validator/Validator.php',
'vendor/zend/library/Zend/Validator/AbstractValidator.php',
'vendor/zend/library/Zend/Validator/Hostname.php',
'vendor/zend/library/Zend/Validator/Ip.php',
//'vendor/zend/library/Zend/Validator/Hostname/Biz.php',
//'vendor/zend/library/Zend/Validator/Hostname/Cn.php',
'vendor/zend/library/Zend/Validator/Hostname/Com.php',
'vendor/zend/library/Zend/Validator/Hostname/Jp.php',
);

$dirs = array(
'src/Goutte',
'src/vendor/symfony/src/Symfony/Component/BrowserKit',
'src/vendor/symfony/src/Symfony/Component/DomCrawler',
'src/vendor/symfony/src/Symfony/Component/CssSelector',
'src/vendor/symfony/src/Symfony/Component/Process',
//'src/vendor/zend/library/Zend/Date',
'src/vendor/zend/library/Zend/Uri',
'src/vendor/zend/library/Zend/Http',
'vendor/Symfony/Component/BrowserKit',
'vendor/Symfony/Component/DomCrawler',
'vendor/Symfony/Component/CssSelector',
'vendor/Symfony/Component/Process',
//'vendor/zend/library/Zend/Date',
'vendor/zend/library/Zend/Uri',
'vendor/zend/library/Zend/Http',
);

$finder = new Finder();
Expand Down
Empty file removed src/vendor/.vendors
Empty file.
9 changes: 0 additions & 9 deletions update_vendors.sh

This file was deleted.

1 change: 1 addition & 0 deletions vendor/Symfony/Component/BrowserKit
Submodule BrowserKit added at 9839e6
1 change: 1 addition & 0 deletions vendor/Symfony/Component/ClassLoader
Submodule ClassLoader added at 250f88
1 change: 1 addition & 0 deletions vendor/Symfony/Component/CssSelector
Submodule CssSelector added at 5afebb
1 change: 1 addition & 0 deletions vendor/Symfony/Component/DomCrawler
Submodule DomCrawler added at 8ab79a
1 change: 1 addition & 0 deletions vendor/Symfony/Component/Finder
Submodule Finder added at 707b2f
1 change: 1 addition & 0 deletions vendor/Symfony/Component/Process
Submodule Process added at 64a166
1 change: 1 addition & 0 deletions vendor/zend
Submodule zend added at 4235f9

0 comments on commit 488e9dc

Please sign in to comment.