diff --git a/tools/markdown.php b/tools/markdown.php index a054bf3..d743cf8 100755 --- a/tools/markdown.php +++ b/tools/markdown.php @@ -1,7 +1,7 @@ #!/usr/bin/php */ -require_once ("domframework/getopts.php"); -require_once ("domframework/dblayeroo.php"); +require_once (__DIR__."/../src/Getopts.php"); +require_once (__DIR__."/../src/Dblayeroo.php"); /** Generate the model files from an existing database * Provide the DSN to connect to the database, and the program will generate @@ -33,7 +33,7 @@ class modelGenerator */ public function __construct () { - $getopts = new \getopts (); + $getopts = new Domframework\Getopts (); $getopts->add ("Help", "?h", "help", "Help of the software"); $getopts->add ("DSN", "", "dsn:", "DSN - Data Source Name\n". " Exemple : --dsn \"mysql:dbname=DBNAME\"", @@ -70,7 +70,7 @@ class modelGenerator $this->namespaceName = $getopts->get ("Namespace"); try { - $this->db = new \dblayeroo ($dsn, + $this->db = new Domframework\Dblayeroo ($dsn, $getopts->get ("Username"), $getopts->get ("Password")); } diff --git a/tools/modelGraph.php b/tools/modelGraph.php index 95e749e..62591df 100755 --- a/tools/modelGraph.php +++ b/tools/modelGraph.php @@ -5,7 +5,7 @@ * @author Dominique Fournier */ -require_once ("domframework/dblayeroo.php"); +require_once (__DIR__."/../src/Dblayeroo.php"); /** modelGraph * Allow to create the relational graph of an existing database @@ -32,7 +32,7 @@ class modelgraph // {{{ { $this->output = $output; - $this->db = new \dblayeroo ($dsn, $username, $password); + $this->db = new Domframework\Dblayeroo ($dsn, $username, $password); $this->graphvizCommande (); } // }}} diff --git a/tools/sqlMigrate.php b/tools/sqlMigrate.php index 34270c8..a09929e 100755 --- a/tools/sqlMigrate.php +++ b/tools/sqlMigrate.php @@ -14,10 +14,10 @@ * informations will be stored. The file will be created if it doesn't exists. */ -require_once ("domframework/console.php"); -require_once ("domframework/dblayeroo.php"); -require_once ("domframework/getopts.php"); -require_once ("domframework/config.php"); +require_once (__DIR__."/../src/Console.php"); +require_once (__DIR__."/../src/Dblayeroo.php"); +require_once (__DIR__."/../src/Getopts.php"); +require_once (__DIR__."/../src/Config.php"); /** Manage the configuration file */ @@ -58,7 +58,7 @@ class main public function __construct () { // Manage the Getopts - $getopts = new getopts (); + $getopts = new Domframework\Getopts (); $getopts->add ("Help", "?h", array ("help"), "Help of the software"); $getopts->add ("Step", "", array ("step:"), "Restart at provided step", "StepIdentifier"); @@ -74,13 +74,13 @@ class main die ("Invalid Step provided (Must be between 0 and 6)\n"); } if (empty ($getopts->restOfLine ())) - throw new Exception ("No configuration file provided"); + throw new \Exception ("No configuration file provided"); if (count ($getopts->restOfLine ()) > 1) - throw new Exception ("Too much configuration file provided"); + throw new \Exception ("Too much configuration file provided"); $configurationFile = current ($getopts->restOfLine ()); if (! file_exists ($configurationFile)) touch ($configurationFile); - $config = new configuration (); + $config = new Domframework\Configuration (); $config->confFile = $configurationFile; $db = $config->get ("db"); @@ -143,10 +143,10 @@ class main if ($step === 1) { echo "#### Entering step 1: read the existing databases schemes\n"; - $srcDB = new dblayeroo ($db["srcDSN"], $db["srcUser"], + $srcDB = new Domframework\Dblayeroo ($db["srcDSN"], $db["srcUser"], $db["srcPassword"]); $srcTables = $srcDB->listTables (); - $dstDB = new dblayeroo ($db["dstDSN"], $db["dstUser"], + $dstDB = new Domframework\Dblayeroo ($db["dstDSN"], $db["dstUser"], $db["dstPassword"]); $dstTables = $dstDB->listTables (); $value = array ( @@ -159,9 +159,9 @@ class main } echo "#### Connect to the defined databases\n"; - $srcDB = new dblayeroo ($db["srcDSN"], $db["srcUser"], + $srcDB = new Domframework\Dblayeroo ($db["srcDSN"], $db["srcUser"], $db["srcPassword"]); - $dstDB = new dblayeroo ($db["dstDSN"], $db["dstUser"], + $dstDB = new Domframework\Dblayeroo ($db["dstDSN"], $db["dstUser"], $db["dstPassword"]); echo "\n"; @@ -358,7 +358,7 @@ class main */ public function ask ($question, $proposal = "") { - $console = new console (); + $console = new Domframework\Console (); $console->echo ("$question: "); return trim ($console->readline ($proposal)); }