本文整理汇总了PHP中Client::getDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::getDir方法的具体用法?PHP Client::getDir怎么用?PHP Client::getDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::getDir方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($route, $args = array())
{
$path = '';
// Break apart the route
$parts = explode('/', str_replace('../', '', (string) $route));
foreach ($parts as $part) {
$path .= $part;
if (is_dir(Client::getDir() . 'controller/' . $path)) {
$path .= '/';
array_shift($parts);
continue;
}
$file = Client::getDir() . 'controller/' . str_replace(array('../', '..\\', '..'), '', $path) . '.php';
if (is_file($file)) {
$this->file = $file;
$this->class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $path);
array_shift($parts);
break;
}
}
if ($args) {
$this->args = $args;
}
$method = array_shift($parts);
if ($method) {
$this->method = $method;
} else {
$this->method = 'index';
}
}
示例2: output
public function output($file, $data)
{
if (Client::isAdmin()) {
$output = $this->view($file . '.tpl', $data);
} else {
if (file_exists(Client::getDir() . 'view/theme/' . $this->config->get('config_template') . '/template/' . $file . '.tpl')) {
$output = $this->view($this->config->get('config_template') . '/template/' . $file . '.tpl', $data);
} else {
$output = $this->view('default/template/' . $file . '.tpl', $data);
}
}
return $output;
}
示例3: model
public function model($model)
{
$file = Client::getDir() . 'model/' . $model . '.php';
$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
if (file_exists($file)) {
$this->trigger->fire('pre.load.model', $model);
include_once $file;
$model_class = new $class($this->registry);
$this->registry->set('model_' . str_replace('/', '_', $model), $model_class);
$this->trigger->fire('post.load.model', $model_class);
} else {
trigger_error('Error: Could not load model ' . $file . '!');
exit;
}
}
示例4: modification
function modification($filename)
{
if (Client::isCatalog()) {
$file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(Client::getDir()));
} else {
$file = DIR_MODIFICATION . 'admin/' . substr($filename, strlen(Client::getDir()));
}
if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
$file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM));
}
if (is_file($file)) {
return $file;
}
return $filename;
}
示例5: deleteEvent
public function deleteEvent($code)
{
$this->filesystem->remove(Client::getDir() . 'event/app/' . $code . '.php');
}
示例6: override
public function override($filename)
{
$_ = array();
$file = Client::getDir() . 'language/' . 'override/' . $this->directory . '/' . $filename . '.php';
if (file_exists($file)) {
require $file;
}
$this->data = array_merge($this->data, $_);
return $this->data;
}
示例7: getCallbackListeners
public function getCallbackListeners()
{
$listeners = array();
$folder = $this->getCallbackFolder();
if (empty($folder) or !file_exists(Client::getDir() . 'event/' . $folder . '/')) {
return $listeners;
}
$files = new Finder();
$files->files()->in(Client::getDir() . 'event/' . $folder . '/');
$files->files()->name('*.php');
foreach ($files as $file) {
$file_name = str_replace('\\', '/', $file->getRelativePathname());
$file_name = str_replace('.php', '', $file_name);
$listeners[] = $folder . '/' . $file_name;
}
return $listeners;
}
示例8: getCallbackListeners
public function getCallbackListeners()
{
$listeners = array();
$files = new Finder();
$files->files()->in(Client::getDir() . 'event/app/');
$folder = $this->getCallbackFolder();
if (!empty($folder) and file_exists(Client::getDir() . 'event/' . $folder . '/')) {
$files->files()->in(Client::getDir() . 'event/' . $folder . '/');
}
$files->files()->name('*.php');
foreach ($files as $file) {
$file_name = str_replace('\\', '/', $file->getRelativePathname());
$file_name = str_replace('.php', '', $file_name);
$listeners[] = $folder . '/' . $file_name;
// System triggers
$file = Client::getDir() . 'event/app/' . $file_name . '.php';
if (file_exists($file) and !in_array('app/' . $file_name, $listeners)) {
$listeners[] = 'app/' . $file_name;
}
}
return $listeners;
}