Update the tools to use the new namespaces

This commit is contained in:
2021-05-10 15:04:36 +02:00
parent eb30d8ef97
commit 03ede5c375
4 changed files with 20 additions and 20 deletions

View File

@@ -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));
}