public function __construct(FileParser $fileParser)
 {
     $generalConfigurationFile = '../' . Bootstrap::CONFIGURATIONS_DIRECTORY . '/general.yml';
     $pdoConnectionSettings = $fileParser->parseFile($generalConfigurationFile)['database']['pdo'];
     $host = $pdoConnectionSettings['host'];
     $database = $pdoConnectionSettings['database'];
     $user = $pdoConnectionSettings['user'];
     $password = $pdoConnectionSettings['password'];
     $charset = $pdoConnectionSettings['charset'];
     $this->pdo = new PDO("mysql:host={$host};dbname={$database};charset={$charset}", $user, $password);
 }
 public function __construct(FileParser $fileParser)
 {
     $generalConfigurationFile = '../' . Bootstrap::CONFIGURATIONS_DIRECTORY . '/general.yml';
     $twigSettings = $fileParser->parseFile($generalConfigurationFile)['templating']['twig'];
     $environmentSettings = [];
     if ($twigSettings['debug']) {
         $environmentSettings['debug'] = true;
     }
     if (isset($twigSettings['cacheDirectory']) && !empty($twigSettings['cacheDirectory'])) {
         $environmentSettings['cache'] = $twigSettings['cacheDirectory'];
     }
     $twig_loader = new Twig_Loader_Filesystem($twigSettings['templatesDirectory']);
     $twig = new Twig_Environment($twig_loader, $environmentSettings);
     $this->twig = $twig;
 }
 public function __construct(FileParser $fileParser)
 {
     $generalConfigurationFile = '../' . Bootstrap::CONFIGURATIONS_DIRECTORY . '/general.yml';
     $smartySettings = $fileParser->parseFile($generalConfigurationFile)['templating']['smarty'];
     $smarty = new Smarty();
     $smarty->setTemplateDir($smartySettings['templates']['directory']);
     if (isset($smartySettings['compilation']['directory']) && !empty($smartySettings['compilation']['directory'])) {
         $smarty->setCompileDir($smartySettings['compilation']['directory']);
     }
     if ($smartySettings['cache']['enable']) {
         $smarty->setCacheDir($smartySettings['cache']['directory']);
         $smarty->setCaching(Smarty::CACHING_LIFETIME_CURRENT);
         $smarty->setCacheLifetime($smartySettings['cache']['lifeTime']);
     }
     $this->smarty = $smarty;
 }
 public function __construct(FileParser $fileParser)
 {
     $coreServicesFile = __DIR__ . '/../../Configurations/services.yml';
     $userGeneralServicesFile = '../' . Bootstrap::CONFIGURATIONS_DIRECTORY . '/services.yml';
     $userEnvironmentServicesFile = '../' . Bootstrap::CONFIGURATIONS_DIRECTORY . '/services_' . Bootstrap::$environment . '.yml';
     $this->servicesDefinitions = $fileParser->parseFile($coreServicesFile);
     $userGeneralServicesDefinitions = $fileParser->parseFile($userGeneralServicesFile);
     if (empty($userGeneralServicesDefinitions)) {
         return;
     }
     foreach ($userGeneralServicesDefinitions as $service => $definition) {
         $this->servicesDefinitions[$service] = $definition;
     }
     if (file_exists($userEnvironmentServicesFile)) {
         $userEnvironmentServicesDefinitions = $fileParser->parseFile($userEnvironmentServicesFile);
         if (empty($userEnvironmentServicesDefinitions)) {
             return;
         }
         foreach ($userEnvironmentServicesDefinitions as $service => $definition) {
             $this->servicesDefinitions[$service] = $definition;
         }
     }
 }