-
Notifications
You must be signed in to change notification settings - Fork 10
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
27 changed files
with
1,128 additions
and
334 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
vendor/ | ||
_reports | ||
*.bak | ||
soa.log | ||
*.DS_Store | ||
.project | ||
.classpath | ||
uploads/ | ||
*sublime* |
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,4 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
include('doctrine.php'); |
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,38 @@ | ||
<?php | ||
|
||
include __DIR__.'/../bootstrap.php'; | ||
|
||
$helpers = array( | ||
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), | ||
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) | ||
); | ||
|
||
$cli = new \Symfony\Component\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION); | ||
$cli->setCatchExceptions(true); | ||
$helperSet = $cli->getHelperSet(); | ||
foreach ($helpers as $name => $helper) { | ||
$helperSet->set($helper, $name); | ||
} | ||
$cli->addCommands(array( | ||
// DBAL Commands | ||
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), | ||
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), | ||
|
||
// ORM Commands | ||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), | ||
new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), | ||
|
||
)); | ||
$cli->run(); |
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,106 @@ | ||
<?php | ||
use Silex\Provider\DoctrineServiceProvider; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Silex\Provider\ValidatorServiceProvider; | ||
use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
|
||
|
||
use Doctrine\ORM\Tools\Setup, | ||
Doctrine\ORM\EntityManager, | ||
Doctrine\Common\EventManager as EventManager, | ||
Doctrine\ORM\Events, | ||
Doctrine\ORM\Configuration, | ||
Doctrine\Common\Cache\ArrayCache as Cache, | ||
Doctrine\Common\Annotations\AnnotationRegistry, | ||
Doctrine\Common\ClassLoader; | ||
|
||
require_once __DIR__.'/vendor/silex.phar'; | ||
|
||
require_once __DIR__.'/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php'; | ||
|
||
$classLoaderSymfony = new \Doctrine\Common\ClassLoader('Symfony', __DIR__.'/vendor' ); | ||
$classLoaderSymfony->register(); | ||
|
||
$classLoaderDoctrineCommon = new \Doctrine\Common\ClassLoader('Doctrine\\Common', __DIR__.'/vendor/doctrine/common/lib' ); | ||
$classLoaderDoctrineCommon->register(); | ||
|
||
$classLoaderDoctrineMigrations = new \Doctrine\Common\ClassLoader('Doctrine\\DBAL\\Migrations', __DIR__.'/vendor/doctrine/dbal/lib' ); | ||
$classLoaderDoctrineMigrations->register(); | ||
|
||
$classLoaderDoctrineDbal = new \Doctrine\Common\ClassLoader('Doctrine\\DBAL', __DIR__.'/vendor/doctrine/dbal/lib' ); | ||
$classLoaderDoctrineDbal->register(); | ||
|
||
$classLoaderDoctrine = new \Doctrine\Common\ClassLoader('Doctrine', __DIR__.'/vendor/doctrine/orm/lib' ); | ||
$classLoaderDoctrine->register(); | ||
|
||
$classLoaderJMS = new \Doctrine\Common\ClassLoader('JMS', __DIR__.'/vendor' ); | ||
$classLoaderJMS->register(); | ||
|
||
$classLoaderDMS = new \Doctrine\Common\ClassLoader('DMS', __DIR__.'/vendor' ); | ||
$classLoaderDMS->register(); | ||
|
||
$classLoaderMetadata = new \Doctrine\Common\ClassLoader('Metadata', __DIR__.'/vendor/Metadata/src' ); | ||
$classLoaderMetadata->register(); | ||
|
||
$classLoaderModel = new \Doctrine\Common\ClassLoader('model', __DIR__ ); | ||
$classLoaderModel->register(); | ||
|
||
$classLoaderService = new \Doctrine\Common\ClassLoader('service', __DIR__ ); | ||
$classLoaderService->register(); | ||
|
||
$classLoaderTest = new \Doctrine\Common\ClassLoader('test', __DIR__ ); | ||
$classLoaderTest->register(); | ||
|
||
$classLoaderCoderockr = new \Doctrine\Common\ClassLoader('Coderockr', __DIR__.'/vendor' ); | ||
$classLoaderCoderockr->register(); | ||
|
||
if(!getenv('APPLICATION_ENV')) | ||
$env = 'testing'; | ||
else | ||
$env = getenv('APPLICATION_ENV'); | ||
|
||
if ($env == 'testing') | ||
include __DIR__.'/configs/configs.testing.php'; | ||
elseif ($env == 'development') | ||
include __DIR__.'/configs/configs.development.php'; | ||
else | ||
include __DIR__.'/configs/configs.php'; | ||
|
||
include __DIR__.'/library/filter.php'; | ||
|
||
//doctrine | ||
$config = new Configuration(); | ||
$cache = new Cache(); | ||
$config->setQueryCacheImpl($cache); | ||
$config->setProxyDir('/tmp'); | ||
$config->setProxyNamespace('EntityProxy'); | ||
$config->setAutoGenerateProxyClasses(true); | ||
|
||
//mapping (example uses annotations, could be any of XML/YAML or plain PHP) | ||
AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); | ||
AnnotationRegistry::registerAutoloadNamespace('JMS', __DIR__.'/vendor'); | ||
|
||
$driver = new Doctrine\ORM\Mapping\Driver\AnnotationDriver( | ||
new Doctrine\Common\Annotations\AnnotationReader(), | ||
array(__DIR__ .'/model') | ||
); | ||
$config->setMetadataDriverImpl($driver); | ||
$config->setMetadataCacheImpl($cache); | ||
|
||
//getting the EntityManager | ||
$em = EntityManager::create( | ||
$dbOptions, | ||
$config | ||
); | ||
|
||
|
||
//load subscribers | ||
$evm = $em->getEventManager(); | ||
$directoryIterator = new \DirectoryIterator(__DIR__ . '/model/subscriber'); | ||
foreach ($directoryIterator as $f) { | ||
if ($f->getFileName() != '.' && $f->getFilename() !='..') { | ||
$subscriber = 'model\\subscriber\\' . $f->getBasename('.php'); | ||
$evm->addEventSubscriber(new $subscriber); | ||
} | ||
} |
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,6 +1,6 @@ | ||
<?php | ||
|
||
$clients = array( | ||
'85e4a615f62c711d3aac0e7def5b4903' => 'Coderockr App 1', | ||
'85e4a615f62c71sdfdsfds1d3aac0e7def5b4903' => 'Coderockr App 2', | ||
'85e4a615f62c711d3aac0e7def5b4903' => 'Test Suite', | ||
'85e4a615f62c71sdfdsfds1d3aac0e7def5b4903' => 'Admin Interface', | ||
); |
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,11 @@ | ||
<?php | ||
$dbOptions = array( | ||
'driver' => 'pdo_mysql', | ||
'host' => 'soatest.dev', | ||
'port' => '3306', | ||
'user' => 'root', | ||
'password' => '', | ||
'dbname' => '48pratos', | ||
); | ||
|
||
$soaUrl = 'http://soatest.dev:8080'; |
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,7 +1,10 @@ | ||
<?php | ||
$dbOptions = array( | ||
'driver' => 'pdo_mysql', | ||
'host' => 'localhost', | ||
'user' => 'root', | ||
'dbname' => 'rest', | ||
); | ||
'driver' => 'pdo_mysql', | ||
'host' => 'localhost', | ||
'user' => 'root', | ||
'password' => '', | ||
'dbname' => '48pratos', | ||
); | ||
|
||
$soaUrl = 'http://soa.dev'; |
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,11 @@ | ||
<?php | ||
$dbOptions = array( | ||
'driver' => 'pdo_mysql', | ||
'host' => 'soatest.dev', | ||
'port' => '3306', | ||
'user' => 'root', | ||
'password' => '', | ||
'dbname' => '48pratos_test', | ||
); | ||
|
||
$soaUrl = 'http://soatest.dev:8080'; |
Binary file not shown.
Oops, something went wrong.