コード例 #1
0
 /**
  * @return RegistryClassPattern
  **/
 public function build(MetaClass $class)
 {
     $userFile = $class->getPath() . $class->getName() . EXT_CLASS;
     if (MetaConfiguration::me()->isForcedGeneration() || !file_exists($userFile)) {
         $this->dumpFile($userFile, Format::indentize(RegistryClassBuilder::build($class)));
     }
     return $this;
 }
コード例 #2
0
ファイル: MetaClass.php プロジェクト: justthefish/hesper
 public function hasChilds()
 {
     foreach (MetaConfiguration::me()->getClassList() as $class) {
         if ($class->getParent() && $class->getParent()->getName() == $this->getName()) {
             return true;
         }
     }
     return false;
 }
コード例 #3
0
ファイル: build.php プロジェクト: justthefish/hesper
}
if (!$pathMeta) {
    stop("Path to meta.xml is not defined!");
}
require $pathConfig;
if (isset($_SERVER['TERM']) && ($_SERVER['TERM'] == 'xterm' || $_SERVER['TERM'] == 'xterm-256color' || $_SERVER['TERM'] == 'linux') && !$metaNoColor) {
    $out = new \Hesper\Meta\Console\ColoredTextOutput();
} else {
    $out = new \Hesper\Meta\Console\TextOutput();
}
$out = new \Hesper\Meta\Console\MetaOutput($out);
if ($pathMeta && $pathConfig) {
    init();
    $out->newLine()->infoLine('Hesper-' . HESPER_VERSION . ': MetaConfiguration builder.', true)->newLine();
    try {
        $meta = \Hesper\Meta\Entity\MetaConfiguration::me()->setOutput($out)->load(HESPER_META . 'internal.xml', false);
        $out->info('Known internal classes: ');
        foreach ($meta->getClassList() as $class) {
            $out->info($class->getName() . ', ', true);
        }
        $out->infoLine("that's all.")->newLine();
        $meta->setDryRun($metaDryRun)->load($pathMeta)->setForcedGeneration($metaForce);
        if ($createPUML) {
            $pumlFile = HESPER_META_AUTO_DIR . DIRECTORY_SEPARATOR . "puml.txt";
            file_put_contents($pumlFile, $meta->makePUML());
            $out->infoLine('puml saved to ' . $pumlFile);
            exit;
        }
        if ($metaOnlyContainers) {
            $meta->buildContainers();
        } else {
コード例 #4
0
ファイル: ObjectType.php プロジェクト: justthefish/hesper
 /**
  * @return MetaClass
  **/
 public function getClass()
 {
     return MetaConfiguration::me()->getClassByName($this->className);
 }
コード例 #5
0
ファイル: BasePattern.php プロジェクト: justthefish/hesper
 /**
  * @return BasePattern
  **/
 protected function buildDao(MetaClass $class)
 {
     $this->dumpFile(HESPER_META_AUTO_DAO_DIR . 'Auto' . $class->getName() . 'DAO' . EXT_CLASS, Format::indentize(AutoDaoBuilder::build($class)));
     $userFile = HESPER_META_DAO_DIR . $class->getName() . 'DAO' . EXT_CLASS;
     if (MetaConfiguration::me()->isForcedGeneration() || !file_exists($userFile)) {
         $this->dumpFile($userFile, Format::indentize(DaoBuilder::build($class)));
     }
     return $this;
 }