本文整理汇总了PHP中SearchHelper::correctPath方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHelper::correctPath方法的具体用法?PHP SearchHelper::correctPath怎么用?PHP SearchHelper::correctPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::correctPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerTypes
/**
* Register the extractor types.
*
* @param boolean $clear. Optional. Defaults to false.
*/
public function registerTypes($clear = false)
{
if ($clear) {
$this->clearExtractors();
}
$dir = opendir(SearchHelper::correctPath($this->extractorPath));
while (($file = readdir($dir)) !== false) {
if (substr($file, -17) == 'Extractor.inc.php') {
require_once $this->extractorPath . '/' . $file;
$class = substr($file, 0, -8);
if (!class_exists($class)) {
// if the class does not exist, we can't do anything.
continue;
}
$extractor = new $class();
if ($extractor instanceof DocumentExtractor) {
$extractor->registerMimeTypes();
}
}
}
closedir($dir);
}
示例2: registerFields
/**
* Load all fields into the registry
*
*/
public function registerFields()
{
$this->fields = array();
$dir = opendir(SearchHelper::correctPath($this->path));
while (($file = readdir($dir)) !== false) {
if (substr($file, -13) == 'Field.inc.php') {
require_once $this->path . '/' . $file;
$class = substr($file, 0, -8);
if (!class_exists($class)) {
continue;
}
$field = new $class();
if (is_null($field) || !$field instanceof FieldExpr) {
continue;
}
$this->registerField($field);
}
}
closedir($dir);
$this->registerMetdataFields();
}