r55 - in manual: branches branches/1.5 build
Sebastian Bergmann at BerliOS <[email protected]> Sat, 30 Jul 2005 12:39:20 +0200
| Newsgroups | gmane.comp.web.phpopentracker.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: s_bergmann
Date: 2005-07-30 12:39:14 +0200 (Sat, 30 Jul 2005)
New Revision: 55
Added:
manual/branches/1.5/
manual/branches/1.5/chapters/
manual/branches/1.5/de/
manual/branches/1.5/en/
manual/branches/1.5/entities.ent
Removed:
manual/branches/1.5/README
manual/branches/1.5/build
manual/branches/1.5/build.conf-dist
manual/branches/1.5/chapters/
manual/branches/1.5/de.xml.in
manual/branches/1.5/en.xml.in
manual/branches/1.5/entities/
manual/branches/1.5/make.bat
manual/branches/1.5/stylesheets/
manual/branches/phpOpenTracker-1/
Modified:
manual/build/make-1.5-de.bat
manual/build/make-1.5-en.bat
Log:
Restructuring, step 2 of 3.
Copied: manual/branches/1.5 (from rev 51, manual/branches/phpOpenTracker-1)
Deleted: manual/branches/1.5/README
===================================================================
--- manual/branches/phpOpenTracker-1/README 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/README 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,5 +0,0 @@
-The phpOpenTracker Manual is written using the DocBook/XML markup, check out
-http://www.docbook.org/ for its DTD and XSL Stylesheets to transform the source
-into something useful, like HTML or PDF.
-
--- Sebastian
Deleted: manual/branches/1.5/build
===================================================================
--- manual/branches/phpOpenTracker-1/build 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/build 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,555 +0,0 @@
-#!/usr/local/bin/php -Cq
-<?php
-error_reporting(E_ALL);
-set_time_limit(0);
-ob_implicit_flush(true);
-
-require_once 'System.php';
-
-if (!@include_once('build.conf')) {
- include_once('build.conf-dist');
-}
-
-$defaultFormats = array(
- 'docbook-toys' => array('rtf'),
- 'xsltproc' => array('html-chunked', 'pdf')
-);
-
-$supportedFormats = array(
- 'docbook-toys' => array(
- 'dvi',
- 'pdf',
- 'ps',
- 'rtf',
- 'tex'
- ),
-
- 'xsltproc' => array(
- 'html',
- 'html-chunked',
- 'fo',
- 'pdf',
- 'ps',
- 'rtf',
- 'tex',
- 'text',
- 'xml'
- )
-);
-
-$defaultLanguages = array(
- 'de',
- 'en'
-);
-
-$supportedLanguages = array(
- 'de',
- 'en'
-);
-
-$formats = $defaultFormats[PROCESSOR];
-$highlight = true;
-$languages = $defaultLanguages;
-$tempFiles = array();
-
-$options = Console_Getopt::getopt(
- $argv,
- '',
- array(
- 'format=',
- 'language=',
- 'no-highlighting'
- )
-);
-
-foreach ($options[0] as $option) {
- switch ($option[0]) {
- case '--format': {
- if ($option[1] == 'all') {
- $formats = $supportedFormats[PROCESSOR];
- } else {
- $formats = array();
- $tempFormats = explode(',', $option[1]);
-
- foreach ($tempFormats as $tempFormat) {
- if (in_array($tempFormat, $supportedFormats[PROCESSOR])) {
- $formats[] = $tempFormat;
- }
- }
-
- if (empty($formats)) {
- $formats = $defaultFormats[PROCESSOR];
- }
- }
-
- }
- break;
-
- case '--no-highlighting': {
- $highlight = false;
- }
- break;
-
- case '--language': {
- if ($option[1] == 'all') {
- $languages = $supportedLanguages;
- } else {
- $languages = array();
- $tempLanguages = explode(',', $option[1]);
-
- foreach ($tempLanguages as $tempLanguage) {
- if (in_array($tempLanguage, $supportedLanguages)) {
- $languages[] = $tempLanguage;
- }
- }
-
- if (empty($languages)) {
- $languages = $defaultLanguages;
- }
- }
- }
- break;
- }
-}
-
-foreach ($languages as $language) {
- foreach ($formats as $format) {
- render($format, $language, $highlight);
- }
-}
-
-function render($format, $language, $highlight) {
- static $built;
-
- printf(
- "Rendering %s/%s: ",
-
- $language,
- $format
- );
-
- $start = getMicrotime();
-
- $doHighlight = $highlight;
- $inputFile = $language . '.xml';
-
- $outputDirectory = sprintf(
- 'output%s%s',
- DIRECTORY_SEPARATOR,
- $language
- );
-
- switch ($format) {
- case 'fo':
- case 'pdf':
- case 'tex':
- case 'xml': {
- $outputFileSuffix = $format;
- }
- break;
-
- case 'text': {
- $outputFileSuffix = 'txt';
- }
- break;
-
- default: {
- $outputFileSuffix = 'html';
- }
- }
-
- $outputFile = sprintf(
- 'output%s%s%sphpOpenTracker.%s',
- DIRECTORY_SEPARATOR,
- $language,
- DIRECTORY_SEPARATOR,
- $outputFileSuffix
- );
-
- prepareFile(
- $inputFile,
- array(
- '{DTD_PATH}'
- ),
- array(
- DTD_PATH
- )
- );
-
- if ($format == 'html' || $format == 'html-chunked') {
- exec('cp entities/online.ent entities.ent');
- } else {
- exec('cp entities/print.ent entities.ent');
- }
-
- array_push($GLOBALS['tempFiles'], 'entities.ent');
-
- if (PROCESSOR != 'xsltproc') {
- exec(
- sprintf(
- 'java com.elharo.xml.xinclude.SAXXIncluder %s >temp.xml',
- $inputFile
- )
- );
-
- array_push($GLOBALS['tempFiles'], 'temp.xml');
-
- $inputFile = 'temp.xml';
- }
-
- if (PROCESSOR == 'xsltproc' &&
- $format == 'xml') {
- exec(
- sprintf(
- 'xmllint --noent --xinclude %s >%s',
- $inputFile,
- $outputFile
- )
- );
- } else {
- switch (PROCESSOR) {
- case 'docbook-toys': {
- exec(
- sprintf(
- 'db2%s -o %s',
-
- $format,
- $inputFile
- )
- );
-
- exec(
- sprintf(
- 'mv temp.%s output/%s/print.%s',
- $format,
- $language,
- $inputFile
- )
- );
-
- array_push($GLOBALS['tempFiles'], 'CATALOG.local');
- array_push($GLOBALS['tempFiles'], 'suse-html.dsl');
- array_push($GLOBALS['tempFiles'], 'suse-print.dsl');
- }
- break;
-
- case 'xsltproc': {
- switch ($format) {
- case 'pdf':
- case 'rtf': {
- $renderFormat = 'fo';
- }
- break;
-
- default: {
- $renderFormat = $format;
- }
- }
-
- $stylesheetFile = prepareStylesheet(
- $renderFormat,
- $language
- );
-
- switch ($format) {
- case 'fo':
- case 'html':
- case 'pdf':
- case 'rtf':
- case 'tex':
- case 'text': {
- if ($format == 'pdf') {
- $tempOutputFile = str_replace('.pdf', '.fo', $outputFile);
- }
-
- else if ($format == 'text') {
- $tempOutputFile = $outputFile . '.tmp.html';
- array_push($GLOBALS['tempFiles'], $tempOutputFile);
- }
-
- if (!isset($built[$renderFormat][$language])) {
- exec(
- sprintf(
- 'xsltproc --xinclude -o %s %s %s',
-
- isset($tempOutputFile) ? $tempOutputFile : $outputFile,
- $stylesheetFile,
- $inputFile
- )
- );
-
- $built[$renderFormat][$language] = true;
- }
-
- if ($format == 'fo') {
- $doHighlight = false;
- }
-
- else if ($format == 'pdf' ||
- $format == 'ps') {
- exec(
- sprintf(
- 'fop -fo %s -%s %s',
-
- $tempOutputFile,
- $format,
- $outputFile
- )
- );
-
- $doHighlight = false;
- }
-
- else if ($format == 'text') {
- exec(
- sprintf(
- 'lynx -dump %s > %s',
-
- str_replace('\\', '/', $tempOutputFile),
- $outputFile
- )
- );
-
- $doHighlight = false;
- }
-
- else if ($format == 'rtf') {
- exec(
- sprintf(
- 'fo2rtf %s %s',
-
- $outputFile,
- str_replace('.fo', '.rtf', $outputFile)
- )
- );
-
- $doHighlight = false;
- }
- }
- break;
-
- case 'html-chunked': {
- if (!isset($built[$renderFormat][$language])) {
- exec(
- sprintf(
- 'xsltproc --xinclude %s %s',
-
- $stylesheetFile,
- $inputFile
- )
- );
-
- $built[$renderFormat][$language] = true;
- }
- }
- break;
- }
-
- if ($doHighlight) {
- if ($format == 'html') {
- highlightFile($outputFile);
- }
-
- else if ($format == 'html-chunked') {
- highlightDirectory($outputDirectory);
- }
- }
- }
- break;
- }
- }
-
- while ($tempFile = array_pop($GLOBALS['tempFiles'])) {
- @unlink($tempFile);
- }
-
- $end = getMicrotime();
-
- if (extension_loaded('bcmath')) {
- $time = bcsub($end, $start, 6);
- } else {
- $time = $end - $start;
- }
-
- printf(
- "%01.2f seconds\n",
-
- $time
- );
-}
-
-function highlight($string) {
- if (strpos($string[1], '?>') === false ||
- strpos($string[1], '<?xml') !== false) {
- return '<pre class="programlisting"><code>' . $string[1] . '</code></pre>';
- }
-
- return str_replace(
- array(
- "\n",
- '<br /><font color="#113d73"><?php',
- '?><br /></font><br /></font>'
- ),
- array(
- '',
- '<font color="#113d73"><?php',
- '?><br /></font></font>'
- ),
- sprintf(
- '<pre class="programlisting">%s</pre>',
- highlight_string(
- str_replace(
- array(
- '<',
- '>',
- '&',
- '"'
- ),
- array(
- '<',
- '>',
- '&',
- '"'
- ),
- $string[1]
- ),
- 1
- )
- )
- );
-}
-
-function highlightDirectory($directory) {
- if ($dir = @opendir($directory)) {
- while (false !== ($filename = @readdir($dir))) {
- if (ereg('.html$', $filename) &&
- $filename != 'phpOpenTracker.html') {
- highlightFile($directory . DIRECTORY_SEPARATOR . $filename);
- }
- }
-
- @closedir($dir);
- }
-}
-
-function highlightFile($file) {
- if ($buffer = @join('', @file($file))) {
- $buffer = preg_replace_callback(
- '!<pre class="programlisting">(.+)</pre>!Us',
- 'highlight',
- $buffer
- );
-
- if ($fp = @fopen($file, 'w')) {
- @fwrite($fp, $buffer);
- @fclose($fp);
- } else {
- echo "Cannot write to $file.\n";
- exit;
- }
- } else {
- echo "Cannot open $file.\n";
- exit;
- }
-}
-
-function prepareFile($filename, $variables, $values) {
- if ($file = @implode('', @file($filename . '.in'))) {
- $file = str_replace($variables, $values, $file);
-
- if ($fp = @fopen($filename, 'w')) {
- @fwrite($fp, $file);
- @fclose($fp);
- } else {
- echo "Cannot create $filename.\n";
- exit;
- }
-
- array_push($GLOBALS['tempFiles'], $filename);
- }
-}
-
-function prepareStylesheet($format, $language) {
- switch ($format) {
- case 'fo':
- case 'rtf': {
- $stylesheetFile = sprintf(
- 'stylesheets%sfo.xsl',
- DIRECTORY_SEPARATOR
- );
- }
- break;
-
- case 'tex': {
- $stylesheetFile = sprintf(
- 'stylesheets%stex.xsl',
- DIRECTORY_SEPARATOR
- );
- }
- break;
-
- default: {
- $stylesheetFile = sprintf(
- 'stylesheets%s%s.xsl',
- DIRECTORY_SEPARATOR,
- $format
- );
- }
- break;
- }
-
- prepareFile(
- sprintf(
- 'stylesheets%scommon.xsl',
- DIRECTORY_SEPARATOR
- ),
- array(
- '{language}',
- '{db2latex_root}',
- '{xsl_root}'
- ),
- array(
- $language,
- DB2LATEX_ROOT,
- XSL_ROOT
- )
- );
-
- prepareFile(
- sprintf(
- 'stylesheets%snonhtml-common.xsl',
- DIRECTORY_SEPARATOR
- ),
- array(
- '{db2latex_root}',
- '{xsl_root}'
- ),
- array(
- DB2LATEX_ROOT,
- XSL_ROOT
- )
- );
-
- prepareFile(
- $stylesheetFile,
- array(
- '{language}',
- '{db2latex_root}',
- '{xsl_root}'
- ),
- array(
- $language,
- DB2LATEX_ROOT,
- XSL_ROOT
- )
- );
-
- return $stylesheetFile;
-}
-
-function getMicrotime() {
- $microtime = explode(' ', microtime());
-
- return $microtime[1] . substr($microtime[0], 1);
-}
-?>
Deleted: manual/branches/1.5/build.conf-dist
===================================================================
--- manual/branches/phpOpenTracker-1/build.conf-dist 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/build.conf-dist 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,14 +0,0 @@
-<?php
-define('PROCESSOR', 'xsltproc');
-
-define('DTD_PATH', 'file:///d:/home/docbook/dtd/docbookx.dtd');
-define('XSL_ROOT', 'd:/home/docbook/xsl');
-define('DB2LATEX_ROOT', 'd:/home/docbook/db2latex/xsl');
-
-ini_set('highlight.bg', '#ffffff');
-ini_set('highlight.comment', '#ba8370');
-ini_set('highlight.default', '#113d73');
-ini_set('highlight.html', '#000000');
-ini_set('highlight.keyword', '#005500');
-ini_set('highlight.string', '#550000');
-?>
Copied: manual/branches/1.5/chapters (from rev 54, manual/branches/phpOpenTracker-1/chapters)
Copied: manual/branches/1.5/de (from rev 54, manual/branches/phpOpenTracker-1/de)
Deleted: manual/branches/1.5/de.xml.in
===================================================================
--- manual/branches/phpOpenTracker-1/de.xml.in 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/de.xml.in 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
-
-<!DOCTYPE book SYSTEM "{DTD_PATH}" [
- <!ENTITY api-reference SYSTEM "chapters/de/api-reference.xml">
- <!ENTITY bookinfo SYSTEM "chapters/de/bookinfo.xml">
- <!ENTITY configuration SYSTEM "chapters/de/configuration.xml">
- <!ENTITY installation SYSTEM "chapters/de/installation.xml">
- <!ENTITY internals SYSTEM "chapters/de/internals.xml">
- <!ENTITY introduction SYSTEM "chapters/de/introduction.xml">
- <!ENTITY preface SYSTEM "chapters/de/preface.xml">
- <!ENTITY tuning SYSTEM "chapters/de/tuning.xml">
- <!ENTITY copyright SYSTEM "chapters/copyright.xml">
-
- <!ENTITY % entities SYSTEM "entities.ent">
- %entities;
-]>
-<book>
- &bookinfo;
- &preface;
- &introduction;
- &installation;
- &api-reference;
- &configuration;
- &tuning;
- &internals;
- ©right;
-</book>
Copied: manual/branches/1.5/en (from rev 54, manual/branches/phpOpenTracker-1/en)
Deleted: manual/branches/1.5/en.xml.in
===================================================================
--- manual/branches/phpOpenTracker-1/en.xml.in 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/en.xml.in 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1" ?>
-
-<!DOCTYPE book SYSTEM "{DTD_PATH}" [
- <!ENTITY api-reference SYSTEM "chapters/en/api-reference.xml">
- <!ENTITY bookinfo SYSTEM "chapters/en/bookinfo.xml">
- <!ENTITY configuration SYSTEM "chapters/en/configuration.xml">
- <!ENTITY installation SYSTEM "chapters/en/installation.xml">
- <!ENTITY internals SYSTEM "chapters/en/internals.xml">
- <!ENTITY introduction SYSTEM "chapters/en/introduction.xml">
- <!ENTITY preface SYSTEM "chapters/en/preface.xml">
- <!ENTITY tuning SYSTEM "chapters/en/tuning.xml">
- <!ENTITY copyright SYSTEM "chapters/copyright.xml">
-
- <!ENTITY % entities SYSTEM "entities.ent">
- %entities;
-]>
-<book>
- &bookinfo;
- &preface;
- &introduction;
- &installation;
- &api-reference;
- &configuration;
- &tuning;
- &internals;
- ©right;
-</book>
Copied: manual/branches/1.5/entities.ent (from rev 54, manual/branches/phpOpenTracker-1/entities.ent)
Deleted: manual/branches/1.5/make.bat
===================================================================
--- manual/branches/phpOpenTracker-1/make.bat 2005-06-30 09:17:18 UTC (rev 51)
+++ manual/branches/1.5/make.bat 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,13 +0,0 @@
-@echo off
-@cls
-@del output\de\*.html > NUL
-@del output\de\*.pdf > NUL
-@del output\en\*.html > NUL
-@del output\en\*.pdf > NUL
-
-@php -d output_buffering=Off build
-
-@copy /Y figures\*.png output\de\figures\ > NUL
-@copy /Y stylesheets\docbook.css output\de\ > NUL
-@copy /Y figures\*.png output\en\figures\ > NUL
-@copy /Y stylesheets\docbook.css output\en\ > NUL
Modified: manual/build/make-1.5-de.bat
===================================================================
--- manual/build/make-1.5-de.bat 2005-07-30 10:34:41 UTC (rev 54)
+++ manual/build/make-1.5-de.bat 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,7 +1,7 @@
@echo off
@cls
@rm output/de/1.5/*.css output/de/1.5/*.html output/de/1.5/figures/*.png
-@xsltproc --xinclude --stringparam base.dir output/de/1.5/ --stringparam l10n.gentext.language de stylesheets/html-chunked.xsl ../branches/phpOpenTracker-1/de/book.xml
+@xsltproc --xinclude --stringparam base.dir output/de/1.5/ --stringparam l10n.gentext.language de stylesheets/html-chunked.xsl ../branches/1.5/de/book.xml
@php highlight.php output/de/1.5/
@cp stylesheets/docbook.css output/de/1.5/
-@cp ../branches/phpOpenTracker-1/figures/*.png output/de/1.5/figures/
+@cp ../branches/1.5/figures/*.png output/de/1.5/figures/
Modified: manual/build/make-1.5-en.bat
===================================================================
--- manual/build/make-1.5-en.bat 2005-07-30 10:34:41 UTC (rev 54)
+++ manual/build/make-1.5-en.bat 2005-07-30 10:39:14 UTC (rev 55)
@@ -1,7 +1,7 @@
@echo off
@cls
@rm output/en/1.5/*.css output/en/1.5/*.html output/en/1.5/figures/*.png
-@xsltproc --xinclude --stringparam base.dir output/en/1.5/ --stringparam l10n.gentext.language en stylesheets/html-chunked.xsl ../branches/phpOpenTracker-1/en/book.xml
+@xsltproc --xinclude --stringparam base.dir output/en/1.5/ --stringparam l10n.gentext.language en stylesheets/html-chunked.xsl ../branches/1.5/en/book.xml
@php highlight.php output/en/1.5/
@cp stylesheets/docbook.css output/en/1.5/
-@cp ../branches/phpOpenTracker-1/figures/*.png output/en/1.5/figures/
+@cp ../branches/1.5/figures/*.png output/en/1.5/figures/