-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
/phpunit.xml | ||
|
||
vendor/imagine | ||
vendor/symfony |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: php | ||
php: 5.3.8 | ||
before_script: php vendor/vendors.php | ||
script: phpunit --colors -c phpunit.xml.dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
$vendorDir = __DIR__.'/../vendor'; | ||
require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | ||
|
||
use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
|
||
$loader = new UniversalClassLoader(); | ||
$loader->registerNamespaces(array( | ||
'Symfony' => array($vendorDir.'/symfony/src'), | ||
'Imagine' => array($vendorDir.'/imagine/lib'), | ||
)); | ||
$loader->register(); | ||
|
||
spl_autoload_register(function($class) { | ||
if (0 === strpos($class, 'Liip\\ImagineBundle\\')) { | ||
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; | ||
if (!stream_resolve_include_path($path)) { | ||
return false; | ||
} | ||
require_once $path; | ||
return true; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,7 @@ | ||
<?php | ||
|
||
spl_autoload_register(function($class) { | ||
$class = ltrim($class, '\\'); | ||
if (0 === strpos($class, 'Liip\ImagineBundle\\')) { | ||
$file = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Liip\ImagineBundle\\'))).'.php'; | ||
if (file_exists($file)) { | ||
require $file; | ||
} | ||
} | ||
}); | ||
|
||
if (!defined('SYMFONY_SRC_DIR') || 'NOT_SET' === SYMFONY_SRC_DIR) { | ||
throw new \RuntimeException('You must set the Symfony src dir'); | ||
} | ||
|
||
if (!defined('IMAGINE_SRC_DIR') || 'NOT_SET' === IMAGINE_SRC_DIR) { | ||
throw new \RuntimeException('You must set the Imagine src dir'); | ||
if (file_exists($file = __DIR__.'/autoload.php')) { | ||
require_once $file; | ||
} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { | ||
require_once $file; | ||
} | ||
|
||
require_once SYMFONY_SRC_DIR.'/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | ||
|
||
$loader = new \Symfony\Component\ClassLoader\UniversalClassLoader(); | ||
$loader->registerNamespace('Symfony', SYMFONY_SRC_DIR); | ||
$loader->registerNamespace('Imagine', IMAGINE_SRC_DIR); | ||
$loader->register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
set_time_limit(0); | ||
|
||
if (!is_dir($vendorDir = __DIR__)) { | ||
mkdir($vendorDir, 0777, true); | ||
} | ||
|
||
$deps = array( | ||
array('symfony', 'http://github.com/symfony/symfony', 'v2.0.5'), | ||
array('imagine', 'http://github.com/avalanche123/Imagine', 'v0.2.6'), | ||
); | ||
|
||
foreach ($deps as $dep) { | ||
list($name, $url, $rev) = $dep; | ||
|
||
echo "> Installing/Updating $name\n"; | ||
|
||
$installDir = $vendorDir.'/'.$name; | ||
if (!is_dir($installDir)) { | ||
system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir))); | ||
} | ||
|
||
if ($rev) { | ||
system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev))); | ||
} | ||
} |