示例#1
0
 static function getManager()
 {
     // 		require_once __DIR__ . '/../../vendor/autoload.php';
     // 		$loader = new ClassLoader('Entities', __DIR__);
     // 		$loader->register();
     // 		$loader = new ClassLoader('Proxies', __DIR__);
     // 		$loader->register();
     //configuration
     $config = new Configuration();
     $cache = new Cache();
     $config->setQueryCacheImpl($cache);
     $config->setProxyDir(__DIR__ . '/../../cache/ProofPilot/Proxies');
     $config->setProxyNamespace('ProofPilot\\Proxies');
     $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');
     $driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(new \Doctrine\Common\Annotations\AnnotationReader(), array(__DIR__ . '/Entities'));
     $config->setMetadataDriverImpl($driver);
     $config->setMetadataCacheImpl($cache);
     $args = \ProofPilot\Jobs\Jobs::readConfig('doctrine');
     //getting the EntityManager
     $em = EntityManager::create(array('driver' => $args['driver'], 'user' => $args['user'], 'password' => $args['password'], 'host' => $args['host'], 'dbname' => $args['dbname']), $config);
     return $em;
 }
示例#2
0
文件: SMS.php 项目: ddobei/Fresque
 public function setUp()
 {
     $this->config = parent::readConfig('tropo');
 }
 public function setUp()
 {
     parent::setup();
     $this->config = parent::readConfig('sendgrid');
 }