本文整理汇总了PHP中app::config方法的典型用法代码示例。如果您正苦于以下问题:PHP app::config方法的具体用法?PHP app::config怎么用?PHP app::config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::config方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configSectionInject
public static function configSectionInject($s)
{
if (is_array($s)) {
self::$config = array_merge(self::$config, $s);
} else {
if (file_exists(__APP__ . '/' . $s . '/config.inc')) {
self::$config = array_merge(self::$config, include __APP__ . '/' . $s . '/config.inc');
}
}
}
示例2: init
static function init()
{
define("DP_VER", "1.0.1", false);
defined("CORE_PATH") or define("CORE_PATH", __DIR__);
defined("ROOT_PATH") or define("ROOT_PATH", dirname(CORE_PATH));
defined("PLUGIN_PATH") or define("PLUGIN_PATH", ROOT_PATH . "/plugins");
defined("APP_PATH") or define("APP_PATH", ROOT_PATH . "/app");
defined("LOG_PATH") or define("LOG_PATH", ROOT_PATH . "/logs");
function L($module = _MODULE_)
{
return app::in($module . "Logic", $module . "\\libs\\" . $module);
}
function P($lib, $module = _MODULE_)
{
return app::in($module . "_" . $lib, $module . "\\libs\\" . $lib);
}
function C($key, $item = "")
{
if (!isset(app::$config[$key])) {
$split = explode(".", $key);
$dest = count($split) > 1 ? $split[0] . "/config/" . $split[1] : "config/" . $split[0];
app::$config[$key] = (include APP_PATH . "/{$dest}.php");
}
return empty($item) ? app::$config[$key] : app::$config[$key][$item];
}
//autoload
spl_autoload_register(function ($className) {
$class = "/" . str_replace("\\", "/", $className) . ".php";
self::autoLoad($class, array(CORE_PATH, APP_PATH, ROOT_PATH));
});
plugin::init();
session::start();
self::$config = (include ROOT_PATH . "/config/app.php");
empty(self::$config['db']) || db::connect(self::$config['db']);
empty(self::$config['rule']) || router::set(self::$config['rule']);
}
示例3: initConfig
/**
* Init config of the module
*/
public function initConfig()
{
$config = array();
include $this->name . '/config.php';
\app::$config = array_merge(\app::$config, $config);
}
示例4: tr
<input type="checkbox" onclick="if(this.checked) document.getElementById('pass1').type = 'text'; else document.getElementById('pass1').type = 'password';"><?php
echo tr('Check Password');
?>
</div>
<div><br>
</div>
<input type="hidden" name="step" value="validstep4" />
<?php
break 2;
case 5:
include 'modules/core/classes/app.php';
class_alias('core\\classes\\app', 'app');
include 'profiles/www/config.php';
define('PREFIX', $config['db']['prefix']);
app::$config = $config;
app::$activeModules = array_filter($config['modules']);
$config['aliasClasses'] = array('app' => 'core\\classes\\app', 'request' => 'core\\classes\\request', 'response' => 'core\\classes\\response', 'block' => 'core\\classes\\block', 'tools' => 'core\\classes\\tools', 'view' => 'core\\classes\\view', 'module' => 'core\\classes\\module', 'PDOconnection' => 'core\\classes\\PDOconnection', 'config' => 'core\\classes\\config', 'queryBuilder' => 'core\\classes\\queryBuilder', 'entity' => 'core\\classes\\entity', 'theme' => 'core\\classes\\theme', 'page' => 'core\\classes\\page', 'css' => 'core\\classes\\css', 'user' => 'core\\classes\\user', 'pagination' => 'core\\classes\\pagination', 'img' => 'core\\classes\\img', 'field' => 'core\\classes\\field', 'field_ident' => 'core\\fields\\ident', 'field_string' => 'core\\fields\\string', 'field_numeric' => 'core\\fields\\numeric', 'field_decimal' => 'core\\fields\\decimal', 'field_price' => 'core\\fields\\price', 'field_percent' => 'core\\fields\\percent', 'field_mail' => 'core\\fields\\mail', 'field_password' => 'core\\fields\\password', 'field_state' => 'core\\fields\\state', 'field_date' => 'core\\fields\\date', 'field_publication' => 'core\\fields\\publication', 'field_image' => 'core\\fields\\image', 'field_url' => 'core\\fields\\url', 'field_url_rewriting' => 'core\\fields\\url_rewriting', 'field_wysiwyg' => 'core\\fields\\wysiwyg', 'field_textarea' => 'core\\fields\\textarea', 'field_user' => 'core\\fields\\user', 'field_ip' => 'core\\fields\\ip', 'field_boolean' => 'core\\fields\\boolean', 'field_foreignkey' => 'core\\fields\\foreignkey', 'field_formasso' => 'core\\fields\\formasso');
app::$aliasClasses = $config['aliasClasses'];
define('PROFILE_PATH', 'profiles/www/modules/');
$toInclude = array('config', 'queryBuilder', 'entity', 'field', 'field_ident', 'field_string', 'field_numeric', 'field_decimal', 'field_price', 'field_percent', 'field_mail', 'field_password', 'field_state', 'field_date', 'field_publication', 'field_image', 'field_flash', 'field_url', 'field_url_rewriting', 'field_wysiwyg', 'field_textarea', 'field_user', 'field_ip', 'field_boolean', 'field_foreignkey', 'field_formasso', 'PDOconnection', 'tools', 'module');
foreach ($config['aliasClasses'] as $alias => $class) {
if (in_array($alias, $toInclude)) {
include 'modules/' . str_replace('\\', '/', $class) . '.php';
class_alias($class, $alias);
}
}
//create SQL tables
include 'modules/core/module.php';
$core = new \core\module('core');
$core->install();
示例5: testLastUsedPasswordsMaxReached
/**
*
* @expectedException Application\Exceptions\ValidateException
*/
public function testLastUsedPasswordsMaxReached()
{
// User should be a service provider
$user = clone $this->_user;
$user->id = null;
$user->setOrganizationId(self::PROVIDER_COMMERCIAL_ORG_ID);
$user->save();
// Update password N times
$limit = \app::config('lastUsedPasswordsLimit');
$loops = $limit + 5;
for ($i = 0; $i < $loops; $i++) {
$lastPassword = 'Testing' . rand(1000, 9999);
$user = $this->_service->updatePassword($user, $lastPassword);
$lastUsedPasswords = $this->_service->getLastUsedPasswords($user->id);
$this->assertNotEmpty($lastUsedPasswords);
}
$this->assertEquals(count($lastUsedPasswords), $limit);
// Try to insert an existent password in a list
$this->_service->updatePassword($user, $lastPassword);
}