本文整理汇总了PHP中Schema::openConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::openConnection方法的具体用法?PHP Schema::openConnection怎么用?PHP Schema::openConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema::openConnection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Schema
// | xmi2db |
// | Creating SQL Queries from an xmi file |
// | Requirements: PHP5 with SimpleXMI Support |
// +----------------------------------------------------------------------+
// | Author: Christian Seip <christian.seip@gdi-service.de> |
// +----------------------------------------------------------------------+
// based on http://www.phpclasses.org/package/2272-PHP-Generate-SQL-queries-to-import-data-from-XML-files.html
//Begin Start Pascoul
require_once '../lib/pascoul/pascoul.php';
include '../classes/schema.php';
include '../classes/logger.php';
include '../conf/database_conf.php';
$xmi2db = new xmi2db("XMI.content");
#Set DB connection
$schema = new Schema($xmi2db->schema, new Logger(0));
$xmi2db->setConn($schema->openConnection(PG_HOST, PG_DBNAME, PG_USER, PG_PASSWORD));
$xmi2db->start();
class xmi2db
{
private $root_element;
private $table;
private $data;
private $xmi_file;
private $basePackage;
private $progress;
/**
* Constructor
*
* @param XMI root element
*/
function xmi2db($root)
示例2: array
include '../classes/featuretype.php';
if (file_exists(FILTER_FILE)) {
$filter = json_decode(file_get_contents(FILTER_FILE), true);
} else {
$logger->log("Filterdatei " . FILTER_FILE . " nicht gefunden.");
$filter = array();
}
$tabNameAssoc = array();
$log_sql = '';
$logger = new Logger(LOGLEVEL);
#*****************************************************************************
#
#*****************************************************************************
# Initialize the umlSchema object
$umlSchema = new Schema(UML_SCHEMA, $logger);
$umlSchema->openConnection(PG_HOST, PG_DBNAME, PG_USER, PG_PASSWORD);
# Initialize the gmlSchema object
$ogrSchema = new OgrSchema(OGR_SCHEMA, $logger);
$ogrSchema->umlSchema = $umlSchema;
$sql = $ogrSchema->asSql();
#**************
# FeatureTypes
#**************
# Lade oberste Klassen vom Typ FeatureType, die von keinen anderen abgeleitet wurden
$topClasses = $umlSchema->getTopUmlClasses('FeatureType');
# Für alle oberen Klassen
foreach ($topClasses as $topClass) {
$ogrSchema->listFeatureTypesAttributes('FeatureType', null, $topClass, false);
}
# Sortiere Ausgabeliste
ksort($ogrSchema->renameList);