Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge e5c9e7f

  • Loading branch information...
commit e516f617e61ccf8ecd643debcba3882f4a670a3e 1 parent e2b9d83
@willdurand willdurand authored Virginie BARDALES committed
View
8 .gitignore
@@ -1,6 +1,6 @@
-/phpunit.xml
-/Tests/autoload.php
-/vendor/*
-!/vendor/vendors.php
+phpunit.xml
+Tests/autoload.php
+vendor/
Propel/om/
Propel/map/
+composer.lock
View
24 Tests/Propel/PropelTestCase.php
@@ -0,0 +1,24 @@
+<?php
+
+/*
+ * This file is part of the FOSOAuthServerBundle package.
+ *
+ * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace FOS\OAuthServerBundle\Tests\Propel;
+
+use FOS\OAuthServerBundle\Tests\TestCase;
+
+class PropelTestCase extends TestCase
+{
+ public function setUp()
+ {
+ if (!class_exists('\Propel')) {
+ $this->markTestSkipped('Propel is not installed.');
+ }
+ }
+}
View
3  Tests/Propel/TokenTest.php
@@ -12,9 +12,8 @@
namespace FOS\OAuthServerBundle\Tests\Propel;
use FOS\OAuthServerBundle\Propel\Token;
-use FOS\OAuthServerBundle\Tests\TestCase;
-class TokenTest extends TestCase
+class TokenTest extends PropelTestCase
{
/**
* @dataProvider getTestHasExpiredData
View
43 Tests/autoload.php.dist
@@ -1,43 +0,0 @@
-<?php
-
-/*
- * This file is part of the FOSOAuthServerBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-$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' => $vendorDir.'/symfony/src',
- 'OAuth2' => $vendorDir.'/oauth2-php/lib',
- 'Doctrine\\Common' => $vendorDir.'/doctrine-common/lib',
- 'Doctrine\\DBAL' => $vendorDir.'/doctrine-dbal/lib',
- 'Doctrine\\ODM\\MongoDB' => $vendorDir.'/doctrine-mongodb-odm/lib',
- 'Doctrine\\MongoDB' => $vendorDir.'/doctrine-mongodb/lib',
- 'Doctrine\\ODM\\CouchDB' => $vendorDir.'/doctrine-couchdb/lib',
- 'Doctrine\\CouchDB' => $vendorDir.'/doctrine-couchdb/lib',
- 'Doctrine\\ORM' => $vendorDir.'/doctrine/lib',
-));
-$loader->register();
-
-spl_autoload_register(function($class) {
- if (0 === strpos($class, 'FOS\\OAuthServerBundle\\')) {
- $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
- if (!stream_resolve_include_path($path)) {
- return false;
- }
- require_once $path;
-
- return true;
- }
-});
-
-require_once $vendorDir . '/propel/runtime/lib/Propel.php';
View
30 Tests/bootstrap.php
@@ -9,8 +9,32 @@
* file that was distributed with this source code.
*/
-if (file_exists($file = __DIR__.'/autoload.php')) {
- require_once $file;
-} elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
+require_once __DIR__ . '/../vendor/.composer/autoload.php';
+
+// require Propel
+if (file_exists($file = __DIR__ . '/../vendor/propel/propel1/generator/lib/util/PropelQuickBuilder.php')) {
+ set_include_path(__DIR__ . '/../vendor/phing/phing/classes' . PATH_SEPARATOR . get_include_path());
require_once $file;
}
+
+spl_autoload_register(function($class) {
+ if (0 === strpos($class, 'FOS\\OAuthServerBundle\\')) {
+ $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
+ if (!stream_resolve_include_path($path)) {
+ return false;
+ }
+ require_once $path;
+
+ return true;
+ }
+});
+
+// Generate Propel base classes on the fly
+if (class_exists('TypehintableBehavior')) {
+ $class = new \ReflectionClass('TypehintableBehavior');
+ $builder = new \PropelQuickBuilder();
+ $builder->getConfig()->setBuildProperty('behavior.typehintable.class', $class->getFileName());
+ $builder->setSchema(file_get_contents(__DIR__ . '/../Resources/config/propel/schema.xml'));
+ $builder->setClassTargets(array('tablemap', 'peer', 'object', 'query', 'peerstub'));
+ $builder->buildClasses();
+}
View
10 composer.json
@@ -20,11 +20,17 @@
"symfony/framework-bundle": "2.0.*",
"symfony/security-bundle": "2.0.*"
},
+ "require-dev": {
+ "symfony/symfony": "dev-master",
+ "doctrine/orm": "dev-master",
+ "doctrine/mongodb-odm": "dev-master",
+ "willdurand/propel-typehintable-behavior": "dev-master"
+ },
"suggest": {
"doctrine/doctrine-bundle": "2.0.*",
"doctrine/mongodb-odm-bundle": "2.0.*",
- "propel/propel-bundle": "*",
- "willdurand/propel-typehintable-behavior": "*"
+ "propel/propel-bundle": "If you want to user Propel with Symfony2, then you will have to install the PropelBundle",
+ "willdurand/propel-typehintable-behavior": "The Typehintable behavior is useful to add type hints on generated methods, to be compliant with interfaces"
},
"autoload": {
"psr-0": { "FOS\\OAuthServerBundle": "" }
View
51 vendor/vendors.php
@@ -1,51 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/*
- * This file is part of the FOSOAuthServerBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-set_time_limit(0);
-
-if (isset($argv[1])) {
- $_SERVER['SYMFONY_VERSION'] = $argv[1];
-}
-
-$vendorDir = __DIR__;
-$deps = array(
- array('symfony', 'git://github.com/symfony/symfony.git', isset($_SERVER['SYMFONY_VERSION']) ? $_SERVER['SYMFONY_VERSION'] : 'origin/master'),
- array('oauth2-php', 'git://github.com/FriendsOfSymfony/oauth2-php', 'origin/master'),
- array('doctrine-common', 'git://github.com/doctrine/common.git', 'origin/master'),
- array('doctrine-dbal', 'git://github.com/doctrine/dbal.git', 'origin/master'),
- array('doctrine', 'git://github.com/doctrine/doctrine2.git', 'origin/master'),
- array('doctrine-mongodb-odm', 'git://github.com/doctrine/mongodb-odm.git', 'origin/master'),
- array('doctrine-mongodb', 'git://github.com/doctrine/mongodb.git', 'origin/master'),
- array('doctrine-couchdb', 'git://github.com/doctrine/couchdb-odm.git', 'origin/master'),
- array('propel', 'git://github.com/propelorm/Propel.git', 'origin/master'),
-);
-
-foreach ($deps as $dep) {
- list($name, $url, $rev) = $dep;
-
- echo "> Installing/Updating $name\n";
-
- $installDir = $vendorDir . '/' . $name;
- if (!is_dir($installDir)) {
- $return = null;
- system(sprintf('git clone -q %s %s', escapeshellarg($url), escapeshellarg($installDir)), $return);
- if ($return > 0) {
- exit($return);
- }
- }
-
- $return = null;
- system(sprintf('cd %s && git fetch -q origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)), $return);
- if ($return > 0) {
- exit($return);
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.