Example #1
0
 private static function loadConfiguration()
 {
     //Makiavelo::info("Loading database configuration file: ");
     $database_yml = ROOT_PATH . Makiavelo::DATABASE_CONFIGURATION;
     Makiavelo::info($database_yml);
     $parser = new YAMLParser();
     $config = $parser->parsePath($database_yml);
     //Makiavelo::info("Configuration loaded: ");
     //Makiavelo::info(print_r($config, true));
     DBLayer::$config = $config[Makiavelo::getCurrentEnv()];
 }
Example #2
0
 public static function loadLocaleFiles()
 {
     $folder = ROOT_PATH . I18n::LOCALES_FOLDER . "/" . I18n::$locale;
     Makiavelo::info("Loading locale information...");
     $d = @dir($folder);
     if ($d === false) {
         Makiavelo::info("**** ERROOR ***");
         Makiavelo::info("Can't open locales folder: {$folder}");
         throw new I18nCantFindLocaleFiles("Can't open locales folder: {$folder}");
     } else {
         $parser = new YAMLParser();
         $full_data = array();
         while (false !== ($entry = $d->read())) {
             if ($entry[0] != ".") {
                 Makiavelo::info("-- Loading file: " . ($folder . "/" . $entry));
                 $locale_data = $parser->parsePath($folder . "/" . $entry);
                 $full_data = array_merge($full_data, $locale_data[I18n::$locale]);
                 Makiavelo::info("-- Elements loaded: " . print_r($full_data, true));
             }
         }
         //Makiavelo::info("Translation data : " . print_r($full_data, true));
         I18n::setLocaleData($full_data);
     }
 }
Example #3
0
 private static function load()
 {
     $parser = new YAMLParser();
     $config_path = ROOT_PATH . Config::CONFIG_FILE_PATH;
     return $parser->parsePath($config_path);
 }