adoSchema::ContinueOnError PHP Method

ContinueOnError() public method

Call this method to enable or disable continuation of SQL execution if an error occurs. If the mode is set to TRUE (continue), AXMLS will continue to apply SQL to the database, even if an error occurs. If the mode is set to FALSE (halt), AXMLS will halt execution of generated sql if an error occurs, though parsing of the schema will continue.
public ContinueOnError ( boolean $mode = NULL ) : boolean
$mode boolean execute
return boolean current continueOnError mode
    function ContinueOnError($mode = NULL)
    {
        if (is_bool($mode)) {
            $this->continueOnError = $mode;
        }
        return $this->continueOnError;
    }

Usage Example

Exemplo n.º 1
0
 */
// Create the schema object and build the query array.
$schema = new adoSchema($db);
$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>
');
All Usage Examples Of adoSchema::ContinueOnError