<?php
$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_7618fa2e44dd7" . "c2de26ed1413b5" . "3cddd" => base64_decode("Ly4uLy4uLy" . "4uL3NldHVw"), "_dcf86ccc31af7" . "f63af36115aa12" . "b1ee7" => base64_decode("Y2hkaXI" . "="), "_9342063570b40df207520" . "4394b59df59" => base64_decode("Z2V0Y3" . "dk"), "_dda96eb36c5664b9e2bd4" . "34a776edb25" => base64_decode("L1BoaW5nTG9nZ2VyLn" . "BocA=="), "_11def3af2a83" . "3468dd0e4ff1f" . "0bc5414" => base64_decode("Li4vY29yZS9ib290c3RyY" . "XAucGhw"), "_e13e80e20d331fac" . "e5f56ce9d9be42cd" => base64_decode("cmVzdG9yZV9lcnJvcl" . "9oYW5kbGVy"), "_70dc1ee5e25ad" . "6e161d08e0a3cd" . "16124" => base64_decode("VXBkYXRpbmcgYXBwbGljYXRpb2" . "4gaW5zdGVhZA=="), "_eb3d186008f632a0f30f9ceb2ecf5d9" . "c" => base64_decode("cmVjb" . "3Zlcg" . "=="));
require_once __DIR__ . $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_dda96eb36c5664b9e2bd434a" . "776edb25"];
use Claromentis\Setup\Exception\AlreadyInstalledException;
use Claromentis\Setup\Util;




class DbInstallTask extends Task
{
    
    
    
    
    protected $application = null;
    public function init()
    {
    }
    public function main()
    {
        $_33cd0a6efc4dc46179519f04eaa36255 = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_9342063570b40df207" . "5204394b59df59"]();
        $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_dcf86ccc31af7f63af" . "36115aa12b1ee7"](__DIR__ . $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_7618fa2e44dd7c2de26ed1413" . "b53cddd"]);
        require_once $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_11def3af2a833468dd0e4ff" . "1f0bc5414"];
        $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_e13e80e20d331face5f5" . "6ce9d9be42cd"]();
        global $g_application;
        try {
            global $db;
            $db = $g_application->db;
            $_4825e032d19ebe3edee32a6a54c7afd2 = Util::GetApplicationPath($this->application, $g_application, $this->project);
            $_19eb5dd674f41f73f28cc12c375e91bd = new \Claromentis\Setup\Task\Install($db, $this->application, $_4825e032d19ebe3edee32a6a54c7afd2);
            $_19eb5dd674f41f73f28cc12c375e91bd->setLogger(new PhingLogger($this->project));
            $_19eb5dd674f41f73f28cc12c375e91bd->setProperties($this->project->GetProperties());
            try {
                $_19eb5dd674f41f73f28cc12c375e91bd->Install();
            } catch (AlreadyInstalledException $e) {
                if ($this->project->getProperty($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_eb3d186008f632a0f3" . "0f9ceb2ecf5d9c"])) {
                    $this->log($e->getMessage(), Project::MSG_WARN);
                    $this->log($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_70dc1ee5e25ad6e161d08e0a" . "3cd16124"], Project::MSG_INFO);
                    $_19eb5dd674f41f73f28cc12c375e91bd->Update();
                } else {
                    throw $e;
                }
            }
        } catch (Exception $e) {
            $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_dcf86ccc31af" . "7f63af36115aa" . "12b1ee7"]($_33cd0a6efc4dc46179519f04eaa36255);
            $this->log($e->getMessage(), Project::MSG_ERR);
            throw new BuildException($e->getMessage());
        }
        $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_dcf86ccc31af7" . "f63af36115aa12" . "b1ee7"]($_33cd0a6efc4dc46179519f04eaa36255);
    }
    
    
    
    
    
    
    public function setApplication($_f44467aacb8a4520c7382769d24aa422)
    {
        $this->application = $_f44467aacb8a4520c7382769d24aa422;
    }
}