本文整理汇总了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;
}
示例2: getAccessManager
public static function getAccessManager()
{
if (empty(self::$instance)) {
self::$instance = new Registry();
}
return self::$instance;
}
示例3: get_instance
/**
* Visszadja a Registry objektumot
*/
public static function get_instance()
{
if (!self::$instance) {
self::$instance = new Registry();
}
return self::$instance;
}
示例4: getInstance
/**
* Возвращает единственный экземпляр класса.
* @Возвращаем Registry.
*/
public static function getInstance()
{
if (empty(self::$instance)) {
self::$instance = new static();
}
return self::$instance;
}
示例5: getInstance
/**
* 取得 Registry静态实例
* @return object $this
*/
private static function getInstance()
{
if (!is_object(self::$instance)) {
self::$instance = new Registry();
}
return self::$instance;
}
示例6: instance
public static function instance()
{
if (null == self::$instance) {
self::$instance = new Registry();
}
return self::$instance;
}
示例7: getInstance
/**
* @return Registry
*/
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Registry();
}
return self::$instance;
}
示例8: getInstance
public static function getInstance()
{
if (self::$instance === null) {
self::$instance = new Registry();
}
return self::$instance;
}
示例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;
}
示例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;
}
示例11: instance
static function instance()
{
if (!isset(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
示例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;
}
示例13: singleton
public static function singleton()
{
if (!isset(self::$instance)) {
self::$instance = new self();
}
return self::$instance;
}
示例14: getInstance
public static function getInstance()
{
if (!self::$instance instanceof self) {
//there is no instance
self::$instance = new self();
}
return self::$instance;
}
示例15: singleton
public static function singleton()
{
if (empty(self::$instance)) {
$obj = __CLASS__;
self::$instance = new $obj();
return self::$instance;
}
}