/** * 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; }
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); }
/** * 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); } }