Check if driver is set and returns it
@return mixed
494074
private function call() {

        if(null === $this -> driver) {
            return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR);
        }

        if(null === $this -> driverInstance) {
        	$this -> driverInstance = new $this -> driver();
        }

        return $this -> driverInstance;
    }
324525
private function call() {

        if(null === $this -> driver) {
            return trigger_error('Driver is not set. Set the driver with the setDriver() method', E_USER_ERROR);
        }

        if(null === $this -> image) {
        	return trigger_error('Image has not been set. Set the image with the setImage() method', E_USER_ERROR);
        }

        if(null === $this -> driverInstance) {
        	$this -> driverInstance = new $this -> driver($this -> image);
        }

        return $this -> driverInstance;
    }
511366
public function driver( $driver = null )
	{
		$driver = strtolower( $driver ?: $this->getDefaultDriver() );

		// If the given driver has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a driver created by this name, we'll just return that instance.
		if ( !array_key_exists( $driver, $this->drivers ) )
			$this->drivers[$driver] = $this->createDriver( $driver );

		return $this->drivers[$driver];
	}
344208
public function getDriver($driver = null)
    {
        $driverName = $driver ? $driver : Config::get('driver');
        if (is_array($driverName)) {
            // 驱动为数组，表示类的某个方法
            if (!is_callable($driverName)) {
                throw new BadMethodCallException('Method Not Found: ' . $driverName[0] . '->' . $driverName[1] . '()');
            }

            return call_user_func_array($driverName, []);
        } elseif (is_object($driverName)) {
            // 驱动为对象直接返回
            return $driverName;
        } elseif (is_string($driverName)) {
            // 驱动为字符串，为内置驱动
            $driver = 'create' . ucfirst($driverName) . 'Driver';
            if (!method_exists($this, $driver)) {
                throw new BadMethodCallException("Mailer driver {$driverName} not exist");
            }
        }


        return $this->$driver();
    }
597511
public static function detectImageDriver()
    {
        $extension = mb_strtolower(Craft::$app->getConfig()->getGeneral()->imageDriver);

        if ($extension === 'gd') {
            self::$imageDriver = 'gd';
        } else if ($extension === 'imagick') {
            self::$imageDriver = 'imagick';
        } else { // autodetect
            self::$imageDriver = Craft::$app->images->getIsGd() ? 'gd' : 'imagick';
        }
    }
1074489
public static function check($specific = null)
	{
		$drivers = $specific === null ? static::$_instances : (array) $specific;

		foreach ($drivers as $i)
		{
			if ( ! static::$_verify_multiple && ! empty(static::$_verified))
			{
				return true;
			}

			$i = $i instanceof Auth_Login_Driver ? $i : static::instance($i);
			if ( ! array_key_exists($i->get_id(), static::$_verified))
			{
				$i->check();
			}

			if ($specific)
			{
				if (array_key_exists($i->get_id(), static::$_verified))
				{
					return true;
				}
			}
		}

		return $specific === null && ! empty(static::$_verified);
	}
799845
public function checkKernel()
    {
        $content = file_get_contents($this->kernelURL);

        $out = JSON::decode($content, true);

        if ($this->compaireSecondary($out->version, $this->kernel->version)
         && ($out->sha != $this->kernel->sha)) {
            return $out;
        } else {
            return false;
        }
    }
956947
public function getAvailableDrivers()
	{
		$drivers = array();
		
		if(count($this->drivers) > 0)
		{
			foreach($this->drivers as $driver)
			{
				if(class_exists("LikePDO\\Drivers\\".$driver."Driver"))
				{
					$drivers[] = $driver;
				}
			}
		}
		
		return $drivers;
	}
1222708
public function run($driverName = null)
    {
        if ($this->isRunning()) {
            return false;
        }
        if (!$this->beforeRun()) {
            return false;
        }
        if (!$driverName) {
            $driverName = $this->getDriverNameByWeight();
        }
        $this->initBackupDrivers([$driverName]);
        $success = $this->runDriver($driverName);

        return $this->afterRun($success);
    }
646827
protected function getDriver() {
    $version = $this->getVersion();
    if ($this->isVersionIsGreaterOrEqual($version, array(0, 11, 0))) {
      return new Driver\FfmpegDriver();
    } else if ($this->isVersionIsGreaterOrEqual($version, array(0, 9, 0))) {
      return new Driver\FfmpegDriver10();
    } else if ($this->isVersionIsGreaterOrEqual($version, array(0, 8, 0))) {
      return new Driver\FfmpegDriver08();
    } else {
      return new Driver\FfmpegDriver06();
    }
  }
84600
public function check()
    {
        $result = true;

        $configurationSettings = [
            'Database.Host',
            'Database.Username',
            'Database.Password',
            'Database.Port',
            'Database.Name',
        ];

        foreach ($configurationSettings as $setting) {
            if ($this->configuration->hasConfigurationKey($setting) === false) {
                $this->missingConfiguration[] = $setting;
                $result = false;
            }
        }

        return $result;
    }
538606
private function createDriver()
    {
        if (is_string($this->config['driver'])) {
            $drivername = ucfirst($this->config['driver']);
            $driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername);

            if (class_exists($driverclass)) {
                return new $driverclass;
            }

            throw new \Intervention\Image\Exception\NotSupportedException(
                "Driver ({$drivername}) could not be instantiated."
            );
        }

        if ($this->config['driver'] instanceof AbstractDriver) {
            return $this->config['driver'];
        }

        throw new \Intervention\Image\Exception\NotSupportedException(
            "Unknown driver type."
        );
    }
1200619
public function driver(AbstractDriver $driver = null)
    {
        if ($driver === null) {
            return $this->getDriver();
        }

        return $this->setDriver($driver);
    }
811309
public function driver($driver = null)
    {
        $shortener = $this->app['config']['shortener'];

        $driver = $driver ?: $shortener['default'];

        $driverMethod = 'create'.ucfirst($driver).'Driver';

        if (method_exists($this, $driverMethod)) {
            return $this->{$driverMethod}($shortener);
        }

        throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
    }
1073821
public function getCache()
    {
        if (null === self::$cache) {
            if (!empty($this->appConfig['cache']['driver'])) {
                // Options definition.
                if (empty($this->appConfig['cache']['options'])) {
                    $options = array();
                } else {
                    $options = $this->appConfig['cache']['options'];
                }

                // Driver definition.
                if ('memcached' !== $this->appConfig['cache']['driver']) {
                    $className = $this->appConfig['cache']['driver'];
                } else {
                    $className = '\Towel\Cache\TowelMemcached';
                }

                // Driver instantiation
                $cacheDriver = new $className();
                $cacheDriver->setOptions($options);
            }

            self::$cache = new TowelCache($cacheDriver);
        }

        return self::$cache;
    }
137623
public function getDrivers()
    {
        $drivers = array();

        $files = $this->finder->files()->in($this->driverPath)->name($this->fileTypes);

        foreach ($files as $file) {
            $driver = str_replace('.yml', '', $file->getRelativePathname());
            $service = $this->getService($driver);

            if ($service and $servers = $service->getServers()) {
                foreach ($servers as $server) {
                    $drivers[$driver . ':' . $server] = $driver . ':' . $server;
                }
            }
        }

        return $drivers;
    }
988448
public static function getDrivers()
        {
            $types = array();

            if (class_exists('\PDO')) {
                $types[self::DRIVER_MYSQL] = 'MySQL / MariaDB';
                $types[self::DRIVER_POSTGRES] = 'PostgreSQL';
                $types[self::DRIVER_MS_SQL_SERVER] = 'Microsoft SQL Server';
            } else {
                throw new Exception('You need to have PHP PDO installed to be able to use B2DB');
            }

            return $types;
        }