本文整理汇总了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;
}
示例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;
}
示例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');
}
示例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);
}
示例5: getManager
/**
* @return JSManager
*/
public static function getManager()
{
return Manager::instance('default');
}
示例6: read
public function read()
{
$input = @fread($this->socket, 2048);
if (!$input && feof($this->socket)) {
Manager::instance()->quit($this);
return '';
}
return trim($input);
}
示例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)
{
}
}