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


PHP Registry::instance方法代码示例

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


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

示例1: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:powersoftTV,项目名称:nf.dev,代码行数:7,代码来源:Registry.php

示例2: getAccessManager

 public static function getAccessManager()
 {
     if (empty(self::$instance)) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:VitaOpus,项目名称:Patterns,代码行数:7,代码来源:Command.php

示例3: get_instance

 /**
  *	Visszadja a Registry objektumot
  */
 public static function get_instance()
 {
     if (!self::$instance) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:10,代码来源:registry_class.php

示例4: getInstance

 /**
  * Возвращает единственный экземпляр класса.
  * @Возвращаем Registry.
  */
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new static();
     }
     return self::$instance;
 }
开发者ID:bionicle12,项目名称:testsite,代码行数:11,代码来源:Registry.php

示例5: getInstance

 /**
  * 取得 Registry静态实例
  * @return object $this
  */
 private static function getInstance()
 {
     if (!is_object(self::$instance)) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:nofuyun,项目名称:note,代码行数:11,代码来源:registry.php

示例6: instance

 public static function instance()
 {
     if (null == self::$instance) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:honglei619,项目名称:cuteflow_v2,代码行数:7,代码来源:Registry.php

示例7: getInstance

 /**
  * @return Registry
  */
 static function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info-store,代码行数:10,代码来源:registry.php

示例8: getInstance

 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new Registry();
     }
     return self::$instance;
 }
开发者ID:open-steam,项目名称:usermanagement-ldap,代码行数:7,代码来源:class.Registry.php

示例9: getInstance

 /**
  * Retorna uma instância da classe Registry (padrão Singleton)
  * @return	Registry	retorna uma da própria classe
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:nylmarcos,项目名称:estagio,代码行数:11,代码来源:Registry.php

示例10: newCmtFormHlr

 function newCmtFormHlr($author = false, $email = false, $author_id = false, $article_id = false, $content = false, $date = false)
 {
     if ($content == false) {
         $content = $_REQUEST['comment_text'];
     }
     if ($article_id == false) {
         $article_id = $_REQUEST['id'];
     }
     $reg = Registry::instance();
     $_hinfo = $reg->get('hamster_info');
     $login_status = $reg->get('login_status');
     if ($login_status == 3) {
         $author = mysql_escape_string(htmlspecialchars($_hinfo['name']));
         $email = '';
         $author_id = intval($_hinfo['id']);
         if ($_REQUEST['comment_text'] == '') {
             return array();
         }
         require_once 'lib/markdown/markdown.php';
         $content = Markdown(strip_tags($content));
     } else {
         $content = '<p>' . htmlspecialchars($content) . '</p>';
         $email = mysql_escape_string(htmlspecialchars($_REQUEST['comment_email']));
         if ($_REQUEST['comment_name'] != '' && $name == false) {
             $author = mysql_escape_string(htmlspecialchars($_REQUEST['comment_name']));
         } else {
             $author = 'НЛО';
         }
         if (strpos($_REQUEST['comment_text'], 'http://') !== false || $_REQUEST['comment_text'] == '' || $_REQUEST['comment_sid'] != $_SESSION['comment_sid'] || !isset($_SESSION['comment_sid']) || time() - $_SESSION['comment_stamp'] < 2) {
             return array();
         }
     }
     $prs = array('author' => $author, 'email' => $email, 'author_id' => $author_id, 'article_id' => intval($article_id), 'content' => mysql_escape_string($content), 'date' => local2gm());
     return $prs;
 }
开发者ID:noisywiz,项目名称:tractor,代码行数:35,代码来源:view.php

示例11: instance

 static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:jabouzi,项目名称:projet,代码行数:7,代码来源:listing12.01.php

示例12: instance

 /**
  * Returns an instance of the registry
  *
  * @return Registry
  */
 public static function instance()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:brego,项目名称:prank,代码行数:12,代码来源:registry.php

示例13: singleton

 public static function singleton()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:Kheros,项目名称:Plexis,代码行数:7,代码来源:Registry.php

示例14: getInstance

 public static function getInstance()
 {
     if (!self::$instance instanceof self) {
         //there is no instance
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:kasen92,项目名称:M-master,代码行数:8,代码来源:registry.php

示例15: singleton

 public static function singleton()
 {
     if (empty(self::$instance)) {
         $obj = __CLASS__;
         self::$instance = new $obj();
         return self::$instance;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:8,代码来源:registry.php


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