예제 #1
0
 public static function getInstance()
 {
     if (self::$instance == false) {
         self::$instance = new Manager();
     }
     return self::$instance;
 }
예제 #2
0
 /**
  * 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
0
 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
0
 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
0
파일: JS.php 프로젝트: pscheit/psc-cms
 /**
  * @return JSManager
  */
 public static function getManager()
 {
     return Manager::instance('default');
 }
예제 #6
0
 public function read()
 {
     $input = @fread($this->socket, 2048);
     if (!$input && feof($this->socket)) {
         Manager::instance()->quit($this);
         return '';
     }
     return trim($input);
 }
예제 #7
0
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)
    {
    }
}