Пример #1
0
 /**
  * Removes temporary test contents.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $run = dirname(__FILE__) . '/_run';
     if (file_exists($run) === false) {
         mkdir($run, 0755);
     }
     $this->_clearRunResources($run);
     include_once 'PHP/Depend.php';
     include_once 'PHP/Depend/StorageRegistry.php';
     include_once 'PHP/Depend/Storage/MemoryEngine.php';
     PHP_Depend_StorageRegistry::set(PHP_Depend::TOKEN_STORAGE, new PHP_Depend_Storage_MemoryEngine());
     PHP_Depend_StorageRegistry::set(PHP_Depend::PARSER_STORAGE, new PHP_Depend_Storage_MemoryEngine());
     if (defined('STDERR') === false) {
         define('STDERR', fopen('php://stderr', true));
     }
 }
Пример #2
0
 /**
  * This method initializes the storage strategies for node tokens that are
  * used during a single PHP_Depend run and the parser cache storage.
  *
  * @return void
  */
 private function _initStorages()
 {
     foreach ($this->_storages as $identifier => $storage) {
         // Fallback for unconfigured storage engines
         if ($storage === null) {
             // Include memory storage class definition
             include_once 'PHP/Depend/Storage/MemoryEngine.php';
             $storage = new PHP_Depend_Storage_MemoryEngine();
         }
         PHP_Depend_StorageRegistry::set($identifier, $storage);
     }
 }