本文整理匯總了PHP中VQMod::getCwd方法的典型用法代碼示例。如果您正苦於以下問題:PHP VQMod::getCwd方法的具體用法?PHP VQMod::getCwd怎麽用?PHP VQMod::getCwd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VQMod
的用法示例。
在下文中一共展示了VQMod::getCwd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _parseMods
/**
* VQModObject::_parseMods()
*
* @param DOMNode $node <modification> node to be parsed
* @return null
* @description Parses modifications in preparation for the applyMod method to work
*/
private function _parseMods(DOMNode $node)
{
$files = $node->getElementsByTagName('file');
$replaces = VQMod::$_replaces;
foreach ($files as $file) {
$path = $file->getAttribute('path') ? $file->getAttribute('path') : '';
$filesToMod = explode(',', $file->getAttribute('name'));
foreach ($filesToMod as $filename) {
$fileToMod = $path . $filename;
if (!empty($replaces)) {
foreach ($replaces as $r) {
if (count($r) == 2) {
$fileToMod = preg_replace($r[0], $r[1], $fileToMod);
}
}
}
$error = $file->hasAttribute('error') ? $file->getAttribute('error') : 'log';
$fullPath = VQMod::path($fileToMod);
if (!$fullPath || !file_exists($fullPath)) {
if (strpos($fileToMod, '*') !== false) {
$fullPath = VQMod::getCwd() . $fileToMod;
} else {
if ($error == 'log' || $error == 'abort') {
$skip = $error == 'log' ? ' (SKIPPED)' : ' (ABORTING MOD)';
VQMod::$log->write('VQModObject::parseMods - Could not resolve path for [' . $fileToMod . ']' . $skip, $this);
}
if ($error == 'log' || $error == 'skip') {
continue;
} elseif ($error == 'abort') {
return false;
}
}
}
$operations = $file->getElementsByTagName('operation');
foreach ($operations as $opIndex => $operation) {
$error = $operation->hasAttribute('error') ? $operation->getAttribute('error') : 'abort';
$ignoreif = $operation->getElementsByTagName('ignoreif')->item(0);
if ($ignoreif) {
$ignoreif = new VQSearchNode($ignoreif);
} else {
$ignoreif = false;
}
$this->mods[$fullPath][] = array('search' => new VQSearchNode($operation->getElementsByTagName('search')->item(0)), 'add' => new VQAddNode($operation->getElementsByTagName('add')->item(0)), 'ignoreif' => $ignoreif, 'error' => $error, 'fileToMod' => $fileToMod, 'opIndex' => $opIndex);
}
}
}
}