本文整理汇总了PHP中secureFileName函数的典型用法代码示例。如果您正苦于以下问题:PHP secureFileName函数的具体用法?PHP secureFileName怎么用?PHP secureFileName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了secureFileName函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define('DIR_LANG', DIR_AJAX_ROOT . 'langs' . DIRECTORY_SEPARATOR);
//Class Declarations
define('CLASS_FILE', DIR_AJAX_INC . 'class.file.php');
define("CLASS_UPLOAD", DIR_AJAX_INC . 'class.upload.php');
define('CLASS_MANAGER', DIR_AJAX_INC . 'class.manager.php');
define('CLASS_IMAGE', DIR_AJAX_INC . "class.image.php");
define('CLASS_HISTORY', DIR_AJAX_INC . "class.history.php");
define('CLASS_SESSION_ACTION', DIR_AJAX_INC . "class.sessionaction.php");
define('CLASS_PAGINATION', DIR_AJAX_INC . 'class.pagination.php');
define('CLASS_SEARCH', DIR_AJAX_INC . "class.search.php");
//SCRIPT FILES declarations
define('SPT_FUNCTION_BASE', DIR_AJAX_INC . 'function.base.php');
//include different config base file according to query string "config"
$configBaseFileName = 'config.base.php';
if (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") {
$configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
}
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName;
require_once DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php";
require_once DIR_AJAX_INC . "function.base.php";
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php";
$session = new Session();
$auth = new Auth();
if (CONFIG_ACCESS_CONTROL_MODE == 1) {
//access control enabled
if (!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) {
//
header('Location: ' . appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString()));
exit;
}
}
示例2: define
* echo dirname(__FILE__);
* ?>
* 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer
* 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that
* 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be
* 6. enjoy it
*
*/
define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
//theme related setting
/*
* options avaialbe for CONFIG_EDITOR_NAME are:
stand_alone
tinymce
fckeditor
*/
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
define('CONFIG_EDITOR_NAME', CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor']) ? secureFileName($_GET['editor']) : 'stand_alone');
define('CONFIG_THEME_NAME', CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme']) ? secureFileName($_GET['theme']) : 'default');
//change the theme to your custom theme rather than default
define('CONFIG_DEFAULT_VIEW', CONFIG_SYS_THUMBNAIL_VIEW_ENABLE ? 'detail' : 'detail');
//thumnail or detail
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
define('CONFIG_LOAD_DOC_LATTER', false);
//all documents will be loaded up after the template has been loaded to the client
//General Option Declarations
//LANGAUGAE DECLARATIONNS
define('CONFIG_LANG_INDEX', 'language');
//the index in the session
define('CONFIG_LANG_DEFAULT', CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php')) ? secureFileName($_GET['language']) : 'en');
//change it to be your language file base name, such en
示例3: file_exists
* 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer
* 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that
* 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be
* 6. enjoy it
*
*/
define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
//theme related setting
/*
* options avaialbe for CONFIG_EDITOR_NAME are:
stand_alone
tinymce
fckeditor
*/
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce'));
define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default
define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client
//General Option Declarations
//LANGAUGAE DECLARATIONNS
define('CONFIG_LANG_INDEX', 'language'); //the index in the session
define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en
?>
示例4: define
define('CONFIG_WEBSITE_DOCUMENT_ROOT', rtrim(api_get_path(SYS_SERVER_ROOT_PATH), '/'));
//theme related setting
/*
* options avaialbe for CONFIG_EDITOR_NAME are:
stand_alone
tinymce
fckeditor
*/
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
define('CONFIG_EDITOR_NAME', CONFIG_QUERY_STRING_ENABLE && !empty($editor) ? secureFileName($editor) : 'fckeditor');
// run mode fckeditor (Chamilo editor)
define('CONFIG_THEME_NAME', CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme']) ? secureFileName($_GET['theme']) : 'default');
//change the theme to your custom theme rather than default
define('CONFIG_DEFAULT_VIEW', CONFIG_SYS_THUMBNAIL_VIEW_ENABLE ? 'thumbnail' : 'detail');
//thumbnail or detail
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10000);
//change 10 by 10000 while pagination is deactivated on Chamilo
define('CONFIG_LOAD_DOC_LATTER', false);
//all documents will be loaded up after the template has been loaded to the client
//General Option Declarations
//LANGAUGAE DECLARATIONNS
$ajaxfilemanager_code_translation_table = array('' => 'en', 'pt' => 'pt_pt', 'sr' => 'sr_latn');
$langajaxfilemanager = strtolower(str_replace('-', '_', api_get_language_isocode()));
$langajaxfilemanager = isset($ajaxfilemanager_code_translation_table[$langajaxfilemanager]) ? $ajaxfilemanager_code_translation_table[$langajaxfilemanager] : $langajaxfilemanager;
$langajaxfilemanager = file_exists(api_get_path(SYS_PATH) . 'main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/langs/' . $langajaxfilemanager . '.php') ? $langajaxfilemanager : 'en';
define('CONFIG_LANG_INDEX', 'language');
//the index in the session
define('CONFIG_LANG_DEFAULT', CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php') ? secureFileName($_GET['language']) : $langajaxfilemanager);
//change it to be your language file base name, such en
// Language text direction.
define('CONFIG_LANG_TEXT_DIRECTION_DEFAULT', in_array(CONFIG_LANG_DEFAULT, array('ar', 'prs', 'he', 'ps', 'fa')) ? 'rtl' : 'ltr');