本文整理汇总了PHP中addHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP addHeader函数的具体用法?PHP addHeader怎么用?PHP addHeader使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addHeader函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_start
<?php
session_start();
include_once 'lib/layout.php';
include_once 'lib/locale.php';
if (isset($_SESSION['lang'])) {
include 'locale/' . $_SESSION['lang'] . '.php';
} else {
$locale = new Locale();
$_SESSION['lang'] = $locale->getCountryLanguageByIp($_SERVER['REMOTE_ADDR']);
include 'locale/' . $_SESSION['lang'] . '.php';
}
$styles = array();
$freelancer = new CSS('freelancer.css', 'css', 'stylesheet');
$styles[] = $freelancer;
addHeader("CREA", $styles);
?>
<body id="page-top" class="index">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
示例2: makeHTML
function makeHTML($endpoint_stats, $endpoint_desc)
{
//create one html file per endpoint
foreach ($endpoint_stats as $endpoint => $d) {
if (count($d) > 2) {
$desc = @$endpoint_desc[$endpoint];
//create an output file
$fo = fopen($endpoint . ".html", "w") or die("Could not create file!");
if ($fo) {
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>';
$html .= addHeader($endpoint);
//add Bio2RDF logo
//add Endpoint description
//add link back to the statistics page
$html .= "<body>";
//add the logo
$html .= addBio2RDFLogo();
$html .= "<h1> Summary data metrics for the Bio2RDF " . $endpoint . " endpoint</h1>";
$html .= "<div id='container'> <div id='items'></div>";
$html .= addDatasetDescription($desc);
$html .= addBio2RDFDetails($d['endpoint_url'], $desc['namespace']);
$html .= addBasicStatsTable($d['endpoint_url'], $d['triples'], $d['unique_subjects'], $d['unique_predicates'], $d['unique_objects']);
$html .= addUniqueTypesTable($d['endpoint_url'], $d['unique_types']);
$html .= addPredicateObjLinks($d['endpoint_url'], $d['predicate_object_links']);
$html .= addPredicateLiteralLinks($d['endpoint_url'], $d['predicate_literals']);
$html .= addSubjectCountPredicateObjectCount($d['endpoint_url'], $d['subject_count_predicate_object_count']);
$html .= addSubjectPredicateUniqueLits($d['endpoint_url'], $d['subject_count_predicate_literal_count']);
$html .= addSubjectTypePredType($d['endpoint_url'], $d['subject_type_predicate_object_type']);
$html .= addNSNSCounts($d['endpoint_url'], $d['nsnscounts']);
$html .= "</div></body></html>";
fwrite($fo, $html);
}
fclose($fo);
}
}
}
示例3: makeHTML
function makeHTML($endpoint_stats)
{
//create one html file per endpoint
foreach ($endpoint_stats as $endpoint => $d) {
if (count($d) > 2) {
//create an output file
$fo = fopen($endpoint . ".html", "w") or die("Could not create file!");
if ($fo) {
$html = "<html>";
$html .= addHeader($endpoint);
$html .= "<h1>" . $endpoint . "</h1>";
$html .= addBasicStatsTable($d['endpoint_url'], $d['triples'], $d['unique_subjects'], $d['unique_predicates'], $d['unique_objects']);
$html .= "</html>";
fwrite($fo, $html);
}
fclose($fo);
}
}
}
示例4: array
$HOSTNAME = `hostname`;
$TOOLS = array("zfs", "zpool", "dmesg", "hdparm", "lspci", "free", "fdisk", "du", "bonnie++");
$DISKS = getDisks();
$ZPOOL_CREATE_CMDS = array("1.1" => "create tank /dev/sda", "1.2" => "create tank /dev/sda /dev/sdb", "1.3" => "create tank /dev/sda /dev/sdb /dev/sde", "1.4" => "create tank /dev/sda /dev/sdb /dev/sde /dev/sdf", "1.5" => "create tank /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg", "2.1" => "create tank mirror /dev/sda /dev/sdb", "2.2" => "create tank mirror /dev/sda /dev/sde", "2.3" => "create tank mirror /dev/sda /dev/sdb mirror /dev/sde /dev/sdf", "2.4" => "create tank mirror /dev/sda /dev/sdb mirror /dev/sde /dev/sdf", "2.5" => "create tank mirror /dev/sda /dev/sdb mirror /dev/sde /dev/sdf", "2.6" => "create tank mirror /dev/sda /dev/sdb mirror /dev/sde /dev/sdf", "3.1" => "create tank raidz /dev/sda /dev/sdb /dev/sde /dev/sdf", "3.2" => "create tank raidz /dev/sda /dev/sdb /dev/sde /dev/sdf", "3.3" => "create tank raidz /dev/sda /dev/sdb /dev/sde /dev/sdf", "3.4" => "create tank raidz /dev/sda /dev/sdb /dev/sde /dev/sdf", "4.1" => "create tank raidz2 /dev/sda /dev/sdb /dev/sde /dev/sdf", "4.2" => "create tank raidz2 /dev/sda /dev/sdb /dev/sde /dev/sdf", "4.3" => "create tank raidz2 /dev/sda /dev/sdb /dev/sde /dev/sdf", "4.4" => "create tank raidz2 /dev/sda /dev/sdb /dev/sde /dev/sdf");
$ZPOOL_CACHE = array("2.4" => "add tank cache /dev/sdc", "2.5" => "add tank cache /dev/sdc /dev/sdg", "2.6" => "add tank cache /dev/sdc /dev/sdg", "3.2" => "add tank cache /dev/sdc", "3.3" => "add tank cache /dev/sdc /dev/sdg", "3.4" => "add tank cache /dev/sdc /dev/sdg", "4.2" => "add tank cache /dev/sdc", "4.3" => "add tank cache /dev/sdc /dev/sdg", "4.4" => "add tank cache /dev/sdc /dev/sdg");
$ZPOOL_LOG = array("2.6" => "add -f tank log /dev/sdd", "3.4" => "add -f tank log /dev/sdd", "4.4" => "add -f tank log /dev/sdd");
$COPY = "© 2016 Philipp Haussleiter";
$RUN_BENCH = true;
##############################################
#
# Config End
#
##############################################
exec("mkdir -p bench");
$indexFile = fopen("bench/index.html", "w") or die("Unable to open index file!");
addHeader($indexFile, "ZFS Benchmark");
openChapter($indexFile, "Index", "Details");
runCmd($DATE, $indexFile);
runCmd($HOSTNAME_CMD, $indexFile);
runCmd($UNAME, $indexFile);
runCmd($FREE, $indexFile);
runCmd($DISK_INDEX_CMD, $indexFile);
addSystemFile();
fwrite($indexFile, "<p><a href=\"sys/system.html\">...more</a></p>\n");
fwrite($indexFile, "<p><kbd>Test Size</kbd><br /><samp>" . $SIZE_GB . " GB</samp></p>\n");
closeChapter($indexFile);
openChapter($indexFile, "Index", "Prepare");
runCmd($ECHO . " \"\" > bench/boonie.csv", $indexFile);
closeChapter($indexFile);
addDiskBenchmark($indexFile);
openChapter($indexFile, "Index", "Benchmarks");
示例5: session_start
session_start();
include_once 'lib/layout.php';
include_once 'lib/locale.php';
$styles = array();
$styles[] = new CSS('docs.css', 'css', 'stylesheet');
$styles[] = new CSS('freelancer.css', 'css', 'stylesheet');
$lang = "";
if (isset($_SESSION['lang'])) {
$lang = $_SESSION['lang'];
include 'locale/' . $lang . '.php';
} else {
$locale = new Locale();
$lang = $locale->getCountryLanguageByIp($_SERVER['REMOTE_ADDR']);
include 'locale/' . $lang . '.php';
}
addHeader("CREA - " . $locale['downloads'], $styles);
?>
<body id="page-top" class="index">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><span><img src="img/crea.png" width="25px"></span> Crea</a>
</div>
示例6: foreach
foreach ($files as $file) {
if (trim($file) != "." || trim($file) != "..") {
$yaml = file_get_contents($file);
$parsed = yaml_parse($yaml);
$api_ref[] = $parsed;
}
}
$files = glob('docs/' . $lang . '/ws/*.{yml}', GLOB_BRACE);
foreach ($files as $file) {
if (trim($file) != "." || trim($file) != "..") {
$yaml = file_get_contents($file);
$parsed = yaml_parse($yaml);
$cmd_ref[] = $parsed;
}
}
addHeader("CREA - " . $locale['documentation'], $styles);
//print_r($parsed);
?>
<body id="page-top" class="index">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><span><img src="img/crea.png" width="25px"></span> Crea</a>
示例7: makeHTML
function makeHTML($entry, $ofile)
{
global $options;
$fp = fopen($ofile, "w") or die("Could not create {$ofile}!");
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>';
$html .= addHeader($entry['name']);
$html .= "<body>";
if ($options['bio2rdf.version']) {
$html .= addBio2RDFLogo();
}
$html .= "<div id='description'>";
$html .= addDatasetDescription($entry);
if ($options['bio2rdf.version']) {
$html .= addBio2RDFDetails($entry['sparql'], $entry['prefix']);
}
$html .= "</div>";
$html .= "<div id='container'> <div id='items'></div>";
$html .= addBasicStatistics($entry);
echo "type counts" . PHP_EOL;
$html .= addTypeCountTable($entry);
// echo "property counts".PHP_EOL;
// $html .= addPropertyCountTable($entry);
echo "object property counts" . PHP_EOL;
$html .= addObjectPropertyCountTable($entry);
echo "datatype property counts" . PHP_EOL;
$html .= addDatatypePropertyCountTable($entry);
echo "subject type property counts" . PHP_EOL;
$html .= addSubjectTypePropertyCountTable($entry);
echo "property object type counts" . PHP_EOL;
$html .= addPropertyObjectTypeCountTable($entry);
// echo "subject property object counts".PHP_EOL;
// $html .= addSubjectPropertyObjectCountTable($entry);
echo "type property type counts" . PHP_EOL;
$html .= addTypePropertyTypeCountTable($entry);
echo "dataset property dataset counts" . PHP_EOL;
$html .= addDatasetPropertyDatasetCountTable($entry);
$html .= "</div>";
$html .= "</body>";
$html .= "</html>";
fwrite($fp, $html);
fclose($fp);
}
示例8: getdate
$dateArray = getdate();
//File name. Do NOT adjust. File name is specified
$fnameND = "vipFeed-{$countyFIPS}.xml";
$fnameZipND = $fnameND . ".zip";
$fname = $localDirectory . $fnameND;
$fnameZip = $localDirectory . $fnameZipND;
//File handles
$logHandle = fopen($logFname, "w+");
$xmlHandle = fopen($fname, "w");
//download data
//download_data("http://talkingpointsmemo.com/images/","bernanke-askance-large.jpg","");
download_data($webDirectory, $precinctsFile, $localDirectory);
download_data($webDirectory, $locationsFile, $localDirectory);
download_data($webDirectory, $segmentsFile, $localDirectory);
//Add contents to feed.
$contents = addHeader($dateArray);
fwrite($xmlHandle, $contents);
$contents = addPrecincts(file_get_contents($localDirectory . $precinctsFile));
fwrite($xmlHandle, $contents);
$contents = addLocations(file_get_contents($localDirectory . $locationsFile));
fwrite($xmlHandle, $contents);
$contents = addSegments(file_get_contents($localDirectory . $segmentsFile), $xmlHandle);
fwrite($xmlHandle, $contents);
$contents = addFooter();
fwrite($xmlHandle, $contents);
zip_file($fname, $fnameZip);
if ($autoFTPupload) {
post_file($ftp_directory . $fnameZipND, $fnameZip, $ftp_server, $ftp_user, $ftp_pass);
}
addLogMessage("DONE!");
//Close handles