/** * @param $analyticsAccountUid * @param array $options * @param Client\AbstractClientAdapter $clientAdapter * @throws Exception\InvalidArgumentException */ public function __construct($analyticsAccountUid, $options = array(), Client\AbstractClientAdapter $clientAdapter = null) { if (empty($analyticsAccountUid)) { throw new Exception\InvalidArgumentException('Google Account/Tracking ID not provided'); } $this->analyticsAccountUid = $analyticsAccountUid; if (!class_exists('Racecore\\GATracking\\Client\\Adapter\\Socket')) { require_once dirname(__FILE__) . '/Autoloader.php'; Autoloader::register(dirname(__FILE__) . '/../../../src/'); } if (!$clientAdapter) { $clientAdapter = new Client\Adapter\Socket(); } $this->setClientAdapter($clientAdapter); if (!empty($options)) { $this->setOptions(array_merge($this->options, $options)); } }
<?php /** Phalcon v2.x.x support **/ namespace Kladr\Core; use Phalcon\DI\Service; //GA require_once dirname(__FILE__) . '/vendor/Racecore/GATracking/Autoloader.php'; \Racecore\GATracking\Autoloader::register(dirname(__FILE__) . '/vendor/'); /** * Kladr\Core\Module * * @author A. Yakovlev. Primepix (http://primepix.ru/) */ class Module implements \Phalcon\Mvc\ModuleDefinitionInterface { /** * Регистрация автозагрузчика модуля */ public function registerAutoloaders(\Phalcon\DiInterface $dependencyInjector = NULL) { $config = new \Phalcon\Config\Adapter\Ini(__DIR__ . '/config/config.ini'); $loader = new \Phalcon\Loader(); $loader->registerNamespaces(array('Kladr\\Core\\Models' => $config->application->modelsDir, 'Kladr\\Core\\Views' => $config->application->viewsDir, 'Kladr\\Core\\Controllers' => $config->application->controllersDir, 'Kladr\\Core\\Services' => $config->application->servicesDir, 'Kladr\\Core\\Plugins' => $config->application->pluginsDir, 'Kladr\\Core\\Plugins\\Base' => $config->application->pluginsBaseDir, 'Kladr\\Core\\Plugins\\General' => $config->application->pluginsGeneralDir, 'Kladr\\Core\\Plugins\\Tools' => $config->application->pluginsToolsDir)); $loader->register(); } /**