当前位置: 首页>>代码示例>>PHP>>正文


PHP Loader::get_library方法代码示例

本文整理汇总了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'));
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:31,代码来源:widgets_comments.php

示例2: captcha

 public function captcha()
 {
     usleep(400000);
     $captcha_lib = Loader::get_library('captcha');
     $captcha_lib->create();
     exit;
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:7,代码来源:tests.php

示例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'));
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:32,代码来源:user.php

示例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}");
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:12,代码来源:home.php

示例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}");
 }
开发者ID:viking2000,项目名称:web-antarix,代码行数:14,代码来源:home.php


注:本文中的Loader::get_library方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。