Skip to content

Commit

Permalink
Melhorias no composer e bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
vitornp committed Aug 7, 2014
1 parent 8a8c687 commit c725ab4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
24 changes: 9 additions & 15 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@

date_default_timezone_set('America/Sao_Paulo');

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\Annotations\AnnotationReader,
Doctrine\Common\ClassLoader;
define('DS', DIRECTORY_SEPARATOR);

$loader = require __DIR__.'/vendor/autoload.php';
$loader->add('Orcamentos', __DIR__.'/src');
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\ORM\Configuration;

$loader = require __DIR__ . '/vendor/autoload.php';

//doctrine
$config = new Configuration();
Expand All @@ -23,13 +17,13 @@
$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__. DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'doctrine' . DIRECTORY_SEPARATOR . 'orm' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'Doctrine' . DIRECTORY_SEPARATOR . 'ORM' . DIRECTORY_SEPARATOR . 'Mapping' . DIRECTORY_SEPARATOR . 'Driver' . DIRECTORY_SEPARATOR . 'DoctrineAnnotations.php');
AnnotationRegistry::registerFile(__DIR__ . DS . 'vendor' . DS . 'doctrine' . DS . 'orm' . DS . 'lib' . DS . 'Doctrine' . DS . 'ORM' . DS . 'Mapping' . DS . 'Driver' . DS . 'DoctrineAnnotations.php');

$driver = new Doctrine\ORM\Mapping\Driver\AnnotationDriver(
new Doctrine\Common\Annotations\AnnotationReader(),
array(__DIR__.'/src/Orcamentos/Model')
array(__DIR__ . DS . 'src' . DS . 'Orcamentos' . DS . 'Model')
);
$config->setMetadataDriverImpl($driver);
$config->setMetadataCacheImpl($cache);
$config->setMetadataCacheImpl($cache);
23 changes: 15 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{
"name": "eminetto/silex-sample",
"description": "Silex sample",
"name": "coderockr/orcamentos",
"description": "Aplicativo de gerenciamento de Orçamentos",
"require": {
"silex/silex": "1.0.*",
"symfony/http-kernel": "*",
"symfony/browser-kit": "*",
"symfony/console": "*",
"doctrine/dbal": "*",
"doctrine/orm": "*",
"dflydev/doctrine-orm-service-provider": "1.0.*@dev",
"twig/twig": ">=1.8,<2.0-dev",
"intervention/image": "dev-master",
"symfony/twig-bridge": "2.1.*",
"intervention/image": "dev-master",
"swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev",
"dflydev/doctrine-orm-service-provider": "1.0.*@dev",
"mockery/mockery": "dev-master@dev",
"zendframework/zend-crypt": "*",
"zendframework/zend-crypt": "*",
"pagerfanta/pagerfanta": "1.0.*@dev"
},
"require-dev": {
"phpunit/phpunit": "*",
"pagerfanta/pagerfanta": "1.0.*@dev",
"mockery/mockery": "dev-master@dev",
"sebastian/phpcpd": "*"
},
"autoload": {
"psr-4": {
"Orcamentos\\": "src/Orcamentos"
}
},
"minimum-stability": "dev"
}
}

0 comments on commit c725ab4

Please sign in to comment.