@param $service

@return \yii\web\Response
195972
public function run( $service ) {

        return $this->redirectWithMessages(
            $this->synchronizer->connect( $service ),
            Yii::t( 'SyncSocial', 'Service was successfully connected' ),
            Yii::t( 'SyncSocial', 'Service could not be connected' )
        );

    }
1197767
public function getService( $serviceName ) {

        if ( empty( $this->services[ $serviceName ] ) ) {
            $this->services[ $serviceName ] = $this->factorySyncService( $serviceName );
        }

        if ( ! $this->services[ $serviceName ] instanceof SyncService ) {
            throw new Exception( Yii::t( 'SyncSocial', 'Component service must be instance of SyncService class' ) );
        }

        return $this->services[ $serviceName ];
    }
183961
public function build($service = null)
    {
        if (!$this->sender) {
            $this->sender = $this->buildGuzzleSender();
        }

        if (!$this->factory) {
            throw new RuntimeException("You need to provide a configuration or a factory for requests");
        }

        if (!$this->logger) {
            $this->logger = new NullLogger();
        }

        return $this->buildClient($this->factory, $this->sender, $this->logger, $service);
    }
238331
public static function getAPI($service)
    {
        $service = strtolower($service);
        $identifier = 'com:connect.oauth.service.'.$service;
        if (!AnService::has($identifier)) {
            $config = array();
            $config['consumer'] = self::getConsumer($service);
            $config['enabled'] = self::enabled($service);
            AnService::set($identifier, AnService::get($identifier, $config));
        }

        return    AnService::get($identifier);
    }
1036890
public function beforeWebMethod($service)
	{
		$safeMethods=array(
			'login',
			'getContacts',
		);
		$pattern='/^('.implode('|',$safeMethods).')$/i';
		if(!Yii::app()->user->isGuest || preg_match($pattern,$service->methodName))
			return true;
		else
			throw new CException('Login required.');
	}
636810
private function getServiceUrl(array $service)
    {
        $map = ['username' => 'user', 'password' => 'pass'];
        $urlParts = [];
        foreach ($service as $key => $value) {
            $newKey = isset($map[$key]) ? $map[$key] : $key;
            $urlParts[$newKey] = $value;
        }

        return Url::buildUrl($urlParts);
    }
274046
public function addService($service)
    {
        if (in_array($service, $this->allServices)) {
            $this->services[] = $service;
        }

        return $this;
    }
1348051
public function handle($request)
    {
        $allow_ips = config('jsonrpc.servers.' . $request->service);

        // если не заданы настройки - по умолчанию запрещаем доступ
        if (null === $allow_ips) {
            throw new JsonRpcException(JsonRpcException::CODE_FORBIDDEN);
        }

        // если разрешено всем
        if ($allow_ips === '*') {
            return true;
        }

        if (!\is_array($allow_ips)) {
            throw new JsonRpcException(JsonRpcException::CODE_FORBIDDEN);
        }

        // если разрешено всем
        if (\in_array('*', $allow_ips, true)) {
            return true;
        }

        $ip = Request::ip();
        if (!\in_array($ip, $allow_ips, true)) {
            throw new JsonRpcException(JsonRpcException::CODE_FORBIDDEN);
        }

        return true;
    }
824879
public function run( $service ) {

        $flagConnect = $this->synchronizer->isConnected( $service );

        if ( $flagConnect ) {
            $resultSync = $this->synchronizer->syncService( $service );

            $successMessage = $resultSync['count'] == 0
                ? Yii::t( 'SyncSocial', 'Service was successfully synchronized! There\'s no new records!', [
                'count' => $resultSync['count']
            ] )
                : Yii::t( 'SyncSocial', 'Service was successfully synchronized! {count} record(s) was added!', [
                'count' => $resultSync['count']
            ] );

            return $this->redirectWithMessages(
                $resultSync['flag'],
                $successMessage,
                Yii::t( 'SyncSocial', 'There is a error in service synchronization' )
            );
        } else {
            Yii::$app->session->setFlash( 'warning', Yii::t( 'SyncSocial', 'Service is not connected' ) );

            return $this->controller->redirect( $this->failedUrl );
        }

    }
910195
public function getServiceDatum($service, $key)
    {
        if (isset($this->servicesData[$service])) {
            return $this->servicesData[$service][$key];
        }

        return null;
    }
811687
public function make($service)
    {
        $service = 'Google_Service_'.ucfirst($service);

        if (class_exists($service)) {
            $class = new \ReflectionClass($service);

            return $class->newInstance($this->client);
        }

        throw new UnknownServiceException($service);
    }
778475
private function init($service)
    {
        //====================================================================//
        // Debug
        Splash::log()->deb('MsgWsCall');
        //====================================================================//
        // Safety Check
        if (!$this->verify()) {
            return Splash::log()->err('ErrWsInValid');
        }
        //====================================================================//
        // Clean Data Input Buffer
        $this->cleanIn();
        //====================================================================//
        // Prepare Data Output Buffer
        //====================================================================//
        // Fill buffer with Server Core infos
        $this->outputs->server = $this->getServerInfos();
        // Remote Service to call
        $this->outputs->service = $service;
        // Share Debug Flag with Server
        $this->outputs->debug = (int) SPLASH_DEBUG;

        return true;
    }
172512
public function service($name)
    {
        if (isset($this->resolved[$name])) {
            return $this->resolved[$name];
        }

        $service = $this->resolver->resolve($name);
        $serviceArgs = $this->resolveFuncArgs($service);

        return $this->resolved[$name] = $service->invoke($serviceArgs);
    }
359503
public function services(string $service): array
    {
        if (empty($this->services[$service])) {
            $services = $this->all();
            if (empty($services[$service])) {
                throw new OutOfBoundsException("The service: {$service} not found");
            }

            $this->services[$service] = $services[$service];
            unset($services);
        }

        return $this->services[$service];
    }
100247
protected function validate(string $service)
    {
        throw_unless(Arr::exists(config('shield.services'), $service), UnknownServiceException::class, sprintf('Service [%s] not found.', $service));
        throw_unless(Arr::exists(config('shield.services.' . $service), 'driver'), UnknownServiceException::class, sprintf('Service [%s] must have a driver.', $service));

        $service = app(config('shield.services.' . $service . '.driver'));

        throw_unless($service instanceof Service, UnsupportedDriverException::class, sprintf('Driver [%s] must implement [%s].', get_class($service), Service::class));

        return $service;
    }
1328825
protected function resolveDatabaseImportCommand($service = null)
    {
        /** @var ServiceDbInterface $instance */
        $instance = $this->resolveDatabaseServiceInstance($service);

        /** @var DatabaseInterface $database */
        $database = $this->getDatabaseInfo($instance);

        switch ($database->getProtocol()) {
            case 'mysql':
                return (new MysqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
            case 'pgsql':
                return (new PgsqlCommand())
                    ->host($database->getHostname())
                    ->username($database->getUser())
                    ->password($database->getPassword())
                    ->database($database->getDatabase());
        }
    }
1184128
public function service($service){

	    if(!$this->exists($service)){
	        throw new ServiceNotFoundException(sprintf('Service "%s" not found', $service));
	    }

		return new Worker($this, $service);
	}