当前位置: 首页>>代码示例>>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;未经允许,请勿转载。