Ejemplo n.º 1
0
function apache_version()
{
    preg_match('/Apache[\\-\\/]([0-9\\.\\-]+)/', ob_wrapper(function () {
        phpinfo();
    }), $version);
    return $version[1];
}
Ejemplo n.º 2
0
 /**
  * Blocks processing
  */
 protected function blocks_processing()
 {
     $Config = Config::instance();
     $Page = Page::instance();
     $Text = Text::instance();
     $blocks_array = ['top' => '', 'left' => '', 'right' => '', 'bottom' => ''];
     foreach ($Config->components['blocks'] as $block) {
         if (!$block['active'] || $block['expire'] != 0 && $block['expire'] < TIME || $block['start'] > TIME || !User::instance()->get_permission('Block', $block['index'])) {
             continue;
         }
         $block['title'] = $Text->process($Config->module('System')->db('texts'), $block['title'], true, true);
         if (Trigger::instance()->run('System/Index/block_render', ['block' => $block['index'], 'blocks_array' => &$blocks_array])) {
             switch ($block['type']) {
                 default:
                     $content = ob_wrapper(function () use($block) {
                         include BLOCKS . "/block.{$block['type']}.php";
                     });
                     break;
                 case 'html':
                 case 'raw_html':
                     $content = $Text->process($Config->module('System')->db('texts'), $block['content'], true, true);
                     break;
             }
             $template = TEMPLATES . '/blocks/block.' . (file_exists(TEMPLATES . "/blocks/block.{$block['template']}") ? $block['template'] : 'default.html');
             $content = str_replace(['<!--id-->', '<!--title-->', '<!--content-->'], [$block['index'], $block['title'], $content], ob_wrapper(function () use($template) {
                 _include($template);
             }));
             if ($block['position'] == 'floating') {
                 $Page->replace("<!--block#{$block['index']}-->", $content);
             } else {
                 $blocks_array[$block['position']] .= $content;
             }
         }
     }
     $Page->Top .= $blocks_array['top'];
     $Page->Left .= $blocks_array['left'];
     $Page->Right .= $blocks_array['right'];
     $Page->Bottom .= $blocks_array['bottom'];
 }
Ejemplo n.º 3
0
/**
 * Check existence of mcrypt
 *
 * @return bool
 */
function check_mcrypt()
{
    return preg_match('/mcrypt support<\\/th><th>enabled/', ob_wrapper(function () {
        phpinfo(INFO_MODULES);
    }));
}