Exemple #1
0
 private function generateYamlFromDb()
 {
     $con_name = $this->getArgumentsvalue('connection-name');
     if ($con_name === '{default}') {
         $con_name = $this->Con->getName();
     }
     $file_path = $this->getOptionsValue('yaml-schema-path');
     $file_path .= '/' . $this->getArgumentsValue('output-name');
     \Doctrine_Core::generateYamlFromDb($file_path, array($con_name), $this->getImportOptions());
 }
 public function execute()
 {
     Doctrine_Core::generateYamlFromDb($this->getArgument('yaml_schema_path'));
     $this->notify('Generate YAML schema successfully from database');
 }
 /**
  * db2yaml
  *
  * This generates YAML schema files from Database.
  */
 public function action_admin_db2yaml()
 {
     // load sfYAML (it's somehow not loaded by doctrine autoload)
     include ROOT_LIBRARIES . 'doctrine/Doctrine/Parser/sfYaml/SfYaml.php';
     Doctrine_Core::generateYamlFromDb(DOCTRINE_YAML_SCHEMA_PATH . 'schema.yml', array(), self::$options);
     $message = '<b>The YAML schema file has been successfully generated from DATABASE.</b>';
     $message .= '<br /><br />Destination File: ' . DOCTRINE_YAML_SCHEMA_PATH . 'schema.yml';
     $this->setFlashmessage('success', $message);
     $this->redirectToReferer();
 }
 public function generateYamlFromDatabase()
 {
     $this->_initDoctrineResource();
     $yamlDir = $this->_getYamlDirectoryPath();
     Doctrine_Core::generateYamlFromDb($yamlDir);
     $this->_print('Succsesfully generated yaml schema files from database.', array('color' => 'green'));
     $this->_print('Destination Directory: ' . $yamlDir);
 }