downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /reST/index.php

<?php
// $Id: index.php 278777 2009-04-15 20:35:37Z philip $
$_SERVER['BASE_PAGE'] = 'reST/index.php';
include_once
$_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once
$_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';

// Pregenerated (on master) cache
$rest_dir = $_SERVER['DOCUMENT_ROOT'].'/reST/cache/';

$path = isset($_GET['rel_path']) ? $_GET['rel_path'] : "";

// Set "this pages ID" (for the notes system)
$PGI["this"] = array("reST/" . ($path ? $path : "index.php"), "");
$_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE'];


$SIDEBAR_DATA = '<h3>File list</h3>
<ul class="simple" id="reSTlist">'
;

$restfiles = glob($rest_dir. "/*");

$list = $lastdir = "";
foreach(
$restfiles as $filename) {
   
$link = basename($filename, ".rest");

   
// Separate the dirname from the filename
   
list($dir, $filename) = explode("_", $link, 2);

   
// Create a tree-like-structure
   
if ($dir != $lastdir) {
        if (
$lastdir) {
           
$list .= "</ul>\n";
        }
       
$list .= "<li><h4>$dir</h4><li>\n<ul class=\"simple\">\n";
       
$lastdir = $dir;
    }

   
// Replace the first - with a directory seperator
   
$link[strpos($link, "_")] = "/";

   
// Only use the "last part" of the filename (i.e. README.FOOBAR => FOOBAR)
   
if (strpos($filename, ".") !== false) {
       
$filename = substr($filename, strpos($filename, ".")+1);
    }

   
$filename = str_replace(array("-", "_"), " ", $filename);
   
$list .= '<li><a href="/reST/' .$link.'">'.$filename.'</a></li>'."\n";
}

if (
$list) {
   
$SIDEBAR_DATA .= "$list</ul>";
} else {
   
$SIDEBAR_DATA .= "<li>No files available</li>";
}
$SIDEBAR_DATA .= "</ul>";


$filename = $rest_dir. "/" .str_replace('/', '_', $path).'.rest';
if ((
$k = array_search($filename, $restfiles)) === false) {
   
site_header("reST");
    if(
$path) {
        echo
'<p class="warn">Unknown file</p>';
    }
    echo
"<p>Please select a file from the filelist on the left</p>";
} else {
   
site_header(basename($path));
    include
$restfiles[$k];
   
manual_notes();
}

site_footer();

 
show source | credits | sitemap | contact | advertising | mirror sites