本文整理汇总了PHP中PMF_String::init方法的典型用法代码示例。如果您正苦于以下问题:PHP PMF_String::init方法的具体用法?PHP PMF_String::init怎么用?PHP PMF_String::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMF_String
的用法示例。
在下文中一共展示了PMF_String::init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
// 10MB
define('PMF_SITEMAP_GOOGLE_PRIORITY_MIN', '0.0');
define('PMF_SITEMAP_GOOGLE_PRIORITY_MAX', '1.0');
define('PMF_SITEMAP_GOOGLE_PRIORITY_DEFAULT', '0.5');
define('PMF_SITEMAP_GOOGLE_GET_GZIP', 'gz');
define('PMF_SITEMAP_GOOGLE_GET_INDEX', 'idx');
define('PMF_SITEMAP_GOOGLE_FILENAME', 'sitemap.xml');
define('PMF_SITEMAP_GOOGLE_FILENAME_GZ', 'sitemap.xml.gz');
define('PMF_SITEMAP_GOOGLE_INDEX_FILENAME', 'sitemap_index.xml');
define('PMF_ROOT_DIR', dirname(__FILE__));
define('IS_VALID_PHPMYFAQ', null);
require PMF_ROOT_DIR . '/inc/Init.php';
//
// Initalizing static string wrapper
//
PMF_String::init('en');
// {{{ Functions
function buildSitemapNode($location, $lastmod = null, $changeFreq = null, $priority = null)
{
if (!isset($lastmod)) {
$lastmod = PMF_Date::createISO8601Date($_SERVER['REQUEST_TIME'], false);
}
if (!isset($changeFreq)) {
$changeFreq = PMF_SITEMAP_GOOGLE_CHANGEFREQ_DAILY;
}
$node = '<url>' . '<loc>' . PMF_String::htmlspecialchars($location) . '</loc>' . '<lastmod>' . $lastmod . '</lastmod>' . '<changefreq>' . $changeFreq . '</changefreq>' . (isset($priority) ? '<priority>' . $priority . '</priority>' : '') . '</url>';
return $node;
}
//
// Future improvements
// WHEN a User PMF Sitemap will be:
示例2: define
use Symfony\Component\HttpFoundation\Response;
define('PMF_ROOT_DIR', dirname(dirname(__DIR__)));
define('IS_VALID_PHPMYFAQ', null);
//
// Bootstrapping
//
require PMF_ROOT_DIR . '/inc/Bootstrap.php';
//
// get language (default: english)
//
$Language = new PMF_Language($faqConfig);
$LANGCODE = $Language->setLanguage($faqConfig->get('main.languageDetection'), $faqConfig->get('main.language'));
//
// Initalizing static string wrapper
//
PMF_String::init($LANGCODE);
// Preload English strings
require_once PMF_ROOT_DIR . '/lang/language_en.php';
$faqConfig->setLanguage($Language);
if ($faqConfig->get('security.enableLoginOnly')) {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
$response = Response::create()->setStatusCode(401);
$response->headers->set('WWW-Authenticate', 'Basic realm="phpMyFAQ RSS Feeds"');
$response->send();
exit;
} else {
$user = new PMF_User_CurrentUser($faqConfig);
if ($user->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
if ($user->getStatus() != 'blocked') {
$auth = true;
} else {
示例3: PMF_Language_Plurals
// Preload English strings
require_once 'lang/language_en.php';
$showCaptcha = PMF_Filter::filterInput(INPUT_GET, 'gen', FILTER_SANITIZE_STRING);
if (isset($LANGCODE) && PMF_Language::isASupportedLanguage($LANGCODE) && is_null($showCaptcha)) {
// Overwrite English strings with the ones we have in the current language,
// but don't include UTF-8 encoded files, these will break the captcha images
require_once 'lang/language_' . $LANGCODE . '.php';
} else {
$LANGCODE = 'en';
}
//Load plurals support for selected language
$plr = new PMF_Language_Plurals($PMF_LANG);
//
// Initalizing static string wrapper
//
PMF_String::init($PMF_LANG["metaCharset"], $LANGCODE);
/**
* Initialize attachment factory
*/
PMF_Attachment_Factory::init($faqconfig->get('main.attachmentsStorageType'), $faqconfig->get('main.defaultAttachmentEncKey'), $faqconfig->get('main.enableAttachmentEncryption'));
//
// Get user action
//
$action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING, 'main');
//
// Authenticate current user
//
$auth = null;
$error = '';
$faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
$faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);
示例4: array
$current_groups = array(-1);
$action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
$language = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING, 'en');
$categoryId = PMF_Filter::filterInput(INPUT_GET, 'categoryId', FILTER_VALIDATE_INT);
$recordId = PMF_Filter::filterInput(INPUT_GET, 'recordId', FILTER_VALIDATE_INT);
// Get language (default: english)
$Language = new PMF_Language();
$language = $Language->setLanguage($faqconfig->get('main.languageDetection'), $faqconfig->get('main.language'));
// Set language
if (PMF_Language::isASupportedLanguage($language)) {
require 'lang/language_' . $language . '.php';
} else {
require 'lang/language_en.php';
}
$plr = new PMF_Language_Plurals($PMF_LANG);
PMF_String::init($language);
// Set empty result
$result = array();
// Handle actions
switch ($action) {
case 'getVersion':
$result = array('version' => $faqconfig->get('main.currentVersion'));
break;
case 'getApiVersion':
$result = array('apiVersion' => (int) $faqconfig->get('main.currentApiVersion'));
break;
case 'search':
$search = new PMF_Search($db, $Language);
$searchString = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED);
$result = $search->search($searchString, false);
$url = $faqconfig->get('main.referenceURL') . '/index.php?action=artikel&cat=%d&id=%d&artlang=%s';
示例5: array
$current_user = -1;
$current_groups = array(-1);
$action = PMF_Filter::filterInput(INPUT_GET, 'action', FILTER_SANITIZE_STRING);
$language = PMF_Filter::filterInput(INPUT_POST, 'lang', FILTER_SANITIZE_STRING, 'en');
// Get language (default: english)
$Language = new PMF_Language();
$LANGCODE = $Language->setLanguage($faqconfig->get('main.languageDetection'), $faqconfig->get('main.language'));
// Set language
if (PMF_Language::isASupportedLanguage($language)) {
$LANGCODE = trim($language);
require_once 'lang/language_' . $LANGCODE . '.php';
} else {
$LANGCODE = 'en';
require_once 'lang/language_en.php';
}
PMF_String::init('utf-8', $LANGCODE);
// Set empty result
$result = array();
// Handle actions
switch ($action) {
case 'getVersion':
$result = array('version' => $faqconfig->get('main.currentVersion'));
break;
case 'getApiVersion':
$result = array('apiVersion' => (int) $faqconfig->get('main.currentApiVersion'));
break;
case 'search':
$search = new PMF_Search();
$searchString = PMF_Filter::filterInput(INPUT_GET, 'q', FILTER_SANITIZE_STRIPPED);
$result = $search->search($searchString, false, true, false);
$url = $faqconfig->get('main.referenceURL') . '/index.php?action=artikel&cat=%d&id=%d&artlang=%s';
示例6: session_name
PMF_Init::cleanRequest();
session_name(PMF_COOKIE_NAME_AUTH . trim($faqconfig->get('main.phpMyFAQToken')));
session_start();
// Preload English strings
require PMF_ROOT_DIR . '/lang/language_en.php';
//
// Get language (default: english)
//
$_language = PMF_Filter::filterInput(INPUT_GET, 'lang', FILTER_SANITIZE_STRING);
if (!is_null($_language) && PMF_Language::isASupportedLanguage($_language)) {
require PMF_ROOT_DIR . '/lang/language_' . $_language . '.php';
}
//
// Initalizing static string wrapper
//
PMF_String::init($PMF_LANG["metaCharset"], $_language);
$user = PMF_User_CurrentUser::getFromSession($faqconfig->get('main.ipCheck'));
$refreshTime = (PMF_SESSION_ID_EXPIRES - PMF_SESSION_ID_REFRESH) * 60;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php
print $PMF_LANG["metaLanguage"];
?>
" lang="<?php
print $PMF_LANG["metaLanguage"];
?>
">
<head>
<title>phpMyFAQ - "Welcome to the real world."</title>
<meta name="copyright" content="(c) 2001-2009 phpMyFAQ Team" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php