Пример #1
0
 function __construct()
 {
     $this->db = Magirc_DB::getInstance();
     $this->cfg = new Config();
     $this->slim = new \Slim\Slim();
     $this->tpl = new Smarty();
     $this->tpl->template_dir = 'tpl';
     $this->tpl->compile_dir = '../tmp';
     $this->tpl->config_dir = '../conf';
     $this->tpl->cache_dir = '../tmp';
     $this->tpl->error_reporting = E_ALL & ~E_NOTICE;
     $this->tpl->autoload_filters = array('pre' => array('jsmin'));
     $this->tpl->addPluginsDir('../lib/smarty-plugins/');
     $this->ckeditor = new CKEditor();
     $this->ckeditor->basePath = $this->cfg->base_url . 'js/ckeditor/';
     $this->ckeditor->returnOutput = true;
     $this->ckeditor->config['height'] = 300;
     $this->ckeditor->config['width'] = 740;
     $this->ckeditor->config['baseHref'] = '../';
     $this->ckeditor->config['contentsCss'] = array('../theme/' . $this->cfg->theme . '/css/styles.css', '../theme/' . $this->cfg->theme . '/css/editor.css', 'http://fonts.googleapis.com/css?family=Share');
     $this->ckeditor->config['docType'] = '<!DOCTYPE html>';
     $this->ckeditor->config['emailProtection'] = 'encode';
     $this->ckeditor->config['entities'] = true;
     $this->ckeditor->config['forcePasteAsPlainText'] = true;
     $this->ckeditor->config['language'] = 'en';
     $this->ckeditor->config['resizeEnabled'] = true;
     $this->ckeditor->config['toolbar'] = array(array('Maximize', 'ShowBlocks', 'Preview', 'Templates'), array('Cut', 'Copy', 'PasteText', '-', 'Print', 'Scayt'), array('Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'), array('Source'), array('Link', 'Unlink', 'Anchor'), array('Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar'), '/', array('Format', 'FontSize', 'TextColor', 'BGColor'), array('Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript'), array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'), array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'));
 }
Пример #2
0
 function __construct()
 {
     $this->tpl = new Smarty();
     $this->tpl->template_dir = 'tpl';
     $this->tpl->compile_dir = '../tmp';
     $this->tpl->cache_dir = 'tmp';
     $this->tpl->autoload_filters = array('pre' => array('jsmin'));
     $this->tpl->addPluginsDir('../lib/smarty-plugins/');
     // We skip db connection in the first steps for check purposes
     if (@$_GET['step'] > 2) {
         $this->db = Magirc_DB::getInstance();
     }
 }
Пример #3
0
<?php

$status = $setup->requirementsCheck();
if ($status['error']) {
    die('Failure. <a href="?step=1">back</a>');
}
// Handle saving of the database configuration
$setup->saveConfig();
// Check Magirc Database connection
if (file_exists(MAGIRC_CFG_FILE)) {
    include MAGIRC_CFG_FILE;
    if (isset($db) && is_array($db)) {
        $setup->db = Magirc_DB::getInstance();
        $status['error'] = $setup->db->error;
        $setup->tpl->assign('db_magirc', $db);
    } else {
        $status['error'] = "Invalid configuration file";
    }
} else {
    $setup->tpl->assign('db_magirc', array('username' => '', 'password' => '', 'database' => '', 'hostname' => 'localhost', 'port' => 3306, 'ssl' => false, 'ssl_key' => null, 'ssl_cert' => null, 'ssl_ca' => null));
    $status['error'] = 'new';
}
// Handle database initialization/upgrade
$dump = $check = $updated = false;
if (!$status['error']) {
    $check = $setup->configCheck();
    $setup->tpl->assign('check', $check);
    if (!$check) {
        // Dump sql file to db
        $dump = $setup->configDump();
        $base_url = $setup->generateBaseUrl();