Пример #1
0
function mkd($path)
{
    if (!is_dir($path)) {
        $rs = @mkdir($path, 0777, true);
        if ($rs) {
            $rs = @chmod($path, 0777);
        }
    }
    if (!is_file("{$path}/index.html")) {
        $rs = @file_put_contents("{$path}/index.html", '');
        if ($rs) {
            @chmod("{$path}/index.html", 0666);
        }
        if (!is_writable("{$path}/index.html")) {
            echo echo_failed($path);
        }
    }
    return $rs;
}
Пример #2
0
$schema->SetPrefix($db_table_prefix);
// Build the SQL array
$schema->ParseSchema('schema.xml');
// maybe display this if $gacl->debug is true?
if ($gacl->_debug) {
    print "Here's the SQL to do the build:<br />\n<code>";
    print $schema->getSQL('html');
    print "</code>\n";
    // exit;
}
// Execute the SQL on the database
#ADODB's xmlschema is being lame, continue on error.
$schema->ContinueOnError(TRUE);
$result = $schema->ExecuteSchema();
if ($result != 2) {
    echo_failed('Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.');
}
if ($failed <= 0) {
    echo_success('
Installation Successful!!!
<div align="center">
<font color="red"><b>*IMPORTANT*</b></font><br/>
<p>Please make sure you create the <b>&lt;phpGACL root&gt;/admin/templates_c</b> directory,
and give it <b>write permissions</b> for the user your web server runs as.</p>
<p>Please read the manual, and example.php to familiarize yourself with phpGACL.</p>
<a href="admin/about.php?first_run=1"><b>Let\'s get started!</b></a>
</div>
');
} else {
    echo_failed('Please fix the above errors and try again.');
}