Source for file DoctypeRegistry.php
Documentation is available at DoctypeRegistry.php
* Hash of doctype names to doctype objects
* Lookup table of aliases to real doctype names
* Registers a doctype to the registry
* @note Accepts a fully-formed doctype object, or the
* parameters for constructing a doctype object
* @param $doctype Name of doctype or literal doctype object
* @param $modules Modules doctype will load
* @param $modules_for_modes Modules doctype will load for certain modes
* @param $aliases Alias names for doctype
* @return Editable registered doctype
public function register($doctype, $xml =
true, $modules =
array(),
$tidy_modules =
array(), $aliases =
array(), $dtd_public =
null, $dtd_system =
null
if (!is_array($modules)) $modules =
array($modules);
if (!is_array($tidy_modules)) $tidy_modules =
array($tidy_modules);
if (!is_array($aliases)) $aliases =
array($aliases);
$doctype, $xml, $modules, $tidy_modules, $aliases, $dtd_public, $dtd_system
$this->doctypes[$doctype->name] =
$doctype;
foreach ($doctype->aliases as $alias) {
if (isset
($this->doctypes[$alias])) continue;
* Retrieves reference to a doctype of a certain name
* @note This function resolves aliases
* @note When possible, use the more fully-featured make()
* @param $doctype Name of doctype
* @return Editable doctype object
public function get($doctype) {
if (isset
($this->aliases[$doctype])) $doctype =
$this->aliases[$doctype];
if (!isset
($this->doctypes[$doctype])) {
* Creates a doctype based on a configuration object,
* will perform initialization on the doctype
* @note Use this function to get a copy of doctype that config
* can hold on to (this is necessary in order to tell
* Generator whether or not the current document is XML
public function make($config) {
* Retrieves the doctype from the configuration object
$doctype =
$config->get('HTML', 'Doctype');
if (!empty($doctype)) return $doctype;
$doctype =
$config->get('HTML', 'CustomDoctype');
if (!empty($doctype)) return $doctype;
// backwards-compatibility
if ($config->get('HTML', 'XHTML')) {
if ($config->get('HTML', 'Strict')) {
$doctype .=
' Transitional';
Documentation generated on Thu, 19 Jun 2008 18:49:04 -0400 by phpDocumentor 1.4.2