本文整理汇总了PHP中FileUtils::file_exists_incpath方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::file_exists_incpath方法的具体用法?PHP FileUtils::file_exists_incpath怎么用?PHP FileUtils::file_exists_incpath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils::file_exists_incpath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPluginCommand
protected function getPluginCommand($plugin, $command, $params = array())
{
if (!FileUtils::file_exists_incpath('M/plugins/' . $plugin . '/commands/' . $command . '.php')) {
if (!FileUtils::file_exists_incpath('M/plugins/' . $plugin)) {
throw new Exception($plugin . ' plugin does not exist');
} else {
throw new Exception($plugin . ' does not have ' . $command . ' command');
}
}
require_once 'M/plugins/' . $plugin . '/commands/' . $command . '.php';
$className = $plugin . '_Command_' . $command;
// Setting up options including Databases DSN
Mreg::get('setup')->setUpEnv();
// Executing
$com = new $className();
return $com;
}
示例2: resolve_class
public static function resolve_class($class, $role, $init_function = null)
{
if (class_exists($class)) {
return true;
}
$file = strtolower(str_replace('_', '/', $class)) . '.php';
foreach (self::getPaths($role) as $path) {
$full_path = $path . '/' . $file_name;
if (FileUtils::file_exists_incpath($full_path)) {
require_once self::resolve_file($file, $role);
if ($init_function instanceof Closure) {
$init_function();
}
return true;
}
}
throw new UnresolvedFileException("Could not load class {$class} in " . print_r(self::getPaths($role), true));
}
示例3: getTemplatePath
public function getTemplatePath()
{
$folders = array_reverse($this->_config['tplfolders']);
Log::error('Searching file ' . $this->_tplfile . ' in ' . print_r($folders, true));
foreach ($folders as $folder) {
if (FileUtils::file_exists_incpath($folder . $this->_tplfile . '.php')) {
Log::error('Found file in ' . $folder);
return $folder . $this->_tplfile . '.php';
}
}
return false;
}