本文整理汇总了PHP中Finder::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Finder::run方法的具体用法?PHP Finder::run怎么用?PHP Finder::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Finder
的用法示例。
在下文中一共展示了Finder::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
{
$string = "Finded results:\r\n\r\n";
foreach ($this->matches as $link => $match) {
$string .= $link . "\r\n";
if ($match) {
foreach ($match as $value) {
$string .= "\t" . $value[0] . "\r\n";
}
} else {
$string .= "\t" . "NOTHING" . "\r\n";
}
}
$fp = fopen($this->logFile, "w");
fwrite($fp, $string);
fclose($fp);
}
public function run()
{
if ($this->loadFile()) {
$this->getPage();
$this->findPattern();
$this->printResult();
echo "Check results in: " . $this->logFile . "\r\n";
} else {
echo "Write links in: " . $this->linksFile . "\r\n";
}
}
}
$LF = new Finder();
$LF->run();
示例2: rename_check
}
function rename_check($event, $args, $finder)
{
$name = $args['name'];
if (gp_restrict_uploads && !\gp\admin\Content\Uploaded::AllowedExtension($name)) {
return false;
}
$args['name'] = $name;
return $args;
}
function SaveFinderData($data)
{
global $config;
$config['finder_data'] = $data;
\gp\admin\Tools::SaveConfig();
}
function ReturnFinderData()
{
global $config;
if (isset($config['finder_data'])) {
return $config['finder_data'];
}
return false;
}
$opts = array('debug' => gpdebug, 'saveData' => 'SaveFinderData', 'returnData' => 'ReturnFinderData', 'roots' => array(array('driver' => 'LocalFileSystem', 'path' => $dataDir . '/data/_uploaded/', 'URL' => \gp\tool::GetDir('data/_uploaded'), 'accessControl' => 'access', 'tmbPath' => $dataDir . '/data/_elthumbs', 'tmbURL' => \gp\tool::GetDir('data/_elthumbs'), 'separator' => '/', 'tmbBgColor' => 'transparent', 'copyOverwrite' => false, 'uploadOverwrite' => false, 'tmbPathMode' => gp_chmod_dir, 'dirMode' => gp_chmod_dir, 'fileMode' => gp_chmod_file)), 'bind' => array('duplicate upload rename rm paste resize' => array('\\gp\\admin\\Content\\Uploaded', 'FinderChange'), 'upload-before' => 'upload_check', 'rename-before' => 'rename_check'));
$opts = \gp\tool\Plugins::Filter('FinderOptionsServer', array($opts));
gpSettingsOverride('finder_options_server', $opts);
// run Finder
$connector = new Finder($opts);
$connector->run();
示例3: SaveFinderData
function SaveFinderData($data)
{
$_SESSION['finder_data'] = $data;
}
function ReturnFinderData()
{
if (isset($_SESSION['finder_data'])) {
return $_SESSION['finder_data'];
}
return false;
}
/**
* Simple function to demonstrate how to control file access using "accessControl" callback.
* This method will disable accessing files/folders starting from '.' (dot)
*
* @param string $attr attribute name (read|write|locked|hidden)
* @param string $path file path relative to volume root directory started with directory separator
* @return bool|null
**/
function access($attr, $path, $data, $volume)
{
return strpos(basename($path), '.') === 0 ? !($attr == 'read' || $attr == 'write') : null;
// else Finder decide it itself
}
// Documentation for connector options:
// https://github.com/oyejorge/gpFinder/wiki/Connector-configuration-options
$opts = array('saveData' => 'SaveFinderData', 'returnData' => 'ReturnFinderData', 'roots' => array(array('driver' => 'LocalFileSystem', 'path' => '../files/', 'URL' => dirname($_SERVER['PHP_SELF']) . '/../files/', 'accessControl' => 'access')));
// run
$finder = new Finder($opts);
$finder->run();