示例#1
0
$table = table::factory();
$table->addRow()->addCell(lang::get('type'))->addCell(lang::get('value'))->addCell(lang::get('status'));
$table->addSection('tbody');
$table->addRow()->addCell(lang::get('php_version'))->addCell('>5.4');
if (version_compare(phpversion(), '5.4', '<')) {
    $table->addCell('<span class="label label-danger">' . lang::get('php_version_54') . '</span>');
} else {
    $table->addCell('<span class="label label-success">' . lang::get('ok') . '</span>');
}
$writeable = [dir::cache(), dir::backend('addons' . DIRECTORY_SEPARATOR), dir::backend('lib' . DIRECTORY_SEPARATOR . 'config.json')];
function stripPath($file)
{
    return str_replace(dir::base(), '', $file);
}
foreach ($writeable as $file) {
    $table->addRow()->addCell(stripPath($file))->addCell('0755');
    if (is_file($file)) {
        if (is_writeable($file)) {
            $table->addCell('<span class="label label-success">' . lang::get('ok') . '</span>');
        } else {
            $table->addCell('<span class="label label-danger">' . lang::get('chmod_755') . '</span>');
            $error = true;
        }
    } elseif (is_dir($file)) {
        if (is_writeable($file)) {
            $table->addCell('<span class="label label-success">' . lang::get('ok') . '</span>');
        } else {
            $table->addCell('<span class="label label-danger">' . lang::get('chmod_755') . '</span>');
            $error = true;
        }
    }
示例#2
0
文件: setup.php 项目: hoksi/Textcube
    foreach ($_COOKIE as $key => $value) {
        $_COOKIE[$key] = stripslashes($value);
    }
}
$host = explode(':', $_SERVER['HTTP_HOST']);
if (count($host) > 1) {
    $_SERVER['HTTP_HOST'] = $host[0];
    $_SERVER['SERVER_PORT'] = $host[1];
}
unset($host);
if (empty($accessInfo)) {
    $root = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 10);
    $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10));
} else {
    $root = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 12);
    $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 12));
}
$_SERVER['PHP_SELF'] = rtrim($_SERVER['PHP_SELF'], '/');
// Set default table prefix.
if (isset($_POST['dbPrefix']) && $_POST['dbPrefix'] == '') {
    $_POST['dbPrefix'] == 'tc_';
}
$context = Model_Context::getInstance();
$context->setProperty('import.library', array('function.string', 'function.time', 'function.javascript', 'function.html', 'function.xml', 'function.mail'));
if (isset($_POST['dbms'])) {
    $database['dbms'] = $_POST['dbms'];
}
require ROOT . '/library/include.php';
importlib('model.blog.blogSetting');
importlib('model.blog.entry');
importlib('auth');