mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
parent
7f099b211b
commit
5a913881a6
@ -8,6 +8,7 @@ INI files as source it enables you to store configuration in a familiar format.
|
|||||||
defines some configuration files for its own purposes. Please note that both modules and framework
|
defines some configuration files for its own purposes. Please note that both modules and framework
|
||||||
keep their main configuration in the INI file called config.ini. Here's some example code:
|
keep their main configuration in the INI file called config.ini. Here's some example code:
|
||||||
|
|
||||||
|
```php
|
||||||
<?php
|
<?php
|
||||||
use \Icinga\Application\Config as IcingaConfig;
|
use \Icinga\Application\Config as IcingaConfig;
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ keep their main configuration in the INI file called config.ini. Here's some exa
|
|||||||
// the module's config.ini. For using other files you have to pass this parameter though.
|
// the module's config.ini. For using other files you have to pass this parameter though.
|
||||||
// The following example loads values from the example module's extra.ini:
|
// The following example loads values from the example module's extra.ini:
|
||||||
IcingaConfig::module('example', 'extra')->logging->get('enabled', true);
|
IcingaConfig::module('example', 'extra')->logging->get('enabled', true);
|
||||||
|
```
|
||||||
|
|
||||||
## Reload from disk
|
## Reload from disk
|
||||||
|
|
||||||
|
@ -126,9 +126,26 @@ class DocParser
|
|||||||
$fileObject->flock(LOCK_UN);
|
$fileObject->flock(LOCK_UN);
|
||||||
}
|
}
|
||||||
$html = Parsedown::instance()->parse(implode('', $cat));
|
$html = Parsedown::instance()->parse(implode('', $cat));
|
||||||
|
$html = preg_replace_callback(
|
||||||
|
'#<pre><code class="language-php">(.*?)\</code></pre>#s',
|
||||||
|
array($this, 'highlight'),
|
||||||
|
$html
|
||||||
|
);
|
||||||
return array($html, $toc[0]->item);
|
return array($html, $toc[0]->item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Syntax highlighting for PHP code
|
||||||
|
*
|
||||||
|
* @param $match
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function highlight($match)
|
||||||
|
{
|
||||||
|
return highlight_string(htmlspecialchars_decode($match[1]), true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract atx- or setext-style headers from the given lines
|
* Extract atx- or setext-style headers from the given lines
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user