123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- define('DB_DATAOBJECT_NO_OVERLOAD', 1);
- require_once 'Generator.php';
- if (php_sapi_name() != 'cli') {
- (new PEAR)->raiseError("\nERROR: You must turn use the cli sapi to run this", null, PEAR_ERROR_DIE);
- }
- if (!ini_get('register_argc_argv')) {
- (new PEAR)->raiseError("\nERROR: You must turn register_argc_argv On in you php.ini file for this to work\neg.\n\nregister_argc_argv = On\n\n", null, PEAR_ERROR_DIE);
- exit;
- }
- if (!@$_SERVER['argv'][1]) {
- (new PEAR)->raiseError("\nERROR: createTable.php usage:\n\n" . $_SERVER['argv'][0] . " example.ini\n\n", null, PEAR_ERROR_DIE);
- exit;
- }
- $config = parse_ini_file($_SERVER['argv'][1], true);
- foreach ($config as $class => $values) {
- $options = &(new PEAR)->getStaticProperty($class, 'options');
- $options = $values;
- }
- $options = &(new PEAR)->getStaticProperty('DB_DataObject', 'options');
- if (empty($options)) {
- (new PEAR)->raiseError("\nERROR: could not read ini file\n\n", null, PEAR_ERROR_DIE);
- exit;
- }
- set_time_limit(0);
- DB_DataObject::debugLevel(isset($options['debug']) ? $options['debug'] : 1);
- $generator = new DB_DataObject_Generator;
- $generator->start();
|