Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Code / Generator / FileGeneratorRegistry.php
blob27538e85b4a1a4dc6c995d15ef827316ccf38545
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Code\Generator;
12 use Zend\Code\Generator\Exception\RuntimeException;
14 class FileGeneratorRegistry
16 /**
17 * @var array $fileCodeGenerators
19 private static $fileCodeGenerators = array();
21 /**
22 * Registry for the Zend\Code package.
24 * @param FileGenerator $fileCodeGenerator
25 * @param string $fileName
26 * @throws RuntimeException
28 public static function registerFileCodeGenerator(FileGenerator $fileCodeGenerator, $fileName = null)
30 if ($fileName == null) {
31 $fileName = $fileCodeGenerator->getFilename();
34 if ($fileName == '') {
35 throw new RuntimeException('FileName does not exist.');
38 // cannot use realpath since the file might not exist, but we do need to have the index
39 // in the same DIRECTORY_SEPARATOR that realpath would use:
40 $fileName = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $fileName);
42 static::$fileCodeGenerators[$fileName] = $fileCodeGenerator;