ResourceMirror.php
public function store($resource)
    {
        if (!$resource instanceof LocalResource) {
            throw new \InvalidArgumentException('Resource is not local.');
        }

        $file = $this->directory.'/'.$resource->getPath();
        @mkdir(dirname($file), 0777, true);
        file_put_contents($file, $resource->getContent());
        return new MaterializedResource($resource, $this->directory);
    }
public function store($resource)
    {
        if (!$resource instanceof LocalResource) {
            throw new \InvalidArgumentException('Resource is not local.');
        }

        $file = $this->directory.'/'.$resource->getPath();
        @mkdir(dirname($file), 0777, true);
        file_put_contents($file, $resource->getContent());
        return new MaterializedResource($resource, $this->directory);
    }
public function store ( $ resource ) { if ( ! $ resource instanceof LocalResource ) { throw new \ InvalidArgumentException ( 'Resource is not local.' ) ; } $ file = $ this -> directory . '/' . $ resource -> getPath ( ) ; @ mkdir ( dirname ( $ file ) , 0777 , true ) ; file_put_contents ( $ file , $ resource -> getContent ( ) ) ; return new MaterializedResource ( $ resource , $ this -> directory ) ; }
Stores a local resource. Existing files are overwritten.

@param LocalResource $resource
@return MaterializedResource

@throws \InvalidArgumentException
If given resource is not local.
Stores a local resource . Existing files are overwritten .