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


PHP PluginRegistry::getInstance方法代码示例

本文整理汇总了PHP中PluginRegistry::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistry::getInstance方法的具体用法?PHP PluginRegistry::getInstance怎么用?PHP PluginRegistry::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PluginRegistry的用法示例。


在下文中一共展示了PluginRegistry::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 /**
  * Logs in to the system
  *
  * @param $username string The username
  * @param $password strint The password
  * @return string
  */
 public function login($username, $password)
 {
     @session_destroy();
     @session_start();
     $password = md5($password);
     $msg = "";
     $pru = PluginRegistry::getInstance();
     $login = $pru->getPlugin("Login Plugin");
     $result = $login->SOAPLogin($username, $password);
     return session_id();
     switch ($result) {
         case 200:
             $msg = "Logged in successfully";
             break;
         case 402:
             $msg = "There was an error while trying to login; your username is blocked";
             break;
         case 403:
             $msg = "Incorrect username/password combination";
             break;
         case 500:
             $msg = "There was an error on the server, please try later";
             break;
         default:
             $msg = "Incorrect username/password combination";
             break;
     }
     return $msg;
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:36,代码来源:FWSoapLogin.class.php

示例2: hasPlugin

 public function hasPlugin($pname)
 {
     $def = $this->_getPluginsDef();
     if (array_key_exists($pname, $def)) {
         return true;
     }
     if (in_array(PluginRegistry::getInstance($pname, 'DB'), $this->_listeners)) {
         return true;
     }
     return false;
 }
开发者ID:demental,项目名称:m,代码行数:11,代码来源:Pluggable.php

示例3: _restLogin

 /**
  * REST service to login into the system
  * to use a REST service that needs authentication
  *
  * @param $params array Array of params
  * @return void
  */
 private function _restLogin($params)
 {
     if (count($params) == 4) {
         $username = $params[1];
         $password = $params[3];
     } else {
         $this->unauthorized();
     }
     $password = md5($password);
     $pru = PluginRegistry::getInstance();
     $login = $pru->getPlugin("Login Plugin");
     $result = $login->restLogin($username, $password);
     header("Content-type: text/xml");
     print '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
     if ($result == 200) {
         print "<result>Logged in succesfully</result>";
     } else {
         print "<error>Incorrect user or password combination</error>";
     }
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:27,代码来源:FWRestServer.class.php


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