本文整理汇总了PHP中I2CE::resetFileSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP I2CE::resetFileSearch方法的具体用法?PHP I2CE::resetFileSearch怎么用?PHP I2CE::resetFileSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I2CE
的用法示例。
在下文中一共展示了I2CE::resetFileSearch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBrokenErase
public function testBrokenErase()
{
$a = self::$c->getAvailableModules(array(self::data_dir(__CLASS__) . "/OneModuleWithClass"));
TestMagicDataTearDown::brokenTearDown();
I2CE::resetFileSearch();
$this->assertEquals(array(), self::$not_errors);
$this->assertEquals(array(), self::$errors);
$this->setUp();
$a = self::$c->getAvailableModules(array(self::data_dir(__CLASS__) . "/OneModuleWithClass"));
$b = array();
$this->assertEquals($b, $a);
$this->assertRegExp("{Trying to get property of non-object}", self::$not_errors[0]);
$this->assertContains("Got a NULL value for storage.", self::$errors);
self::$errors = array();
TestMagicDataTearDown::tearDown();
I2CE::resetFileSearch();
$this->assertEquals(array(), self::$errors);
}
示例2: tearDown
function tearDown()
{
I2CE_MagicData::tearDown();
I2CE::resetFileSearch();
}
示例3: tearDown
protected function tearDown()
{
I2CE_MagicData::tearDown();
I2CE::resetFileSearch();
I2CE::popErrorHandler(array(__CLASS__, "errorHandler"));
}
示例4: checkRequirements
/**
* Checks the requirements. if all requirements are met and
* there are no conflicts, it returns a list of those that
* need to be installed, an empty array() if none are needed.
* On failure returns null.
*
* @param array $shortnames an array of shortnames
*
* @param mixed $disables a shortname or an array of
* shortnames of modules to disable. Defaults to empty array
*
* @param array $remove an array of potential shortnames to
* remove -- if we did not find them somplace else. (it may
* have just been moved) defaults to an empty array.
*
* @param array $enabled_modules An array of shortnames of
* enabled modules -- we check for conflicts against this
* array
*
* @param mixed $required_modules A shortname or an array of
* shortnames of required modules -- if a module is set to be
* updated and it is not required by on of the modules in this
* array, it will be set as an optional modules. Defaults to
* the empty array
*
* @returns array. Keys are:
* 'failure' - string with the reason for failture
* 'requirements' - array which has as keys shortnames and
* values files for the requirements.
* 'removals' - array of shortnames that need to be removed.
* 'optional' - array with key shortnames and value true
* 'moved' - array with key shortnames and value true
*/
public function checkRequirements($updates, $disables = array(), $removals = array(), $enabled_modules = array(), $required_modules = array(), $reset_moved = true)
{
if ($reset_moved) {
$this->moved = array();
}
if ($this->storage->setIfIsSet($i2ce_config_file, "config/data/I2CE/file") && $i2ce_config_file != ($new_i2ce_config_file = rtrim(dirname(dirname(__FILE__)), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'I2CE_Configuration.xml')) {
//we have moved location of I2CE. Other things have likely gotten moved around as well and we do not want to use the stored paths.
//the file search has been set in I2CE_Update->_updateSite()->needs_upgrade to I2CE::setupFileSearch( array( "CLASSES" => "./", 'MODULES'=>array(dirname($site_module_file),dirname(dirname(__FILE__)))), true);
$this->resetCheckedPaths();
I2CE::resetFileSearch();
$file_search = I2CE::getFileSearch();
if (null === $file_search) {
I2CE::raiseError("Resetting file search");
I2CE::setupFileSearch();
$file_search = I2CE::getFileSearch();
}
// just to make sure all of our module paths are loaded.
$mod_factory = I2CE_ModuleFactory::instance();
$mod_factory->resetStoredLoadedPaths();
$mod_factory->loadPaths($mod, $path, true, $file_search, $this->storage->config->data);
} else {
$mods = array_unique(array_merge(array('I2CE'), $enabled_modules));
$file_search = $this->setupFileSearch($mods);
}
$this->findAvailableConfigs($file_search, true);
if (!$this->storage->is_parent("config/data")) {
I2CE::raiseError("Data not loaded.", E_ERROR);
return array('failure' => "Data not loaded");
}
I2CE::raiseError("Done looking for available config files. Available:\n\t" . implode(',', $this->storage->config->data->getKeys()));
$conflicts = array();
$available = $this->storage->config->data;
if (!is_array($required_modules)) {
$required_modules = array($required_modules);
}
foreach ($removals as $indx => $remove) {
if (isset($available->{$remove})) {
// I found the thing I thought I might need to remove
// someplace else.
unset($removals[$indx]);
$this->moved[$remove] = true;
$updates[] = $remove;
}
}
foreach ($updates as $indx => $update) {
// make sure our desired updates are really available
if (!isset($available->{$update})) {
I2CE::raiseError("Desired update {$update} cannot be found. Instead it is being removed");
I2CE::raiseError(implode(',', $available->getKeys()));
$removals[] = $update;
unset($updates[$indx]);
}
}
// this now holds everything that needs to be disabled or removed
$removals = array_merge($disables, $removals);
$tmp_removals = array();
$avails = $available->getKeys();
while (count($removals) > 0) {
$r = array_pop($removals);
if (!is_scalar($r)) {
I2CE::raiseError("Internal misconfiguration on removals", E_USER_ERROR);
continue;
}
if (array_key_exists($r, $tmp_removals) && $tmp_removals[$r]) {
continue;
}
/*
//.........这里部分代码省略.........