/**
  * @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;
 }
Esempio n. 2
0
 public function hasChilds()
 {
     foreach (MetaConfiguration::me()->getClassList() as $class) {
         if ($class->getParent() && $class->getParent()->getName() == $this->getName()) {
             return true;
         }
     }
     return false;
 }
Esempio n. 3
0
}
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 {
Esempio n. 4
0
 /**
  * @return MetaClass
  **/
 public function getClass()
 {
     return MetaConfiguration::me()->getClassByName($this->className);
 }
Esempio n. 5
0
 /**
  * @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;
 }