array( 'Command line options' => 'command.compiler', 'Configurable options' => 'options.compiler', ), 'Compiled Program' => array( 'Command line options' => 'command.compiled', 'Configurable options' => 'options.compiled', 'Administrative commands' => 'command.admin_server', 'Server Status' => 'server.status', 'Server Statistics' => 'server.stats', ), 'Debugger' => array( 'Getting Started' => 'debugger.start', 'All Commands' => 'debugger.cmds', 'Command A-Z' => 'debugger.refs', ), 'HTTP Server' => array( 'Rewrite Rules' => 'server.rewrite_rules', 'SSL Setup' => 'server.ssl', ), 'Inconsistencies' => array( 'PHP vs. HipHop' => 'inconsistencies', 'HipHop Compiler vs. Interpreter' => 'inconsistencies.hphpi', ), 'New Features' => array( 'New functions' => 'extension.new_functions', 'yield and generator' => 'extension.yield', 'Richer type hints' => 'extension.type_hints', 'Parallel execution' => 'threading', 'Server documents' => 'server.documents', 'RPC server' => 'server.rpc_server', 'Xbox server' => 'server.xbox_server', 'Dangling server' => 'server.dangling_server', ), 'Foreign Function Interfaces' => array( 'C++' => 'ffi.c++', 'Java' => 'ffi.java', 'Python' => 'ffi.python', ), 'Debugging' => array( 'Server' => 'debug.server', 'CPU Profiling' => 'debug.profile', 'Memory leak detection' => 'debug.leak', 'Mutex contention' => 'debug.mutex', 'Useful gdb commands' => 'debug.gdb', 'Useful Linux commands' => 'debug.linux', ), 'Development' => array( 'Coding guidelines' => 'coding_guideline', 'Type system' => 'runtime.type_system', 'Memory model' => 'runtime.memory_model', 'Writing new extensions' => 'extension.development', 'Useful commands' => 'command.project', ), 'References' => array( 'Configuration file format' => 'hdf', ), ); /////////////////////////////////////////////////////////////////////////////// // main echo ""; $file = 'coding_guideline'; if (isset($_GET['file'])) $file = $_GET['file']; $title = find_topics($topics, $file); echo '
| '; format_index($topics, $file); echo ' | '; if (!$title) { echo 'Topic does not exist.'; } else { $doc = file_get_contents(realpath(dirname(__FILE__))."/$file"); if (preg_match('/^debugger\./', $file)) { echo format_debugger_doc($doc); } else { echo format_document($doc); } } echo ' |
| HipHopDoc | |
| ";
echo " | |
\\1\n", $doc); // code blocks $doc = preg_replace('/(
(.*?)<\/pre>/s',
"\\1 \\2", $doc); // fix list item's 2nd lines
$doc = preg_replace('/\n([^ \t]+): (.*)/',
"
\\1: ".
"\\2",
$doc); // item: details
$doc = preg_replace('/\n\n/', '', $doc); // paragraphs
$doc = preg_replace('/\[\[[ \n]*(.*?)[ \n]*\|[ \n]*(.*?)[ \n]*\]\]/s',
'\\2',$doc); // links
// copyright notice
$doc .= '
| '. 'Facebook © 2009 |