setResource() public method

Set driver resource to work on
public setResource ( mixed $resource )
$resource mixed
示例#1
0
 /**
  * Parse config resource and build config array
  *
  * @throws ConfigException
  * @return array Config data array
  */
 protected function getArrayInternal()
 {
     try {
         return $this->yaml->setResource($this->resource)->getArray();
     } catch (\Exception $e) {
         throw new ConfigException($e->getMessage());
     }
 }
示例#2
0
文件: Yaml.php 项目: Webiny/Framework
 /**
  * Create Yaml bridge
  *
  * @param mixed $resource
  */
 private function __construct($resource = null)
 {
     if ($this->isInstanceOf(self::$customDriver, self::$driverInterface)) {
         // If custom driver instance was set, we need to use a copy of it and set it's resource
         $this->driverInstance = clone $this->driverInstance->setResource($resource);
     } else {
         $this->driverInstance = new self::$driverClass();
         $this->driverInstance->setResource($resource);
     }
 }