コード例 #1
0
ファイル: Add.php プロジェクト: halfer/Meshing
 protected function installXml($schemaProc)
 {
     $modelDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathModelsNodes();
     // Create task, configure, then run
     $task = new Meshing_Propel_ClassBuilder();
     $task->setPropelConnection();
     $task->addSchemas($this->schemaDir, $schemaProc);
     $task->setOutputDir($modelDir);
     $task->run();
     echo "Schemas: " . $this->schemaDir . "\n";
     echo "Output: " . $modelDir . "\n";
 }
コード例 #2
0
ファイル: Build.php プロジェクト: halfer/Meshing
 /**
  * Generates the system model
  * 
  * @todo Move the paths to a build.properties file
  * 
  * @param boolean $verbose 
  */
 protected function buildModel($verbose)
 {
     // Set db type, schema and output folder here
     $schemaDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathDbConfig();
     $schemas = Meshing_Utils::getPaths()->getLeafStandardSchema();
     $outputDir = $this->projectRoot . Meshing_Utils::getPaths()->getPathModelsSystem();
     // Create task, configure, then run
     $task = new Meshing_Propel_ClassBuilder();
     $task->setPropelConnection();
     $task->addSchemas($schemaDir, $schemas);
     $task->setOutputDir($outputDir);
     $task->run();
     if ($verbose) {
         echo "done\n";
         echo "Schemas: " . $schemaDir . "\n";
         echo "Output: " . $outputDir . "\n";
     }
 }
コード例 #3
0
ファイル: DatabaseTestCase.php プロジェクト: halfer/Meshing
 /**
  * Tests to build model classes, and optionally to test that build
  * 
  * @param string $prefix
  * @param boolean $runTests 
  */
 protected function _testClassBuilder($prefix = null, $runTests = true)
 {
     $task = new Meshing_Propel_ClassBuilder();
     $task->setPropelConnection(Meshing_Utils::CONN_NODE_TEST_1);
     $task->addSchemas($this->outputSchemaDir, $this->paths->getLeafStandardSchema());
     $task->setOutputDir($this->modelDir);
     $task->run();
     // Find these classes
     if ($runTests) {
         $package = $this->getPackage();
         foreach ($this->expectedClasses() as $class) {
             foreach (array('', 'Peer', 'Query') as $classSuffix) {
                 $this->assertTrue($this->classExists($class . $classSuffix, $package, $prefix), 'Checking generated class `' . $class . $classSuffix . '` exists');
             }
         }
     }
 }