/** * Base constructor. * * @param string $config Path to the MaxMind configuration. * * @throws \Webiny\Component\StdLib\Exception\Exception */ public function __construct($config) { $config = \Webiny\Component\Config\Config::getInstance()->yaml($config); // bootstrap Mongo::setConfig(['Mongo' => $config->get('Mongo', null, true)]); Entity::setConfig(['Entity' => $config->get('Entity', null, true)]); }
/** * Runs the installation. * * @throws \Webiny\Component\StdLib\Exception\Exception */ public function runInstaller($configFile) { // bootstrap $this->config = Config::getInstance()->yaml($configFile); Mongo::setConfig(['Mongo' => $this->config->get('Mongo', null, true)]); Entity::setConfig(['Entity' => $this->config->get('Entity', null, true)]); /** * @var $mongo Mongo */ $this->mongo = $this->mongo($this->config->Entity->Database); // import process $this->downloadDatabase(); $this->unpackDatabase(); $this->importLocations(); //$this->importIp4CityBlock(); //$this->importIp6CityBlock(); echo "\nImport has finished."; die; }
public static function setUpBeforeClass() { Mongo::setConfig(realpath(__DIR__ . '/' . self::MONGO_CONFIG)); Entity::setConfig(realpath(__DIR__ . '/' . self::CONFIG)); /** * Make sure no collections exist */ self::mongo()->dropCollection('Author'); self::mongo()->dropCollection('Page'); self::mongo()->dropCollection('Comment'); self::mongo()->dropCollection('Label'); self::mongo()->dropCollection('Label2Page'); /** * Create some test entity instances */ $page = new Page(); $author = new Author(); $comment = new Comment(); $label = new Label(); $label2 = new Label(); /** * Try simple assignment (should trigger assign via magic method) */ $author->name = 'Pavel Denisjuk'; /** * Assign using regular way */ $comment->getAttribute('text')->setValue('Best blog post ever!'); $label->getAttribute('label')->setValue('marketing'); $label2->getAttribute('label')->setValue('seo'); $page->getAttribute('title')->setValue('First blog post'); $page->getAttribute('publishOn')->setValue('2014-11-01'); $page->getAttribute('remindOn')->setValue(time()); $page->getAttribute('author')->setValue($author); $page->getAttribute('settings')->setValue(['key1' => 'value1', 'key2' => ['key3' => 'value3']]); $page->getAttribute('comments')->add($comment); $page->getAttribute('labels')->add([$label, $label2]); self::$page = $page; }
public function driverSet() { Mongo::setConfig(realpath(__DIR__ . '/' . self::CONFIG)); return [[$this->mongo()]]; }
public function setUp() { \Webiny\Component\Mongo\Mongo::setConfig(new ConfigObject(['Driver' => 'Webiny\\AnalyticsDb\\Test\\MongoDriverMock'])); $this->instance = new Query\Dimensions(new Mongo('localhost', 'testDb'), 'browser', 100, DateHelper::today()); }
public function setUp() { \Webiny\Component\Mongo\Mongo::setConfig(new ConfigObject(['Driver' => 'Webiny\\AnalyticsDb\\Test\\MongoDriverMock'])); $this->instance = new AnalyticsDb(new Mongo('localhost', 'testDb')); }
<?php require_once '../vendor/autoload.php'; \Webiny\Component\Security\Security::setConfig('./securityConfig.yaml'); \Webiny\Component\Mongo\Mongo::setConfig('./mongoConfig.yaml'); \Webiny\Component\Entity\Entity::setConfig('./entityConfig.yaml'); $security = \Webiny\Component\Security\Security::getInstance(); $loginConfig = \Webiny\Component\Config\Config::getInstance()->yaml('./loginConfig.yaml'); $login = new \Webiny\Login\Login($security, $loginConfig);
public static function setUpBeforeClass() { Mongo::setConfig(realpath(__DIR__ . '/' . self::MONGO_CONFIG)); Entity::setConfig(realpath(__DIR__ . '/' . self::CONFIG)); self::deleteAllTestCollections(); }
public function setUp() { Mongo::setConfig(realpath(__DIR__ . '/' . self::CONFIG)); }