Пример #1
0
 /**
  * Helper function to recompile class
  * @param \recompilr\Compiler\CompilerInterface $compiler
  * @return string
  */
 protected function recompile(CompilerInterface $compiler)
 {
     $classRegistry = $compiler->getClassRegistry();
     $maps = $classRegistry->getClassMapping();
     $contents = '';
     if (!empty($maps)) {
         foreach ($maps as $map) {
             if ($map->isMapped()) {
                 $compiled = $map->recompile();
                 if (!empty($compiled)) {
                     $contents .= $compiled;
                     $contents .= "\r\n";
                     $contents .= "\r\n";
                     $contents .= "\\recompilr\\map('" . $map->getClassName() . "','" . $map->getCurrentName() . "');";
                     $contents .= "\r\n";
                     $contents .= "\r\n";
                 }
             }
         }
     }
     $contents = str_replace('<?php', '', $contents);
     return $contents;
 }