1
0
mirror of https://github.com/php/phd.git synced 2026-03-23 22:52:05 +01:00

Change property names to camel case

This commit is contained in:
haszi
2024-12-29 13:12:56 +01:00
committed by Gina Peter Banyard
parent e66f34e029
commit b80ae36dba
65 changed files with 288 additions and 288 deletions

View File

@@ -7,61 +7,61 @@ class Config
public readonly string $copyright;
/** @var array<string, string> */
public array $output_format = [];
public bool $no_index = false;
public bool $force_index = false;
public bool $no_toc = false;
public string $xml_root = '.';
public string $xml_file = './.manual.xml';
public string $history_file = './fileModHistory.php';
public string $lang_dir = './';
public array $outputFormat = [];
public bool $noIndex = false;
public bool $forceIndex = false;
public bool $noToc = false;
public string $xmlRoot = '.';
public string $xmlFile = './.manual.xml';
public string $historyFile = './fileModHistory.php';
public string $langDir = './';
public string $language = 'en';
public string $fallback_language = 'en';
public string $fallbackLanguage = 'en';
public int $verbose = VERBOSE_DEFAULT;
public string $date_format = 'H:i:s';
public string $dateFormat = 'H:i:s';
/** @var array<string> */
public array $render_ids = [];
public array $renderIds = [];
/** @var array<string> */
public array $skip_ids = [];
private bool $color_output = true;
public string $output_dir = './output/';
public string $output_filename = '';
public array $skipIds = [];
private bool $colorOutput = true;
public string $outputDir = './output/';
public string $outputFilename = '';
/** @var resource */
public $php_error_output = \STDERR;
public string $php_error_color = '01;31'; // Red
public $phpErrorOutput = \STDERR;
public string $phpErrorColor = '01;31'; // Red
/** @var resource */
public $user_error_output = \STDERR;
public string $user_error_color = '01;33'; // Yellow
public $userErrorOutput = \STDERR;
public string $userErrorColor = '01;33'; // Yellow
/** @var resource */
public $phd_info_output = \STDOUT;
public string $phd_info_color = '01;32'; // Green
public $phdInfoOutput = \STDOUT;
public string $phdInfoColor = '01;32'; // Green
/** @var resource */
public $phd_warning_output = \STDOUT;
public string $phd_warning_color = '01;35'; // Magenta
public $phdWarningOutput = \STDOUT;
public string $phdWarningColor = '01;35'; // Magenta
public string $highlighter = 'phpdotnet\\phd\\Highlighter';
/** @var array<string> */
public array $package =['Generic'];
/** @var array<string> $css */
public array $css = [];
public bool $process_xincludes = false;
public bool $processXincludes = false;
public ?string $ext = null;
/** @var array<string> */
public array $package_dirs = [__INSTALLDIR__];
public bool $saveconfig = false;
public array $packageDirs = [__INSTALLDIR__];
public bool $saveConfig = false;
public bool $quit = false;
public ?IndexRepository $indexcache = null;
public bool $memoryindex = false;
public ?IndexRepository $indexCache = null;
public bool $memoryIndex = false;
public string $phpweb_version_filename = '';
public string $phpweb_acronym_filename = '';
public string $phpweb_sources_filename = '';
public string $phpweb_history_filename = '';
public string $phpwebVersionFilename = '';
public string $phpwebAcronymFilename = '';
public string $phpwebSourcesFilename = '';
public string $phpwebHistoryFilename = '';
public function __construct() {
$this->copyright = 'Copyright(c) 2007-' . \date('Y') . ' The PHP Documentation Group';
if('WIN' === \strtoupper(\substr(\PHP_OS, 0, 3))) {
$this->color_output = false;
$this->colorOutput = false;
}
}
@@ -98,7 +98,7 @@ class Config
*/
public function getSupportedPackages(): array {
$packageList = [];
foreach($this->package_dirs as $dir) {
foreach($this->packageDirs as $dir) {
foreach (\glob($dir . "/phpdotnet/phd/Package/*", \GLOB_ONLYDIR) as $item) {
$baseitem = \basename($item);
if ($baseitem[0] !== '.') {
@@ -112,30 +112,30 @@ class Config
/**
* Returns whether terminal output supports colors
*/
public function getColor_output(): bool {
return $this->color_output;
public function getColorOutput(): bool {
return $this->colorOutput;
}
/**
* Enables/disables color output on the terminal
*/
public function setColor_output(bool $color_output): void {
public function setColorOutput(bool $colorOutput): void {
// Disable colored output if the terminal doesn't support colors
if ($color_output && function_exists('posix_isatty')) {
if (!posix_isatty($this->phd_info_output)) {
$this->phd_info_color = false;
if ($colorOutput && function_exists('posix_isatty')) {
if (!posix_isatty($this->phdInfoOutput)) {
$this->phdInfoColor = false;
}
if (!posix_isatty($this->phd_warning_output)) {
$this->phd_warning_color = false;
if (!posix_isatty($this->phdWarningOutput)) {
$this->phdWarningColor = false;
}
if (!posix_isatty($this->php_error_output)) {
$this->php_error_color = false;
if (!posix_isatty($this->phpErrorOutput)) {
$this->phpErrorColor = false;
}
if (!posix_isatty($this->user_error_output)) {
$this->user_error_color = false;
if (!posix_isatty($this->userErrorOutput)) {
$this->userErrorColor = false;
}
}
$this->color_output = $color_output;
$this->colorOutput = $colorOutput;
}
/**
@@ -152,27 +152,27 @@ class Config
* @return boolean True if indexing is required.
*/
public function requiresIndexing(): bool {
if (! $this->indexcache) {
$indexfile = $this->output_dir . 'index.sqlite';
if (! $this->indexCache) {
$indexfile = $this->outputDir . 'index.sqlite';
if (!\file_exists($indexfile)) {
return true;
}
}
if ($this->no_index) {
if ($this->noIndex) {
return false;
}
if ($this->force_index) {
if ($this->forceIndex) {
return true;
}
if ($this->indexcache->getIndexingTimeCount() === 0) {
if ($this->indexCache->getIndexingTimeCount() === 0) {
return true;
}
$xmlLastModification = \filemtime($this->xml_file);
if ($this->indexcache->getIndexingTime() > $xmlLastModification) {
$xmlLastModification = \filemtime($this->xmlFile);
if ($this->indexCache->getIndexingTime() > $xmlLastModification) {
return false;
}
return true;

View File

@@ -68,8 +68,8 @@ abstract class Format extends ObjectStorage
public function __construct(Config $config, OutputHandler $outputHandler) {
$this->config = $config;
$this->outputHandler = $outputHandler;
if ($this->config->indexcache) {
$this->indexRepository = $this->config->indexcache;
if ($this->config->indexCache) {
$this->indexRepository = $this->config->indexCache;
if (!($this instanceof Index)) {
$this->sortIDs();
}
@@ -337,13 +337,13 @@ abstract class Format extends ObjectStorage
if (isset($this->autogen[$lang][$text])) {
return $this->autogen[$lang][$text];
}
if ($lang == $this->config->fallback_language) {
if ($lang == $this->config->fallbackLanguage) {
throw new \InvalidArgumentException("Cannot autogenerate text for '$text'");
}
return $this->autogen($text, $this->config->fallback_language);
return $this->autogen($text, $this->config->fallbackLanguage);
}
$filename = $this->config->lang_dir . $lang . ".ini";
$filename = $this->config->langDir . $lang . ".ini";
if (!file_exists($filename) && strncmp(basename($filename), 'doc-', 4) === 0) {
$filename = dirname($filename) . DIRECTORY_SEPARATOR . substr(basename($filename), 4);

View File

@@ -71,12 +71,12 @@ abstract class Format_Abstract_XHTML extends Format {
* @return void
*/
public function postConstruct() {
$this->mediamanager = new MediaManager($this->config->xml_root);
$this->mediamanager = new MediaManager($this->config->xmlRoot);
$outputdir = $this->getOutputDir();
if (isset($outputdir) && $outputdir) {
$this->mediamanager->output_dir = $outputdir;
} else {
$this->mediamanager->output_dir = $this->config->output_dir . '/' . strtolower($this->getFormatName()) . '-data/';
$this->mediamanager->output_dir = $this->config->outputDir . '/' . strtolower($this->getFormatName()) . '-data/';
$this->mediamanager->relative_ref_path = basename($this->mediamanager->output_dir) . '/';
}
}

View File

@@ -55,7 +55,7 @@ class Options_Handler implements Options_Interface
*/
public function option_memoryindex(string $k, mixed $v): array
{
return ['memoryindex' => true];
return ['memoryIndex' => true];
}
/**
@@ -80,7 +80,7 @@ class Options_Handler implements Options_Interface
$formats[] = $val;
}
}
return ['output_format' => $formats];
return ['outputFormat' => $formats];
}
/**
@@ -135,7 +135,7 @@ class Options_Handler implements Options_Interface
*/
public function option_noindex(string $k, mixed $v): array
{
return ['no_index' => true];
return ['noIndex' => true];
}
/**
@@ -151,7 +151,7 @@ class Options_Handler implements Options_Interface
*/
public function option_forceindex(string $k, mixed $v): array
{
return ['force_index' => true];
return ['forceIndex' => true];
}
/**
@@ -167,7 +167,7 @@ class Options_Handler implements Options_Interface
*/
public function option_notoc(string $k, mixed $v): array
{
return ['no_toc' => true];
return ['noToc' => true];
}
/**
@@ -190,8 +190,8 @@ class Options_Handler implements Options_Interface
trigger_error(sprintf("'%s' is not a readable docbook file", $v), E_USER_ERROR);
}
return [
'xml_root' => dirname($v),
'xml_file' => $v,
'xmlRoot' => dirname($v),
'xmlFile' => $v,
];
}
@@ -225,7 +225,7 @@ class Options_Handler implements Options_Interface
}
$v = (substr($v, strlen($v) - strlen(DIRECTORY_SEPARATOR)) === DIRECTORY_SEPARATOR) ? $v : ($v . DIRECTORY_SEPARATOR);
return ['output_dir' => $v];
return ['outputDir' => $v];
}
/**
@@ -238,7 +238,7 @@ class Options_Handler implements Options_Interface
}
$file = basename($v);
return ['output_filename' => $file];
return ['outputFilename' => $file];
}
/**
@@ -257,7 +257,7 @@ class Options_Handler implements Options_Interface
*/
public function option_partial(string $k, mixed $v): array
{
$render_ids = $this->config->render_ids;
$renderIds = $this->config->renderIds;
foreach((array)$v as $val) {
$recursive = true;
if (strpos($val, "=") !== false) {
@@ -268,9 +268,9 @@ class Options_Handler implements Options_Interface
}
$recursive = (bool) $recursive;
}
$render_ids[$val] = $recursive;
$renderIds[$val] = $recursive;
}
return ['render_ids' => $render_ids];
return ['renderIds' => $renderIds];
}
/**
@@ -319,7 +319,7 @@ class Options_Handler implements Options_Interface
*/
public function option_skip(string $k, mixed $v): array
{
$skip_ids = $this->config->skip_ids;
$skipIds = $this->config->skipIds;
foreach((array)$v as $val) {
$recursive = true;
if (strpos($val, "=") !== false) {
@@ -330,9 +330,9 @@ class Options_Handler implements Options_Interface
}
$recursive = (bool) $recursive;
}
$skip_ids[$val] = $recursive;
$skipIds[$val] = $recursive;
}
return ['skip_ids' => $skip_ids];
return ['skipIds' => $skipIds];
}
/**
@@ -350,7 +350,7 @@ class Options_Handler implements Options_Interface
trigger_error("yes/no || on/off || true/false || 1/0 expected", E_USER_ERROR);
}
return ['saveconfig' => $val];
return ['saveConfig' => $val];
}
/**
@@ -444,7 +444,7 @@ class Options_Handler implements Options_Interface
if (!is_bool($val)) {
trigger_error("yes/no || on/off || true/false || 1/0 expected", E_USER_ERROR);
}
return ['color_output' => $val];
return ['colorOutput' => $val];
}
/**
@@ -474,7 +474,7 @@ class Options_Handler implements Options_Interface
*/
public function option_packagedir(string $k, mixed $v): array
{
$packages = $this->config->package_dirs;
$packages = $this->config->packageDirs;
foreach((array)$v as $val) {
if ($path = realpath($val)) {
if (!in_array($path, $packages)) {
@@ -484,7 +484,7 @@ class Options_Handler implements Options_Interface
trigger_error(vsprintf('Invalid path: %s', [$val]), E_USER_WARNING);
}
}
return ['package_dirs' => $packages];
return ['packageDirs' => $packages];
}
/**
@@ -500,7 +500,7 @@ class Options_Handler implements Options_Interface
*/
public function option_xinclude(string $k, mixed $v): array
{
return ['process_xincludes' => true];
return ['processXincludes' => true];
}
/**
@@ -539,21 +539,21 @@ class Options_Handler implements Options_Interface
--package <packagename> The package to use
-I
--noindex Do not index before rendering but load from cache
(default: " . ($this->config->no_index ? 'true' : 'false') . ")
(default: " . ($this->config->noIndex ? 'true' : 'false') . ")
-M
--memoryindex Do not save indexing into a file, store it in memory.
(default: " . ($this->config->memoryindex ? 'true' : 'false') . ")
(default: " . ($this->config->memoryIndex ? 'true' : 'false') . ")
-r
--forceindex Force re-indexing under all circumstances
(default: " . ($this->config->force_index ? 'true' : 'false') . ")
(default: " . ($this->config->forceIndex ? 'true' : 'false') . ")
-t
--notoc Do not rewrite TOC before rendering but load from
cache (default: " . ($this->config->no_toc ? 'true' : 'false') . ")
cache (default: " . ($this->config->noToc ? 'true' : 'false') . ")
-d <filename>
--docbook <filename> The Docbook file to render from
-x
--xinclude Process XML Inclusions (XInclude)
(default: " . ($this->config->process_xincludes ? 'true' : 'false') . ")
(default: " . ($this->config->processXincludes ? 'true' : 'false') . ")
-p <id[=bool]>
--partial <id[=bool]> The ID to render, optionally skipping its children
chunks (default to true; render children)
@@ -563,7 +563,7 @@ class Options_Handler implements Options_Interface
-l
--list Print out the supported packages and formats
-o <directory>
--output <directory> The output directory (default: " . $this->config->output_dir . ")
--output <directory> The output directory (default: " . $this->config->outputDir . ")
-F filename
--outputfilename filename Filename to use when writing standalone formats
(default: <packagename>-<formatname>.<formatext>)
@@ -572,7 +572,7 @@ class Options_Handler implements Options_Interface
theme). (default: " . $this->config->language . ")
-c <bool>
--color <bool> Enable color output when output is to a terminal
(default: " . ($this->config->getColor_output() ? 'true' : 'false') . ")
(default: " . ($this->config->getColorOutput() ? 'true' : 'false') . ")
-C <filename>
--css <filename> Link for an external CSS file.
-g <classname>
@@ -585,7 +585,7 @@ class Options_Handler implements Options_Interface
--ext <extension> The alternative filename extension to use,
including the dot. Use 'false' for no extension.
-S <bool>
--saveconfig <bool> Save the generated config (default: " . ($this->config->saveconfig ? 'true' : 'false') . ").
--saveconfig <bool> Save the generated config (default: " . ($this->config->saveConfig ? 'true' : 'false') . ").
-Q
--quit Don't run the build. Use with --saveconfig to

View File

@@ -31,34 +31,34 @@ class OutputHandler
* Method to get a color escape sequence
*/
private function term_color(string $text, string|false $color): string {
return $this->config->getColor_output() && $color !== false ? "\033[" . $color . "m" . $text . "\033[m" : $text;
return $this->config->getColorOutput() && $color !== false ? "\033[" . $color . "m" . $text . "\033[m" : $text;
}
public function printPhdInfo(string $msg, string $info = ""): int {
$color = $this->config->phd_info_color;
$outputStream = $this->config->phd_info_output;
$color = $this->config->phdInfoColor;
$outputStream = $this->config->phdInfoOutput;
return $this->print($msg, $outputStream, $color, $info);
}
private function printPhdWarning(string $msg, string $warning = ""): int {
$color = $this->config->phd_warning_color;
$outputStream = $this->config->phd_warning_output;
$color = $this->config->phdWarningColor;
$outputStream = $this->config->phdWarningOutput;
return $this->print($msg, $outputStream, $color, $warning);
}
public function printUserError(string $msg, string $file, int $line, string $error = ""): int {
$color = $this->config->user_error_color;
$outputStream = $this->config->user_error_output;
$color = $this->config->userErrorColor;
$outputStream = $this->config->userErrorOutput;
$data = \sprintf("%s:%d\n\t%s", $file, $line, $msg);
return $this->print($data, $outputStream, $color, $error);
}
public function printPhpError(string $msg, string $file, int $line, string $error = ""): int {
$color = $this->config->php_error_color;
$outputStream = $this->config->php_error_output;
$color = $this->config->phpErrorColor;
$outputStream = $this->config->phpErrorOutput;
$data = \sprintf("%s:%d\n\t%s", $file, $line, $msg);
return $this->print($data, $outputStream, $color, $error);
@@ -71,7 +71,7 @@ class OutputHandler
return \fprintf($outputStream, "%s\n", $colorMsg);
}
$time = \date($this->config->date_format);
$time = \date($this->config->dateFormat);
$timestamp = $this->term_color(\sprintf("[%s - %s]", $time, $infoOrErrorString), $color);
return \fprintf($outputStream, "%s %s\n", $timestamp, $msg);

View File

@@ -79,9 +79,9 @@ HEADER;
case Render::INIT:
if ($value) {
if (!is_resource($this->getFileStream())) {
$filename = $this->config->output_dir;
if ($this->config->output_filename) {
$filename .= $this->config->output_filename;
$filename = $this->config->outputDir;
if ($this->config->outputFilename) {
$filename .= $this->config->outputFilename;
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}

View File

@@ -73,7 +73,7 @@ class Package_Generic_ChunkedXHTML extends Package_Generic_XHTML {
return; //Don't create output dir when rendering to buffer
}
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {

View File

@@ -312,7 +312,7 @@ class Package_Generic_Manpage extends Format_Abstract_Manpage {
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir . strtolower($this->toValidName($this->getFormatName())) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->toValidName($this->getFormatName())) . '/');
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {
trigger_error("Output directory is a file?", E_USER_ERROR);

View File

@@ -1132,7 +1132,7 @@ abstract class Package_Generic_PDF extends Format_Abstract_PDF {
public function format_imagedata($open, $name, $attrs, $props) {
if ($props["empty"] && isset($this->cchunk["xml-base"]) && ($base = $this->cchunk["xml-base"]) &&
isset($attrs[Reader::XMLNS_DOCBOOK]["fileref"]) && ($fileref = $attrs[Reader::XMLNS_DOCBOOK]["fileref"])) {
$imagePath = $this->config->xml_root . DIRECTORY_SEPARATOR . $base . $fileref;
$imagePath = $this->config->xmlRoot . DIRECTORY_SEPARATOR . $base . $fileref;
if (file_exists($imagePath))
$this->pdfDoc->add(PdfWriter::IMAGE, $imagePath);

View File

@@ -218,7 +218,7 @@ abstract class Package_Generic_TocFeed extends Format
case Render::INIT:
$this->setOutputDir(
$this->config->output_dir
$this->config->outputDir
. strtolower($this->getFormatName()) . '/'
);
$dir = $this->getOutputDir();

View File

@@ -665,7 +665,7 @@ abstract class Package_Generic_XHTML extends Format_Abstract_XHTML {
}
$stylesDir = $this->getOutputDir();
if (!$stylesDir) {
$stylesDir = $this->config->output_dir;
$stylesDir = $this->config->outputDir;
}
$stylesDir .= 'styles/';
if (file_exists($stylesDir)) {

View File

@@ -207,15 +207,15 @@ abstract class Package_IDE_Base extends Format {
}
public function loadVersionInfo() {
if (file_exists($this->config->phpweb_version_filename)) {
$this->versions = self::generateVersionInfo($this->config->phpweb_version_filename);
if (file_exists($this->config->phpwebVersionFilename)) {
$this->versions = self::generateVersionInfo($this->config->phpwebVersionFilename);
} else {
trigger_error("Can't load the versions file", E_USER_ERROR);
}
}
public function createOutputDirectory() {
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {
trigger_error("Output directory is a file?", E_USER_ERROR);

View File

@@ -42,7 +42,7 @@ class Package_IDE_Funclist extends Format {
$this->registerTextMap($this->textmap);
break;
case Render::FINALIZE:
$filename = $this->config->output_dir . strtolower($this->getFormatName()) . $this->getExt();
$filename = $this->config->outputDir . strtolower($this->getFormatName()) . $this->getExt();
file_put_contents($filename, $this->buffer);
break;
case Render::VERBOSE:

View File

@@ -93,7 +93,7 @@ class Package_IDE_SQLite extends Package_IDE_Base {
}
public function createDatabase() {
$db = new \SQLite3($this->config->output_dir . strtolower($this->getFormatName()) . $this->getExt());
$db = new \SQLite3($this->config->outputDir . strtolower($this->getFormatName()) . $this->getExt());
$db->exec('DROP TABLE IF EXISTS functions');
$db->exec('DROP TABLE IF EXISTS params');
$db->exec('DROP TABLE IF EXISTS notes');

View File

@@ -45,9 +45,9 @@ HEADER;
}
public function createFileName() {
$filename = $this->config->output_dir;
if ($this->config->output_filename) {
$filename .= $this->config->output_filename;
$filename = $this->config->outputDir;
if ($this->config->outputFilename) {
$filename .= $this->config->outputFilename;
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}

View File

@@ -221,11 +221,11 @@ class Package_PEAR_CHM extends Package_PEAR_ChunkedXHTML {
parent::update($event, $value);
break;
case Render::INIT:
$this->chmdir = $this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
$this->chmdir = $this->config->outputDir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if(!file_exists($this->chmdir) || is_file($this->chmdir)) {
mkdir($this->chmdir, 0777, true) or die("Can't create the CHM project directory");
}
$this->outputdir = $this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->outputdir = $this->config->outputDir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->postConstruct();
if(!file_exists($this->outputdir) || is_file($this->outputdir)) {
mkdir($this->outputdir, 0777, true) or die("Can't create the cache directory");

View File

@@ -71,7 +71,7 @@ class Package_PEAR_ChunkedXHTML extends Package_PEAR_XHTML {
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {

View File

@@ -20,7 +20,7 @@ class Package_PHP_BigPDF extends Package_PHP_PDF {
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir);
$this->setOutputDir($this->config->outputDir);
break;
case Render::VERBOSE:
@@ -56,8 +56,8 @@ class Package_PHP_BigPDF extends Package_PHP_PDF {
$this->outputHandler->v("Writing Full PDF Manual (%s)", $this->cchunk["setname"], VERBOSE_TOC_WRITING);
$filename = $this->getOutputDir();
if ($this->config->output_filename) {
$filename .= $this->config->output_filename;
if ($this->config->outputFilename) {
$filename .= $this->config->outputFilename;
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}

View File

@@ -42,9 +42,9 @@ HEADER;
}
public function createFileName() {
$filename = $this->config->output_dir;
if ($this->config->output_filename) {
$filename .= $this->config->output_filename;
$filename = $this->config->outputDir;
if ($this->config->outputFilename) {
$filename .= $this->config->outputFilename;
} else {
$filename .= strtolower($this->getFormatName()) . $this->getExt();
}

View File

@@ -232,11 +232,11 @@ class Package_PHP_CHM extends Package_PHP_ChunkedXHTML
case Render::INIT:
$this->loadVersionAcronymInfo();
$this->chmdir = $this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
$this->chmdir = $this->config->outputDir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if(!file_exists($this->chmdir) || is_file($this->chmdir)) {
mkdir($this->chmdir, 0777, true) or die("Can't create the CHM project directory");
}
$this->outputdir = $this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->outputdir = $this->config->outputDir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR . "res" . DIRECTORY_SEPARATOR;
$this->postConstruct();
if(!file_exists($this->outputdir) || is_file($this->outputdir)) {
mkdir($this->outputdir, 0777, true) or die("Can't create the cache directory");

View File

@@ -35,7 +35,7 @@ class Package_PHP_Epub extends Package_PHP_ChunkedXHTML
public function update($event, $value = null) {
switch($event) {
case Render::INIT:
$this->parentdir = $this->config->output_dir
$this->parentdir = $this->config->outputDir
. strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR;
if(!file_exists($this->parentdir) || is_file($this->parentdir)) {

View File

@@ -24,7 +24,7 @@ class Package_PHP_HowTo extends Package_PHP_Web {
parent::update($event, $value);
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
if (file_exists($this->getOutputDir())) {
if (!is_dir($this->getOutputDir())) {

View File

@@ -97,7 +97,7 @@ class Package_PHP_KDevelop extends Format {
break;
case Render::INIT:
if ($value) {
$this->setOutputDir($this->config->output_dir);
$this->setOutputDir($this->config->outputDir);
$this->setFileStream(fopen($this->getOutputDir() . strtolower($this->getFormatName()), "w"));
self::headerToc();
}

View File

@@ -120,7 +120,7 @@ class Package_PHP_PDF extends Package_Generic_PDF {
case Render::INIT:
if (!class_exists("HaruDoc")) die ("PDF output needs libharu & haru/pecl extensions... Please install them and start PhD again.\n");
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR);
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR);
if(!file_exists($this->getOutputDir()) || is_file($this->getOutputDir())) mkdir($this->getOutputDir(), 0777, true) or die("Can't create the cache directory.\n");
break;
case Render::VERBOSE:

View File

@@ -82,7 +82,7 @@ class Package_PHP_Web extends Package_PHP_XHTML {
case Render::INIT:
$this->loadVersionAcronymInfo();
$this->loadSourcesInfo();
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
$this->postConstruct();
$this->loadHistoryInfo();
if (file_exists($this->getOutputDir())) {
@@ -95,7 +95,7 @@ class Package_PHP_Web extends Package_PHP_XHTML {
}
}
if ($this->getFormatName() == "PHP-Web") {
if (!$this->config->no_toc && is_dir($this->getOutputDir() . 'toc')) {
if (!$this->config->noToc && is_dir($this->getOutputDir() . 'toc')) {
$this->removeDir($this->getOutputDir() . 'toc');
}
if (!file_exists($this->getOutputDir() . "toc") || is_file($this->getOutputDir() . "toc")) {
@@ -301,7 +301,7 @@ contributors($setup);
}
public function loadSourcesInfo() {
$this->sources = self::generateSourcesInfo($this->config->phpweb_sources_filename);
$this->sources = self::generateSourcesInfo($this->config->phpwebSourcesFilename);
}
public static function generateSourcesInfo($filename) {
@@ -346,12 +346,12 @@ contributors($setup);
}
public function loadHistoryInfo() {
if (!is_file($this->config->phpweb_history_filename)) {
if (!is_file($this->config->phpwebHistoryFilename)) {
$this->history = [];
return;
}
$history = include $this->config->phpweb_history_filename;
$history = include $this->config->phpwebHistoryFilename;
$this->history = (is_array($history)) ? $history : [];
}

View File

@@ -239,9 +239,9 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML {
}
public function loadVersionAcronymInfo() {
$this->versions = self::generateVersionInfo($this->config->phpweb_version_filename);
$this->deprecated = self::generateDeprecatedInfo($this->config->phpweb_version_filename);
$this->acronyms = self::generateAcronymInfo($this->config->phpweb_acronym_filename);
$this->versions = self::generateVersionInfo($this->config->phpwebVersionFilename);
$this->deprecated = self::generateDeprecatedInfo($this->config->phpwebVersionFilename);
$this->acronyms = self::generateAcronymInfo($this->config->phpwebAcronymFilename);
}
public static function generateVersionInfo($filename) {

View File

@@ -9,18 +9,18 @@ class Reader_Partial extends Reader
public function __construct(
OutputHandler $outputHandler,
array $render_ids,
?array $skip_ids = [],
array $renderIds,
?array $skipIds = [],
?array $parents = [],
) {
parent::__construct($outputHandler);
if ($render_ids === []) {
if ($renderIds === []) {
throw new \Exception("Didn't get any IDs to seek");
}
$this->partial = $render_ids;
$this->skip = $skip_ids;
$this->partial = $renderIds;
$this->skip = $skipIds;
$this->parents = $parents;
}

View File

@@ -18,7 +18,7 @@ class TestGenericChunkedXHTML extends Package_Generic_ChunkedXHTML {
parent::update($event, $value);
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
break;
//No verbose
}
@@ -32,7 +32,7 @@ class TestGenericChunkedXHTML extends Package_Generic_ChunkedXHTML {
$content .= stream_get_contents($fp);
if ($id === "") {
$filename = $this->config->xml_file;
$filename = $this->config->xmlFile;
}
echo "Filename: " . basename($filename) . "\n";

View File

@@ -18,7 +18,7 @@ class TestPHPChunkedXHTML extends Package_PHP_ChunkedXHTML {
parent::update($event, $value);
break;
case Render::INIT:
$this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/');
$this->setOutputDir($this->config->outputDir . strtolower($this->getFormatName()) . '/');
break;
//No verbose
}
@@ -32,7 +32,7 @@ class TestPHPChunkedXHTML extends Package_PHP_ChunkedXHTML {
$content .= stream_get_contents($fp);
if ($id === "") {
$filename = $this->config->xml_file;
$filename = $this->config->xmlFile;
}
echo "Filename: " . basename($filename) . "\n";

View File

@@ -11,11 +11,11 @@ class TestRender extends Render {
public function run() {
if ($this->index && $this->config->requiresIndexing()) {
if (!file_exists($this->config->output_dir)) {
mkdir($this->config->output_dir, 0755);
if (!file_exists($this->config->outputDir)) {
mkdir($this->config->outputDir, 0755);
}
$this->attach($this->index);
$this->reader->open($this->config->xml_file);
$this->reader->open($this->config->xmlFile);
$this->execute($this->reader);
$this->detach($this->index);
}
@@ -25,7 +25,7 @@ class TestRender extends Render {
}
if (count($this) > 0) {
$this->reader->open($this->config->xml_file);
$this->reader->open($this->config->xmlFile);
$this->execute($this->reader);
}
}

View File

@@ -41,38 +41,38 @@ $commandLineOptions = $optionsParser->getopt();
$config->init($commandLineOptions);
if (isset($commandLineOptions["package_dirs"])) {
Autoloader::setPackageDirs($config->package_dirs);
if (isset($commandLineOptions["packageDirs"])) {
Autoloader::setPackageDirs($config->packageDirs);
}
/* If no docbook file was passed, die */
if (!is_dir($config->xml_root) || !is_file($config->xml_file)) {
if (!is_dir($config->xmlRoot) || !is_file($config->xmlFile)) {
trigger_error("No Docbook file given. Specify it on the command line with --docbook.", E_USER_ERROR);
}
if (!file_exists($config->output_dir)) {
if (!file_exists($config->outputDir)) {
$outputHandler->v("Creating output directory..", VERBOSE_MESSAGES);
if (!mkdir($config->output_dir, 0777, True)) {
trigger_error(vsprintf("Can't create output directory : %s", [$config->output_dir]), E_USER_ERROR);
if (!mkdir($config->outputDir, 0777, True)) {
trigger_error(vsprintf("Can't create output directory : %s", [$config->outputDir]), E_USER_ERROR);
}
$outputHandler->v("Output directory created", VERBOSE_MESSAGES);
} elseif (!is_dir($config->output_dir)) {
} elseif (!is_dir($config->outputDir)) {
trigger_error("Output directory is not a file?", E_USER_ERROR);
}
// This needs to be moved. Preferably into the PHP package.
if (!$conf) {
$config->init(array(
"lang_dir" => __INSTALLDIR__ . DIRECTORY_SEPARATOR . "phpdotnet" . DIRECTORY_SEPARATOR
"langDir" => __INSTALLDIR__ . DIRECTORY_SEPARATOR . "phpdotnet" . DIRECTORY_SEPARATOR
. "phd" . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR
. "langs" . DIRECTORY_SEPARATOR,
"phpweb_version_filename" => $config->xml_root . DIRECTORY_SEPARATOR . 'version.xml',
"phpweb_acronym_filename" => $config->xml_root . DIRECTORY_SEPARATOR . 'entities' . DIRECTORY_SEPARATOR . 'acronyms.xml',
"phpweb_sources_filename" => $config->xml_root . DIRECTORY_SEPARATOR . 'sources.xml',
"phpweb_history_filename" => $config->xml_root . DIRECTORY_SEPARATOR . 'fileModHistory.php',
"phpwebVersionFilename" => $config->xmlRoot . DIRECTORY_SEPARATOR . 'version.xml',
"phpwebAcronymFilename" => $config->xmlRoot . DIRECTORY_SEPARATOR . 'entities' . DIRECTORY_SEPARATOR . 'acronyms.xml',
"phpwebSourcesFilename" => $config->xmlRoot . DIRECTORY_SEPARATOR . 'sources.xml',
"phpwebHistoryFilename" => $config->xmlRoot . DIRECTORY_SEPARATOR . 'fileModHistory.php',
));
}
if ($config->saveconfig) {
if ($config->saveConfig) {
$outputHandler->v("Writing the config file", VERBOSE_MESSAGES);
file_put_contents("phd.config.php", "<?php\nreturn " . var_export($config->getAllFiltered(), 1) . ";");
}
@@ -83,19 +83,19 @@ if ($config->quit) {
function make_reader(Config $config, OutputHandler $outputHandler) {
//Partial Rendering
$idlist = $config->render_ids + $config->skip_ids;
$idlist = $config->renderIds + $config->skipIds;
if (!empty($idlist)) {
$outputHandler->v("Running partial build", VERBOSE_RENDER_STYLE);
$parents = [];
if ($config->indexcache) {
$parents = $config->indexcache->getParents($config->render_ids);
if ($config->indexCache) {
$parents = $config->indexCache->getParents($config->renderIds);
}
$reader = new Reader_Partial(
$outputHandler,
$config->render_ids,
$config->skip_ids,
$config->renderIds,
$config->skipIds,
$parents,
);
} else {
@@ -109,34 +109,34 @@ $render = new Render();
// Set reader LIBXML options
$readerOpts = LIBXML_PARSEHUGE;
if ($config->process_xincludes) {
if ($config->processXincludes) {
$readerOpts |= LIBXML_XINCLUDE;
}
// Setup indexing database
if ($config->memoryindex) {
if ($config->memoryIndex) {
$db = new \SQLite3(":memory:");
$initializeDb = true;
} else {
$initializeDb = !file_exists($config->output_dir . 'index.sqlite');
$db = new \SQLite3($config->output_dir . 'index.sqlite');
$initializeDb = !file_exists($config->outputDir . 'index.sqlite');
$db = new \SQLite3($config->outputDir . 'index.sqlite');
}
$indexRepository = new IndexRepository($db);
if ($initializeDb) {
$indexRepository->init();
}
$config->indexcache = $indexRepository;
$config->indexCache = $indexRepository;
// Indexing
if ($config->requiresIndexing()) {
$outputHandler->v("Indexing...", VERBOSE_INDEXING);
// Create indexer
$format = new Index($config->indexcache, $config, $outputHandler);
$format = new Index($config->indexCache, $config, $outputHandler);
$render->attach($format);
$reader = make_reader($config, $outputHandler);
$reader->open($config->xml_file, NULL, $readerOpts);
$reader->open($config->xmlFile, NULL, $readerOpts);
$render->execute($reader);
$render->detach($format);
@@ -150,19 +150,19 @@ foreach($config->package as $package) {
$factory = Format_Factory::createFactory($package);
// Default to all output formats specified by the package
if (count($config->output_format) == 0) {
$config->output_format = $factory->getOutputFormats();
if (count($config->outputFormat) == 0) {
$config->outputFormat = $factory->getOutputFormats();
}
// Register the formats
foreach ($config->output_format as $format) {
foreach ($config->outputFormat as $format) {
$render->attach($factory->createFormat($format, $config, $outputHandler));
}
}
// Render formats
$reader = make_reader($config, $outputHandler);
$reader->open($config->xml_file, NULL, $readerOpts);
$reader->open($config->xmlFile, NULL, $readerOpts);
foreach($render as $format) {
$format->notify(Render::VERBOSE, true);
}

View File

@@ -6,14 +6,14 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/setup.php";
$xml_file = __DIR__ . "/data/bug_GH-87.xml";
$xmlFile = __DIR__ . "/data/bug_GH-87.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$config->indexcache = $indexRepository;
$config->indexCache = $indexRepository;
$index = new TestIndex($indexRepository, $config, $outputHandler);

View File

@@ -6,16 +6,16 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/setup.php";
$xml_file = __DIR__ . "/data/bug_doc-en_GH-3353.xml";
$xmlFile = __DIR__ . "/data/bug_doc-en_GH-3353.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$render = new Render();
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$config->indexcache = $indexRepository;
$config->indexCache = $indexRepository;
// Indexing
@@ -23,7 +23,7 @@ $index = new TestIndex($indexRepository, $config, $outputHandler);
$render->attach($index);
$reader = new Reader($outputHandler);
$reader->open($config->xml_file, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$reader->open($config->xmlFile, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$render->execute($reader);
$render->detach($index);
@@ -34,7 +34,7 @@ $format = new TestPHPChunkedXHTML($config, $outputHandler);
$render->attach($format);
$reader = new Reader($outputHandler);
$reader->open($config->xml_file, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$reader->open($config->xmlFile, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE);
$render->execute($reader);
?>

View File

@@ -6,14 +6,14 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/setup.php";
$xml_file = __DIR__ . "/data/example_numbering_001.xml";
$xmlFile = __DIR__ . "/data/example_numbering_001.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$config->indexcache = $indexRepository;
$config->indexCache = $indexRepository;
$index = new TestIndex($indexRepository, $config, $outputHandler);

View File

@@ -6,14 +6,14 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/setup.php";
$xml_file = __DIR__ . "/data/example_numbering_001.xml";
$xmlFile = __DIR__ . "/data/example_numbering_001.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();
$config->indexcache = $indexRepository;
$config->indexCache = $indexRepository;
$index = new TestIndex($indexRepository, $config, $outputHandler);

View File

@@ -6,10 +6,10 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../setup.php";
$xml_file = __DIR__ . "/data/bug_GH-98.xml";
$xmlFile = __DIR__ . "/data/bug_GH-98.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();

View File

@@ -6,10 +6,10 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../setup.php";
$xml_file = __DIR__ . "/data/indexing_001.xml";
$xmlFile = __DIR__ . "/data/indexing_001.xml";
$config->force_index = true;
$config->xml_file = $xml_file;
$config->forceIndex = true;
$config->xmlFile = $xmlFile;
$indexRepository = new IndexRepository(new \SQLite3(":memory:"));
$indexRepository->init();

View File

@@ -27,31 +27,31 @@ var_dump($commandLineOptions);
?>
--EXPECTF--
array(20) {
["output_format"]=>
["outputFormat"]=>
array(1) {
[0]=>
string(5) "xhtml"
}
["no_index"]=>
["noIndex"]=>
bool(true)
["force_index"]=>
["forceIndex"]=>
bool(true)
["no_toc"]=>
["noToc"]=>
bool(true)
["xml_root"]=>
["xmlRoot"]=>
string(13) "tests/options"
["xml_file"]=>
["xmlFile"]=>
string(38) "tests/options/default_handler_009.phpt"
["output_dir"]=>
["outputDir"]=>
string(14) "tests/options/"
["output_filename"]=>
["outputFilename"]=>
string(23) "default_handler_009.xml"
["render_ids"]=>
["renderIds"]=>
array(1) {
["bookId"]=>
bool(true)
}
["skip_ids"]=>
["skipIds"]=>
array(1) {
["idToSkip"]=>
bool(true)
@@ -60,7 +60,7 @@ array(20) {
int(%d)
["language"]=>
string(2) "en"
["color_output"]=>
["colorOutput"]=>
bool(true)
["highlighter"]=>
string(11) "highlighter"
@@ -74,13 +74,13 @@ array(20) {
[0]=>
string(8) "some.css"
}
["process_xincludes"]=>
["processXincludes"]=>
bool(true)
["ext"]=>
string(5) ".html"
["memoryindex"]=>
["memoryIndex"]=>
bool(true)
["package_dirs"]=>
["packageDirs"]=>
array(2) {
[0]=>
string(%d) "%s"

View File

@@ -27,31 +27,31 @@ var_dump($commandLineOptions);
?>
--EXPECTF--
array(20) {
["output_format"]=>
["outputFormat"]=>
array(1) {
[0]=>
string(5) "xhtml"
}
["no_index"]=>
["noIndex"]=>
bool(true)
["force_index"]=>
["forceIndex"]=>
bool(true)
["no_toc"]=>
["noToc"]=>
bool(true)
["xml_root"]=>
["xmlRoot"]=>
string(13) "tests/options"
["xml_file"]=>
["xmlFile"]=>
string(38) "tests/options/default_handler_009.phpt"
["output_dir"]=>
["outputDir"]=>
string(14) "tests/options/"
["output_filename"]=>
["outputFilename"]=>
string(23) "default_handler_009.xml"
["render_ids"]=>
["renderIds"]=>
array(1) {
["bookId"]=>
bool(true)
}
["skip_ids"]=>
["skipIds"]=>
array(1) {
["idToSkip"]=>
bool(true)
@@ -60,7 +60,7 @@ array(20) {
int(%d)
["language"]=>
string(2) "en"
["color_output"]=>
["colorOutput"]=>
bool(true)
["highlighter"]=>
string(11) "highlighter"
@@ -74,13 +74,13 @@ array(20) {
[0]=>
string(8) "some.css"
}
["process_xincludes"]=>
["processXincludes"]=>
bool(true)
["ext"]=>
string(5) ".html"
["memoryindex"]=>
["memoryIndex"]=>
bool(true)
["package_dirs"]=>
["packageDirs"]=>
array(2) {
[0]=>
string(%d) "%s"

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/001-1.xml";
$xmlFile = __DIR__ . "/data/001-1.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/002.xml";
$xmlFile = __DIR__ . "/data/002.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/003.xml";
$xmlFile = __DIR__ . "/data/003.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/attribute_formatting_001.xml";
$xmlFile = __DIR__ . "/data/attribute_formatting_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/attribute_formatting_002.xml";
$xmlFile = __DIR__ . "/data/attribute_formatting_002.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);

View File

@@ -6,11 +6,11 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/attribute_formatting_003.xml";
$xmlFile = __DIR__ . "/data/attribute_formatting_003.xml";
$config = new Config;
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/caption_001.xml";
$xmlFile = __DIR__ . "/data/caption_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$format->postConstruct();

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/simplelist.xml";
$xmlFile = __DIR__ . "/data/simplelist.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/whitespace_formatting_001.xml";
$xmlFile = __DIR__ . "/data/whitespace_formatting_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestGenericChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/bug49101-1.xml";
$xmlFile = __DIR__ . "/data/bug49101-1.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/bug49101-1.xml";
$xmlFile = __DIR__ . "/data/bug49101-1.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPBigXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/bug49102-1.xml";
$xmlFile = __DIR__ . "/data/bug49102-1.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/bug_doc-en_GH-3197.xml";
$xmlFile = __DIR__ . "/data/bug_doc-en_GH-3197.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/class_rendering_001.xml";
$xmlFile = __DIR__ . "/data/class_rendering_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/class_rendering_002.xml";
$xmlFile = __DIR__ . "/data/class_rendering_002.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_filePhpdoc = __DIR__ . "/data/class_rendering_001.xml";
$xmlFilePhpdoc = __DIR__ . "/data/class_rendering_001.xml";
$config->xml_file = $xml_filePhpdoc;
$config->xmlFile = $xmlFilePhpdoc;
$formatPhpdoc = new TestPHPChunkedXHTML($config, $outputHandler);
$renderPhpdoc = new TestRender(new Reader($outputHandler), $config, $formatPhpdoc);
@@ -18,9 +18,9 @@ $renderPhpdoc->run();
$phpdocOutput = ob_get_clean();
$xml_fileReferenceWithRole = __DIR__ . "/data/class_rendering_002.xml";
$xmlFileReferenceWithRole = __DIR__ . "/data/class_rendering_002.xml";
$config->xml_file = $xml_fileReferenceWithRole;
$config->xmlFile = $xmlFileReferenceWithRole;
$formatReferenceWithRole = new TestPHPChunkedXHTML($config, $outputHandler);
$renderReferenceWithRole = new TestRender(new Reader($outputHandler), $config, $formatReferenceWithRole);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/constant_links.xml";
$xmlFile = __DIR__ . "/data/constant_links.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$indices = [
[

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/exception_rendering_001.xml";
$xmlFile = __DIR__ . "/data/exception_rendering_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/exception_rendering_002.xml";
$xmlFile = __DIR__ . "/data/exception_rendering_002.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_filePhpdoc = __DIR__ . "/data/exception_rendering_001.xml";
$xmlFilePhpdoc = __DIR__ . "/data/exception_rendering_001.xml";
$config->xml_file = $xml_filePhpdoc;
$config->xmlFile = $xmlFilePhpdoc;
$formatPhpdoc = new TestPHPChunkedXHTML($config, $outputHandler);
$renderPhpdoc = new TestRender(new Reader($outputHandler), $config, $formatPhpdoc);
@@ -18,9 +18,9 @@ $renderPhpdoc->run();
$phpdocOutput = ob_get_clean();
$xml_fileReferenceWithRole = __DIR__ . "/data/exception_rendering_002.xml";
$xmlFileReferenceWithRole = __DIR__ . "/data/exception_rendering_002.xml";
$config->xml_file = $xml_fileReferenceWithRole;
$config->xmlFile = $xmlFileReferenceWithRole;
$formatReferenceWithRole = new TestPHPChunkedXHTML($config, $outputHandler);
$renderReferenceWithRole = new TestRender(new Reader($outputHandler), $config, $formatReferenceWithRole);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/faq001.xml";
$xmlFile = __DIR__ . "/data/faq001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/type_rendering_methodsynopsis_return_types.xml";
$xmlFile = __DIR__ . "/data/type_rendering_methodsynopsis_return_types.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/type_rendering_methodsynopsis_parameters.xml";
$xmlFile = __DIR__ . "/data/type_rendering_methodsynopsis_parameters.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml";
$xmlFile = __DIR__ . "/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -6,9 +6,9 @@ namespace phpdotnet\phd;
require_once __DIR__ . "/../../setup.php";
$xml_file = __DIR__ . "/data/variablelist_rendering_001.xml";
$xmlFile = __DIR__ . "/data/variablelist_rendering_001.xml";
$config->xml_file = $xml_file;
$config->xmlFile = $xmlFile;
$format = new TestPHPChunkedXHTML($config, $outputHandler);
$render = new TestRender(new Reader($outputHandler), $config, $format);

View File

@@ -17,7 +17,7 @@ error_reporting($olderrrep | VERBOSE_DEFAULT);
set_error_handler($errorHandler->handleError(...));
$config->init([]);
$config->lang_dir = __INSTALLDIR__ . DIRECTORY_SEPARATOR
$config->langDir = __INSTALLDIR__ . DIRECTORY_SEPARATOR
. "phpdotnet" . DIRECTORY_SEPARATOR . "phd" . DIRECTORY_SEPARATOR
. "data" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR;
$config->package_dirs = [__INSTALLDIR__];
$config->packageDirs = [__INSTALLDIR__];