本文整理汇总了PHP中G::LoadSystemExist方法的典型用法代码示例。如果您正苦于以下问题:PHP G::LoadSystemExist方法的具体用法?PHP G::LoadSystemExist怎么用?PHP G::LoadSystemExist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::LoadSystemExist方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFromPMTable
/**
*
*
* Creates a Dynaform based on a PMTable
*
* @name createFromPMTable
* @author gustavo cruz gustavo[at]colosa[dot]com
* @param array $aData Fields with :
* $aData['DYN_UID'] the dynaform id
* $aData['USR_UID'] the userid
* string $pmTableUid uid of the PMTable
*
*/
public function createFromPMTable($aData, $pmTableUid)
{
$this->create($aData);
$aData['DYN_UID'] = $this->getDynUid();
//krumo(BasePeer::getFieldnames('Content'));
$fields = array();
//$oCriteria = new Criteria('workflow');
$pmTable = AdditionalTablesPeer::retrieveByPK($pmTableUid);
$addTabName = $pmTable->getAddTabName();
$keys = '';
if (isset($aData['FIELDS'])) {
foreach ($aData['FIELDS'] as $iRow => $row) {
if ($keys != '') {
$keys = $keys . '|' . $row['PRO_VARIABLE'];
} else {
$keys = $row['PRO_VARIABLE'];
}
}
} else {
$keys = ' ';
}
// $addTabKeys = $pmTable->getAddTabDynavars();
// $addTabKeys = unserialize($addTabKeys);
// $keys = '';
// foreach ( $addTabKeys as $addTabKey ){
// if (trim($addTabKey['CASE_VARIABLE'])!=''&&$keys!=''){
// $keys = $keys.'|'.$addTabKey['CASE_VARIABLE'];
// } else {
// $keys = $addTabKey['CASE_VARIABLE'];
// }
//
// }
// Determines the engine to use
// For a description of a table
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sql = $oDataBase->getTableDescription($addTabName);
} else {
$sql = 'DESC ' . $addTabName;
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$file = $aData['PRO_UID'] . '/' . $aData['DYN_UID'];
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
$ses = new DBSession($dbc);
$fieldXML = new DynaFormField($dbc);
$pmConnectionName = $addTabName . '_CONNECTION';
if ($aData['DYN_TYPE'] == 'xmlform') {
$labels = array();
$options = array();
$attributes = array('XMLNODE_NAME_OLD' => '', 'XMLNODE_NAME' => $pmConnectionName, 'TYPE' => 'pmconnection', 'PMTABLE' => $pmTableUid, 'KEYS' => $keys);
$fieldXML->Save($attributes, $labels, $options);
}
$keyRequered = '';
$countKeys = 0;
while ($res->next()) {
if ($res->get('Key') != '') {
$countKeys++;
}
if ($res->get('Extra') == 'auto_increment') {
$keyRequered .= $res->get('Field');
}
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
while ($res->next()) {
// if(strtoupper($res->get('Null'))=='NO') {
if (strtoupper($res->get($oDataBase->getFieldNull())) == 'NO') {
if ($countKeys == 1 && $res->get('Field') == $keyRequered) {
$required = '0';
} else {
$required = '1';
}
} else {
$required = '0';
}
$fieldName = $res->get('Field');
$defaultValue = $res->get('Default');
$labels = array(SYS_LANG => $fieldName);
$options = array();
$type = explode('(', $res->get('Type'));
switch ($type[0]) {
case 'text':
//.........这里部分代码省略.........
示例2: CONCAT
CONCAT(U.USR_LASTNAME, ' ', U.USR_FIRSTNAME) AS USR_FULLNAME
FROM
TASK_USER AS TU
LEFT JOIN
USERS AS U
ON (
TU.USR_UID = U.USR_UID
)
WHERE
TU.TAS_UID = '" . $_POST['TAS_UID'] . "' AND
TU.TU_TYPE = 1 AND
TU.TU_RELATION = 1 AND
U.USR_STATUS = 1");
*/
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sConcat = $oDataBase->concatString("U.USR_LASTNAME", "' '", "U.USR_FIRSTNAME");
}
$sSQL = " SELECT\n TU.USR_UID AS USR_UID, " . $sConcat . " AS USR_FULLNAME\n FROM\n TASK_USER AS TU\n LEFT JOIN\n USERS AS U\n ON (\n TU.USR_UID = U.USR_UID\n )\n WHERE\n TU.TAS_UID = '" . $_POST['TAS_UID'] . "' AND\n TU.TU_TYPE = 1 AND\n TU.TU_RELATION = 1 AND\n U.USR_STATUS = 1";
$oDataset = $oSession->Execute($sSQL);
while ($aRow = $oDataset->Read()) {
$sAux .= '<option value="' . $aRow['USR_UID'] . '">' . $aRow['USR_FULLNAME'] . '</option>';
}
$sAux .= '</select>';
echo $sAux;
break;
case 'EVALUATE':
G::LoadClass('application');
$oApplication = new Application(new DBConnection());
示例3: update
public function update($fields)
{
$con = Propel::getConnection(ReportTablePeer::DATABASE_NAME);
try {
$con->begin();
$this->load($fields['REP_TAB_UID']);
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$oValidate = $oDataBase->getValidate($this->validate());
} else {
$oValidate = $this->validate();
}
// if($this->validate())
if ($oValidate) {
$contentResult = 0;
if (array_key_exists("REP_TAB_TITLE", $fields)) {
$contentResult += $this->setRepTabTitle($fields["REP_TAB_TITLE"]);
}
$result = $this->save();
$result = $result == 0 ? $contentResult > 0 ? 1 : 0 : $result;
$con->commit();
return $result;
} else {
$con->rollback();
$validationE = new Exception("Failed Validation in class " . get_class($this) . ".");
$validationE->aValidationFailures = $this->getValidationFailures();
throw $validationE;
}
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
示例4: tableExist
/**
* Function tableExist
* Check if table exists
*
* @access public
* @return boolean
*/
public function tableExist()
{
/*
$bExists = true;
$oConnection = mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME);
$oDataset = mysql_query('SELECT COUNT(*) FROM REPORT_TABLE') || ($bExists = false);
return $bExists;
*/
$bExists = true;
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$bExists = $oDataBase->reportTableExist();
}
return $bExists;
}
示例5: verifyTable
public function verifyTable()
{
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sql = $oDataBase->createTableObjectPermission();
}
$con = Propel::getConnection("workflow");
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery();
}
示例6: createFromPMTable
/**
*
*
* Creates a Dynaform based on a PMTable
*
* @name createFromPMTable
* @author gustavo cruz gustavo[at]colosa[dot]com
* @param array $aData Fields with :
* $aData['DYN_UID'] the dynaform id
* $aData['USR_UID'] the userid
* string $pmTableUid uid of the PMTable
*
*/
public function createFromPMTable($aData, $pmTableUid)
{
$this->create($aData, $pmTableUid);
$aData['DYN_UID'] = $this->getDynUid();
//krumo(BasePeer::getFieldnames('Content'));
$fields = array();
//$oCriteria = new Criteria('workflow');
$pmTable = AdditionalTablesPeer::retrieveByPK($pmTableUid);
$addTabName = $pmTable->getAddTabName();
$keys = '';
if (isset($aData['FIELDS'])) {
foreach ($aData['FIELDS'] as $iRow => $row) {
if ($keys != '') {
$keys = $keys . '|' . $row['PRO_VARIABLE'];
} else {
$keys = $row['PRO_VARIABLE'];
}
}
} else {
$keys = ' ';
}
// $addTabKeys = $pmTable->getAddTabDynavars();
// $addTabKeys = unserialize($addTabKeys);
// $keys = '';
// foreach ( $addTabKeys as $addTabKey ){
// if (trim($addTabKey['CASE_VARIABLE'])!=''&&$keys!=''){
// $keys = $keys.'|'.$addTabKey['CASE_VARIABLE'];
// } else {
// $keys = $addTabKey['CASE_VARIABLE'];
// }
//
// }
// Determines the engine to use
// For a description of a table
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sql = $oDataBase->getTableDescription($addTabName);
} else {
$sql = 'DESC ' . $addTabName;
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
$file = $aData['PRO_UID'] . '/' . $aData['DYN_UID'];
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
$ses = new DBSession($dbc);
$fieldXML = new DynaFormField($dbc);
$pmConnectionName = $addTabName . '_CONNECTION';
if ($aData['DYN_TYPE'] == 'xmlform') {
$labels = array();
$options = array();
$attributes = array('XMLNODE_NAME_OLD' => '', 'XMLNODE_NAME' => $pmConnectionName, 'TYPE' => 'pmconnection', 'PMTABLE' => $pmTableUid, 'KEYS' => $keys);
$fieldXML->Save($attributes, $labels, $options);
}
$keyRequered = '';
$countKeys = 0;
while ($res->next()) {
if ($res->get('Key') != '') {
$countKeys++;
}
if ($res->get('Extra') == 'auto_increment') {
$keyRequered .= $res->get('Field');
}
}
$dbh = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
$sth = $dbh->createStatement();
$res = $sth->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
while ($res->next()) {
// if(strtoupper($res->get('Null'))=='NO') {
if (strtoupper($res->get($oDataBase->getFieldNull())) == 'NO') {
if ($countKeys == 1 && $res->get('Field') == $keyRequered) {
$required = '0';
} else {
$required = '1';
}
} else {
$required = '0';
}
$fieldName = $res->get('Field');
$defaultValue = $res->get('Default');
$labels = array(SYS_LANG => $fieldName);
$options = array();
$type = explode('(', $res->get('Type'));
switch ($type[0]) {
case 'text':
//.........这里部分代码省略.........
示例7: getDbServerVersion
/**
* This function gets DB-s version
*
* @param string $driver
* @return void
*/
public function getDbServerVersion($driver)
{
if (!isset($this->ip)) {
$this->ip = getenv('HTTP_CLIENT_IP');
}
if (isset($this->ip) && isset($this->db_user) && isset($this->db_passwd)) {
try {
if (!isset($this->db_sourcename)) {
$this->db_sourcename = DB_NAME;
}
$value = 'none';
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$value = $oDataBase->getServerVersion($driver, $this->ip, $this->db_port, $this->db_user, $this->db_passwd, $this->db_sourcename);
}
return $value;
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
} else {
throw new Exception('NET::Error->No params for Data Base Server!');
}
}
示例8: testLoadSystemExist
/**
* @covers G::LoadSystemExist
* @todo Implement testLoadSystemExist().
*/
public function testLoadSystemExist()
{
$this->assertTrue(G::LoadSystemExist("controller"));
$this->assertFalse(G::LoadSystemExist("noExist"));
}
示例9: getTransferHistoryCriteria
/**
* @param $sAppUid
* @return Criteria
*/
public function getTransferHistoryCriteria($sAppUid)
{
$c = new Criteria('workflow');
$c->addAsColumn('TAS_TITLE', 'TAS_TITLE.CON_VALUE');
$c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$c->addSelectColumn(UsersPeer::USR_LASTNAME);
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$c->addSelectColumn(AppDelegationPeer::PRO_UID);
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
$c->addSelectColumn(AppDelegationPeer::APP_UID);
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
///-- $c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new \database();
$c->addAsColumn('USR_NAME', $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME"));
$c->addAsColumn(
'DEL_FINISH_DATE', $oDataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'-'", AppDelegationPeer::DEL_FINISH_DATE)
);
$c->addAsColumn(
'APP_TYPE', $oDataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'IN_PROGRESS'", AppDelayPeer::APP_TYPE)
);
}
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$c->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
$c->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE);
//APP_DELEGATION LEFT JOIN USERS
$c->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
//APP_DELAY FOR MORE DESCRIPTION
//$c->addJoin(AppDelegationPeer::DEL_INDEX, AppDelayPeer::APP_DEL_INDEX, Criteria::LEFT_JOIN);
//$c->addJoin(AppDelegationPeer::APP_UID, AppDelayPeer::APP_UID, Criteria::LEFT_JOIN);
$del = \DBAdapter::getStringDelimiter();
$app = array();
$app[] = array(AppDelegationPeer::DEL_INDEX, AppDelayPeer::APP_DEL_INDEX);
$app[] = array(AppDelegationPeer::APP_UID, AppDelayPeer::APP_UID);
$c->addJoinMC($app, Criteria::LEFT_JOIN);
//LEFT JOIN CONTENT TAS_TITLE
$c->addAlias("TAS_TITLE", 'CONTENT');
$del = \DBAdapter::getStringDelimiter();
$appTitleConds = array();
$appTitleConds[] = array(AppDelegationPeer::TAS_UID, 'TAS_TITLE.CON_ID');
$appTitleConds[] = array('TAS_TITLE.CON_CATEGORY', $del . 'TAS_TITLE' . $del);
$appTitleConds[] = array('TAS_TITLE.CON_LANG', $del . SYS_LANG . $del);
$c->addJoinMC($appTitleConds, Criteria::LEFT_JOIN);
//WHERE
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
//ORDER BY
$c->clearOrderByColumns();
$c->addAscendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
return $c;
}