本文整理汇总了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']));
}
示例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');
}
示例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');
}