コード例 #1
0
ファイル: DBLayerClass.php プロジェクト: quyen91/lfpr
 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()];
 }
コード例 #2
0
ファイル: CRUDGeneratorClass.php プロジェクト: quyen91/lfpr
 public function execute($params)
 {
     $parser = new YAMLParser();
     $yaml_configuration = $parser->parse($params[0]);
     print_r($yaml_configuration);
     if (!isset($yaml_configuration['crud'])) {
         Makiavelo::info("**** ERROR ****");
         Makiavelo::info("CRUD key not found on yaml file, cancelling generation...");
     } else {
         $crud_info = $yaml_configuration['crud'];
         $this->en_name = $crud_info['entity']['name'];
         if (isset($crud_info['entity']['validations'])) {
             $this->generateValidations($crud_info['entity']['validations']);
         }
         $this->generateEntity($crud_info['entity']);
         $this->generateViews($crud_info['entity']);
         $this->generateSQL();
         $this->generateRoutes();
         $contGen = new ControllerGenerator();
         $contGen->execute(array($this->en_name, "no-views"));
     }
 }
コード例 #3
0
ファイル: I18nClass.php プロジェクト: quyen91/lfpr
 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);
     }
 }
コード例 #4
0
ファイル: ConfigClass.php プロジェクト: quyen91/lfpr
 private static function load()
 {
     $parser = new YAMLParser();
     $config_path = ROOT_PATH . Config::CONFIG_FILE_PATH;
     return $parser->parsePath($config_path);
 }