Set file head.
@return void
434798
public function setFileHead(): void
    {
        // check local service file
        $this->fileHead = $this->prepareFilePath('head', false);
        if (!file_exists($this->fileHead)) {
            // look up for default file
            $this->fileHead = $this->prepareDefaultFilePath('head');
        }
    }
1299392
def head_on_file(self, file):
        """"""
        response = HeadResponse()
        if (not os.path.isfile(file)):
            response.status_code = '404'
        else:
            response.status_code = '200'
            response.headers[
                'last-modified'] = datetime_to_str(os.path.getmtime(file))
            response.headers['content-length'] = os.path.getsize(file)
        return(response)
1262709
private function _setContentFromFile() {
		
		// empty original template content
		$this->setContent('');
		
		// check for template file and load it
		if ($filename = $this->getTemplate()) {
			if (file_exists($filename)) {
				$content = trim(file_get_contents($this->_filename));
				$this->setContent($content);
			}
		}
	}
1250536
public function setFiles($files = array())
    {
        if (count($files) === 0) {
            $this->_files = $_FILES;
        } else {
            $this->_files = $files;
        }
        return $this;
    }
834242
def set_head(self, node):
    """"""
    for head in self.head:
      head.next.add(node)
    self.head[:] = []
    self.head.append(node)
1155198
public function setTargetfile()
	{
		//set the upload_path_relative
		$this->upload_path_relative = $this->upload_path . $this->target_file_name;

		//set the full target file path
		$this->target_file = $this->target_dir . $this->target_file_name;

		return $this;

	}
767052
protected function __generateHead()
    {
        ksort($this->_head);

        foreach ($this->_head as $position => $obj) {
            if (is_object($obj)) {
                $this->Head->appendChild($obj);
            }
        }
    }
212576
public function head($url, $fields = null, callable $callback = null)
    {
        $this->send($url, self::HEAD, $fields, $callback);
    }
627306
protected static function allowHeaders()
    {
        if (self::$needHeaders !== null) {
            return self::$needHeaders;
        }

        return self::$needHeaders = Request::is('GET') || Request::is('HEAD');
    }
75469
public function setTargetfilename()
	{
		//set the value of target file name
		$this->target_file_name = sprintf('%s.%s',sha1_file($_FILES[$this->file_name]['tmp_name']),$this->file_type);

		return $this;

	}
630659
public function setFile($file) {
        $f = $file;
        if (preg_match('#^compress\.(.*)://(.*)#', $file, $r)) {
            $f = $r[2];
        }
        if(is_readable($f)) {
            $open = fopen($file, "rb");
            $this->file = $open;
        } else {
            $this->handleError("{$file} is not readable.");
        }

	}
856173
private function saveHeaders() {
	$this->lock();
	$this->file->rewind();
	$headers = $this->file->current();
	if(!empty($headers)) {
		$this->headers = $headers;
	}

	$this->file->next();
	$this->file->flock(LOCK_UN);

	$this->checkIdField();
}
1225903
public function head($uri, array $headers = [])
	{
		return $this->sendRequest(
			$this->message->createRequest('HEAD', $uri, $headers, null)
		);
	}
971181
protected function addTableHead()
	{
		$this->addTableRow('TH', $this->table['rows'][0]);
		$this->createHeadTags($this->table['rows'][0]['pos'], $this->pos);
	}
287
public function head()
    {
        global $event, $theme;

        if ($event != 'rah_backup') {
            return;
        }

        gTxtScript(array(
            'rah_backup_confirm_backup',
        ));

        $msg = array(
            'backup' => escape_js($theme->announce_async(gTxt('rah_backup_taking'))),
            'error' => escape_js($theme->announce_async(gTxt('rah_backup_task_error'))),
        );

        $js = <<<EOF
            $(function ()
            {
                $('.rah_backup_take').on('click', function (e)
                {
                    e.preventDefault();
                    var obj = $(this), href, spinner;

                    if (obj.hasClass('disabled') || !verify(textpattern.gTxt('rah_backup_confirm_backup'))) {
                        return false;
                    }

                    $.globalEval('{$msg['backup']}');

                    spinner = $('<span> <span class="spinner"></span> </span>');
                    href = obj.attr('href');
                    obj.addClass('disabled').attr('href', '#').after(spinner);

                    $.ajax('index.php', {
                        data: href.substr(1) + '&app_mode=async',
                        dataType: 'script',
                        timeout: 1800000
                    }).fail(function ()
                    {
                        $.globalEval('{$msg['error']}');
                    }).always(function ()
                    {
                        obj.removeClass('disabled').attr('href', href);
                        spinner.remove();
                    });
                });
            });
EOF;

        echo script_js($js);
    }
511840
protected function setRedirectHeaders()
    {
        $this->header->remove('Location');
        $this->header->remove('Refresh');

        if ($this->delay) {
            $this->header->set('Refresh', $this->delay . '; URL=' . $this->address);

            return;
        }

        $this->header->set('Location', $this->address);
    }
495424
public function sendHeaders(): void
    {
        foreach ((array) $this->headers as $name => $value) {
            $this->sendHeader($name, $value);
        }
    }