From 4e0c6c654297a3f6f6678791706d48ebef37d5cf Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:38:54 +0100 Subject: [PATCH 01/10] Convert array to properties --- phpdotnet/phd/Config.php | 88 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 5bba0468..972a45d5 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -5,49 +5,51 @@ class Config { const VERSION = '@phd_version@'; - private static $optionArrayDefault = array( - 'output_format' => array(), - 'no_index' => false, - 'force_index' => false, - 'no_toc' => false, - 'xml_root' => '.', - 'xml_file' => './.manual.xml', - 'history_file' => './fileModHistory.php', - 'lang_dir' => './', - 'language' => 'en', - 'fallback_language' => 'en', - 'verbose' => VERBOSE_DEFAULT, - 'date_format' => 'H:i:s', - 'render_ids' => array( - ), - 'skip_ids' => array( - ), - 'color_output' => true, - 'output_dir' => './output/', - 'output_filename' => '', - 'php_error_output' => STDERR, - 'php_error_color' => '01;31', // Red - 'user_error_output' => STDERR, - 'user_error_color' => '01;33', // Yellow - 'phd_info_output' => STDOUT, - 'phd_info_color' => '01;32', // Green - 'phd_warning_output' => STDOUT, - 'phd_warning_color' => '01;35', // Magenta - 'highlighter' => 'phpdotnet\\phd\\Highlighter', - 'package' => array( - 'Generic', - ), - 'css' => array(), - 'process_xincludes' => false, - 'ext' => null, - 'package_dirs' => array(__INSTALLDIR__), - 'saveconfig' => false, - 'quit' => false, - 'indexcache' => '', - 'memoryindex' => '', - ); - - private static $optionArray = null; + /** @var array */ + 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 string $language = 'en'; + public string $fallback_language = 'en'; + public int $verbose = VERBOSE_DEFAULT; + public string $date_format = 'H:i:s'; + /** @var array */ + public array $render_ids = []; + /** @var array */ + public array $skip_ids = []; + private bool $color_output = true; + public string $output_dir = './output/'; + public string $output_filename = ''; + /** @var resource */ + public $php_error_output = \STDERR; + public string $php_error_color = '01;31'; // Red + /** @var resource */ + public $user_error_output = \STDERR; + public string $user_error_color = '01;33'; // Yellow + /** @var resource */ + public $phd_info_output = \STDOUT; + public string $phd_info_color = '01;32'; // Green + /** @var resource */ + public $phd_warning_output = \STDOUT; + public string $phd_warning_color = '01;35'; // Magenta + public string $highlighter = 'phpdotnet\\phd\\Highlighter'; + /** @var array */ + public array $package =['Generic']; + /** @var array $css */ + public array $css = []; + public bool $process_xincludes = false; + public ?string $ext = null; + /** @var array */ + public array $package_dirs = [__INSTALLDIR__]; + public bool $saveconfig = false; + public bool $quit = false; + public ?IndexRepository $indexcache = null; + public bool $memoryindex = false; public static function init(array $a) { // Override any defaults due to operating system constraints From b3aac50225da6d09a966de73249afe79f0ea29cb Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:41:36 +0100 Subject: [PATCH 02/10] Replace method calls with property access Remove methods mapping method calls to property access --- phpdotnet/phd/Config.php | 90 ++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 60 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 972a45d5..e055e649 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -100,50 +100,18 @@ public static function exportable($val) { } return $val; } + /** - * Maps static function calls to config option setter/getters. - * - * To set an option, call "Config::setOptionname($value)". - * To retrieve an option, call "Config::optionname()". - * - * It is also possible, but deprecated, to call - * "Config::set_optionname($value)". - * - * @param string $name Name of called function - * @param array $params Array of function parameters - * - * @return mixed Config value that was requested or set. + * Returns the list of supported formats from the package directories set + * + * @return array */ - public static function __callStatic($name, $params) - { - $name = strtolower($name); // FC if this becomes case-sensitive - - if (strncmp($name, 'set', 3) === 0) { - $name = substr($name, 3); - if ($name[0] === '_') { - $name = substr($name, 1); - } - if (strlen($name) < 1 || count($params) !== 1) { // assert - trigger_error('Misuse of config option setter', E_USER_ERROR); - } - self::$optionArray[$name] = $params[0]; - // no return, intentional - } - return isset(self::$optionArray[$name]) - ? self::$optionArray[$name] - : NULL; - } - - public function __call($name, $params) { - return self::__callStatic($name, $params); - } - - public static function getSupportedPackages() { - $packageList = array(); - foreach(Config::package_dirs() as $dir) { - foreach (glob($dir . "/phpdotnet/phd/Package/*", GLOB_ONLYDIR) as $item) { - $baseitem = basename($item); - if ($baseitem[0] != '.') { + public function getSupportedPackages(): array { + $packageList = []; + foreach($this->package_dirs as $dir) { + foreach (\glob($dir . "/phpdotnet/phd/Package/*", \GLOB_ONLYDIR) as $item) { + $baseitem = \basename($item); + if ($baseitem[0] !== '.') { $packageList[] = $baseitem; } } @@ -151,24 +119,26 @@ public static function getSupportedPackages() { return $packageList; } - public static function setColor_output($color_output) - { + /** + * Enables/disables color output on the terminal + */ + public function setColor_output(bool $color_output): void { // Disable colored output if the terminal doesn't support colors if ($color_output && function_exists('posix_isatty')) { - if (!posix_isatty(Config::phd_info_output())) { - Config::setPhd_info_color(false); + if (!posix_isatty($this->phd_info_output)) { + $this->phd_info_color = false; } - if (!posix_isatty(Config::phd_warning_output())) { - Config::setPhd_warning_color(false); + if (!posix_isatty($this->phd_warning_output)) { + $this->phd_warning_color = false; } - if (!posix_isatty(Config::php_error_output())) { - Config::setPhd_error_color(false); + if (!posix_isatty($this->php_error_output)) { + $this->php_error_color = false; } - if (!posix_isatty(Config::user_error_output())) { - Config::setUser_error_color(false); + if (!posix_isatty($this->user_error_output)) { + $this->user_error_color = false; } } - self::$optionArray['color_output'] = $color_output; + $this->color_output = $color_output; } public static function set_color_output() @@ -194,27 +164,27 @@ public static function copyright() { * @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->output_dir . 'index.sqlite'; if (!\file_exists($indexfile)) { return true; } } - if ($this->no_index()) { + if ($this->no_index) { return false; } - if ($this->force_index()) { + if ($this->force_index) { 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->xml_file); + if ($this->indexcache->getIndexingTime() > $xmlLastModification) { return false; } return true; From 9b92d471b2ac52be3dd384a30059a1e8a4e126de Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:43:36 +0100 Subject: [PATCH 03/10] Refactor methods mass getting and setting options Remove superfluous exportable() method --- phpdotnet/phd/Config.php | 64 +++++++++++++--------------------------- 1 file changed, 20 insertions(+), 44 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index e055e649..1cf34e0b 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -51,54 +51,30 @@ class Config public ?IndexRepository $indexcache = null; public bool $memoryindex = false; - public static function init(array $a) { - // Override any defaults due to operating system constraints - // and copy defaults to working optionArray - if ($newInit = is_null(self::$optionArray)) { - - // By default, Windows does not support colors on the console. - // ANSICON by Jason Hood (http://adoxa.110mb.com/ansicon/index.html) - // can be used to provide colors at the console on Windows. - // Color output can still be enabled via the command line parameters --color - if('WIN' === strtoupper(substr(PHP_OS, 0, 3))) { - self::$optionArrayDefault['color_output'] = false; + /** + * Sets one or more configuration options from an array + * + * @param array + */ + public function init(array $configOptions): void { + foreach ($configOptions as $option => $value) { + if (! \property_exists($this, $option)) { + throw new \Exception("Invalid option supplied: $option"); } - - self::$optionArray = self::$optionArrayDefault; - } - - // now merge other options - self::$optionArray = array_merge(self::$optionArray, (array)$a); - - if ($newInit) { - // Always set saveconfig to false for a new initialization, even after restoring - // a save configuration. This allows additional options to be added at the - // command line without them being automatically saved. - self::$optionArray['saveconfig'] = false; - - // As well as the quit option. - self::$optionArray['quit'] = false; - - // Set the error reporting level to the restored level. - error_reporting($GLOBALS['olderrrep'] | self::$optionArray['verbose']); + + $this->$option = $value; } + + \error_reporting($GLOBALS['olderrrep'] | $this->verbose); } - public static function getAllFiltered() { - $retval = self::$optionArray; - return self::exportable($retval); - } - public static function exportable($val) { - foreach($val as $k => &$opt) { - if (is_array($opt)) { - $opt = self::exportable($opt); - continue; - } - if (is_resource($opt)) { - unset($val[$k]); - } - } - return $val; + /** + * Returns all configuration options and their values + * + * @return array + */ + public function getAllFiltered(): array { + return \get_object_vars($this); } /** From 3b7843e5bc15398308d27fe2e74108ffc4e5a531 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:46:05 +0100 Subject: [PATCH 04/10] Fix color output related methods Add getter for color output Remove superfluous set_color_output() method Add code related to color output on windows to the constructor --- phpdotnet/phd/Config.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 1cf34e0b..0dac454d 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -51,6 +51,12 @@ class Config public ?IndexRepository $indexcache = null; public bool $memoryindex = false; + public function __construct() { + if('WIN' === \strtoupper(\substr(\PHP_OS, 0, 3))) { + $this->color_output = false; + } + } + /** * Sets one or more configuration options from an array * @@ -95,6 +101,13 @@ public function getSupportedPackages(): array { return $packageList; } + /** + * Returns whether terminal output supports colors + */ + public function getColor_output(): bool { + return $this->color_output; + } + /** * Enables/disables color output on the terminal */ @@ -117,11 +130,6 @@ public function setColor_output(bool $color_output): void { $this->color_output = $color_output; } - public static function set_color_output() - { - trigger_error('Use setColor_output()', E_USER_DEPRECATED); - } - public static function copyright() { return sprintf('Copyright(c) 2007-%s The PHP Documentation Group', date('Y')); } From da20c56c8feef187aacd813574ab3e632ac85a23 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:47:23 +0100 Subject: [PATCH 05/10] Refactor copyright Make copyright a readonly property that is initialized in the constructor Remove copyright() method --- phpdotnet/phd/Config.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 0dac454d..26f4e880 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -4,6 +4,7 @@ class Config { const VERSION = '@phd_version@'; + public readonly string $copyright; /** @var array */ public array $output_format = []; @@ -52,6 +53,8 @@ class Config public bool $memoryindex = false; 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; } @@ -130,10 +133,6 @@ public function setColor_output(bool $color_output): void { $this->color_output = $color_output; } - public static function copyright() { - return sprintf('Copyright(c) 2007-%s The PHP Documentation Group', date('Y')); - } - /** * Checks if indexing is needed. * From 496ef48e73fc62d9331b492e8b4012b4f28c998c Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:49:36 +0100 Subject: [PATCH 06/10] Add PHP format related properties --- phpdotnet/phd/Config.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 26f4e880..2399884d 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -52,6 +52,11 @@ class Config 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 function __construct() { $this->copyright = 'Copyright(c) 2007-' . \date('Y') . ' The PHP Documentation Group'; From 297cd32818db6e92684f6208fc5c24209d26a584 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:50:45 +0100 Subject: [PATCH 07/10] Make constant explicitly public --- phpdotnet/phd/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 2399884d..4a49b2da 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -3,7 +3,7 @@ class Config { - const VERSION = '@phd_version@'; + public const VERSION = '@phd_version@'; public readonly string $copyright; /** @var array */ From aa6ba6552fe8e4e1748ac4d68d9695b739ee57c3 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:53:13 +0100 Subject: [PATCH 08/10] Replace method calls with property access --- phpdotnet/phd/Format.php | 14 ++--- phpdotnet/phd/Format/Abstract/XHTML.php | 4 +- phpdotnet/phd/Options/Handler.php | 30 +++++----- phpdotnet/phd/OutputHandler.php | 20 +++---- phpdotnet/phd/Package/Generic/BigXHTML.php | 8 +-- .../phd/Package/Generic/ChunkedXHTML.php | 6 +- phpdotnet/phd/Package/Generic/Manpage.php | 4 +- phpdotnet/phd/Package/Generic/PDF.php | 4 +- phpdotnet/phd/Package/Generic/TocFeed.php | 6 +- phpdotnet/phd/Package/Generic/XHTML.php | 8 +-- phpdotnet/phd/Package/IDE/Base.php | 6 +- phpdotnet/phd/Package/IDE/Funclist.php | 4 +- phpdotnet/phd/Package/IDE/JSON.php | 2 +- phpdotnet/phd/Package/IDE/PHP.php | 2 +- phpdotnet/phd/Package/IDE/PHPStub.php | 2 +- phpdotnet/phd/Package/IDE/SQLite.php | 4 +- phpdotnet/phd/Package/IDE/XML.php | 2 +- phpdotnet/phd/Package/PEAR/BigXHTML.php | 10 ++-- phpdotnet/phd/Package/PEAR/CHM.php | 8 +-- phpdotnet/phd/Package/PEAR/ChunkedXHTML.php | 6 +- phpdotnet/phd/Package/PEAR/TocFeed.php | 2 +- phpdotnet/phd/Package/PEAR/Web.php | 2 +- phpdotnet/phd/Package/PHP/BigPDF.php | 6 +- phpdotnet/phd/Package/PHP/BigXHTML.php | 8 +-- phpdotnet/phd/Package/PHP/CHM.php | 12 ++-- phpdotnet/phd/Package/PHP/ChunkedXHTML.php | 2 +- phpdotnet/phd/Package/PHP/Epub.php | 4 +- phpdotnet/phd/Package/PHP/HowTo.php | 2 +- phpdotnet/phd/Package/PHP/KDevelop.php | 4 +- phpdotnet/phd/Package/PHP/PDF.php | 2 +- phpdotnet/phd/Package/PHP/TocFeed.php | 2 +- phpdotnet/phd/Package/PHP/Web.php | 16 ++--- phpdotnet/phd/Package/PHP/XHTML.php | 12 ++-- phpdotnet/phd/TestGenericChunkedXHTML.php | 4 +- phpdotnet/phd/TestPHPChunkedXHTML.php | 4 +- phpdotnet/phd/TestRender.php | 8 +-- render.php | 58 +++++++++---------- 37 files changed, 149 insertions(+), 149 deletions(-) diff --git a/phpdotnet/phd/Format.php b/phpdotnet/phd/Format.php index 1375138f..31ee7885 100644 --- a/phpdotnet/phd/Format.php +++ b/phpdotnet/phd/Format.php @@ -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(); } @@ -331,19 +331,19 @@ final public function parse($xml) { final public function autogen($text, $lang = null) { if ($lang == NULL) { - $lang = $this->config->language(); + $lang = $this->config->language; } if (isset($this->autogen[$lang])) { if (isset($this->autogen[$lang][$text])) { return $this->autogen[$lang][$text]; } - if ($lang == $this->config->fallback_language()) { + if ($lang == $this->config->fallback_language) { throw new \InvalidArgumentException("Cannot autogenerate text for '$text'"); } - return $this->autogen($text, $this->config->fallback_language()); + return $this->autogen($text, $this->config->fallback_language); } - $filename = $this->config->lang_dir() . $lang . ".ini"; + $filename = $this->config->lang_dir . $lang . ".ini"; if (!file_exists($filename) && strncmp(basename($filename), 'doc-', 4) === 0) { $filename = dirname($filename) . DIRECTORY_SEPARATOR . substr(basename($filename), 4); @@ -517,7 +517,7 @@ public function rowspan($attrs) { public function highlight($text, $role = 'php', $format = 'xhtml') { if (!isset(self::$highlighters[$format])) { - $class = $this->config->highlighter(); + $class = $this->config->highlighter; self::$highlighters[$format] = $class::factory($format); } diff --git a/phpdotnet/phd/Format/Abstract/XHTML.php b/phpdotnet/phd/Format/Abstract/XHTML.php index d07f13ce..37ba455f 100644 --- a/phpdotnet/phd/Format/Abstract/XHTML.php +++ b/phpdotnet/phd/Format/Abstract/XHTML.php @@ -71,12 +71,12 @@ public function CDATA($value) { * @return void */ public function postConstruct() { - $this->mediamanager = new MediaManager($this->config->xml_root()); + $this->mediamanager = new MediaManager($this->config->xml_root); $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->output_dir . '/' . strtolower($this->getFormatName()) . '-data/'; $this->mediamanager->relative_ref_path = basename($this->mediamanager->output_dir) . '/'; } } diff --git a/phpdotnet/phd/Options/Handler.php b/phpdotnet/phd/Options/Handler.php index 48bf0d0c..0d68ee8e 100644 --- a/phpdotnet/phd/Options/Handler.php +++ b/phpdotnet/phd/Options/Handler.php @@ -257,7 +257,7 @@ public function option_p(string $k, mixed $v): array */ public function option_partial(string $k, mixed $v): array { - $render_ids = $this->config->render_ids(); + $render_ids = $this->config->render_ids; foreach((array)$v as $val) { $recursive = true; if (strpos($val, "=") !== false) { @@ -319,7 +319,7 @@ public function option_s(string $k, mixed $v): array */ public function option_skip(string $k, mixed $v): array { - $skip_ids = $this->config->skip_ids(); + $skip_ids = $this->config->skip_ids; foreach((array)$v as $val) { $recursive = true; if (strpos($val, "=") !== false) { @@ -474,7 +474,7 @@ public function option_k(string $k, mixed $v): array */ public function option_packagedir(string $k, mixed $v): array { - $packages = $this->config->package_dirs(); + $packages = $this->config->package_dirs; foreach((array)$v as $val) { if ($path = realpath($val)) { if (!in_array($path, $packages)) { @@ -518,7 +518,7 @@ public function option_version(string $k, mixed $v): never $this->outputHandler->printPhdInfo("\t$package: $version"); } $this->outputHandler->printPhdInfo('PHP Version: ' . phpversion()); - $this->outputHandler->printPhdInfo($this->config->copyright()); + $this->outputHandler->printPhdInfo($this->config->copyright); exit(0); } @@ -530,7 +530,7 @@ public function option_h(string $k, mixed $v): never public function option_help(string $k, mixed $v): never { echo "PhD version: " .$this->config::VERSION; - echo "\n" . $this->config->copyright() . "\n + echo "\n" . $this->config->copyright . "\n -v --verbose Adjusts the verbosity level -f @@ -539,21 +539,21 @@ public function option_help(string $k, mixed $v): never --package The package to use -I --noindex Do not index before rendering but load from cache - (default: " . ($this->config->noindex() ? 'true' : 'false') . ") + (default: " . ($this->config->no_index ? '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->forceindex() ? 'true' : 'false') . ") + (default: " . ($this->config->force_index ? 'true' : 'false') . ") -t --notoc Do not rewrite TOC before rendering but load from - cache (default: " . ($this->config->notoc() ? 'true' : 'false') . ") + cache (default: " . ($this->config->no_toc ? 'true' : 'false') . ") -d --docbook The Docbook file to render from -x --xinclude Process XML Inclusions (XInclude) - (default: " . ($this->config->xinclude() ? 'true' : 'false') . ") + (default: " . ($this->config->process_xincludes ? 'true' : 'false') . ") -p --partial The ID to render, optionally skipping its children chunks (default to true; render children) @@ -563,16 +563,16 @@ public function option_help(string $k, mixed $v): never -l --list Print out the supported packages and formats -o - --output The output directory (default: " . $this->config->output_dir() . ") + --output The output directory (default: " . $this->config->output_dir . ") -F filename --outputfilename filename Filename to use when writing standalone formats (default: -.) -L --lang The language of the source file (used by the CHM - theme). (default: " . $this->config->language() . ") + theme). (default: " . $this->config->language . ") -c --color Enable color output when output is to a terminal - (default: " . ($this->config->color_output() ? 'true' : 'false') . ") + (default: " . ($this->config->getColor_output() ? 'true' : 'false') . ") -C --css Link for an external CSS file. -g @@ -585,11 +585,11 @@ public function option_help(string $k, mixed $v): never --ext The alternative filename extension to use, including the dot. Use 'false' for no extension. -S - --saveconfig Save the generated config (default: " . ($this->config->saveconfig() ? 'true' : 'false') . "). + --saveconfig Save the generated config (default: " . ($this->config->saveconfig ? 'true' : 'false') . "). -Q --quit Don't run the build. Use with --saveconfig to - just save the config (default: " . ($this->config->quit() ? 'true' : 'false') . "). + just save the config (default: " . ($this->config->quit ? 'true' : 'false') . "). -k --packagedir Use an external package directory. diff --git a/phpdotnet/phd/OutputHandler.php b/phpdotnet/phd/OutputHandler.php index 0f623076..a7bd0e5d 100644 --- a/phpdotnet/phd/OutputHandler.php +++ b/phpdotnet/phd/OutputHandler.php @@ -31,34 +31,34 @@ public function __construct( * Method to get a color escape sequence */ private function term_color(string $text, string|false $color): string { - return $this->config->color_output() && $color !== false ? "\033[" . $color . "m" . $text . "\033[m" : $text; + return $this->config->getColor_output() && $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->phd_info_color; + $outputStream = $this->config->phd_info_output; 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->phd_warning_color; + $outputStream = $this->config->phd_warning_output; 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->user_error_color; + $outputStream = $this->config->user_error_output; $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->php_error_color; + $outputStream = $this->config->php_error_output; $data = \sprintf("%s:%d\n\t%s", $file, $line, $msg); return $this->print($data, $outputStream, $color, $error); @@ -71,7 +71,7 @@ private function print(string $msg, $outputStream, string|false $color = false, return \fprintf($outputStream, "%s\n", $colorMsg); } - $time = \date($this->config->date_format()); + $time = \date($this->config->date_format); $timestamp = $this->term_color(\sprintf("[%s - %s]", $time, $infoOrErrorString), $color); return \fprintf($outputStream, "%s %s\n", $timestamp, $msg); diff --git a/phpdotnet/phd/Package/Generic/BigXHTML.php b/phpdotnet/phd/Package/Generic/BigXHTML.php index f58447b4..a15076b8 100644 --- a/phpdotnet/phd/Package/Generic/BigXHTML.php +++ b/phpdotnet/phd/Package/Generic/BigXHTML.php @@ -79,15 +79,15 @@ public function update($event, $value = null) { 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->output_dir; + if ($this->config->output_filename) { + $filename .= $this->config->output_filename; } else { $filename .= strtolower($this->getFormatName()) . $this->getExt(); } $this->postConstruct(); - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } $this->setFileStream(fopen($filename, "w+")); diff --git a/phpdotnet/phd/Package/Generic/ChunkedXHTML.php b/phpdotnet/phd/Package/Generic/ChunkedXHTML.php index d0da3395..38ebf741 100644 --- a/phpdotnet/phd/Package/Generic/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/Generic/ChunkedXHTML.php @@ -73,7 +73,7 @@ public function update($event, $value = null) { return; //Don't create output dir when rendering to buffer } - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); $this->postConstruct(); if (file_exists($this->getOutputDir())) { if (!is_dir($this->getOutputDir())) { @@ -84,7 +84,7 @@ public function update($event, $value = null) { trigger_error("Can't create output directory", E_USER_ERROR); } } - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } break; @@ -96,7 +96,7 @@ public function update($event, $value = null) { public function header($id) { $title = $this->getLongDescription($id); - $lang = $this->config->language(); + $lang = $this->config->language; $root = Format::getRootIndex(); static $cssLinks = null; if ($cssLinks === null) { diff --git a/phpdotnet/phd/Package/Generic/Manpage.php b/phpdotnet/phd/Package/Generic/Manpage.php index be5c3d21..b2581577 100644 --- a/phpdotnet/phd/Package/Generic/Manpage.php +++ b/phpdotnet/phd/Package/Generic/Manpage.php @@ -263,7 +263,7 @@ public function __construct( parent::__construct($config, $outputHandler); $this->registerFormatName("Generic Unix Manual Pages"); - $this->setExt($this->config->ext() === null ? ".3.gz" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".3.gz" : $this->config->ext); $this->setChunked(true); $this->cchunk = $this->dchunk; } @@ -312,7 +312,7 @@ public function update($event, $value = null) { break; case Render::INIT: - $this->setOutputDir($this->config->output_dir() . strtolower($this->toValidName($this->getFormatName())) . '/'); + $this->setOutputDir($this->config->output_dir . 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); diff --git a/phpdotnet/phd/Package/Generic/PDF.php b/phpdotnet/phd/Package/Generic/PDF.php index bf58aa06..9088f4b9 100644 --- a/phpdotnet/phd/Package/Generic/PDF.php +++ b/phpdotnet/phd/Package/Generic/PDF.php @@ -301,7 +301,7 @@ public function __construct( OutputHandler $outputHandler ) { parent::__construct($config, $outputHandler); - $this->setExt($this->config->ext() === null ? ".pdf" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".pdf" : $this->config->ext); $this->pdfDoc = new PdfWriter(); } @@ -1132,7 +1132,7 @@ public function format_indice($open, $name, $attrs) { 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->xml_root . DIRECTORY_SEPARATOR . $base . $fileref; if (file_exists($imagePath)) $this->pdfDoc->add(PdfWriter::IMAGE, $imagePath); diff --git a/phpdotnet/phd/Package/Generic/TocFeed.php b/phpdotnet/phd/Package/Generic/TocFeed.php index 3165f934..5888fd16 100644 --- a/phpdotnet/phd/Package/Generic/TocFeed.php +++ b/phpdotnet/phd/Package/Generic/TocFeed.php @@ -139,7 +139,7 @@ public function __construct( $this->registerFormatName($this->formatName); $this->setTitle('Index'); $this->setChunked(true); - $this->setExt($this->config->ext() === null ? ".atom" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".atom" : $this->config->ext); $this->date = date('c'); if ($this->feedBaseUri === null) { $this->feedBaseUri = $this->targetBaseUri; @@ -218,7 +218,7 @@ public function update($event, $value = null) case Render::INIT: $this->setOutputDir( - $this->config->output_dir() + $this->config->output_dir . strtolower($this->getFormatName()) . '/' ); $dir = $this->getOutputDir(); @@ -397,7 +397,7 @@ public function header($id) { $title = htmlspecialchars($this->getLongDescription($id)); $date = $this->date; - $lang = $this->config->language(); + $lang = $this->config->language; $selflink = $this->createLink($id); $htmllink = $this->createTargetLink($id); $author = htmlspecialchars($this->author); diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 9040e21b..73e0cce7 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -553,7 +553,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerPIHandlers($this->pihandlers); - $this->setExt($this->config->ext() === null ? ".html" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".html" : $this->config->ext); } public function getDefaultElementMap() { @@ -651,7 +651,7 @@ protected function createCSSLinks() { protected function fetchStylesheet($name = null) { if (!$this->isChunked()) { - foreach ((array)$this->config->css() as $css) { + foreach ((array)$this->config->css as $css) { if ($style = file_get_contents($css)) { $this->stylesheets[] = $style; } else { @@ -662,7 +662,7 @@ protected function fetchStylesheet($name = null) { } $stylesDir = $this->getOutputDir(); if (!$stylesDir) { - $stylesDir = $this->config->output_dir(); + $stylesDir = $this->config->output_dir; } $stylesDir .= 'styles/'; if (file_exists($stylesDir)) { @@ -674,7 +674,7 @@ protected function fetchStylesheet($name = null) { trigger_error("Can't create the styles/ directory.", E_USER_ERROR); } } - foreach ((array)$this->config->css() as $css) { + foreach ((array)$this->config->css as $css) { $basename = basename($css); $dest = md5(substr($css, 0, -strlen($basename))) . '-' . $basename; if (@copy($css, $stylesDir . $dest)) { diff --git a/phpdotnet/phd/Package/IDE/Base.php b/phpdotnet/phd/Package/IDE/Base.php index 211eb893..adc089c7 100644 --- a/phpdotnet/phd/Package/IDE/Base.php +++ b/phpdotnet/phd/Package/IDE/Base.php @@ -207,15 +207,15 @@ public function versionInfo($funcname) { } 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->phpweb_version_filename)) { + $this->versions = self::generateVersionInfo($this->config->phpweb_version_filename); } 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->output_dir . strtolower($this->getFormatName()) . '/'); if (file_exists($this->getOutputDir())) { if (!is_dir($this->getOutputDir())) { trigger_error("Output directory is a file?", E_USER_ERROR); diff --git a/phpdotnet/phd/Package/IDE/Funclist.php b/phpdotnet/phd/Package/IDE/Funclist.php index 9022f821..9ec5b4f8 100644 --- a/phpdotnet/phd/Package/IDE/Funclist.php +++ b/phpdotnet/phd/Package/IDE/Funclist.php @@ -20,7 +20,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName("IDE-Funclist"); - $this->setExt($this->config->ext() === null ? ".txt" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".txt" : $this->config->ext); } public function createLink($for, &$desc = null, $type = Format::SDESC) {} @@ -42,7 +42,7 @@ public function update($event, $value = null) { $this->registerTextMap($this->textmap); break; case Render::FINALIZE: - $filename = $this->config->output_dir() . strtolower($this->getFormatName()) . $this->getExt(); + $filename = $this->config->output_dir . strtolower($this->getFormatName()) . $this->getExt(); file_put_contents($filename, $this->buffer); break; case Render::VERBOSE: diff --git a/phpdotnet/phd/Package/IDE/JSON.php b/phpdotnet/phd/Package/IDE/JSON.php index a01f9efb..05d0079c 100644 --- a/phpdotnet/phd/Package/IDE/JSON.php +++ b/phpdotnet/phd/Package/IDE/JSON.php @@ -9,7 +9,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('IDE-JSON'); - $this->setExt($this->config->ext() === null ? ".json" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".json" : $this->config->ext); } public function parseFunction() { diff --git a/phpdotnet/phd/Package/IDE/PHP.php b/phpdotnet/phd/Package/IDE/PHP.php index c309956a..bf03e3f6 100644 --- a/phpdotnet/phd/Package/IDE/PHP.php +++ b/phpdotnet/phd/Package/IDE/PHP.php @@ -9,7 +9,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('IDE-PHP'); - $this->setExt($this->config->ext() === null ? ".php" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".php" : $this->config->ext); } public function parseFunction() { diff --git a/phpdotnet/phd/Package/IDE/PHPStub.php b/phpdotnet/phd/Package/IDE/PHPStub.php index 14180613..96d5bc69 100644 --- a/phpdotnet/phd/Package/IDE/PHPStub.php +++ b/phpdotnet/phd/Package/IDE/PHPStub.php @@ -9,7 +9,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('IDE-PHPStub'); - $this->setExt($this->config->ext() === null ? ".php" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".php" : $this->config->ext); } public function parseFunction() { diff --git a/phpdotnet/phd/Package/IDE/SQLite.php b/phpdotnet/phd/Package/IDE/SQLite.php index 3a4e6645..6c8843c2 100644 --- a/phpdotnet/phd/Package/IDE/SQLite.php +++ b/phpdotnet/phd/Package/IDE/SQLite.php @@ -12,7 +12,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('IDE-SQLite'); - $this->setExt($this->config->ext() === null ? ".sqlite" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".sqlite" : $this->config->ext); } public function INIT($value) { @@ -93,7 +93,7 @@ public function parseFunction() { } public function createDatabase() { - $db = new \SQLite3($this->config->output_dir() . strtolower($this->getFormatName()) . $this->getExt()); + $db = new \SQLite3($this->config->output_dir . 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'); diff --git a/phpdotnet/phd/Package/IDE/XML.php b/phpdotnet/phd/Package/IDE/XML.php index badc04c7..a3dab38d 100644 --- a/phpdotnet/phd/Package/IDE/XML.php +++ b/phpdotnet/phd/Package/IDE/XML.php @@ -9,7 +9,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('IDE-XML'); - $this->setExt($this->config->ext() === null ? ".xml" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".xml" : $this->config->ext); } public function parseFunction() { diff --git a/phpdotnet/phd/Package/PEAR/BigXHTML.php b/phpdotnet/phd/Package/PEAR/BigXHTML.php index ed413497..300c2068 100755 --- a/phpdotnet/phd/Package/PEAR/BigXHTML.php +++ b/phpdotnet/phd/Package/PEAR/BigXHTML.php @@ -9,7 +9,7 @@ public function __construct( parent::__construct($config, $outputHandler); $this->registerFormatName("PEAR-BigXHTML"); $this->setTitle("PEAR Manual"); - $this->setExt($this->config->ext() === null ? ".html" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".html" : $this->config->ext); $this->setChunked(false); } @@ -45,9 +45,9 @@ public function close() { } public function createFileName() { - $filename = $this->config->output_dir(); - if ($this->config->output_filename()) { - $filename .= $this->config->output_filename(); + $filename = $this->config->output_dir; + if ($this->config->output_filename) { + $filename .= $this->config->output_filename; } else { $filename .= strtolower($this->getFormatName()) . $this->getExt(); } @@ -97,7 +97,7 @@ public function update($event, $value = null) { case Render::INIT: if ($value) { $this->postConstruct(); - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } $this->createOutputFile(); diff --git a/phpdotnet/phd/Package/PEAR/CHM.php b/phpdotnet/phd/Package/PEAR/CHM.php index 8a924f68..9e30e49b 100755 --- a/phpdotnet/phd/Package/PEAR/CHM.php +++ b/phpdotnet/phd/Package/PEAR/CHM.php @@ -221,16 +221,16 @@ public function update($event, $value = null) { parent::update($event, $value); break; case Render::INIT: - $this->chmdir = $this->config->output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR; + $this->chmdir = $this->config->output_dir . 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->output_dir . 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"); } - $lang = $this->config->language(); + $lang = $this->config->language; $this->hhpStream = fopen($this->chmdir . "pear_manual_{$lang}.hhp", "w"); $this->hhcStream = fopen($this->chmdir . "pear_manual_{$lang}.hhc", "w"); $this->hhkStream = fopen($this->chmdir . "pear_manual_{$lang}.hhk", "w"); @@ -286,7 +286,7 @@ protected static function cleanIndexName($value) } protected function headerChm() { - $lang = $this->config->language(); + $lang = $this->config->language; fwrite($this->hhpStream, '[OPTIONS] Binary TOC=Yes Compatibility=1.1 or later diff --git a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php index 39a247a8..a4c85d90 100755 --- a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php @@ -9,7 +9,7 @@ public function __construct( parent::__construct($config, $outputHandler); $this->registerFormatName("PEAR-Chunked-XHTML"); $this->setTitle("PEAR Manual"); - $this->setExt($this->config->ext() === null ? ".html" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".html" : $this->config->ext); $this->setChunked(true); } @@ -71,7 +71,7 @@ public function update($event, $value = null) { break; case Render::INIT: - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); $this->postConstruct(); if (file_exists($this->getOutputDir())) { if (!is_dir($this->getOutputDir())) { @@ -82,7 +82,7 @@ public function update($event, $value = null) { trigger_error("Can't create output directory", E_USER_ERROR); } } - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } break; diff --git a/phpdotnet/phd/Package/PEAR/TocFeed.php b/phpdotnet/phd/Package/PEAR/TocFeed.php index 9039e806..419deb8b 100644 --- a/phpdotnet/phd/Package/PEAR/TocFeed.php +++ b/phpdotnet/phd/Package/PEAR/TocFeed.php @@ -90,7 +90,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); - $language = $this->config->language(); + $language = $this->config->language; $variables = array('targetBaseUri', 'feedBaseUri', 'idprefix'); foreach ($variables as $varname) { $this->$varname = str_replace( diff --git a/phpdotnet/phd/Package/PEAR/Web.php b/phpdotnet/phd/Package/PEAR/Web.php index b366c400..9483385d 100755 --- a/phpdotnet/phd/Package/PEAR/Web.php +++ b/phpdotnet/phd/Package/PEAR/Web.php @@ -20,7 +20,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName('PEAR-Web'); - $this->setExt($this->config->ext() === null ? '.php' : $this->config->ext()); + $this->setExt($this->config->ext === null ? '.php' : $this->config->ext); } public function __destruct() diff --git a/phpdotnet/phd/Package/PHP/BigPDF.php b/phpdotnet/phd/Package/PHP/BigPDF.php index 4e7e0561..deeb209e 100644 --- a/phpdotnet/phd/Package/PHP/BigPDF.php +++ b/phpdotnet/phd/Package/PHP/BigPDF.php @@ -20,7 +20,7 @@ public function update($event, $value = null) { break; case Render::INIT: - $this->setOutputDir($this->config->output_dir()); + $this->setOutputDir($this->config->output_dir); break; case Render::VERBOSE: @@ -56,8 +56,8 @@ public function format_root_set($open, $name, $attrs, $props) { $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->output_filename) { + $filename .= $this->config->output_filename; } else { $filename .= strtolower($this->getFormatName()) . $this->getExt(); } diff --git a/phpdotnet/phd/Package/PHP/BigXHTML.php b/phpdotnet/phd/Package/PHP/BigXHTML.php index d0380b98..4b3a7fd8 100644 --- a/phpdotnet/phd/Package/PHP/BigXHTML.php +++ b/phpdotnet/phd/Package/PHP/BigXHTML.php @@ -42,9 +42,9 @@ public function close() { } public function createFileName() { - $filename = $this->config->output_dir(); - if ($this->config->output_filename()) { - $filename .= $this->config->output_filename(); + $filename = $this->config->output_dir; + if ($this->config->output_filename) { + $filename .= $this->config->output_filename; } else { $filename .= strtolower($this->getFormatName()) . $this->getExt(); } @@ -93,7 +93,7 @@ public function update($event, $value = null) { if ($value) { $this->loadVersionAcronymInfo(); $this->postConstruct(); - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } $this->createOutputFile(); diff --git a/phpdotnet/phd/Package/PHP/CHM.php b/phpdotnet/phd/Package/PHP/CHM.php index 5fbef332..eedeb66d 100644 --- a/phpdotnet/phd/Package/PHP/CHM.php +++ b/phpdotnet/phd/Package/PHP/CHM.php @@ -232,16 +232,16 @@ public function update($event, $value = null) { case Render::INIT: $this->loadVersionAcronymInfo(); - $this->chmdir = $this->config->output_dir() . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR; + $this->chmdir = $this->config->output_dir . 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->output_dir . 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"); } - $lang = $this->config->language(); + $lang = $this->config->language; $this->hhpStream = fopen($this->chmdir . "php_manual_{$lang}.hhp", "w"); $this->hhcStream = fopen($this->chmdir . "php_manual_{$lang}.hhc", "w"); $this->hhkStream = fopen($this->chmdir . "php_manual_{$lang}.hhk", "w"); @@ -264,7 +264,7 @@ public function update($event, $value = null) { protected function appendChm($name, $ref, $hasChild) { if ($this->flags & Render::OPEN) { - $charset = $this->LANGUAGES[$this->config->language()]["preferred_charset"]; + $charset = $this->LANGUAGES[$this->config->language]["preferred_charset"]; $name = htmlspecialchars(iconv('UTF-8', $charset, html_entity_decode($name, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, $charset); $this->currentTocDepth++; @@ -306,7 +306,7 @@ protected static function cleanIndexName($value) protected function headerChm() { - $lang = $this->config->language(); + $lang = $this->config->language; fwrite($this->hhpStream, '[OPTIONS] Binary TOC=Yes Compatibility=1.1 or later @@ -389,7 +389,7 @@ public function format_root_chunk($open, $name, $attrs) { public function format_varlistentry($open, $name, $attrs) { if ($open) { $this->collectContent($attrs); - $charset = $this->LANGUAGES[$this->config->language()]["preferred_charset"]; + $charset = $this->LANGUAGES[$this->config->language]["preferred_charset"]; $content = htmlspecialchars(iconv('UTF-8', $charset, $this->lastContent["name"] ?? ""), ENT_QUOTES); if ($content) { diff --git a/phpdotnet/phd/Package/PHP/ChunkedXHTML.php b/phpdotnet/phd/Package/PHP/ChunkedXHTML.php index 8e134363..0440afab 100644 --- a/phpdotnet/phd/Package/PHP/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/PHP/ChunkedXHTML.php @@ -8,7 +8,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); $this->registerFormatName("PHP-Chunked-XHTML"); - $this->setExt($this->config->ext() === null ? ".html" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".html" : $this->config->ext); } public function __destruct() { diff --git a/phpdotnet/phd/Package/PHP/Epub.php b/phpdotnet/phd/Package/PHP/Epub.php index 80a46e38..ad2e4dc0 100644 --- a/phpdotnet/phd/Package/PHP/Epub.php +++ b/phpdotnet/phd/Package/PHP/Epub.php @@ -35,7 +35,7 @@ public function __construct( public function update($event, $value = null) { switch($event) { case Render::INIT: - $this->parentdir = $this->config->output_dir() + $this->parentdir = $this->config->output_dir . strtolower($this->getFormatName()) . DIRECTORY_SEPARATOR; if(!file_exists($this->parentdir) || is_file($this->parentdir)) { @@ -73,7 +73,7 @@ public function update($event, $value = null) { protected function initInfo() { $root = parent::getRootIndex(); - $lang = $this->config->language(); + $lang = $this->config->language; return array( 'book_id' => 'php-manual', 'title' => $root['ldesc'], diff --git a/phpdotnet/phd/Package/PHP/HowTo.php b/phpdotnet/phd/Package/PHP/HowTo.php index 40530eb8..df3ec21e 100644 --- a/phpdotnet/phd/Package/PHP/HowTo.php +++ b/phpdotnet/phd/Package/PHP/HowTo.php @@ -24,7 +24,7 @@ public function update($event, $value = null) { parent::update($event, $value); break; case Render::INIT: - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); $this->postConstruct(); if (file_exists($this->getOutputDir())) { if (!is_dir($this->getOutputDir())) { diff --git a/phpdotnet/phd/Package/PHP/KDevelop.php b/phpdotnet/phd/Package/PHP/KDevelop.php index 3fa39e2d..30437f79 100644 --- a/phpdotnet/phd/Package/PHP/KDevelop.php +++ b/phpdotnet/phd/Package/PHP/KDevelop.php @@ -72,7 +72,7 @@ public function __construct( parent::__construct($config, $outputHandler); $this->registerFormatName("PHP-KDevelop"); $this->setTitle("PHP Manual"); - $this->setExt($this->config->ext() === null ? ".php" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".php" : $this->config->ext); } public function __destruct() { @@ -97,7 +97,7 @@ public function update($event, $value = null) { break; case Render::INIT: if ($value) { - $this->setOutputDir($this->config->output_dir()); + $this->setOutputDir($this->config->output_dir); $this->setFileStream(fopen($this->getOutputDir() . strtolower($this->getFormatName()), "w")); self::headerToc(); } diff --git a/phpdotnet/phd/Package/PHP/PDF.php b/phpdotnet/phd/Package/PHP/PDF.php index 74b52381..580ebcbc 100644 --- a/phpdotnet/phd/Package/PHP/PDF.php +++ b/phpdotnet/phd/Package/PHP/PDF.php @@ -120,7 +120,7 @@ public function update($event, $value = null) { 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->output_dir . 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: diff --git a/phpdotnet/phd/Package/PHP/TocFeed.php b/phpdotnet/phd/Package/PHP/TocFeed.php index 09767b76..769a7c68 100644 --- a/phpdotnet/phd/Package/PHP/TocFeed.php +++ b/phpdotnet/phd/Package/PHP/TocFeed.php @@ -138,7 +138,7 @@ public function __construct( ) { parent::__construct($config, $outputHandler); - $language = $this->config->language(); + $language = $this->config->language; $variables = array('targetBaseUri', 'feedBaseUri', 'idprefix'); foreach ($variables as $varname) { $this->$varname = str_replace( diff --git a/phpdotnet/phd/Package/PHP/Web.php b/phpdotnet/phd/Package/PHP/Web.php index 63063c37..67da25e8 100644 --- a/phpdotnet/phd/Package/PHP/Web.php +++ b/phpdotnet/phd/Package/PHP/Web.php @@ -16,7 +16,7 @@ public function __construct( $this->registerFormatName("PHP-Web"); $this->setTitle("PHP Manual"); $this->setChunked(true); - $this->setExt($this->config->ext() === null ? ".php" : $this->config->ext()); + $this->setExt($this->config->ext === null ? ".php" : $this->config->ext); } public function close() { @@ -82,7 +82,7 @@ public function update($event, $value = null) { case Render::INIT: $this->loadVersionAcronymInfo(); $this->loadSourcesInfo(); - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); $this->postConstruct(); $this->loadHistoryInfo(); if (file_exists($this->getOutputDir())) { @@ -95,14 +95,14 @@ public function update($event, $value = null) { } } if ($this->getFormatName() == "PHP-Web") { - if (!$this->config->no_toc() && is_dir($this->getOutputDir() . 'toc')) { + if (!$this->config->no_toc && is_dir($this->getOutputDir() . 'toc')) { $this->removeDir($this->getOutputDir() . 'toc'); } if (!file_exists($this->getOutputDir() . "toc") || is_file($this->getOutputDir() . "toc")) { mkdir($this->getOutputDir() . "toc", 0777, true) or die("Can't create the toc directory"); } } - if ($this->config->css()) { + if ($this->config->css) { $this->fetchStylesheet(); } break; @@ -204,7 +204,7 @@ public function header($id) { ); $setup["history"] = $this->history[$setup["source"]["path"]] ?? []; if ($this->getChildren($id)) { - $lang = $this->config->language(); + $lang = $this->config->language; $setup["extra_header_links"] = array( "rel" => "alternate", "href" => "/manual/{$lang}/feeds/{$id}.atom", @@ -301,7 +301,7 @@ private function findParentBookOrSet(string $id): ?array } public function loadSourcesInfo() { - $this->sources = self::generateSourcesInfo($this->config->phpweb_sources_filename()); + $this->sources = self::generateSourcesInfo($this->config->phpweb_sources_filename); } public static function generateSourcesInfo($filename) { @@ -346,12 +346,12 @@ public function sourceInfo($id) { } public function loadHistoryInfo() { - if (!is_file($this->config->phpweb_history_filename())) { + if (!is_file($this->config->phpweb_history_filename)) { $this->history = []; return; } - $history = include $this->config->phpweb_history_filename(); + $history = include $this->config->phpweb_history_filename; $this->history = (is_array($history)) ? $history : []; } diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index 9a734eb7..e8a1aa5f 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -218,11 +218,11 @@ public function __construct( $this->dchunk = array_merge(parent::getDefaultChunkInfo(), $this->getDefaultChunkInfo()); $this->registerPIHandlers($this->pihandlers); - if ($this->config->css() === []) { - $this->config->setCss(array( + if ($this->config->css === []) { + $this->config->css = [ "http://www.php.net/styles/theme-base.css", "http://www.php.net/styles/theme-medium.css", - )); + ]; } } @@ -239,9 +239,9 @@ public function getDefaultChunkInfo() { } 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->phpweb_version_filename); + $this->deprecated = self::generateDeprecatedInfo($this->config->phpweb_version_filename); + $this->acronyms = self::generateAcronymInfo($this->config->phpweb_acronym_filename); } public static function generateVersionInfo($filename) { diff --git a/phpdotnet/phd/TestGenericChunkedXHTML.php b/phpdotnet/phd/TestGenericChunkedXHTML.php index 175c09cd..d0c983e1 100644 --- a/phpdotnet/phd/TestGenericChunkedXHTML.php +++ b/phpdotnet/phd/TestGenericChunkedXHTML.php @@ -18,7 +18,7 @@ public function update($event, $value = null) { parent::update($event, $value); break; case Render::INIT: - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); break; //No verbose } @@ -32,7 +32,7 @@ public function writeChunk($id, $fp) { $content .= stream_get_contents($fp); if ($id === "") { - $filename = $this->config->xml_file(); + $filename = $this->config->xml_file; } echo "Filename: " . basename($filename) . "\n"; diff --git a/phpdotnet/phd/TestPHPChunkedXHTML.php b/phpdotnet/phd/TestPHPChunkedXHTML.php index 24acd3f5..145c2179 100644 --- a/phpdotnet/phd/TestPHPChunkedXHTML.php +++ b/phpdotnet/phd/TestPHPChunkedXHTML.php @@ -18,7 +18,7 @@ public function update($event, $value = null) { parent::update($event, $value); break; case Render::INIT: - $this->setOutputDir($this->config->output_dir() . strtolower($this->getFormatName()) . '/'); + $this->setOutputDir($this->config->output_dir . strtolower($this->getFormatName()) . '/'); break; //No verbose } @@ -32,7 +32,7 @@ public function writeChunk($id, $fp) { $content .= stream_get_contents($fp); if ($id === "") { - $filename = $this->config->xml_file(); + $filename = $this->config->xml_file; } echo "Filename: " . basename($filename) . "\n"; diff --git a/phpdotnet/phd/TestRender.php b/phpdotnet/phd/TestRender.php index 3ef0f4b9..5e37db59 100644 --- a/phpdotnet/phd/TestRender.php +++ b/phpdotnet/phd/TestRender.php @@ -11,11 +11,11 @@ public function __construct( 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->output_dir)) { + mkdir($this->config->output_dir, 0755); } $this->attach($this->index); - $this->reader->open($this->config->xml_file()); + $this->reader->open($this->config->xml_file); $this->execute($this->reader); $this->detach($this->index); } @@ -25,7 +25,7 @@ public function run() { } if (count($this) > 0) { - $this->reader->open($this->config->xml_file()); + $this->reader->open($this->config->xml_file); $this->execute($this->reader); } } diff --git a/render.php b/render.php index 54860066..6071b048 100644 --- a/render.php +++ b/render.php @@ -42,20 +42,20 @@ $config->init($commandLineOptions); if (isset($commandLineOptions["package_dirs"])) { - Autoloader::setPackageDirs($config->package_dirs()); + Autoloader::setPackageDirs($config->package_dirs); } /* If no docbook file was passed, die */ -if (!is_dir($config->xml_root()) || !is_file($config->xml_file())) { +if (!is_dir($config->xml_root) || !is_file($config->xml_file)) { 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->output_dir)) { $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->output_dir, 0777, True)) { + trigger_error(vsprintf("Can't create output directory : %s", [$config->output_dir]), E_USER_ERROR); } $outputHandler->v("Output directory created", VERBOSE_MESSAGES); -} elseif (!is_dir($config->output_dir())) { +} elseif (!is_dir($config->output_dir)) { trigger_error("Output directory is not a file?", E_USER_ERROR); } @@ -65,37 +65,37 @@ "lang_dir" => __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', + "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', )); } -if ($config->saveconfig()) { +if ($config->saveconfig) { $outputHandler->v("Writing the config file", VERBOSE_MESSAGES); file_put_contents("phd.config.php", "getAllFiltered(), 1) . ";"); } -if ($config->quit()) { +if ($config->quit) { exit(0); } function make_reader(Config $config, OutputHandler $outputHandler) { //Partial Rendering - $idlist = $config->render_ids() + $config->skip_ids(); + $idlist = $config->render_ids + $config->skip_ids; 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->render_ids); } $reader = new Reader_Partial( $outputHandler, - $config->render_ids(), - $config->skip_ids(), + $config->render_ids, + $config->skip_ids, $parents, ); } else { @@ -109,34 +109,34 @@ function make_reader(Config $config, OutputHandler $outputHandler) { // Set reader LIBXML options $readerOpts = LIBXML_PARSEHUGE; -if ($config->process_xincludes()) { +if ($config->process_xincludes) { $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->output_dir . 'index.sqlite'); + $db = new \SQLite3($config->output_dir . 'index.sqlite'); } $indexRepository = new IndexRepository($db); if ($initializeDb) { $indexRepository->init(); } -$config->set_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->xml_file, NULL, $readerOpts); $render->execute($reader); $render->detach($format); @@ -146,23 +146,23 @@ function make_reader(Config $config, OutputHandler $outputHandler) { $outputHandler->v("Skipping indexing", VERBOSE_INDEXING); } -foreach((array)$config->package() as $package) { +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->set_output_format((array)$factory->getOutputFormats()); + if (count($config->output_format) == 0) { + $config->output_format = $factory->getOutputFormats(); } // Register the formats - foreach ($config->output_format() as $format) { + foreach ($config->output_format 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->xml_file, NULL, $readerOpts); foreach($render as $format) { $format->notify(Render::VERBOSE, true); } From 6cbb374deda8afe99813ee1dd8cc71a581a068fc Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 22 Dec 2024 19:53:28 +0100 Subject: [PATCH 09/10] Fix tests --- tests/bug_GH-87.phpt | 6 +++--- tests/bug_doc-en_GH-3353.phpt | 10 +++++----- tests/bug_doc-en_GH-3428.phpt | 6 +++--- tests/example_numbering_001.phpt | 6 +++--- tests/index/bug_GH-98.phpt | 4 ++-- tests/index/indexing_001.phpt | 4 ++-- tests/package/generic/001.phpt | 2 +- tests/package/generic/002.phpt | 2 +- tests/package/generic/003.phpt | 2 +- tests/package/generic/attribute_formatting_001.phpt | 2 +- tests/package/generic/attribute_formatting_002.phpt | 2 +- tests/package/generic/attribute_formatting_003.phpt | 2 +- tests/package/generic/caption_001.phpt | 2 +- tests/package/generic/simplelist_001.phpt | 2 +- tests/package/generic/whitespace_formatting_001.phpt | 2 +- tests/package/php/bug49101-1.phpt | 2 +- tests/package/php/bug49101-2.phpt | 2 +- tests/package/php/bug49102-1.phpt | 2 +- tests/package/php/bug_doc-en_GH-3179.phpt | 2 +- tests/package/php/class_rendering_001.phpt | 2 +- tests/package/php/class_rendering_002.phpt | 2 +- tests/package/php/class_rendering_003.phpt | 4 ++-- tests/package/php/constant_links_001.phpt | 2 +- tests/package/php/exception_rendering_001.phpt | 2 +- tests/package/php/exception_rendering_002.phpt | 2 +- tests/package/php/exception_rendering_003.phpt | 4 ++-- tests/package/php/faq001.phpt | 2 +- tests/package/php/type_rendering_001.phpt | 2 +- tests/package/php/type_rendering_002.phpt | 2 +- tests/package/php/type_rendering_003.phpt | 2 +- tests/package/php/variablelist_rendering_001.phpt | 2 +- tests/setup.php | 6 +++--- 32 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tests/bug_GH-87.phpt b/tests/bug_GH-87.phpt index eca6ba69..58cb0d97 100644 --- a/tests/bug_GH-87.phpt +++ b/tests/bug_GH-87.phpt @@ -8,12 +8,12 @@ require_once __DIR__ . "/setup.php"; $xml_file = __DIR__ . "/data/bug_GH-87.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); -$config->set_indexcache($indexRepository); +$config->indexcache = $indexRepository; $index = new TestIndex($indexRepository, $config, $outputHandler); diff --git a/tests/bug_doc-en_GH-3353.phpt b/tests/bug_doc-en_GH-3353.phpt index e8a698ea..5445a7c4 100644 --- a/tests/bug_doc-en_GH-3353.phpt +++ b/tests/bug_doc-en_GH-3353.phpt @@ -8,14 +8,14 @@ require_once __DIR__ . "/setup.php"; $xml_file = __DIR__ . "/data/bug_doc-en_GH-3353.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $render = new Render(); $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); -$config->set_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->xml_file, 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->xml_file, null, LIBXML_PARSEHUGE | LIBXML_XINCLUDE); $render->execute($reader); ?> diff --git a/tests/bug_doc-en_GH-3428.phpt b/tests/bug_doc-en_GH-3428.phpt index 2efdc0f5..b579bfc1 100644 --- a/tests/bug_doc-en_GH-3428.phpt +++ b/tests/bug_doc-en_GH-3428.phpt @@ -8,12 +8,12 @@ require_once __DIR__ . "/setup.php"; $xml_file = __DIR__ . "/data/example_numbering_001.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); -$config->set_indexcache($indexRepository); +$config->indexcache = $indexRepository; $index = new TestIndex($indexRepository, $config, $outputHandler); diff --git a/tests/example_numbering_001.phpt b/tests/example_numbering_001.phpt index 1cb729f3..7b47a939 100644 --- a/tests/example_numbering_001.phpt +++ b/tests/example_numbering_001.phpt @@ -8,12 +8,12 @@ require_once __DIR__ . "/setup.php"; $xml_file = __DIR__ . "/data/example_numbering_001.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); -$config->set_indexcache($indexRepository); +$config->indexcache = $indexRepository; $index = new TestIndex($indexRepository, $config, $outputHandler); diff --git a/tests/index/bug_GH-98.phpt b/tests/index/bug_GH-98.phpt index ff13cea9..cf2da925 100644 --- a/tests/index/bug_GH-98.phpt +++ b/tests/index/bug_GH-98.phpt @@ -8,8 +8,8 @@ require_once __DIR__ . "/../setup.php"; $xml_file = __DIR__ . "/data/bug_GH-98.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); diff --git a/tests/index/indexing_001.phpt b/tests/index/indexing_001.phpt index c4921979..7f36392a 100644 --- a/tests/index/indexing_001.phpt +++ b/tests/index/indexing_001.phpt @@ -8,8 +8,8 @@ require_once __DIR__ . "/../setup.php"; $xml_file = __DIR__ . "/data/indexing_001.xml"; -$config->setForce_index(true); -$config->setXml_file($xml_file); +$config->force_index = true; +$config->xml_file = $xml_file; $indexRepository = new IndexRepository(new \SQLite3(":memory:")); $indexRepository->init(); diff --git a/tests/package/generic/001.phpt b/tests/package/generic/001.phpt index 95ab7a23..47935dbb 100644 --- a/tests/package/generic/001.phpt +++ b/tests/package/generic/001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/001-1.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/generic/002.phpt b/tests/package/generic/002.phpt index bd9aa51a..1b7b379a 100644 --- a/tests/package/generic/002.phpt +++ b/tests/package/generic/002.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/002.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/generic/003.phpt b/tests/package/generic/003.phpt index ffc7efd8..2af5300a 100644 --- a/tests/package/generic/003.phpt +++ b/tests/package/generic/003.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/003.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/generic/attribute_formatting_001.phpt b/tests/package/generic/attribute_formatting_001.phpt index 994a64b9..ce999a0e 100644 --- a/tests/package/generic/attribute_formatting_001.phpt +++ b/tests/package/generic/attribute_formatting_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/attribute_formatting_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); diff --git a/tests/package/generic/attribute_formatting_002.phpt b/tests/package/generic/attribute_formatting_002.phpt index 4543bc87..83a28a06 100644 --- a/tests/package/generic/attribute_formatting_002.phpt +++ b/tests/package/generic/attribute_formatting_002.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/attribute_formatting_002.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); diff --git a/tests/package/generic/attribute_formatting_003.phpt b/tests/package/generic/attribute_formatting_003.phpt index 42bf69ae..e54a6f3a 100644 --- a/tests/package/generic/attribute_formatting_003.phpt +++ b/tests/package/generic/attribute_formatting_003.phpt @@ -10,7 +10,7 @@ $xml_file = __DIR__ . "/data/attribute_formatting_003.xml"; $config = new Config; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); diff --git a/tests/package/generic/caption_001.phpt b/tests/package/generic/caption_001.phpt index 6390bb36..f1274325 100644 --- a/tests/package/generic/caption_001.phpt +++ b/tests/package/generic/caption_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/caption_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $format->postConstruct(); diff --git a/tests/package/generic/simplelist_001.phpt b/tests/package/generic/simplelist_001.phpt index ad592da8..612f8971 100644 --- a/tests/package/generic/simplelist_001.phpt +++ b/tests/package/generic/simplelist_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/simplelist.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/generic/whitespace_formatting_001.phpt b/tests/package/generic/whitespace_formatting_001.phpt index cbe0384a..bc6b725b 100644 --- a/tests/package/generic/whitespace_formatting_001.phpt +++ b/tests/package/generic/whitespace_formatting_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/whitespace_formatting_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestGenericChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/bug49101-1.phpt b/tests/package/php/bug49101-1.phpt index 1677b243..acd3b0c6 100644 --- a/tests/package/php/bug49101-1.phpt +++ b/tests/package/php/bug49101-1.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/bug49101-1.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/bug49101-2.phpt b/tests/package/php/bug49101-2.phpt index 5cc8ddad..5640815a 100644 --- a/tests/package/php/bug49101-2.phpt +++ b/tests/package/php/bug49101-2.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/bug49101-1.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPBigXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/bug49102-1.phpt b/tests/package/php/bug49102-1.phpt index d79cbc7e..545eee78 100644 --- a/tests/package/php/bug49102-1.phpt +++ b/tests/package/php/bug49102-1.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/bug49102-1.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/bug_doc-en_GH-3179.phpt b/tests/package/php/bug_doc-en_GH-3179.phpt index c47acbf9..e5bb9809 100644 --- a/tests/package/php/bug_doc-en_GH-3179.phpt +++ b/tests/package/php/bug_doc-en_GH-3179.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/bug_doc-en_GH-3197.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/class_rendering_001.phpt b/tests/package/php/class_rendering_001.phpt index fadf3d19..44bb6355 100644 --- a/tests/package/php/class_rendering_001.phpt +++ b/tests/package/php/class_rendering_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/class_rendering_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/class_rendering_002.phpt b/tests/package/php/class_rendering_002.phpt index dbe4fbe5..4add8f52 100644 --- a/tests/package/php/class_rendering_002.phpt +++ b/tests/package/php/class_rendering_002.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/class_rendering_002.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/class_rendering_003.phpt b/tests/package/php/class_rendering_003.phpt index ab2e8475..005ff003 100644 --- a/tests/package/php/class_rendering_003.phpt +++ b/tests/package/php/class_rendering_003.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_filePhpdoc = __DIR__ . "/data/class_rendering_001.xml"; -$config->setXml_file($xml_filePhpdoc); +$config->xml_file = $xml_filePhpdoc; $formatPhpdoc = new TestPHPChunkedXHTML($config, $outputHandler); $renderPhpdoc = new TestRender(new Reader($outputHandler), $config, $formatPhpdoc); @@ -20,7 +20,7 @@ $phpdocOutput = ob_get_clean(); $xml_fileReferenceWithRole = __DIR__ . "/data/class_rendering_002.xml"; -$config->setXml_file($xml_fileReferenceWithRole); +$config->xml_file = $xml_fileReferenceWithRole; $formatReferenceWithRole = new TestPHPChunkedXHTML($config, $outputHandler); $renderReferenceWithRole = new TestRender(new Reader($outputHandler), $config, $formatReferenceWithRole); diff --git a/tests/package/php/constant_links_001.phpt b/tests/package/php/constant_links_001.phpt index 01c6f3e7..01bffc6a 100644 --- a/tests/package/php/constant_links_001.phpt +++ b/tests/package/php/constant_links_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/constant_links.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $indices = [ [ diff --git a/tests/package/php/exception_rendering_001.phpt b/tests/package/php/exception_rendering_001.phpt index e6dba3ab..780180a0 100644 --- a/tests/package/php/exception_rendering_001.phpt +++ b/tests/package/php/exception_rendering_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/exception_rendering_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/exception_rendering_002.phpt b/tests/package/php/exception_rendering_002.phpt index 69a997a0..9a5ba51e 100644 --- a/tests/package/php/exception_rendering_002.phpt +++ b/tests/package/php/exception_rendering_002.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/exception_rendering_002.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/exception_rendering_003.phpt b/tests/package/php/exception_rendering_003.phpt index e47903cc..252b0655 100644 --- a/tests/package/php/exception_rendering_003.phpt +++ b/tests/package/php/exception_rendering_003.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_filePhpdoc = __DIR__ . "/data/exception_rendering_001.xml"; -$config->setXml_file($xml_filePhpdoc); +$config->xml_file = $xml_filePhpdoc; $formatPhpdoc = new TestPHPChunkedXHTML($config, $outputHandler); $renderPhpdoc = new TestRender(new Reader($outputHandler), $config, $formatPhpdoc); @@ -20,7 +20,7 @@ $phpdocOutput = ob_get_clean(); $xml_fileReferenceWithRole = __DIR__ . "/data/exception_rendering_002.xml"; -$config->setXml_file($xml_fileReferenceWithRole); +$config->xml_file = $xml_fileReferenceWithRole; $formatReferenceWithRole = new TestPHPChunkedXHTML($config, $outputHandler); $renderReferenceWithRole = new TestRender(new Reader($outputHandler), $config, $formatReferenceWithRole); diff --git a/tests/package/php/faq001.phpt b/tests/package/php/faq001.phpt index 84b1bafe..d883cfe1 100644 --- a/tests/package/php/faq001.phpt +++ b/tests/package/php/faq001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/faq001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/type_rendering_001.phpt b/tests/package/php/type_rendering_001.phpt index 4cb3d1f3..7300eb9a 100644 --- a/tests/package/php/type_rendering_001.phpt +++ b/tests/package/php/type_rendering_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/type_rendering_methodsynopsis_return_types.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/type_rendering_002.phpt b/tests/package/php/type_rendering_002.phpt index d18d307e..17fbd29a 100644 --- a/tests/package/php/type_rendering_002.phpt +++ b/tests/package/php/type_rendering_002.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/type_rendering_methodsynopsis_parameters.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/type_rendering_003.phpt b/tests/package/php/type_rendering_003.phpt index 0781ad86..f9da13db 100644 --- a/tests/package/php/type_rendering_003.phpt +++ b/tests/package/php/type_rendering_003.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/type_rendering_constructorsynopsis_parameters-and-return-type.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/package/php/variablelist_rendering_001.phpt b/tests/package/php/variablelist_rendering_001.phpt index db805c8c..5cce9e8f 100644 --- a/tests/package/php/variablelist_rendering_001.phpt +++ b/tests/package/php/variablelist_rendering_001.phpt @@ -8,7 +8,7 @@ require_once __DIR__ . "/../../setup.php"; $xml_file = __DIR__ . "/data/variablelist_rendering_001.xml"; -$config->setXml_file($xml_file); +$config->xml_file = $xml_file; $format = new TestPHPChunkedXHTML($config, $outputHandler); $render = new TestRender(new Reader($outputHandler), $config, $format); diff --git a/tests/setup.php b/tests/setup.php index 1cb7d59c..4c7e5db5 100644 --- a/tests/setup.php +++ b/tests/setup.php @@ -17,7 +17,7 @@ set_error_handler($errorHandler->handleError(...)); $config->init([]); -$config->setLang_dir(__INSTALLDIR__ . DIRECTORY_SEPARATOR +$config->lang_dir = __INSTALLDIR__ . DIRECTORY_SEPARATOR . "phpdotnet" . DIRECTORY_SEPARATOR . "phd" . DIRECTORY_SEPARATOR -. "data" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR); -$config->setPackage_dirs([__INSTALLDIR__]); +. "data" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR; +$config->package_dirs = [__INSTALLDIR__]; From 627460d4cfb2471a77dce66522824a6453b9ebf7 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 29 Dec 2024 13:12:56 +0100 Subject: [PATCH 10/10] Change property names to camel case --- phpdotnet/phd/Config.php | 108 +++++++++--------- phpdotnet/phd/Format.php | 10 +- phpdotnet/phd/Format/Abstract/XHTML.php | 4 +- phpdotnet/phd/Options/Handler.php | 56 ++++----- phpdotnet/phd/OutputHandler.php | 20 ++-- phpdotnet/phd/Package/Generic/BigXHTML.php | 6 +- .../phd/Package/Generic/ChunkedXHTML.php | 2 +- phpdotnet/phd/Package/Generic/Manpage.php | 2 +- phpdotnet/phd/Package/Generic/PDF.php | 2 +- phpdotnet/phd/Package/Generic/TocFeed.php | 2 +- phpdotnet/phd/Package/Generic/XHTML.php | 2 +- phpdotnet/phd/Package/IDE/Base.php | 6 +- phpdotnet/phd/Package/IDE/Funclist.php | 2 +- phpdotnet/phd/Package/IDE/SQLite.php | 2 +- phpdotnet/phd/Package/PEAR/BigXHTML.php | 6 +- phpdotnet/phd/Package/PEAR/CHM.php | 4 +- phpdotnet/phd/Package/PEAR/ChunkedXHTML.php | 2 +- phpdotnet/phd/Package/PHP/BigPDF.php | 6 +- phpdotnet/phd/Package/PHP/BigXHTML.php | 6 +- phpdotnet/phd/Package/PHP/CHM.php | 4 +- phpdotnet/phd/Package/PHP/Epub.php | 2 +- phpdotnet/phd/Package/PHP/HowTo.php | 2 +- phpdotnet/phd/Package/PHP/KDevelop.php | 2 +- phpdotnet/phd/Package/PHP/PDF.php | 2 +- phpdotnet/phd/Package/PHP/Web.php | 10 +- phpdotnet/phd/Package/PHP/XHTML.php | 6 +- phpdotnet/phd/Reader/Partial.php | 10 +- phpdotnet/phd/TestGenericChunkedXHTML.php | 4 +- phpdotnet/phd/TestPHPChunkedXHTML.php | 4 +- phpdotnet/phd/TestRender.php | 8 +- render.php | 58 +++++----- tests/bug_GH-87.phpt | 8 +- tests/bug_doc-en_GH-3353.phpt | 12 +- tests/bug_doc-en_GH-3428.phpt | 8 +- tests/example_numbering_001.phpt | 8 +- tests/index/bug_GH-98.phpt | 6 +- tests/index/indexing_001.phpt | 6 +- tests/options/default_handler_009.phpt | 28 ++--- tests/options/default_handler_010.phpt | 28 ++--- tests/package/generic/001.phpt | 4 +- tests/package/generic/002.phpt | 4 +- tests/package/generic/003.phpt | 4 +- .../generic/attribute_formatting_001.phpt | 4 +- .../generic/attribute_formatting_002.phpt | 4 +- .../generic/attribute_formatting_003.phpt | 4 +- tests/package/generic/caption_001.phpt | 4 +- tests/package/generic/simplelist_001.phpt | 4 +- .../generic/whitespace_formatting_001.phpt | 4 +- tests/package/php/bug49101-1.phpt | 4 +- tests/package/php/bug49101-2.phpt | 4 +- tests/package/php/bug49102-1.phpt | 4 +- tests/package/php/bug_doc-en_GH-3179.phpt | 4 +- tests/package/php/class_rendering_001.phpt | 4 +- tests/package/php/class_rendering_002.phpt | 4 +- tests/package/php/class_rendering_003.phpt | 8 +- tests/package/php/constant_links_001.phpt | 4 +- .../package/php/exception_rendering_001.phpt | 4 +- .../package/php/exception_rendering_002.phpt | 4 +- .../package/php/exception_rendering_003.phpt | 8 +- tests/package/php/faq001.phpt | 4 +- tests/package/php/type_rendering_001.phpt | 4 +- tests/package/php/type_rendering_002.phpt | 4 +- tests/package/php/type_rendering_003.phpt | 4 +- .../php/variablelist_rendering_001.phpt | 4 +- tests/setup.php | 4 +- 65 files changed, 288 insertions(+), 288 deletions(-) diff --git a/phpdotnet/phd/Config.php b/phpdotnet/phd/Config.php index 4a49b2da..688525f4 100644 --- a/phpdotnet/phd/Config.php +++ b/phpdotnet/phd/Config.php @@ -7,61 +7,61 @@ class Config public readonly string $copyright; /** @var array */ - 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 */ - public array $render_ids = []; + public array $renderIds = []; /** @var array */ - 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 */ public array $package =['Generic']; /** @var array $css */ public array $css = []; - public bool $process_xincludes = false; + public bool $processXincludes = false; public ?string $ext = null; /** @var array */ - 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 @@ public function getAllFiltered(): array { */ 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 @@ public function getSupportedPackages(): array { /** * 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 @@ public function setColor_output(bool $color_output): void { * @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; diff --git a/phpdotnet/phd/Format.php b/phpdotnet/phd/Format.php index 31ee7885..16ced847 100644 --- a/phpdotnet/phd/Format.php +++ b/phpdotnet/phd/Format.php @@ -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 @@ final public function autogen($text, $lang = null) { 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); diff --git a/phpdotnet/phd/Format/Abstract/XHTML.php b/phpdotnet/phd/Format/Abstract/XHTML.php index 37ba455f..a28b59ab 100644 --- a/phpdotnet/phd/Format/Abstract/XHTML.php +++ b/phpdotnet/phd/Format/Abstract/XHTML.php @@ -71,12 +71,12 @@ public function CDATA($value) { * @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) . '/'; } } diff --git a/phpdotnet/phd/Options/Handler.php b/phpdotnet/phd/Options/Handler.php index 0d68ee8e..e2eda75e 100644 --- a/phpdotnet/phd/Options/Handler.php +++ b/phpdotnet/phd/Options/Handler.php @@ -55,7 +55,7 @@ public function option_M(string $k, mixed $v): array */ public function option_memoryindex(string $k, mixed $v): array { - return ['memoryindex' => true]; + return ['memoryIndex' => true]; } /** @@ -80,7 +80,7 @@ public function option_format(string $k, mixed $v): array $formats[] = $val; } } - return ['output_format' => $formats]; + return ['outputFormat' => $formats]; } /** @@ -135,7 +135,7 @@ public function option_i(string $k, mixed $v): array */ public function option_noindex(string $k, mixed $v): array { - return ['no_index' => true]; + return ['noIndex' => true]; } /** @@ -151,7 +151,7 @@ public function option_r(string $k, mixed $v): array */ public function option_forceindex(string $k, mixed $v): array { - return ['force_index' => true]; + return ['forceIndex' => true]; } /** @@ -167,7 +167,7 @@ public function option_t(string $k, mixed $v): array */ public function option_notoc(string $k, mixed $v): array { - return ['no_toc' => true]; + return ['noToc' => true]; } /** @@ -190,8 +190,8 @@ public function option_docbook(string $k, mixed $v): array 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 @@ public function option_output(string $k, mixed $v): array } $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 @@ public function option_outputfilename(string $k, mixed $v): array } $file = basename($v); - return ['output_filename' => $file]; + return ['outputFilename' => $file]; } /** @@ -257,7 +257,7 @@ public function option_p(string $k, mixed $v): array */ 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 @@ public function option_partial(string $k, mixed $v): array } $recursive = (bool) $recursive; } - $render_ids[$val] = $recursive; + $renderIds[$val] = $recursive; } - return ['render_ids' => $render_ids]; + return ['renderIds' => $renderIds]; } /** @@ -319,7 +319,7 @@ public function option_s(string $k, mixed $v): array */ 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 @@ public function option_skip(string $k, mixed $v): array } $recursive = (bool) $recursive; } - $skip_ids[$val] = $recursive; + $skipIds[$val] = $recursive; } - return ['skip_ids' => $skip_ids]; + return ['skipIds' => $skipIds]; } /** @@ -350,7 +350,7 @@ public function option_saveconfig(string $k, mixed $v): array trigger_error("yes/no || on/off || true/false || 1/0 expected", E_USER_ERROR); } - return ['saveconfig' => $val]; + return ['saveConfig' => $val]; } /** @@ -444,7 +444,7 @@ public function option_color(string $k, mixed $v): array 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 @@ public function option_k(string $k, mixed $v): array */ 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 @@ public function option_packagedir(string $k, mixed $v): array trigger_error(vsprintf('Invalid path: %s', [$val]), E_USER_WARNING); } } - return ['package_dirs' => $packages]; + return ['packageDirs' => $packages]; } /** @@ -500,7 +500,7 @@ public function option_x(string $k, mixed $v): array */ public function option_xinclude(string $k, mixed $v): array { - return ['process_xincludes' => true]; + return ['processXincludes' => true]; } /** @@ -539,21 +539,21 @@ public function option_help(string $k, mixed $v): never --package 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 --docbook 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 --partial The ID to render, optionally skipping its children chunks (default to true; render children) @@ -563,7 +563,7 @@ public function option_help(string $k, mixed $v): never -l --list Print out the supported packages and formats -o - --output The output directory (default: " . $this->config->output_dir . ") + --output The output directory (default: " . $this->config->outputDir . ") -F filename --outputfilename filename Filename to use when writing standalone formats (default: -.) @@ -572,7 +572,7 @@ public function option_help(string $k, mixed $v): never theme). (default: " . $this->config->language . ") -c --color Enable color output when output is to a terminal - (default: " . ($this->config->getColor_output() ? 'true' : 'false') . ") + (default: " . ($this->config->getColorOutput() ? 'true' : 'false') . ") -C --css Link for an external CSS file. -g @@ -585,7 +585,7 @@ public function option_help(string $k, mixed $v): never --ext The alternative filename extension to use, including the dot. Use 'false' for no extension. -S - --saveconfig Save the generated config (default: " . ($this->config->saveconfig ? 'true' : 'false') . "). + --saveconfig Save the generated config (default: " . ($this->config->saveConfig ? 'true' : 'false') . "). -Q --quit Don't run the build. Use with --saveconfig to diff --git a/phpdotnet/phd/OutputHandler.php b/phpdotnet/phd/OutputHandler.php index a7bd0e5d..96da4c3e 100644 --- a/phpdotnet/phd/OutputHandler.php +++ b/phpdotnet/phd/OutputHandler.php @@ -31,34 +31,34 @@ public function __construct( * 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 @@ private function print(string $msg, $outputStream, string|false $color = false, 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); diff --git a/phpdotnet/phd/Package/Generic/BigXHTML.php b/phpdotnet/phd/Package/Generic/BigXHTML.php index a15076b8..2dce3f9d 100644 --- a/phpdotnet/phd/Package/Generic/BigXHTML.php +++ b/phpdotnet/phd/Package/Generic/BigXHTML.php @@ -79,9 +79,9 @@ public function update($event, $value = null) { 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(); } diff --git a/phpdotnet/phd/Package/Generic/ChunkedXHTML.php b/phpdotnet/phd/Package/Generic/ChunkedXHTML.php index 38ebf741..83e0481d 100644 --- a/phpdotnet/phd/Package/Generic/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/Generic/ChunkedXHTML.php @@ -73,7 +73,7 @@ public function update($event, $value = null) { 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())) { diff --git a/phpdotnet/phd/Package/Generic/Manpage.php b/phpdotnet/phd/Package/Generic/Manpage.php index b2581577..b86229a0 100644 --- a/phpdotnet/phd/Package/Generic/Manpage.php +++ b/phpdotnet/phd/Package/Generic/Manpage.php @@ -312,7 +312,7 @@ public function update($event, $value = null) { 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); diff --git a/phpdotnet/phd/Package/Generic/PDF.php b/phpdotnet/phd/Package/Generic/PDF.php index 9088f4b9..1254847b 100644 --- a/phpdotnet/phd/Package/Generic/PDF.php +++ b/phpdotnet/phd/Package/Generic/PDF.php @@ -1132,7 +1132,7 @@ public function format_indice($open, $name, $attrs) { 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); diff --git a/phpdotnet/phd/Package/Generic/TocFeed.php b/phpdotnet/phd/Package/Generic/TocFeed.php index 5888fd16..43842dbf 100644 --- a/phpdotnet/phd/Package/Generic/TocFeed.php +++ b/phpdotnet/phd/Package/Generic/TocFeed.php @@ -218,7 +218,7 @@ public function update($event, $value = null) case Render::INIT: $this->setOutputDir( - $this->config->output_dir + $this->config->outputDir . strtolower($this->getFormatName()) . '/' ); $dir = $this->getOutputDir(); diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 73e0cce7..94423208 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -662,7 +662,7 @@ protected function fetchStylesheet($name = null) { } $stylesDir = $this->getOutputDir(); if (!$stylesDir) { - $stylesDir = $this->config->output_dir; + $stylesDir = $this->config->outputDir; } $stylesDir .= 'styles/'; if (file_exists($stylesDir)) { diff --git a/phpdotnet/phd/Package/IDE/Base.php b/phpdotnet/phd/Package/IDE/Base.php index adc089c7..fadc967f 100644 --- a/phpdotnet/phd/Package/IDE/Base.php +++ b/phpdotnet/phd/Package/IDE/Base.php @@ -207,15 +207,15 @@ public function versionInfo($funcname) { } 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); diff --git a/phpdotnet/phd/Package/IDE/Funclist.php b/phpdotnet/phd/Package/IDE/Funclist.php index 9ec5b4f8..2672fdb3 100644 --- a/phpdotnet/phd/Package/IDE/Funclist.php +++ b/phpdotnet/phd/Package/IDE/Funclist.php @@ -42,7 +42,7 @@ public function update($event, $value = null) { $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: diff --git a/phpdotnet/phd/Package/IDE/SQLite.php b/phpdotnet/phd/Package/IDE/SQLite.php index 6c8843c2..22bcb7a5 100644 --- a/phpdotnet/phd/Package/IDE/SQLite.php +++ b/phpdotnet/phd/Package/IDE/SQLite.php @@ -93,7 +93,7 @@ public function parseFunction() { } 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'); diff --git a/phpdotnet/phd/Package/PEAR/BigXHTML.php b/phpdotnet/phd/Package/PEAR/BigXHTML.php index 300c2068..98de5c20 100755 --- a/phpdotnet/phd/Package/PEAR/BigXHTML.php +++ b/phpdotnet/phd/Package/PEAR/BigXHTML.php @@ -45,9 +45,9 @@ public function close() { } 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(); } diff --git a/phpdotnet/phd/Package/PEAR/CHM.php b/phpdotnet/phd/Package/PEAR/CHM.php index 9e30e49b..f96dd38c 100755 --- a/phpdotnet/phd/Package/PEAR/CHM.php +++ b/phpdotnet/phd/Package/PEAR/CHM.php @@ -221,11 +221,11 @@ public function update($event, $value = null) { 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"); diff --git a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php index a4c85d90..69f17afd 100755 --- a/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php +++ b/phpdotnet/phd/Package/PEAR/ChunkedXHTML.php @@ -71,7 +71,7 @@ public function update($event, $value = null) { 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())) { diff --git a/phpdotnet/phd/Package/PHP/BigPDF.php b/phpdotnet/phd/Package/PHP/BigPDF.php index deeb209e..ed56fc7e 100644 --- a/phpdotnet/phd/Package/PHP/BigPDF.php +++ b/phpdotnet/phd/Package/PHP/BigPDF.php @@ -20,7 +20,7 @@ public function update($event, $value = null) { break; case Render::INIT: - $this->setOutputDir($this->config->output_dir); + $this->setOutputDir($this->config->outputDir); break; case Render::VERBOSE: @@ -56,8 +56,8 @@ public function format_root_set($open, $name, $attrs, $props) { $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(); } diff --git a/phpdotnet/phd/Package/PHP/BigXHTML.php b/phpdotnet/phd/Package/PHP/BigXHTML.php index 4b3a7fd8..f45ecf9f 100644 --- a/phpdotnet/phd/Package/PHP/BigXHTML.php +++ b/phpdotnet/phd/Package/PHP/BigXHTML.php @@ -42,9 +42,9 @@ public function close() { } 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(); } diff --git a/phpdotnet/phd/Package/PHP/CHM.php b/phpdotnet/phd/Package/PHP/CHM.php index eedeb66d..f172f26d 100644 --- a/phpdotnet/phd/Package/PHP/CHM.php +++ b/phpdotnet/phd/Package/PHP/CHM.php @@ -232,11 +232,11 @@ public function update($event, $value = null) { 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"); diff --git a/phpdotnet/phd/Package/PHP/Epub.php b/phpdotnet/phd/Package/PHP/Epub.php index ad2e4dc0..ef16501b 100644 --- a/phpdotnet/phd/Package/PHP/Epub.php +++ b/phpdotnet/phd/Package/PHP/Epub.php @@ -35,7 +35,7 @@ public function __construct( 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)) { diff --git a/phpdotnet/phd/Package/PHP/HowTo.php b/phpdotnet/phd/Package/PHP/HowTo.php index df3ec21e..20db365e 100644 --- a/phpdotnet/phd/Package/PHP/HowTo.php +++ b/phpdotnet/phd/Package/PHP/HowTo.php @@ -24,7 +24,7 @@ public function update($event, $value = null) { 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())) { diff --git a/phpdotnet/phd/Package/PHP/KDevelop.php b/phpdotnet/phd/Package/PHP/KDevelop.php index 30437f79..5783e898 100644 --- a/phpdotnet/phd/Package/PHP/KDevelop.php +++ b/phpdotnet/phd/Package/PHP/KDevelop.php @@ -97,7 +97,7 @@ public function update($event, $value = null) { 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(); } diff --git a/phpdotnet/phd/Package/PHP/PDF.php b/phpdotnet/phd/Package/PHP/PDF.php index 580ebcbc..15760717 100644 --- a/phpdotnet/phd/Package/PHP/PDF.php +++ b/phpdotnet/phd/Package/PHP/PDF.php @@ -120,7 +120,7 @@ public function update($event, $value = null) { 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: diff --git a/phpdotnet/phd/Package/PHP/Web.php b/phpdotnet/phd/Package/PHP/Web.php index 67da25e8..eed2b0a1 100644 --- a/phpdotnet/phd/Package/PHP/Web.php +++ b/phpdotnet/phd/Package/PHP/Web.php @@ -82,7 +82,7 @@ public function update($event, $value = null) { 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 @@ public function update($event, $value = null) { } } 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 @@ private function findParentBookOrSet(string $id): ?array } 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 @@ public function sourceInfo($id) { } 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 : []; } diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php index e8a1aa5f..eef9c78e 100644 --- a/phpdotnet/phd/Package/PHP/XHTML.php +++ b/phpdotnet/phd/Package/PHP/XHTML.php @@ -239,9 +239,9 @@ public function getDefaultChunkInfo() { } 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) { diff --git a/phpdotnet/phd/Reader/Partial.php b/phpdotnet/phd/Reader/Partial.php index 3a2d5a40..6ff1d631 100644 --- a/phpdotnet/phd/Reader/Partial.php +++ b/phpdotnet/phd/Reader/Partial.php @@ -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; } diff --git a/phpdotnet/phd/TestGenericChunkedXHTML.php b/phpdotnet/phd/TestGenericChunkedXHTML.php index d0c983e1..b239dec9 100644 --- a/phpdotnet/phd/TestGenericChunkedXHTML.php +++ b/phpdotnet/phd/TestGenericChunkedXHTML.php @@ -18,7 +18,7 @@ public function update($event, $value = null) { 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 @@ public function writeChunk($id, $fp) { $content .= stream_get_contents($fp); if ($id === "") { - $filename = $this->config->xml_file; + $filename = $this->config->xmlFile; } echo "Filename: " . basename($filename) . "\n"; diff --git a/phpdotnet/phd/TestPHPChunkedXHTML.php b/phpdotnet/phd/TestPHPChunkedXHTML.php index 145c2179..ef15fbe3 100644 --- a/phpdotnet/phd/TestPHPChunkedXHTML.php +++ b/phpdotnet/phd/TestPHPChunkedXHTML.php @@ -18,7 +18,7 @@ public function update($event, $value = null) { 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 @@ public function writeChunk($id, $fp) { $content .= stream_get_contents($fp); if ($id === "") { - $filename = $this->config->xml_file; + $filename = $this->config->xmlFile; } echo "Filename: " . basename($filename) . "\n"; diff --git a/phpdotnet/phd/TestRender.php b/phpdotnet/phd/TestRender.php index 5e37db59..a0f82f21 100644 --- a/phpdotnet/phd/TestRender.php +++ b/phpdotnet/phd/TestRender.php @@ -11,11 +11,11 @@ public function __construct( 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 @@ public function run() { } if (count($this) > 0) { - $this->reader->open($this->config->xml_file); + $this->reader->open($this->config->xmlFile); $this->execute($this->reader); } } diff --git a/render.php b/render.php index 6071b048..5d62c0c9 100644 --- a/render.php +++ b/render.php @@ -41,38 +41,38 @@ $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", "getAllFiltered(), 1) . ";"); } @@ -83,19 +83,19 @@ 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 @@ function make_reader(Config $config, OutputHandler $outputHandler) { // 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 @@ function make_reader(Config $config, OutputHandler $outputHandler) { $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); } diff --git a/tests/bug_GH-87.phpt b/tests/bug_GH-87.phpt index 58cb0d97..01baf99a 100644 --- a/tests/bug_GH-87.phpt +++ b/tests/bug_GH-87.phpt @@ -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); diff --git a/tests/bug_doc-en_GH-3353.phpt b/tests/bug_doc-en_GH-3353.phpt index 5445a7c4..e2f0b0c3 100644 --- a/tests/bug_doc-en_GH-3353.phpt +++ b/tests/bug_doc-en_GH-3353.phpt @@ -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); ?> diff --git a/tests/bug_doc-en_GH-3428.phpt b/tests/bug_doc-en_GH-3428.phpt index b579bfc1..fe19e2c3 100644 --- a/tests/bug_doc-en_GH-3428.phpt +++ b/tests/bug_doc-en_GH-3428.phpt @@ -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); diff --git a/tests/example_numbering_001.phpt b/tests/example_numbering_001.phpt index 7b47a939..6cab495f 100644 --- a/tests/example_numbering_001.phpt +++ b/tests/example_numbering_001.phpt @@ -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); diff --git a/tests/index/bug_GH-98.phpt b/tests/index/bug_GH-98.phpt index cf2da925..c798509d 100644 --- a/tests/index/bug_GH-98.phpt +++ b/tests/index/bug_GH-98.phpt @@ -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(); diff --git a/tests/index/indexing_001.phpt b/tests/index/indexing_001.phpt index 7f36392a..f1553f51 100644 --- a/tests/index/indexing_001.phpt +++ b/tests/index/indexing_001.phpt @@ -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(); diff --git a/tests/options/default_handler_009.phpt b/tests/options/default_handler_009.phpt index 948df0b4..2730eeb0 100644 --- a/tests/options/default_handler_009.phpt +++ b/tests/options/default_handler_009.phpt @@ -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" diff --git a/tests/options/default_handler_010.phpt b/tests/options/default_handler_010.phpt index 24aab92f..d24666b4 100644 --- a/tests/options/default_handler_010.phpt +++ b/tests/options/default_handler_010.phpt @@ -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" diff --git a/tests/package/generic/001.phpt b/tests/package/generic/001.phpt index 47935dbb..95460d00 100644 --- a/tests/package/generic/001.phpt +++ b/tests/package/generic/001.phpt @@ -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); diff --git a/tests/package/generic/002.phpt b/tests/package/generic/002.phpt index 1b7b379a..34ba495d 100644 --- a/tests/package/generic/002.phpt +++ b/tests/package/generic/002.phpt @@ -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); diff --git a/tests/package/generic/003.phpt b/tests/package/generic/003.phpt index 2af5300a..3143628f 100644 --- a/tests/package/generic/003.phpt +++ b/tests/package/generic/003.phpt @@ -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); diff --git a/tests/package/generic/attribute_formatting_001.phpt b/tests/package/generic/attribute_formatting_001.phpt index ce999a0e..76bbf787 100644 --- a/tests/package/generic/attribute_formatting_001.phpt +++ b/tests/package/generic/attribute_formatting_001.phpt @@ -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); diff --git a/tests/package/generic/attribute_formatting_002.phpt b/tests/package/generic/attribute_formatting_002.phpt index 83a28a06..6e7aec9d 100644 --- a/tests/package/generic/attribute_formatting_002.phpt +++ b/tests/package/generic/attribute_formatting_002.phpt @@ -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); diff --git a/tests/package/generic/attribute_formatting_003.phpt b/tests/package/generic/attribute_formatting_003.phpt index e54a6f3a..ded7e667 100644 --- a/tests/package/generic/attribute_formatting_003.phpt +++ b/tests/package/generic/attribute_formatting_003.phpt @@ -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); diff --git a/tests/package/generic/caption_001.phpt b/tests/package/generic/caption_001.phpt index f1274325..e982f3c6 100644 --- a/tests/package/generic/caption_001.phpt +++ b/tests/package/generic/caption_001.phpt @@ -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(); diff --git a/tests/package/generic/simplelist_001.phpt b/tests/package/generic/simplelist_001.phpt index 612f8971..f75ab7fe 100644 --- a/tests/package/generic/simplelist_001.phpt +++ b/tests/package/generic/simplelist_001.phpt @@ -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); diff --git a/tests/package/generic/whitespace_formatting_001.phpt b/tests/package/generic/whitespace_formatting_001.phpt index bc6b725b..b8642701 100644 --- a/tests/package/generic/whitespace_formatting_001.phpt +++ b/tests/package/generic/whitespace_formatting_001.phpt @@ -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); diff --git a/tests/package/php/bug49101-1.phpt b/tests/package/php/bug49101-1.phpt index acd3b0c6..ac30b8e9 100644 --- a/tests/package/php/bug49101-1.phpt +++ b/tests/package/php/bug49101-1.phpt @@ -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); diff --git a/tests/package/php/bug49101-2.phpt b/tests/package/php/bug49101-2.phpt index 5640815a..07661c6c 100644 --- a/tests/package/php/bug49101-2.phpt +++ b/tests/package/php/bug49101-2.phpt @@ -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); diff --git a/tests/package/php/bug49102-1.phpt b/tests/package/php/bug49102-1.phpt index 545eee78..316809c7 100644 --- a/tests/package/php/bug49102-1.phpt +++ b/tests/package/php/bug49102-1.phpt @@ -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); diff --git a/tests/package/php/bug_doc-en_GH-3179.phpt b/tests/package/php/bug_doc-en_GH-3179.phpt index e5bb9809..64a50d86 100644 --- a/tests/package/php/bug_doc-en_GH-3179.phpt +++ b/tests/package/php/bug_doc-en_GH-3179.phpt @@ -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); diff --git a/tests/package/php/class_rendering_001.phpt b/tests/package/php/class_rendering_001.phpt index 44bb6355..0448efcf 100644 --- a/tests/package/php/class_rendering_001.phpt +++ b/tests/package/php/class_rendering_001.phpt @@ -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); diff --git a/tests/package/php/class_rendering_002.phpt b/tests/package/php/class_rendering_002.phpt index 4add8f52..302dbe6f 100644 --- a/tests/package/php/class_rendering_002.phpt +++ b/tests/package/php/class_rendering_002.phpt @@ -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); diff --git a/tests/package/php/class_rendering_003.phpt b/tests/package/php/class_rendering_003.phpt index 005ff003..78d51202 100644 --- a/tests/package/php/class_rendering_003.phpt +++ b/tests/package/php/class_rendering_003.phpt @@ -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); diff --git a/tests/package/php/constant_links_001.phpt b/tests/package/php/constant_links_001.phpt index 01bffc6a..07f23b82 100644 --- a/tests/package/php/constant_links_001.phpt +++ b/tests/package/php/constant_links_001.phpt @@ -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 = [ [ diff --git a/tests/package/php/exception_rendering_001.phpt b/tests/package/php/exception_rendering_001.phpt index 780180a0..9b6b440e 100644 --- a/tests/package/php/exception_rendering_001.phpt +++ b/tests/package/php/exception_rendering_001.phpt @@ -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); diff --git a/tests/package/php/exception_rendering_002.phpt b/tests/package/php/exception_rendering_002.phpt index 9a5ba51e..327feb50 100644 --- a/tests/package/php/exception_rendering_002.phpt +++ b/tests/package/php/exception_rendering_002.phpt @@ -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); diff --git a/tests/package/php/exception_rendering_003.phpt b/tests/package/php/exception_rendering_003.phpt index 252b0655..06d349f3 100644 --- a/tests/package/php/exception_rendering_003.phpt +++ b/tests/package/php/exception_rendering_003.phpt @@ -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); diff --git a/tests/package/php/faq001.phpt b/tests/package/php/faq001.phpt index d883cfe1..023840ac 100644 --- a/tests/package/php/faq001.phpt +++ b/tests/package/php/faq001.phpt @@ -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); diff --git a/tests/package/php/type_rendering_001.phpt b/tests/package/php/type_rendering_001.phpt index 7300eb9a..60657658 100644 --- a/tests/package/php/type_rendering_001.phpt +++ b/tests/package/php/type_rendering_001.phpt @@ -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); diff --git a/tests/package/php/type_rendering_002.phpt b/tests/package/php/type_rendering_002.phpt index 17fbd29a..2e99387a 100644 --- a/tests/package/php/type_rendering_002.phpt +++ b/tests/package/php/type_rendering_002.phpt @@ -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); diff --git a/tests/package/php/type_rendering_003.phpt b/tests/package/php/type_rendering_003.phpt index f9da13db..18aa17dd 100644 --- a/tests/package/php/type_rendering_003.phpt +++ b/tests/package/php/type_rendering_003.phpt @@ -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); diff --git a/tests/package/php/variablelist_rendering_001.phpt b/tests/package/php/variablelist_rendering_001.phpt index 5cce9e8f..4f4d45d8 100644 --- a/tests/package/php/variablelist_rendering_001.phpt +++ b/tests/package/php/variablelist_rendering_001.phpt @@ -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); diff --git a/tests/setup.php b/tests/setup.php index 4c7e5db5..37ebb2de 100644 --- a/tests/setup.php +++ b/tests/setup.php @@ -17,7 +17,7 @@ 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__];