本文整理汇总了PHP中F3::mset方法的典型用法代码示例。如果您正苦于以下问题:PHP F3::mset方法的具体用法?PHP F3::mset怎么用?PHP F3::mset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F3
的用法示例。
在下文中一共展示了F3::mset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
Load appropriate dictionary files
@public
**/
static function load()
{
if (!self::$vars['LANGUAGE']) {
// Auto-detect
if (extension_loaded('intl')) {
$def = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? Locale::acceptFromHTTP($_SERVER['HTTP_ACCEPT_LANGUAGE']) : Locale::getDefault();
} else {
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$def = preg_replace('/^(\\w{2}(?:-\\w{2})?).*/', '\\1', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
} else {
$def = setlocale(LC_ALL, NULL);
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$def = key(preg_grep('/' . strstr($def, '_', TRUE) . '/', self::$languages));
} elseif (preg_match('/^\\w{2}/', $def, $match)) {
$def = $match[0];
} else {
// Environment points to invalid language
$def = 'en';
}
}
}
self::$vars['LANGUAGE'] = $def;
}
$def = self::$vars['LANGUAGE'];
$list = array($def);
if (preg_match('/^\\w{2}/', $def, $match)) {
array_unshift($list, $match[0]);
if (extension_loaded('intl')) {
Locale::setDefault($match[0]);
} elseif (isset(self::$languages[$match[0]])) {
self::$locale = setlocale(LC_ALL, NULL);
setlocale(LC_ALL, self::$languages[$match[0]]);
}
}
// Add English as fallback
array_unshift($list, 'en');
foreach (array_unique($list) as $language) {
$file = self::fixslashes(self::$vars['LOCALES']) . $language . '.php';
if (is_file($file) && ($trans = (require $file)) && is_array($trans)) {
// Combine dictionaries and assign key/value pairs
F3::mset($trans, '', FALSE);
}
}
if (!extension_loaded('intl') && !isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
setlocale(LC_ALL, NULL);
}
}
示例2: function
<?php
//APP ROUTER a.k.a VIEWER
\F3::mset(array("UI" => __DIR__ . "/View/", "DEBUG" => 2, "UPLOADS" => __DIR__ . "/uploaded/", "AUTOLOAD" => __DIR__ . "/;" . __DIR__ . "/f3/burger/", "TEMP" => __DIR__ . "/tmp/", "CACHE" => __DIR__ . "/cachez/", "kekesed.sitename" => "Kambeng blog", "kekesed.copyright.text" => "Kekesed Asmasta. All Right Reserved.", "kekesed.copyright.year_start" => "2014", "kekesed.system.version" => "0.1.17"));
if (!isset($_SESSION)) {
session_start();
}
\kksd\Sesi::$DB = new \DB\SQL("mysql:host=127.0.0.1;port=3306;dbname=kambeng_blog", "kambeng_blog", "kambeng");
\F3::set('db', \kksd\Sesi::$DB);
/*
PUBLIC SETTINGS~ :* :*
*/
\F3::route("GET /", 'Control\\App->indexer');
\F3::route("GET @blogread: /baca/@id-xyml", "Control\\Blog->Tampil");
\F3::route("GET @virtualasset: /img/@link/@size-@id-@type", "Control\\Imager->akses", 3600 * 24 * 7);
// cache seminggu :3
/*
ADMIN PANEL SETTINGS~ :* :*
*/
\Middleware::instance()->before('GET|POST|PUT|DELETE /admin*', function (\Base $f3, $param) {
//cek apa dia login apa kagak, dan layak apa kagak. lel
$access = \Access::instance();
$access->policy('deny');
$access->allow('/admin/*', 'admin');
$access->allow('GET|POST /admin/Auth*');
$access->allow('GET|POST /admin/auth*');
if (!$f3->exists('SESSION.user_type') && !$f3->exists('COOKIE.user')) {
$f3->set('SESSION.user_type', 'guest');
}
$access->authorize($f3->get('SESSION.user_type'), function ($route, $subject) {
\F3::reroute('@admin_pack(@pack=Auth)');
示例3: array
<?php
// Use the Fat-Free Framework
require_once 'lib/F3.php';
require_once 'inc/ldap_fun.php';
F3::set('RELEASE', FALSE);
// Use custom 404 page
F3::set('E404', 'layout.htm');
// Path to our Fat-Free import files
F3::set('IMPORTS', 'inc/');
// Path to our CAPTCHA font file
F3::set('FONTS', 'fonts/');
// Path to our templates
F3::set('GUI', 'gui/');
// Another way of assigning values to framework variables
F3::mset(array('site' => 'Kullanıcı Veritabanı'));
// Common inline Javascript
F3::set('extlink', 'window.open(this.href); return false;');
F3::set('LDAP', array('host' => '192.168.56.102', 'port' => 389, 'base' => 'dc=debuntu,dc=local', 'admin' => 'cn=admin,dc=debuntu,dc=local', 'passw' => 'secret', 'ou' => 'ou=moodleusers,dc=debuntu,dc=local', 'conn' => '', 'bind' => ''));
/* LDAP ozelinde
F3::call(':db'); ile de (F3::set yoluyla) ds,r degiskenlerini.
*/
// Define our main menu; this appears in all our pages
F3::set('menu', array_merge(array('Ana sayfa' => '/'), F3::get('SESSION.user') ? array('Hakkında' => '/about', 'Çıkış' => '/logout') : array('Giriş' => '/login')));
F3::route('GET /', ':showhome');
F3::route('GET /search', ':sorgu');
F3::route('GET /search_cn', ':todo');
// Minify CSS; and cache page for 60 minutes
F3::route('GET /min', ':minified', 3600);
// Cache the "about" page for 60 minutes; read the full documentation to
// understand the possible unwanted side-effects of the cache at the
示例4: set
If you're writing your own application and still debugging it, you might
want to set this Fat-Free variable to FALSE. The stack trace can help
a lot in program testing.
**/
F3::set('RELEASE', FALSE);
// Use custom 404 page
F3::set('E404', 'layout.htm');
// Path to our Fat-Free import files
F3::set('IMPORTS', 'inc/');
// Path to our CAPTCHA font file
F3::set('FONTS', 'fonts/');
// Path to our templates
F3::set('GUI', 'gui/');
// Another way of assigning values to framework variables
F3::mset(array('site' => 'Kullanıcı Veritabanı', 'data' => 'db/demo.db'));
// Common inline Javascript
F3::set('extlink', 'window.open(this.href); return false;');
/**
Create database connection; The demo database is within our Web
directory but for production use, a non-Web accessible path is highly
recommended for better security.
Fat-Free allows you to use any database engine - you just need the DSN
so the framework knows how to communicate with it. Migrating to another
engine should be next to easy. If you stick to the standard SQL92
command set (no engine-specific extensions), you just have to change the
next line. For this demo, we'll use the SQLite engine, so there's no
need to install MySQL on your server.
**/
/*F3::set('DB',