Exemple #1
0
 /**
  * registerFileCodeGnereator()
  *
  * A file code generator registry
  *
  * @param PhpFile $fileCodeGenerator
  * @param string $fileName
  */
 public static function registerFileCodeGenerator(PhpFile $fileCodeGenerator, $fileName = null)
 {
     if ($fileName == null) {
         $fileName = $fileCodeGenerator->getFilename();
     }
     if ($fileName == '') {
         throw new Exception\InvalidArgumentException('FileName does not exist.');
     }
     // cannot use realpath since the file might not exist, but we do need to have the index
     // in the same DIRECTORY_SEPARATOR that realpath would use:
     $fileName = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $fileName);
     self::$_fileCodeGenerators[$fileName] = $fileCodeGenerator;
 }