コード例 #1
0
ファイル: connector.php プロジェクト: swiftie821/DBConnector
 /**
  * Create the class instance
  */
 public function __construct()
 {
     static::$link = mysqli_init();
     static::$link->real_connect(static::$host, static::$username, static::$password, static::$dbname);
     static::$inits++;
     static::$instance = $this;
 }
コード例 #2
0
ファイル: _start.php プロジェクト: fishmad/menu
 public function setUp()
 {
     parent::setUp();
     // Reset all menus
     Menu::reset();
     $this->refreshApplication();
     // Precreate somme Dummy data
     static::$link = new Link('#', 'foo');
     static::$raw = new Raw('foo');
     static::$itemList = new ItemList();
     static::$item = new Item(static::$itemList, static::$link);
 }
コード例 #3
0
ファイル: Language.php プロジェクト: nirix/radium
 /**
  * Registers a new translation.
  *
  * @param function $language
  */
 public function __construct($language)
 {
     static::$link = $this;
     if (!is_callable($language)) {
         throw new InvalidArgumentException('Expected \'$language\' to be callable');
     }
     // Create translation
     $translation = new Translation();
     $language($translation);
     // Register translation
     if (!isset(static::$registered[$translation->locale])) {
         static::$registered[$translation->locale] = $translation;
     } else {
         static::$registered[$translation->locale]->strings = array_merge(static::$registered[$translation->locale]->strings, $translation->strings);
     }
 }