예제 #1
0
 /**
  * Returns an instance to the puli repository
  *
  * @return ResourceRepository
  */
 public function getResourceRepository()
 {
     return $this->puliService->getResourceRepository();
 }
예제 #2
0
<?php

use keeko\framework\config\DatabaseConfiguration;
use keeko\framework\config\DevelopmentConfiguration;
use keeko\framework\service\PuliService;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Propel\Runtime\Connection\ConnectionManagerSingle;
use Propel\Runtime\Propel;
use Symfony\Component\Config\FileLocator;
define('KEEKO_PRODUCTION', 'production');
define('KEEKO_DEVELOPMENT', 'development');
// puli
$puli = new PuliService();
$repo = $puli->getResourceRepository();
// load config
$locator = new FileLocator($repo->get('/config')->getFilesystemPath());
$dbConfig = new DatabaseConfiguration($locator);
$dbConfig->load('database.yaml');
$devConfig = new DevelopmentConfiguration($locator);
if ($repo->contains('/config/development.yaml')) {
    $devConfig->load('development.yaml');
}
// development config
define('KEEKO_ENVIRONMENT', $devConfig->isLoaded() ? KEEKO_DEVELOPMENT : KEEKO_PRODUCTION);
if (KEEKO_ENVIRONMENT == KEEKO_DEVELOPMENT) {
    error_reporting(E_ALL | E_STRICT);
}
// database config
define('KEEKO_DATABASE_LOADED', $dbConfig->isLoaded());
if ($dbConfig->isLoaded()) {