當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。