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