當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Doctrine_Core::getLoadedModelFiles方法代碼示例

本文整理匯總了PHP中Doctrine_Core::getLoadedModelFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Core::getLoadedModelFiles方法的具體用法?PHP Doctrine_Core::getLoadedModelFiles怎麽用?PHP Doctrine_Core::getLoadedModelFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine_Core的用法示例。


在下文中一共展示了Doctrine_Core::getLoadedModelFiles方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testModelLoadingCacheInformation

 public function testModelLoadingCacheInformation()
 {
     $models = Doctrine_Core::getLoadedModels();
     $this->assertTrue(in_array('AggressiveModelLoadingUser', $models));
     $this->assertTrue(in_array('ConservativeModelLoadingProfile', $models));
     $this->assertTrue(in_array('ConservativeModelLoadingContact', $models));
     $modelFiles = Doctrine_Core::getLoadedModelFiles();
     $this->assertTrue(file_exists($modelFiles['ConservativeModelLoadingUser']));
     $this->assertTrue(file_exists($modelFiles['ConservativeModelLoadingProfile']));
     $this->assertTrue(file_exists($modelFiles['ConservativeModelLoadingContact']));
 }
開發者ID:dracony,項目名稱:forked-php-orm-benchmark,代碼行數:11,代碼來源:BaseTestCase.php

示例2: testTest

 public function testTest()
 {
     $models1Dir = dirname(__FILE__) . '/2375/models1';
     $models2Dir = dirname(__FILE__) . '/2375/models2';
     // try loading a couple initial models
     $models1 = Doctrine_Core::loadModels($models1Dir);
     //$models2 = Doctrine_Core::loadModels($models2Dir);
     // make sure two models were loaded
     $this->assertEqual(2, count($models1));
     // make sure the right models were loaded
     $this->assertTrue(key_exists('Ticket_2375_Model1', $models1));
     $this->assertTrue(key_exists('Ticket_2375_Model2', $models1));
     // get a list of all models that have been loaded
     $loadedModels = Doctrine_Core::getLoadedModelFiles();
     // make sure the paths are correct
     $this->assertEqual($loadedModels['Ticket_2375_Model1'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model1.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model2'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model2.php');
     // try loading a few more models
     $models2 = Doctrine_Core::loadModels($models2Dir);
     // make sure the right models were loaded
     $this->assertTrue(key_exists('Ticket_2375_Model3', $models2));
     $this->assertTrue(key_exists('Ticket_2375_Model4', $models2));
     $this->assertTrue(key_exists('Ticket_2375_Model5', $models2));
     $this->assertTrue(key_exists('Ticket_2375_Model6', $models2));
     // get a list of all models that have been loaded
     $loadedModels = Doctrine_Core::getLoadedModelFiles();
     // make sure the paths are correct
     $this->assertEqual($loadedModels['Ticket_2375_Model1'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model1.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model2'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model2.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model3'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model3.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model4'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model4.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model5'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model5.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model6'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model5.php');
     // try loading the first models again
     $models1 = Doctrine_Core::loadModels($models1Dir);
     // make sure the right models were loaded
     $this->assertTrue(key_exists('Ticket_2375_Model1', $models1));
     $this->assertTrue(key_exists('Ticket_2375_Model2', $models1));
     // get a list of all models that have been loaded
     $loadedModels = Doctrine_Core::getLoadedModelFiles();
     // make sure the paths are correct
     $this->assertEqual($loadedModels['Ticket_2375_Model1'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model1.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model2'], $models1Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model2.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model3'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model3.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model4'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model4.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model5'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model5.php');
     $this->assertEqual($loadedModels['Ticket_2375_Model6'], $models2Dir . DIRECTORY_SEPARATOR . 'Ticket_2375_Model5.php');
 }
開發者ID:kaakshay,項目名稱:audience-insight-repository,代碼行數:48,代碼來源:2375TestCase.php

示例3: _cleanup

 /**
  * Cleanup temporary generated models after a diff is performed
  *
  * @return void
  */
 protected function _cleanup()
 {
     $modelFiles = Doctrine_Core::getLoadedModelFiles();
     $filesToClean = array_diff($modelFiles, $this->_startingModelFiles);
     foreach ($filesToClean as $file) {
         if (file_exists($file)) {
             unlink($file);
         }
     }
     // clean up tmp directories
     Doctrine_Lib::removeDirectories($this->_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_fromPrefix) . '_doctrine_tmp_dirs');
     Doctrine_Lib::removeDirectories($this->_tmpPath . DIRECTORY_SEPARATOR . strtolower(self::$_toPrefix) . '_doctrine_tmp_dirs');
 }
開發者ID:szelpe,項目名稱:cukorka,代碼行數:18,代碼來源:Diff.php


注:本文中的Doctrine_Core::getLoadedModelFiles方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。