#!/usr/local/bin/php -q -c /usr/local/etc
<?php
// this PHP script must be used from Command line
// the script create a file with a PHP class
// is like a Command Line CASE tool for php
//
//
// Arguments
//# $1 Variables for the Class in a Text file
//# $2 Class name
//# $3 Extends class name. MysqlRecordSet for this sample
// see example of MysqlRecordSet at
// LINK1http://examples.weberdev.com/get_example.php3?count=3576LINK1
//# $4 Table name that will host the class data
//# $5 Output file name
//
// step one we Read the file that have the Variables
$campos = file($argv[1]);
$fp = fopen ($argv[5], "a");
// step 2 create the class name
fputs($fp,"<?\n");
fputs($fp,"class ". $argv[2] . " extends " . $argv[3] . "\n");
fputs($fp," {\n");
// step 3 the Variables where created here
for ($x=0;$x<(sizeof($campos));$x++)
{
fputs($fp," var \$". trim($campos[$x],"\n") .";\n");
}
// End the Constructor
//Funciontions Add,Del,Query,Update
//see example of MysqlRecordSet at
// LINK2http://examples.weberdev.com/get_example.php3?count=3576LINK2