Generates a specific header file.
@param string $header_name
@return string Source code.
550613
public function GenerateHeader($header_name)
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        $header_object = $this->symbols->headers[$header_name];
        $header_define = $this->GetHeaderDefine($header_name);

        $header_content = "";

        // Get heading of header file
        ob_start();
            include($this->GetTemplatePath(
                $header_name,
                "headers",
                "header",
                "helpers",
                "header"
            ));
            $header_content .= ob_get_contents();
        ob_end_clean();

        // Get constants function template content
        if($header_object->HasConstants() || $header_object->HasGlobalVariables())
        {
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "constants",
                    "function_decl",
                    "helpers",
                    "constant"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            $header_content .= "\n";
        }

        // Get enums function template content
        if($header_object->HasEnumerations())
        {
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "enums",
                    "function_decl",
                    "helpers",
                    "enum"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            $header_content .= "\n";
        }

        // Get functions function template content
        if($header_object->HasFunctions())
        {
            ob_start();
                include($this->GetTemplatePath(
                    $header_name,
                    "functions",
                    "function_decl",
                    "helpers",
                    "function"
                ));
                $header_content .= ob_get_contents();
            ob_end_clean();

            $header_content .= "\n";
        }

        // Get classes function template content
        if($header_object->HasClasses())
        {
            foreach($header_object->namespaces as $namespace_name=>$namespace_object)
            {
                if($namespace_name == "\\")
                    $namespace_name = "";

                $namespace_name_cpp = str_replace(
                    "\\",
                    "::",
                    $namespace_name
                );

                $namespace_name_var = str_replace(
                    "\\",
                    "_",
                    $namespace_name
                );

                foreach($namespace_object->classes as $class_name=>$class_object)
                {
                    ob_start();
                        include($this->GetTemplatePath(
                            $class_name,
                            "classes",
                            "function_decl",
                            "helpers",
                            "class"
                        ));
                        $header_content .= ob_get_contents();
                    ob_end_clean();

                    $header_content .= "\n";
                }
            }
        }

        // Get footer of header file
        ob_start();
            include($this->GetTemplatePath(
                $header_name,
                "headers",
                "footer",
                "helpers",
                "header"
            ));
            $header_content .= ob_get_contents();
        ob_end_clean();

        return $header_content;
    }
1335005
def get_header(self, header_name):
        
        if header_name in self.headers:
            return self.headers[header_name]
        return self.add_header_name(header_name)
132850
protected function decideStreamToFile($response_header)
  {
    if (count($this->receive_to_file_content_types) == 0) return false;
    
    // Get Content-Type from header
    $content_type = PHPCrawlerUtils::getHeaderValue($response_header, "content-type");
    
    // No Content-Type given
    if ($content_type == null) return false;
    
    // Check against the given rules
    $receive = PHPCrawlerUtils::checkStringAgainstRegexArray($content_type, $this->receive_to_file_content_types);
    
    return $receive;
  }
301681
public static function getAssetFolderName($file_name)
    {
        $file_extension = strtolower(substr(strrchr($file_name,"."), 1));
        if (preg_match('/jpg|jpeg|gif|png|ico/', $file_extension)) {
            return 'img';
        }
        if ($file_extension === 'js') {
            return 'js';
        }
        if ($file_extension === 'css') {
            return 'css';
        }
        if ($file_extension === 'pdf') {
            return 'pdf';
        }
        return false;
    }
283285
public function privWriteCentralFileHeader(&$p_header)
    {
        $v_result=1;

        // TBC
        //for(reset($p_header); $key = key($p_header); next($p_header)) {
        //}

        // ----- Transform UNIX mtime to DOS format mdate/mtime
        $v_date = getdate($p_header['mtime']);
        $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
        $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];


        // ----- Packed data
        $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, $p_header['version'], $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len'], $p_header['comment_len'], $p_header['disk'], $p_header['internal'], $p_header['external'], $p_header['offset']);

        // ----- Write the 42 bytes of the header in the zip file
        fputs($this->zip_fd, $v_binary_data, 46);

        // ----- Write the variable fields
        if (strlen($p_header['stored_filename']) != 0) {
            fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
        }
        if ($p_header['extra_len'] != 0) {
            fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
        }
        if ($p_header['comment_len'] != 0) {
            fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
        }

        // ----- Return
        return $v_result;
    }
452091
public function getHeader($name)
    {
        $name = strtolower($name);

        return $this->hasHeader($name) ? $this->headers[$name] : [];
    }
866419
function get_section_names($file_name)
	{
		$file_name = $this->_config_path . $file_name;
		if (!isset($this->_config_data[$file_name])) {
			$this->_trigger_error_msg("Unknown config file '$file_name'");
			return;
		}

		return array_keys($this->_config_data[$file_name]["sections"]);
	}
966277
protected function file_header( $title, $data = array() ) 
	{	
		$conf = \CCConfig::create( 'shipyard' );
		$data = CCDataObject::assign( $data );
		
		// Build the authors string
		$authors = $data->get( 'authors', $conf->get( 'defaults.authors' ) );		
		
		if ( is_array( $authors ) )
		{
			foreach( $authors as $person ) 
			{
				$author_str .= $person['name']." ";
				if ( array_key_exists( 'email', $person ) ) 
				{
					$author_str .= "<".$person['email'].">";
				}
				$author_str .= ", ";
			}
			$author_str = substr( $author_str, 0, -2 );
		}
		
		// Finish comment heeader
		return "$title\n".
			"*\n".
			"\n".
			"@package       ".$data->get( 'package', $conf->get( 'defaults.package' ) )."\n".
			"@author        ".$author_str."\n".
			"@version       ".$data->get( 'version', $conf->get( 'defaults.version' ) )."\n".
			"@copyright     ".$data->get( 'copyright', $conf->get( 'defaults.copyright' ) )."\n";
	}
7463
public function saveCache(string $cache_name = null)
    {
        $cache_dir = $this->cache_path;
        $cnt = 0;
        foreach ($this->repository as $name => &$cache)
        {
            if ($cache_name !== null && $name !== $cache_name)
                continue;

            if (empty($cache['_changed']))
                continue;
            
            ++$cnt;
            unset($cache['_changed']);
            $cache_file = $cache_dir . '/' . $name . '.cache';
            file_put_contents($cache_file, serialize($cache));
            Hook::execute('Wedeto.IO.FileCreated', ['path' => $cache_file]);
        }
        return $cnt;
    }
575370
public function RemoveHeader($header_name)
    {
        $header = $this->output_path 
            . "includes/" 
            . $this->GetHeaderNamePHP($header_name)
        ;
        
        $source = $this->output_path 
            . "src/" 
            . $this->GetSourceNamePHP($header_name)
        ;
        
        if(file_exists($header))
            unlink($header);
        
        if(file_exists($source))
            unlink($source);
    }
1035944
private function getMigrationFileContents($class_name)
    {
        $namespace = $this->getNamespace();

        $contents = [
            '<?php',
            '',
        ];

        if ($header_comment = $this->getHeaderComment()) {
            $contents[] = '/*';
            $contents = array_merge($contents, array_map(function ($line) {
                if ($line) {
                    return ' * ' . $line;
                } else {
                    return ' *';
                }
            }, explode("\n", $header_comment)));
            $contents[] = ' */';
            $contents[] = '';
        }

        if ($namespace) {
            $contents[] = 'namespace ' . $namespace . ';';
            $contents[] = '';
        }

        $contents[] = 'use ActiveCollab\DatabaseMigrations\Migration\Migration;';
        $contents[] = '';

        if ($namespace) {
            $contents[] = '/**';
            $contents[] = ' * @package ' . $namespace;
            $contents[] = ' */';
        }

        $contents[] = 'class ' . $class_name . ' extends Migration';
        $contents[] = '{';
        $contents[] = '    /**';
        $contents[] = '     * {@inheritdoc}';
        $contents[] = '     */';
        $contents[] = '    public function up()';
        $contents[] = '    {';
        $contents[] = '    }';
        $contents[] = '}';
        $contents[] = '';

        return implode("\n", $contents);
    }
931232
public function setHeader(array $header_cols){
      $this->header = new TableHeader($header_cols);

      $this->updateMaxRowLength($this->header);
   }
982480
def generated_jni_header?
      return false unless extname == '.h'
      return false unless lines.count > 2

      return lines[0].include?("/* DO NOT EDIT THIS FILE - it is machine generated */") &&
               lines[1].include?("#include <jni.h>")
    end
634580
public function getFilenameForView(string $view_name): string
    {
        // If we request "::view", then use it explicityly.  Don't allow replacements.
        $explicit = Str::startsWith($view_name, self::NAMESPACE_SEPARATOR);

        if (!Str::contains($view_name, self::NAMESPACE_SEPARATOR)) {
            $view_name = self::NAMESPACE_SEPARATOR . $view_name;
        }

        // Apply replacements / customisations
        while (!$explicit && array_key_exists($view_name, self::$replacements)) {
            $view_name = self::$replacements[$view_name];
        }

        [$namespace, $view_name] = explode(self::NAMESPACE_SEPARATOR, $view_name, 2);

        if ((self::$namespaces[$namespace] ?? null) === null) {
            throw new RuntimeException('Namespace "' . e($namespace) .  '" not found.');
        }

        $view_file = self::$namespaces[$namespace] . $view_name . self::TEMPLATE_EXTENSION;

        if (!is_file($view_file)) {
            throw new RuntimeException('View file not found: ' . e($view_file));
        }

        return $view_file;
    }
718619
private function buildCompleteHeader(): string
    {
        $header = "";
        foreach ($this->headers as $sourceType => $value) {
            $header .= $this->buildHeaderLine($sourceType, $value);
        }
        if (!empty($this->reportUri)) {
            $header .= 'report-uri ' . $this->reportUri . ';';
        }
        return $header;
    }
407199
protected function _writeHeader()
    {
        $output = "# LANGUAGE translation of CakePHP Application\n";
        $output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
        $output .= "#\n";
        $output .= "#, fuzzy\n";
        $output .= "msgid \"\"\n";
        $output .= "msgstr \"\"\n";
        $output .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n";
        $output .= '"POT-Creation-Date: ' . date('Y-m-d H:iO') . "\\n\"\n";
        $output .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n";
        $output .= "\"Last-Translator: NAME <EMAIL@ADDRESS>\\n\"\n";
        $output .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\n\"\n";
        $output .= "\"MIME-Version: 1.0\\n\"\n";
        $output .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n";
        $output .= "\"Content-Transfer-Encoding: 8bit\\n\"\n";
        $output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n";

        return $output;
    }
1094879
private function generateHeader()
    {
        $this->logger->debug("Generating raw frame header");

        $this->logger->debug("Generated frame 1st byte: " . decbin($this->firstFrameByte) . ", 2nd: " . decbin($this->secondFrameByte));
        $header = chr($this->firstFrameByte) . chr($this->secondFrameByte);

        //Payloads with len. of 7 bits are already handled by secondFrameByte
        if ($this->payloadLengthDiscriminator === 126) {
            $this->logger->debug("Encoding length as 16bit");
            $header .= pack("n", $this->payloadLength);

        } elseif ($this->payloadLengthDiscriminator === 127) {
            $this->logger->debug("Encoding length as 64bit");
            //64 bit support in pack()/unpack() was introduced in 5.6.3, which is too young to require it
            //This method also allows proper 64-bit packets handling on 32-bits systems
            $highMap = 0xffffffff00000000;
            $lowMap = 0x00000000ffffffff;
            $higher = ($this->payloadLength & $highMap) >> 32;
            $lower = $this->payloadLength & $lowMap;
            $header .= pack('NN', $higher, $lower);

        } else {
            $this->logger->debug("Length encoded as 7bit");
        }

        if ($this->secondFrameByte & 128) { //Packet is masked, so attach masking key
            $this->logger->debug("Attaching masking key");
            $header .= ord($this->maskingKey);
        }

        return $header;
    }