コード例 #1
0
ファイル: Blog.php プロジェクト: sandriq/blog
 public function run()
 {
     try {
         $this->config = ConfigReader::readConfig('app');
     } catch (\Exception\ConfigSectionException $e) {
         $e->displayErrors();
     }
     $request = $this->processRqst();
     $content = $this->startController($request);
     //ob_start();
     //include BASE_DIR.'/app/views/layout/default.phtml';
     //$tmp = ob_get_clean();
     //var_dump($content);
     //echo $tmp;
 }
コード例 #2
0
ファイル: EntityManagerObject.php プロジェクト: sandriq/blog
 public function __construct()
 {
     $config = ConfigReader::readConfig('doctrine');
     $doctrineConfig = new Configuration();
     $cache = new Cache();
     $doctrineConfig->setQueryCacheImpl($cache);
     $doctrineConfig->setProxyDir($config['proxyDir']);
     $doctrineConfig->setProxyNamespace('Proxy');
     $doctrineConfig->setAutoGenerateProxyClasses(true);
     $doctrineConfig->setResultCacheImpl($cache);
     //mapping (example uses annotations, could be any of XML/YAML or plain PHP)
     AnnotationRegistry::registerFile(BASE_DIR . '/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
     $driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(new \Doctrine\Common\Annotations\AnnotationReader(), array($config['entityDir']));
     $doctrineConfig->setMetadataDriverImpl($driver);
     $doctrineConfig->setMetadataCacheImpl($cache);
     $em = EntityManager::create($config, $doctrineConfig);
     $this->setEm($em);
 }
コード例 #3
0
ファイル: RouterTest.php プロジェクト: sandriq/blog
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $routeConfig = ConfigReader::readConfig('app');
     $this->object = new Router($routeConfig['router']);
 }