本文整理汇总了PHP中Cookie::getSecretKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Cookie::getSecretKey方法的具体用法?PHP Cookie::getSecretKey怎么用?PHP Cookie::getSecretKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie
的用法示例。
在下文中一共展示了Cookie::getSecretKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getKey
private static function getKey()
{
if (self::$key) {
return self::$key;
}
return self::$key = substr(Cookie::getSecretKey(), 0, 32);
}
示例2:
<?php
/*
|--------------------------------------------------------------------------
| Load Site Configuration
|--------------------------------------------------------------------------
|
| Before anything we need to load all the user-specified configurations,
| global variables, custom routes, and theme settings. Many methods
| depend on these settings.
|
*/
$config = Statamic::loadAllConfigs();
$config['_cookies.secret_key'] = Cookie::getSecretKey();
$config['log_enabled'] = TRUE;
$config['log.level'] = Log::convert_log_level($config['_log_level']);
$config['whoops.editor'] = 'sublime';
$config['log.writer'] = new Statamic_Logwriter(array('path' => $config['_log_file_path'], 'file_prefix' => $config['_log_file_prefix']));
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Many users are upgrading to PHP 5.3 for the first time. I know.
| We've gone ahead set the default timezone that will be used by the PHP
| date and date-time functions. This prevents some potentially
| frustrating errors for novice developers.
|
*/
date_default_timezone_set(Helper::pick($config['_timezone'], @date_default_timezone_get(), "UTC"));
/*
示例3: createHash
/**
* Creates a hash for this user
*
* @param Member $member Member object
* @return string
*/
protected static function createHash($member)
{
return $member->get('username') . ':' . md5($member->get('password_hash') . Cookie::getSecretKey());
}
示例4: loadAllConfigs
//.........这里部分代码省略.........
}
/*
|--------------------------------------------------------------------------
| Load Environment Configs and Variables
|--------------------------------------------------------------------------
|
| Environments settings explicitly overwrite any existing settings, and
| therefore must be loaded late. We also set a few helper variables
| to make working with environments even easier.
|
*/
_Environment::establish($config);
/*
|--------------------------------------------------------------------------
| MIME Types
|--------------------------------------------------------------------------
*/
$config['_mimes'] = require Config::getAppConfigPath() . '/mimes.php';
/*
|--------------------------------------------------------------------------
| Localization
|--------------------------------------------------------------------------
|
| We load up English by default. We're American after all. Doesn't the
| world revolve around us? Hello? Bueller? More hamburgers please.
|
*/
$config['_translations'] = array();
$config['_translations']['en'] = YAML::parse(Config::getAppConfigPath() . '/default.en.yaml');
;
if ($lang = array_get($config, '_language', false)) {
if (File::exists(Config::getTranslation($lang))) {
$translation = YAML::parse(Config::getTranslation($lang));
$config['_translations'][$lang] = Helper::arrayCombineRecursive($config['_translations']['en'], $translation);
}
}
$finder = new Finder(); // clear previous Finder interator results
try {
$translation_files = $finder->files()
->in(BASE_PATH . Config::getAddonsPath() . '/*/translations')
->name($lang.'.*.yaml')
->depth(0)
->followLinks();
foreach ($translation_files as $file) {
$translation = YAML::parse($file->getRealPath());
$config['_translations'][$lang] = Helper::arrayCombineRecursive($translation, $config['_translations'][$lang]);
}
} catch(Exception $e) {
// meh. not important.
}
/*
|--------------------------------------------------------------------------
| Set Slim Config
|--------------------------------------------------------------------------
|
| Slim needs to be initialized with a set of config options, so these
| need to be set earlier than the set_default_tags() method.
|
*/
// $config['view'] = new Statamic_View();
$config['cookies.lifetime'] = $config['_cookies.lifetime'];
$config['_cookies.secret_key'] = Cookie::getSecretKey();
if ($admin) {
$admin_theme = array_get($config, '_admin_theme', 'ascent');
if (!Folder::exists(BASE_PATH . Path::tidy('/' . $config['_admin_path'] . '/' . 'themes/' . $admin_theme))) {
$admin_theme = 'ascent';
}
$theme_path = Path::tidy('/' . $config['_admin_path'] . '/' . 'themes/' . $admin_theme . '/');
$config['theme_path'] = $theme_path;
$config['templates.path'] = '.' . $theme_path;
} else {
$public_path = isset($config['_public_path']) ? $config['_public_path'] : '';
$config['theme_path'] = $themes_path . '/' . $config['_theme'] . '/';
$config['templates.path'] = Path::tidy($public_path . $themes_path . '/' . $config['_theme'] . '/');
}
if (!array_get($config, '_display_debug_panel', false)) {
Debug::disable();
}
return $config;
}
示例5: array
/*
|--------------------------------------------------------------------------
| Slim Initialization
|--------------------------------------------------------------------------
|
| Time to get an instance of Slim fired up. We're passing the $config
| array, which contains a bit more data than necessary, but helps keep
| everything simple.
|
*/
$config['whoops.editor'] = 'sublime';
$admin_app = new \Slim\Slim(array_merge($config, array('view' => new Statamic_View())));
// Initialize Whoops middleware
$admin_app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware());
$admin_app->config = $config;
$admin_app->config['_cookies.secret_key'] = Cookie::getSecretKey();
/*
|--------------------------------------------------------------------------
| Cookies for the Monster
|--------------------------------------------------------------------------
|
| Get the Slim Cookie middleware running the specified lifetime.
|
*/
session_cache_limiter(false);
session_start();
/*
|--------------------------------------------------------------------------
| Check for Disabled Control Panel
|--------------------------------------------------------------------------
|