/** * * @return Service */ public static function getInstance() { if (!isset(self::$instance)) { $config = new Config(__DIR__ . '/../../../config'); $service = new Service('GW2Tools', $config); foreach (Translator::getInstance()->getLangs() as $lang) { $service->addModule($lang, new ModuleApi($service, $lang)); } $service->addModule('', new ModuleGeneric($service)); self::$instance = $service; } return self::$instance; }
/** * * @return FileVault */ private static function getInstance($key) { if (!isset(self::$instances[$key])) { $path = Service::getInstance()->getPathCache() . '/' . $key; Directory::createIfNotExists($path); self::$instances[$key] = new self($path); } return self::$instances[$key]; }
/** * * @return string */ public static function table() { return Service::getInstance()->getConfig()->get('table.tokens', 'tokens'); }
<?php /* * This file is part of the Arnapou FileStore package. * * (c) Arnaud Buathier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ include __DIR__ . '/../vendor/autoload.php'; use Arnapou\GW2Tools\Service; use Arnapou\Toolbox\Http\Request; Service::getInstance()->run(Request::createFromGlobals())->send();
<?php /* * This file is part of the Arnapou FileStore package. * * (c) Arnaud Buathier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ include __DIR__ . '/../vendor/autoload.php'; use Arnapou\GW2Tools\Service; Service::getInstance(); $account = \Arnapou\GW2Tools\Gw2Account::getInstance('DEA69D98-AD5C-DA4E-9C0A-BB0B4E2BDD16FCD2DF87-E4DF-42D3-BA18-1AE0B1F25B85'); $char = $account->getCharacter('Tao Lympik'); $attrs = $char->getAttributes(); echo "\n\n";