Example #1
0
 public static function registerFileCodeGenerator(Zend_CodeGenerator_Php_File $fileCodeGenerator, $fileName = null)
 {
     if ($fileName == null) {
         $fileName = $fileCodeGenerator->getFilename();
     }
     if ($fileName == '') {
         throw new Zend_CodeGenerator_Php_Exception('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;
 }