PHP Classes

File: exercise/milkco/common.php

Recommend this page to a friend!
  Packages of Jorge Castro   Chaos Machine One   exercise/milkco/common.php   Download  
File: exercise/milkco/common.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Chaos Machine One
Generate random data that obeys to formulas
Author: By
Last change:
Date: 8 months ago
Size: 1,176 bytes
 

Contents

Class file image Download
<?php

use eftec\chaosmachineone\ChaosMachineOne;
use
eftec\PdoOne;

@
set_time_limit(200);

include
"../../vendor/autoload.php";
include_once
"../../lib/en_US/Person.php";
include_once
__DIR__.'/SakilaLib.php';
//include_once "../../lib/en_US/World.php";
include_once '../../lib/en_US/cities_lite.php';
include_once
"../../lib/en_US/Address.php";
include_once
"../../lib/en_US/Company.php";


//$db=new PdoOne("mysql","localhost","root","abc.123","milkco");
$db=new PdoOne("sqlsrv","PCJC\SQLSERVER2017","sa","ats475","milkco");
$db->logLevel=3;
$db->open();



$chaos=new ChaosMachineOne();
$chaos->debugMode=true;
$chaos->setDb($db);



/*
$tables=$db->tableSorted();
foreach($tables as $table) {
    echo "truncate table `".$table."`;<br>";
}


$tables=$db->objectList('table','true');

foreach($tables as $table) {
    $file=$table.'.php';
    if(!file_exists($file)) {
        $chaos=new ChaosMachineOne();
        $chaos->setDb($db);
        $code="<?php\n";
        $code.="use eftec\chaosmachineone\ChaosMachineOne;\n";
        $code.="\n include 'common.php';\n";
        $code.=$chaos->generateCode($table);
        file_put_contents($file,$code);
    }
}
*/
/*

 */