"Fossies" - the Fresh Open Source Software Archive

Member "sqlupdate-1.6.6/docmaker.php" (25 Feb 2012, 4008 Bytes) of package /linux/privat/old/sqlupdate-1.6.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 
    3 # This is Bisqwit's generic docmaker.php, activated from depfun.mak.
    4 # The same program is used in many different projects to create
    5 # the README.html file from progdesc.php.
    6 #
    7 # docmaker.php version 1.2.0
    8 
    9 # Copyright (C) 2000,2004 Bisqwit (http://iki.fi/bisqwit/)
   10 
   11 # Syntax:
   12 
   13 # argv[1]: Archive name
   14 # argv[2]: Source file (default: progdesc.php)
   15 
   16 # Requires:
   17 #   /usr/local/bin/htmlrecode
   18 #   /WWW/document.php (document formatting module)
   19 #
   20 # From the source file, requires the following:
   21 #   $title
   22 #   $progname
   23 
   24 @$archivename = $argv[1];
   25 @$docmodulefn = $argv[2];
   26 $docformatfn = '/WWW/document.php';
   27 
   28 if(!$docmodulefn) $docmodulefn = 'progdesc.php';
   29 
   30 foreach(array($docmodulefn, $docformatfn) as $fn)
   31   if(!file_exists($fn))
   32   {
   33     print "$fn not found, not making document.\n";
   34     exit(1);
   35   }
   36 
   37 function shellfix($s){return "'".str_replace("'", "'\''", $s)."'";}
   38 
   39 $content_array = file($docmodulefn);
   40 $content = implode('', $content_array);
   41 $fw = fopen('docmaker-temp.php', 'w');
   42 fwrite($fw, preg_replace('/include \'.*;/U', '', $content));
   43 fclose($fw);
   44 include 'docmaker-temp.php';
   45 unlink('docmaker-temp.php');
   46 
   47 if(!isset($outset)) $outset='';
   48 if($outset) ob_start();
   49 
   50 ?>
   51 <html><head><meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
   52  <title><?=htmlspecialchars($title)?></title>
   53  <style type="text/css"><!--
   54 TABLE.toc {border:0px}
   55 A:link,A:visited{text-decoration:none;color:#2A3B83}
   56 A:hover{text-decoration:underline;color:#002040}
   57 A:active{text-decoration:underline;color:#004060;background:#CCD8FF}
   58 TD.toc   {font-size:80%; font-family:Tahoma; text-align:left}
   59 H1       {font-size:250%; font-weight:bold} .level1 {text-align:center}
   60 H2       {font-size:200%; font-weight:bold} .level2 {margin-left:1%}
   61 H3       {font-size:160%; font-weight:bold} .level3 {margin-left:2%}
   62 H4       {font-size:145%; font-weight:bold} .level4 {margin-left:3%}
   63 H5       {font-size:130%; font-weight:bold} .level5 {margin-left:4%}
   64 H6       {font-size:110%; font-weight:bold} .level5 {margin-left:5%}
   65 BODY{background:white;color:black}
   66 CODE{font-family:lucida console,courier new,courier;color:#105000}
   67 PRE.smallerpre{font-family:lucida console,courier new,courier;font-size:80%;color:#500010;margin-left:30px}
   68 SMALL    {font-size:70%}
   69 .nonmail { visibility:hidden;position:absolute; top:0px;left:0px }
   70 .ismail  { font-weight:normal }
   71 --></style></head>
   72  <body>
   73   <h1><?=htmlspecialchars($title)?></h1>
   74   <h2 class=level2> 0. Contents </h2>
   75   
   76   This is the documentation of <?=htmlspecialchars($archivename)?>.
   77 <?
   78 
   79 $url = 'http://iki.fi/bisqwit/source/'.rawurlencode($progname).'.html';
   80 $k = '
   81    The official home page of '.htmlspecialchars($progname).'
   82    is at <a href="'.htmlspecialchars($url).'">'.htmlspecialchars($url).'</a>.<br>
   83    Check there for new versions.
   84 ';
   85 if(isset($git))
   86 {
   87   $k .=
   88     '<p>'.
   89     'Additionally, the most recent source code (bleeding edge) for '.htmlspecialchars($progname).
   90     ' can also be downloaded by cloning the Git repository'.
   91     ' by:<ul style="margin-left:3em;margin-top:0px">'.
   92     '<li><code> git clone <a href="'.htmlspecialchars($git).'">'.htmlspecialchars($git).'</a></code></li>'.
   93     '<li><code> git checkout origin/release -b release</code></li>'.
   94     '<li><code> git checkout origin/master  -b master</code></li>'.
   95     '</ul></p>';
   96 }
   97 $text['download:99999. Downloading'] = $k;
   98 
   99 include $docformatfn;
  100 
  101 $st1 = stat($docmodulefn);
  102 $st2 = stat('docmaker.php');
  103 ?>
  104  <p align=right><small>Generated from
  105        <tt><?=$docmodulefn?></tt> (last updated: <?=date('r', $st1[9])?>)<br>
  106   with <tt>docmaker.php</tt> (last updated: <?=date('r', $st2[9])?>)<br>
  107   at <?=date('r')?></small>
  108  </p>
  109 </body>
  110 </html>
  111 <?
  112 
  113 if($outset)
  114 {
  115   $s = ob_get_contents();
  116   ob_end_clean();
  117   if(file_exists('/usr/local/bin/htmlrecode'))
  118   {
  119     /* Try to ensure browser interpretes japanese characters correctly */
  120     passthru('echo '.shellfix($s).
  121              '|/usr/local/bin/htmlrecode -Iiso-8859-1 -O'.$outset.' 2>/dev/null');
  122   }
  123   else
  124     print $s;
  125 }