本文整理汇总了PHP中S::escapePath方法的典型用法代码示例。如果您正苦于以下问题:PHP S::escapePath方法的具体用法?PHP S::escapePath怎么用?PHP S::escapePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S
的用法示例。
在下文中一共展示了S::escapePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: aliasStatic
function aliasStatic($alias)
{
$file = S::escapePath(AREA_PATH . $alias . '/index.html');
$output = cookTemplate();
pwCache::writeover($file, $output);
ob_clean();
}
示例2: _getHtmlFile
/**
* 获取扩展搜索的HTML模板路径
* @param $direcotry 扩展服务的目录,正常当前为 dirname(__FILE__)或其它自定义目录
* @param $htmlname 扩展搜索服务HTML模板名称
*/
function _getHtmlFile($direcotry, $htmlname)
{
$filePath = S::escapePath($direcotry . '/template/' . $htmlname);
if (!is_file($filePath)) {
return '';
}
return $filePath;
}
示例3: getThemeConfigFile
function getThemeConfigFile($theme)
{
$filedir = S::escapePath($this->config['dir'] . '/' . $theme . '/' . $this->config['configfile']);
if (file_exists($filedir)) {
return $filedir;
}
return false;
}
示例4: setAudioPath
/**
* 设置语音文件路径
* @param $audioPath 路径
* @return bool true-成功, false-失败
*/
function setAudioPath($audioPath)
{
if (empty($audioPath)) {
return false;
}
$this->_audioPath = S::escapePath($audioPath);
return true;
}
示例5: init
function init($db_modes, $group = array(), $system = array())
{
foreach ($db_modes as $key => $value) {
$levelFile = S::escapePath(R_P . 'mode/' . $key . '/config/level.php');
if (!file_exists($levelFile)) {
continue;
}
$level = (include $levelFile);
$this->_cookLevel($key, $level, $group, $system);
}
}
示例6: _presetErrorMessage
/**
* 设置$errorMessage初始值
* @param array $errorMessage
* @access protected
* @return bool|FieldCheck 遇错返回false
*/
function _presetErrorMessage()
{
require_once S::escapePath(GetLang('fielderror'));
$errorMessage = $lang['fielderror'];
if ($errorMessage) {
$this->_setErrorMessage($errorMessage);
return $this;
} else {
return false;
}
}
示例7: findByTypeId
function findByTypeId($typeId)
{
$data = array();
if (file_exists($this->_getCacheKey())) {
include S::escapePath($this->_getCacheKey());
} else {
$data = $this->findByTypeIdWithoutCache($typeId);
pwCache::setData($this->_getCacheKey(), '<?php $data = ' . var_export($data, true) . ';');
}
return $data;
}
示例8: getDelfileFactory
function getDelfileFactory($type)
{
if ($type == 'active') {
return new activeMutiDelfile();
}
if ($type && file_exists(R_P . "require/extents/attach/{$type}MutiDelfile.class.php")) {
$class = $type . 'MutiDelfile';
require_once S::escapePath(R_P . "require/extents/attach/{$type}MutiDelfile.class.php");
return new $class();
}
return new threadMutiDelfile();
}
示例9: getLayoutString
/**
* 获取布局html
*
* @param string $layout 布局名
* @return string
*/
function getLayoutString($layout)
{
if (!isset($this->layoutStrings[$layout])) {
if ($layout && file_exists(S::escapePath(A_P . 'data/layout/' . $layout . '/layout.htm'))) {
//* $this->layoutStrings[$layout] = readover(S::escapePath(A_P.'data/layout/'.$layout.'/layout.htm'));
$this->layoutStrings[$layout] = pwCache::readover(S::escapePath(A_P . 'data/layout/' . $layout . '/layout.htm'));
} else {
$this->layoutStrings[$layout] = '';
}
}
return $this->layoutStrings[$layout];
}
示例10: FileArray
function FileArray($hackdir, $base = 'hack')
{
if (!in_array($base, array('hack', 'mode'))) {
$base = 'hack';
}
if (function_exists('file_get_contents')) {
$filedata = @file_get_contents(S::escapePath(R_P . "{$base}/{$hackdir}/sql.txt"));
} else {
$filedata = readover(R_P . "{$base}/{$hackdir}/sql.txt");
}
$filedata = preg_replace("/;(\r\n|\n)/is", ";[pw]", $filedata);
$filedata = trim(str_replace(array("\t", "\r", "\n"), array('', '', ''), $filedata));
$sqlarray = $filedata ? explode("[pw]", $filedata) : array();
return $sqlarray;
}
示例11: initRight
function initRight()
{
global $gp_gptype, $SYSTEM;
if (!is_null($this->_G)) {
return;
}
if ($this->groupid == 'guest') {
require D_P . 'data/groupdb/group_2.php';
} elseif (file_exists(D_P . "data/groupdb/group_{$this->groupid}.php")) {
require S::escapePath(D_P . "data/groupdb/group_{$this->groupid}.php");
} else {
require D_P . 'data/groupdb/group_1.php';
}
$this->_G = $_G;
$this->_SYSTEM = $SYSTEM;
$this->_gp_gptype = $gp_gptype;
}
示例12: sendMessage
/**
* 以某个用户的身份给另一个用户发送短消息
* @param int $userId 发送者uid
* @param string $receiver 接受者用户名
* @param string $subject 标题
* @param string $content 内容
* return bool
*/
function sendMessage($userId, $receiver, $subject, $content)
{
global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM;
$userService = $this->_getUserService();
$winddb = $userService->get($userId, true, true);
$winduid = $winddb['uid'];
$groupid = $winddb['groupid'];
$windid = $winddb['username'];
$groupid == '-1' && ($groupid = $winddb['memberid']);
if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
} else {
extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
}
M::sendMessage($userId, array($receiver), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => S::escapeChar(stripslashes($subject)), 'content' => S::escapeChar(stripslashes($content))));
return new ApiResponse(true);
}
示例13: getAttModifyFactory
function getAttModifyFactory($type, $aid)
{
if ($type == 'active') {
L::loadClass('activeupload', 'upload', false);
return new ActiveModify($aid);
}
if ($type == 'cms') {
require_once R_P . 'mode/cms/lib/upload/articleupload.class.php';
return new ArticleModify($aid);
}
if ($type && file_exists(R_P . "require/extents/attach/{$type}modify.class.php")) {
$class = $type . 'Modify';
require_once S::escapePath(R_P . "require/extents/attach/{$type}modify.class.php");
return new $class($aid);
}
L::loadClass('AttModify', 'upload', false);
return new AttModify($aid);
}
示例14: run
function run($configs)
{
list($controller, $action, $viewerPath, $className, $actionName, $path) = $this->init($configs);
if (!is_file($path)) {
Error::showError("路径不存在" . $path);
}
require_once S::escapePath($path);
if (!class_exists($className, true)) {
Error::showError("类名不存在" . $className);
}
$obj = new $className();
if ($action && !is_callable(array($obj, $action))) {
Error::showError("方法名不存在" . $action);
}
if (in_array($action, array($className, "execute", "__construct", "init", "before", "after"))) {
Error::showError("方法调用有误" . $className);
}
$obj->execute($controller, $action, $viewerPath);
}
示例15: deleteDir
function deleteDir($dir)
{
$dir = S::escapePath($dir);
while (!rmdir($dir)) {
if (is_dir($dir)) {
if ($dp = opendir($dir)) {
while (($file = readdir($dp)) != false) {
if (is_dir($dir . '/' . $file) && $file != '.' && $file != '..') {
PW_FileOperate::deleteDir($dir . '/' . $file);
} else {
if ($file != '.' && $file != '..') {
P_unlink($dir . '/' . $file);
}
}
}
closedir($dp);
} else {
return false;
}
}
}
}