本文整理汇总了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>";
}