Set the file to read from while streaming up.

@param string $location (Required) The readable location to read from.
@return $this A reference to the current instance.
339525
public function set_read_file($location)
    {
        $this->read_file = $location;
        $read_file_handle = fopen($location, 'r');

        return $this->set_read_stream($read_file_handle);
    }
8338
public function openArchive($location)
    {
        $location = str_replace('/', DIRECTORY_SEPARATOR, $location);
        if (($response = $this->archive->open($location, ZipArchive::CREATE)) !== true) {
            throw new \LogicException('Could not open zip archive at:'.$location.', error: '.$response);
        }
    }
496251
public function set_seek_position($position)
    {
        $this->seek_position = isset($position) ? (integer)$position : null;

        return $this;
    }
1254902
protected function setLocationResponse(LocationResponse $location): self
    {
        if (!$location->isStop()) {
            throw new \InvalidArgumentException('The location must be a station');
        }

        $this->options['id'] = $location->getId();

        return $this;
    }
154206
public function removeImage($location = self::IMAGE_HEADER_LEFT) {
    	if (isset($this->_headerFooterImages[$location])) {
    		unset($this->_headerFooterImages[$location]);
    	}
    	return $this;
    }
1108686
public function set($name, Location $location)
    {
        return $this->cache->put($name, $location->toArray(), $this->expires);
    }
1152460
public function sendOutputTo($location, $append = false)
    {
        $this->output = $location;

        $this->shouldAppendOutput = $append;

        return $this;
    }
505819
public function redirectTo($location) {
        $app = $GLOBALS['app'];
        $host = $_SERVER['HTTP_HOST'];
        if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
            $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
        }
        $protocol = isset($_SERVER['HTTPS'])?'https://':'http://'; 
        $redirectLocation = $protocol.$host.'/'.$app->getConfiguration()->getApplicationContext().'/'.$location;
        if ($app->getSubject()->isAuthenticated()) {
            $separator = '?';
            if(strpos($redirectLocation, '?'))
                $separator = '&';
            $redirectLocation .= $separator."rand_token=".urlencode($app->getSessionManager()->getActiveSession()->getAttribute('nonce'));
        }
        if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && 
            strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
                $this->addHeader("Content-type: application/json");
                $response = array();
                $response['redirect'] = $redirectLocation;
                echo json_encode($response);
                exit;
        } else {
            $this->addHeader('Location: '.$redirectLocation);
        }
    }
1082480
private function canRead(Content $content, Location $location = null, bool $isEmbed = true): bool
    {
        $targets = isset($location) ? [$location] : [];

        return
            $this->permissionResolver->canUser('content', 'read', $content->contentInfo, $targets) ||
            $this->permissionResolver->canUser('content', 'view_embed', $content->contentInfo, $targets);
    }
1124405
public function setRequestLocation(bool $requestLocation = null): self
    {
        $this->requestLocation = $requestLocation;

        if ($requestLocation === true) {
            $this->requestContact = null;
        }

        return $this;
    }
1052580
public function setSite($site){
        if(!$this->setModified('site', $site)->isModified()){
            return $this;
        }
        $this->site = $site;

        return $this;
    }
81245
public function setFile(string $filePath): self
    {
        IOExpect::isFile($filePath);
        IOExpect::isReadable($filePath);

        $this->file = $filePath;

        return $this;
    }
1142687
public function setLocation($location): self
    {
        // Location
        if (\is_array($location)) { // Latitude/Longitude
            // Latitude
            if (isset($location['lat'])) {
                $this->setLatitude($location['lat']);
            } else {
                throw new InvalidException('$location[\'lat\'] has to be set');
            }

            // Longitude
            if (isset($location['lon'])) {
                $this->setLongitude($location['lon']);
            } else {
                throw new InvalidException('$location[\'lon\'] has to be set');
            }
        } elseif (\is_string($location)) { // Geohash
            $this->setGeohash($location);
        } else { // Invalid location
            throw new InvalidException('$location has to be an array (latitude/longitude) or a string (geohash)');
        }

        return $this;
    }
334780
public function setFilePointer($pointer)
	{
		if(!is_resource($pointer))
			throw new InvalidArgumentException("Invalid type - not a file resource");
		
		$this->pointer = $pointer;
		
		# and now to set everything up...
		$metadata = stream_get_meta_data($this->pointer);
		
		# can this stream be read from?
		if(isset($metadata["mode"]))
		{
			$mode = rtrim($metadata["mode"], "bt");
			
			$super = (boolean) preg_match("/\+$/", $mode);
			$mode = rtrim($mode, "+");
			
			switch($mode)
			{
				case "r":
					$this->is_readable = true;
				break;
				
				case "w":
				case "a":
				case "x":
				case "c":
					$this->is_readable = $super;
				break;
				
				default:
					throw new LogicException("Invalid file access type: '".$metadata["mode"]."'");
				break;
			}
		}
		
		# can this stream be written to?
		if(isset($metadata["mode"]))
		{
			$mode = rtrim($metadata["mode"], "bt");
			
			$super = (boolean) preg_match("/\+$/", $mode);
			$mode = rtrim($mode, "+");
			
			switch($mode)
			{
				case "r":
					$this->is_writable = $super;
				break;
				
				case "w":
				case "a":
				case "x":
				case "c":
					$this->is_writable = true;
				break;
				
				default:
					throw new LogicException("Invalid file access type: '".$metadata["mode"]."'");
				break;
			}
		}
		
		# does this stream support seek functionality?
		if(isset($metadata["seekable"]))
			$this->is_seekable = (boolean) $metadata["seekable"];
		
		return null;
	}
1371992
public function addLocation($location)
    {
        $loader = new \Mustache_Loader_FilesystemLoader($location);
        if ($this->mustache->getLoader() instanceof \Mustache_Loader_CascadingLoader) {
            $this->mustache->getLoader()->addLoader( $loader);
        } else {
            $loaders = [$this->mustache->getLoader(), $loader];
            $this->mustache->setLoader(new \Mustache_Loader_CascadingLoader($loaders));
        }
        return $this;
    }
82629
public function setPosition($position)
    {
        if (in_array($position, [self::ADDON_LEFT, self::ADDON_RIGHT])) {
            $this->position = $position;
        }

        return $this;
    }
717427
public function setLocation($location): self
    {
        if ($location instanceof LocationResponse) {
            $this->setLocationResponse($location);

            return $this;
        }

        if ($location instanceof StopLocationResponse) {
            $this->setStopResponse($location);

            return $this;
        }

        if (\is_int($location) || \is_string($location)) {
            $this->setLocationId($location);

            return $this;
        }

        throw new \InvalidArgumentException(
            'The location must be either a LocationResponse object, StopLocationResponse object, string or integer'
        );
    }