merging some changes from the upstream master branch
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
class AppFolder extends BaseAppFolder
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $folderName
|
||||
@@ -86,6 +85,52 @@ class AppFolder extends BaseAppFolder
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the application document registry
|
||||
*
|
||||
* @param array $aData
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function update ($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( AppDocumentPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oAppFolder = AppFolderPeer::retrieveByPK( $aData['FOLDER_UID'] );
|
||||
if (! is_null( $oAppFolder )) {
|
||||
$oAppFolder->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
if ($oAppFolder->validate()) {
|
||||
$oConnection->begin();
|
||||
if (isset( $aData['FOLDER_NAME'] )) {
|
||||
$oAppFolder->setFolderName( $aData['FOLDER_NAME'] );
|
||||
}
|
||||
if (isset( $aData['FOLDER_UID'] )) {
|
||||
$oAppFolder->setFolderUid( $aData['FOLDER_UID'] );
|
||||
}
|
||||
if (isset( $aData['FOLDER_UPDATE_DATE'] )) {
|
||||
$oAppFolder->setFolderUpdateDate( $aData['FOLDER_UPDATE_DATE'] );
|
||||
}
|
||||
$iResult = $oAppFolder->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAppFolder->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be updated!<br />' . $sMessage ));
|
||||
}
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $folderPath
|
||||
|
||||
@@ -309,8 +309,8 @@ class Content extends BaseContent
|
||||
$this->rowsClustered = 0;
|
||||
|
||||
//Creating table CONTENT_BACKUP
|
||||
$oConnection = Propel::getConnection( 'workflow' );
|
||||
$oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `CONTENT_BACKUP` (
|
||||
$connection = Propel::getConnection( 'workflow' );
|
||||
$oStatement = $connection->prepareStatement( "CREATE TABLE IF NOT EXISTS `CONTENT_BACKUP` (
|
||||
`CON_CATEGORY` VARCHAR(30) default '' NOT NULL,
|
||||
`CON_PARENT` VARCHAR(32) default '' NOT NULL,
|
||||
`CON_ID` VARCHAR(100) default '' NOT NULL,
|
||||
@@ -320,10 +320,13 @@ class Content extends BaseContent
|
||||
)Engine=MyISAM DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
|
||||
$oStatement->executeQuery();
|
||||
|
||||
$con = Propel::getConnection( 'workflow' );
|
||||
//set interactive timeout
|
||||
$oStatement = $connection->prepareStatement( "set global interactive_timeout = 100;" );
|
||||
$oStatement->executeQuery();
|
||||
|
||||
$sql = " SELECT DISTINCT CON_LANG
|
||||
FROM CONTENT ";
|
||||
$stmt = $con->createStatement();
|
||||
$stmt = $connection->createStatement();
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
@@ -341,7 +344,7 @@ class Content extends BaseContent
|
||||
$workSpace = new workspaceTools( $workSpace );
|
||||
$workSpace->getDBInfo();
|
||||
|
||||
$link = mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass ) or die( "Could not connect" );
|
||||
$link = mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass, MYSQL_CLIENT_INTERACTIVE ) or die( "Could not connect" );
|
||||
|
||||
mysql_select_db( $workSpace->dbName, $link );
|
||||
mysql_query( "SET NAMES 'utf8';" );
|
||||
@@ -385,7 +388,7 @@ class Content extends BaseContent
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
$total = $this->rowsProcessed + $this->rowsInserted;
|
||||
$connection = Propel::getConnection( 'workflow' );
|
||||
|
||||
$statement = $connection->prepareStatement( "INSERT INTO CONTENT
|
||||
SELECT CON_CATEGORY, CON_PARENT, CON_ID , CON_LANG, CON_VALUE
|
||||
FROM CONTENT_BACKUP" );
|
||||
|
||||
Reference in New Issue
Block a user