本文整理汇总了PHP中Loader::get_library方法的典型用法代码示例。如果您正苦于以下问题:PHP Loader::get_library方法的具体用法?PHP Loader::get_library怎么用?PHP Loader::get_library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader::get_library方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
if (Session::get_state() != Session::ST_LIFE) {
self::set_client_command('refresh', array('url' => 'self'));
self::set_result(FALSE);
return;
}
if (strlen($this->message) > 65000) {
throw new Command_exception('text length error', get_string('errors', 'text_length_error'));
}
$captcha_lib = Loader::get_library('captcha');
if (!$captcha_lib->check($this->captcha)) {
throw new Command_exception('captcha error', get_string('errors', 'captcha_error'));
}
require_once BASEPATH . 'global/cache.php';
$query = array();
$query['%text'] = Security::sanitize_text($this->message);
$query['%name'] = Security::sanitize_text($this->name);
$query['%email'] = Security::sanitize_text($this->email);
$query['%quote_id'] = intval($this->quote_id);
$query['%page'] = Cache::generate_key(TRUE);
$query['%avatar'] = abs(crc32($this->email)) % self::AVATAR_COUNT;
foreach ($query as $key => $value) {
if (!in_array($key, array('%quote_id', '%avatar')) and empty($value)) {
throw new Command_exception('empty text error', get_string('errors', 'empty_field'));
}
}
db::simple_query(self::Q_SET_COMMENT, $query, TRUE);
Cache::reset($query['%page']);
self::set_client_command('refresh', array('url' => 'self'));
}
示例2: captcha
public function captcha()
{
usleep(400000);
$captcha_lib = Loader::get_library('captcha');
$captcha_lib->create();
exit;
}
示例3: execute
public function execute()
{
if (Session::get_state() != Session::ST_LIFE) {
self::set_client_command('refresh', array('url' => 'self'));
self::set_result(FALSE);
return;
}
$additionally = Buffer::get(Identification_strategy::USER_TYPE) == User::T_ALL ? '' : 'AND `type` = "' . Buffer::get(Identification_strategy::USER_TYPE) . '"';
$pass_hash_lib = Loader::get_library('pass_hash');
$captcha_lib = Loader::get_library('captcha');
$login = db::escape_string($this->login);
$row = db::row(self::Q_GET_USER_BY_NAME, array('%login' => $login, '%additionally' => $additionally));
$this->remember = (bool) $this->remember;
if (empty($row)) {
Security::set_ip_violation();
throw new Command_exception(NULL, 'Введённый логин - не существует!');
}
if (!$captcha_lib->check($this->captcha)) {
Security::set_ip_violation();
throw new Command_exception(NULL, 'Введён неправильный проверочный код!');
}
if (!$pass_hash_lib->check_password($row['password'], $this->password)) {
Security::set_ip_violation();
throw new Command_exception(NULL, 'Введён неправильный пароль!');
}
//SELECT DATA_FREE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='db_test' AND TABLE_NAME = 'log_error'
Session::set_user($row['id'], $this->remember);
$user = Loader::get_user();
$secret_key = $user->get_module('secret_key')->regenerate_secret_key();
self::set_client_command('set_secret_key', array('secretKey' => $secret_key));
self::set_client_command('refresh', array('url' => 'self'));
}
示例4: execute
public function execute()
{
$captcha_lib = Loader::get_library('captcha');
if (!$captcha_lib->check($this->captcha)) {
throw new Command_exception('captcha error', get_string('errors', 'captcha_error'));
}
$subject = '(Русская зона) Пользователь - ' . $this->name;
$message = 'email: ' . $this->email . "\r\n";
$message .= 'phone: ' . $this->phone . "\r\n";
$message .= 'message: ' . $this->message;
mail(self::EMAIL, $subject, $message, "Content-type:text/plain; charset = utf-8\r\nFrom:{$this->email}");
}
示例5: execute
public function execute()
{
$captcha_lib = Loader::get_library('captcha');
if (!$captcha_lib->check($this->captcha)) {
throw new Command_exception('captcha error', get_string('errors', 'captcha_error'));
}
if (empty($this->header)) {
$this->header = 'none';
}
$subject = $this->name . ' : ' . $this->header;
$message = 'email: ' . $this->email . "\r\n";
$message .= 'message: ' . $this->message;
mail(self::EMAIL, $subject, $message, "Content-type:text/plain; charset = utf-8\r\nFrom:{$this->email}");
}