當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Manager::instance方法代碼示例

本文整理匯總了PHP中Manager::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Manager::instance方法的具體用法?PHP Manager::instance怎麽用?PHP Manager::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Manager的用法示例。


在下文中一共展示了Manager::instance方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getInstance

 public static function getInstance()
 {
     if (self::$instance == false) {
         self::$instance = new Manager();
     }
     return self::$instance;
 }
開發者ID:ruxon,項目名稱:framework,代碼行數:7,代碼來源:Manager.class.php

示例2: getInstance

 /**
  * Returns an instance of the manager factory object.
  *
  * @return Manager
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         $class = __CLASS__;
         self::$instance = new $class(array('application' => 'CApplicationManager', 'history' => 'CHistoryManager', 'httptest' => 'CHttpTestManager'));
     }
     return self::$instance;
 }
開發者ID:TonywalkerCN,項目名稱:Zabbix,代碼行數:13,代碼來源:Manager.php

示例3: setUp

 public function setUp()
 {
     $this->chainClass = 'Psc\\CSS\\Manager';
     parent::setUp();
     $this->manager = Manager::instance('test');
     $this->manager->register('css/some/test.css');
     $this->manager->enqueue('test');
 }
開發者ID:pscheit,項目名稱:psc-cms,代碼行數:8,代碼來源:ManagerTest.php

示例4: run

 public function run()
 {
     $menu = Menu::instance();
     $manager = Manager::instance();
     $settings = Settings::instance();
     $attachment_edit = AttachmentEdit::instance();
     $menu->set_manager($manager);
     $menu->set_settings($settings);
     $menu->init_pages();
     add_action('wpod', array($menu, 'add_components'));
     add_action('admin_enqueue_scripts', array($attachment_edit, 'enqueue_scripts'), 10, 1);
     add_action('attachment_submitbox_misc_actions', array($attachment_edit, 'attachment_submitbox_misc_actions'), 100, 0);
     add_filter('map_meta_cap', array($this, 'map_meta_cap'), 10, 4);
 }
開發者ID:felixarntz,項目名稱:wp-gcs-offload,代碼行數:14,代碼來源:Admin.php

示例5: getManager

 /**
  * @return JSManager
  */
 public static function getManager()
 {
     return Manager::instance('default');
 }
開發者ID:pscheit,項目名稱:psc-cms,代碼行數:7,代碼來源:JS.php

示例6: read

 public function read()
 {
     $input = @fread($this->socket, 2048);
     if (!$input && feof($this->socket)) {
         Manager::instance()->quit($this);
         return '';
     }
     return trim($input);
 }
開發者ID:jia-git,項目名稱:phpchat,代碼行數:9,代碼來源:chat_server.php

示例7: describe

require_once "limber_record.php";
describe("connection manager", function ($spec) {
    $spec->context("getting adapter", function ($spec) {
        $spec->it("should find a valid adapter", function ($spec) {
            $adapter = Manager::instance()->adapter("mysql");
            $spec($adapter)->should_not->be(null);
        });
        $spec->it("should throw a LimberRecord_InvalidAdapterException when trying to get a invalid adapter", function ($spec) {
            try {
                $adapter = Manager::instance()->adapter("invalid_adapter");
                $spec(true)->should->be(false);
            } catch (InvalidAdapterException $e) {
                $spec(true)->should->be(true);
            }
        });
    });
    $spec->it("should connect to a valid database", function ($spec) {
        $connection = Manager::instance()->connect("mock", "host", "user", "password");
        $spec($connection)->should_not->be(null);
    });
});
//mocks
namespace LimberRecord\Adapters;

class Mock
{
    public function connect($host, $user, $password)
    {
    }
}
開發者ID:kenjiyamamoto,項目名稱:limber-record,代碼行數:30,代碼來源:manager_spec.php


注:本文中的Manager::instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。