本文整理匯總了PHP中anyC::resetPointer方法的典型用法代碼示例。如果您正苦於以下問題:PHP anyC::resetPointer方法的具體用法?PHP anyC::resetPointer怎麽用?PHP anyC::resetPointer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類anyC
的用法示例。
在下文中一共展示了anyC::resetPointer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: runRules
public function runRules()
{
$AC = new anyC();
$AC->setCollectionOf("IncomingPrettify");
$AC->addAssocV3("IncomingPrettifyIsActive", "=", "1");
$I = new mIncoming();
$files = $I->getNewFiles();
echo "<div style=\"max-height:400px;overflow:auto;font-size:10px;padding:5px;\">";
$run = mUserdata::getUDValueS("trinityDBPrettifyExecute", "0") == "1";
if (!$run) {
echo "<p style=\"color:red;margin-bottom:10px;\">The following operations are NOT executed, this is only a preview!<br />To execute the operations, you'll have to enable it in the options.</p>";
}
foreach ($files as $path) {
$newName = basename($path);
if (strpos(strtolower($newName), ".part") == strlen($newName) - 5) {
continue;
}
if (strpos(strtolower($newName), ".mkv") != strlen($newName) - 4 and strpos(strtolower($newName), ".mp4") != strlen($newName) - 4) {
continue;
}
while ($P = $AC->getNextEntry()) {
$newName = preg_replace("/" . str_replace(".", "\\.", $P->A("IncomingPrettifyFind")) . "/e" . ($P->A("IncomingPrettifyCaseSensitive") == "1" ? "" : "i"), str_replace(array("//", "."), array("\\", "\\."), $P->A("IncomingPrettifyReplace")), $newName);
}
$newName = str_replace("\\", "", $newName);
$AC->resetPointer();
if ($newName != basename($path)) {
$color = "";
if ($run) {
$renamed = str_replace(basename($path), $newName, $path);
if (file_exists($renamed)) {
$color = "color:red;";
} else {
if (rename($path, $renamed)) {
$color = "color:green;";
} else {
$color = "color:red;";
}
}
}
echo "<span style=\"{$color}\">" . basename($path) . " -><br />" . basename($newName) . "</span><br /><br />";
}
}
echo "</div>";
}