/** * Returns a reference to the a Table object, always creating it * * @param type $type The table type to instantiate * @param string $prefix A prefix for the table class name. Optional. * @param array $options Configuration array for model. Optional. * @return database A database object * @since 1.5 */ function &getInstance($type, $prefix = 'bTable', $config = array()) { $false = false; $type = preg_replace('/[^A-Z0-9_\\.-]/i', '', $type); $tableClass = $prefix . ucfirst($type); if (!class_exists($tableClass)) { $file = DS . strtolower($type) . '.php'; $path = false; foreach (bTable::addIncludePath() as $path) { if (is_file($path . $file)) { $path = $path . $file; break; } } if ($path) { require_once $path; if (!class_exists($tableClass)) { trigger_error('Table class ' . $tableClass . ' not found in file.'); return $false; } } else { trigger_error('Table ' . $type . ' not supported. File not found.'); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db =& ROLESFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
require_once dirname(__FILE__) . DS . 'helper.php'; ini_set('memory_limit', '200M'); if (!isset($wp_did_header)) { $wp_did_header = true; if (is_file(byrd_rootfolder(__FILE__) . DS . 'wp-load.php')) { require_once byrd_rootfolder(__FILE__) . DS . 'wp-load.php'; require_once ABSPATH . WPINC . DS . 'template-loader.php'; } else { trigger_error('Problem loading Wordpress Framework.'); } } //loading resources require_once dirname(__FILE__) . DS . 'request.php'; require_once dirname(__FILE__) . DS . 'object.php'; require_once dirname(__FILE__) . DS . 'capabilities.class.php'; require_once dirname(__FILE__) . DS . 'role.class.php'; require_once dirname(__FILE__) . DS . 'properties.php'; require_once dirname(__FILE__) . DS . 'configclass.php'; require_once dirname(__FILE__) . DS . 'siteclass.php'; require_once dirname(__FILE__) . DS . 'factory.php'; if (!class_exists('Email')) { require_once dirname(__FILE__) . DS . 'phpmail.php'; } if (!function_exists('file_get_html')) { require_once dirname(__FILE__) . DS . 'simple_html_dom.php'; } require_once ROL_DATABASE . DS . 'database.php'; require_once ROL_DATABASE . DS . 'table.php'; //make sure to add the db tables include path bTable::addIncludePath(ROL_TABLES);
} require_once dirname(__FILE__) . '/defines.php'; require_once dirname(__FILE__) . DS . 'helper.php'; ini_set('memory_limit', '200M'); if (!isset($wp_did_header)) { $wp_did_header = true; if (is_file(byrd_rootfolder(__FILE__) . DS . 'wp-load.php')) { require_once byrd_rootfolder(__FILE__) . DS . 'wp-load.php'; require_once ABSPATH . WPINC . DS . 'template-loader.php'; } else { trigger_error('Problem loading Wordpress Framework.'); } } //loading resources require_once dirname(__FILE__) . DS . 'request.php'; require_once dirname(__FILE__) . DS . 'object.php'; require_once dirname(__FILE__) . DS . 'properties.php'; require_once dirname(__FILE__) . DS . 'configclass.php'; require_once dirname(__FILE__) . DS . 'siteclass.php'; require_once dirname(__FILE__) . DS . 'factory.php'; if (!class_exists('Email')) { require_once dirname(__FILE__) . DS . 'phpmail.php'; } if (!function_exists('file_get_html')) { require_once dirname(__FILE__) . DS . 'simple_html_dom.php'; } require_once EXP_DATABASE . DS . 'database.php'; require_once EXP_DATABASE . DS . 'table.php'; //make sure to add the db tables include path bTable::addIncludePath(EXP_TABLES);