HOR-4532
This commit is contained in:
committed by
Paula Quispe
parent
a67180b139
commit
a50d3c5e5e
@@ -68,11 +68,11 @@ function lookup($target)
|
||||
try {
|
||||
switch ($driver) {
|
||||
case 'mysql':
|
||||
if ($link = mysqli_connect(DB_HOST, DB_USER, DB_PASS)) {
|
||||
$v = mysqli_get_server_info($link);
|
||||
} else {
|
||||
throw new Exception(mysqli_error($link));
|
||||
}
|
||||
$results = \Illuminate\Support\Facades\DB::select(DB::raw("select version()"));
|
||||
|
||||
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $results[0]->{'version()'}, $version);
|
||||
|
||||
$v = $version[0];
|
||||
break;
|
||||
}
|
||||
return (isset($v))?$v:'none';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,30 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* cliUpgrade.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* @author Alexandre Rosenfeld <alexandre@colosa.com>
|
||||
* @package workflow-engine-bin-tasks
|
||||
*/
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
CLI::taskName('upgrade');
|
||||
@@ -296,25 +272,24 @@ function run_unify_database($args)
|
||||
$metadata["version"] = 1;
|
||||
|
||||
list($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
|
||||
$link = mysqli_connect($dbHost, $dbUser, $dbPass);
|
||||
$connectionName = 'UPGRADE';
|
||||
InstallerModule::setNewConnection($connectionName, $dbHost, $dbUser, $dbPass,'', '');
|
||||
|
||||
foreach ($metadata['databases'] as $db) {
|
||||
$dbName = $metadata['DB_NAME'];
|
||||
CLI::logging("+> Restoring {$db['name']} to $dbName database\n");
|
||||
|
||||
$aParameters = array('dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass);
|
||||
$aParameters = ['dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass];
|
||||
|
||||
$restore = $workspace->executeScript($dbName, "$tempDirectory/{$db['name']}.sql", $aParameters, $link);
|
||||
$restore = $workspace->executeScript($dbName, "$tempDirectory/{$db['name']}.sql", $aParameters, $connectionName);
|
||||
|
||||
if ($restore) {
|
||||
CLI::logging("+> Remove {$db['name']} database\n");
|
||||
|
||||
$sql = "DROP DATABASE IF EXISTS {$db['name']};";
|
||||
if (!mysqli_query($link, $sql)) {
|
||||
throw new Exception(mysqli_error($link));
|
||||
}
|
||||
DB::connection($connectionName)->statement("DROP DATABASE IF EXISTS {$db['name']}");
|
||||
}
|
||||
}
|
||||
DB::disconnect($connectionName);
|
||||
|
||||
CLI::logging("Removing temporary files\n");
|
||||
G::rm_dir($tempDirectory);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Class MultipleFilesBackup
|
||||
* create a backup of this workspace
|
||||
@@ -20,12 +22,12 @@ class MultipleFilesBackup
|
||||
* @filename contains the path and filename of the comppress file(s).
|
||||
* @size got the Max size of the compressed files, by default if the $size less to zero will mantains 1000 Mb as Max size.
|
||||
*/
|
||||
public function MultipleFilesBackup($filename, $size)
|
||||
public function __construct($filename, $size)
|
||||
{
|
||||
if (!empty($filename)) {
|
||||
$this->filename = $filename;
|
||||
}
|
||||
if (!empty($size) && (int) $size > 0) {
|
||||
if (!empty($size) && (int)$size > 0) {
|
||||
$this->fileSize = $size;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +93,7 @@ class MultipleFilesBackup
|
||||
G::rm_dir($tempDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore from file(s) commpressed by letsBackup function, into a temporary directory
|
||||
* @ filename got the name and path of the compressed file(s), if there are many files with file extention as a numerical series, the extention should be discriminated.
|
||||
* @ srcWorkspace contains the workspace to be restored.
|
||||
@@ -162,14 +165,14 @@ class MultipleFilesBackup
|
||||
CLI::logging(CLI::warning("> Workspace $backupWorkspace found, but not restoring.") . "\n");
|
||||
continue;
|
||||
} else {
|
||||
CLI::logging("> Restoring " . CLI::info($backupWorkspace) . " to " . CLI::info($workspaceName) . "\n");
|
||||
CLI::logging('> Restoring ' . CLI::info($backupWorkspace) . ' to ' . CLI::info($workspaceName) . "\n");
|
||||
}
|
||||
$workspace = new WorkspaceTools($workspaceName);
|
||||
if ($workspace->workspaceExists()) {
|
||||
if ($overwrite) {
|
||||
CLI::logging(CLI::warning("> Workspace $workspaceName already exist, overwriting!") . "\n");
|
||||
} else {
|
||||
throw new Exception("Destination workspace already exist (use -o to overwrite)");
|
||||
throw new Exception('Destination workspace already exist (use -o to overwrite)');
|
||||
}
|
||||
}
|
||||
if (file_exists($workspace->path)) {
|
||||
@@ -196,31 +199,35 @@ class MultipleFilesBackup
|
||||
list($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
|
||||
|
||||
CLI::logging("> Connecting to system database in '$dbHost'\n");
|
||||
$link = mysqli_connect($dbHost, $dbUser, $dbPass);
|
||||
mysqli_query($link, "SET NAMES 'utf8';");
|
||||
mysqli_query($link, "SET FOREIGN_KEY_CHECKS=0;");
|
||||
if (!$link) {
|
||||
throw new Exception('Could not connect to system database: ' . mysqli_error($link));
|
||||
|
||||
try {
|
||||
$connectionLestRestore = 'RESTORE';
|
||||
InstallerModule::setNewConnection($connectionLestRestore, $dbHost, $dbUser, $dbPass, '', '');
|
||||
DB::connection($connectionLestRestore)
|
||||
->statement("SET NAMES 'utf8'");
|
||||
DB::connection($connectionLestRestore)
|
||||
->statement('SET FOREIGN_KEY_CHECKS=0');
|
||||
} catch (Exception $exception) {
|
||||
throw new Exception('Could not connect to system database: ' . $exception->getMessage());
|
||||
}
|
||||
|
||||
|
||||
$onedb = false;
|
||||
if (strpos($metadata->DB_RBAC_NAME, 'rb_') === false) {
|
||||
$onedb = true;
|
||||
} else {
|
||||
$onedb = false;
|
||||
}
|
||||
|
||||
$newDBNames = $workspace->resetDBInfo($dbHost, $createWorkspace, $onedb);
|
||||
$aParameters = array('dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass);
|
||||
$aParameters = ['dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass];
|
||||
|
||||
foreach ($metadata->databases as $db) {
|
||||
$dbName = $newDBNames[$db->name];
|
||||
CLI::logging("+> Restoring database {$db->name} to $dbName\n");
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql", $aParameters, 1, $link);
|
||||
$workspace->createDBUser($dbName, $db->pass, "localhost", $dbName, $link);
|
||||
$workspace->createDBUser($dbName, $db->pass, "%", $dbName, $link);
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql", $aParameters, 1, $connectionLestRestore);
|
||||
$workspace->createDBUser($dbName, $db->pass, "localhost", $dbName, $connectionLestRestore);
|
||||
$workspace->createDBUser($dbName, $db->pass, "%", $dbName, $connectionLestRestore);
|
||||
}
|
||||
$workspace->upgradeCacheView(false);
|
||||
mysqli_close($link);
|
||||
}
|
||||
CLI::logging("Removing temporary files\n");
|
||||
G::rm_dir($tempDirectory);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Net
|
||||
{
|
||||
public $hostname;
|
||||
@@ -223,30 +225,20 @@ class Net
|
||||
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
|
||||
switch ($pDbDriver) {
|
||||
case 'mysql':
|
||||
// Note, we suppress warnings on the connection calls because we want to avoid displaying warning
|
||||
// When utilizing this code in an API call. Otherwise it will return invalid JSON overall.
|
||||
if ($this->db_passwd == '') {
|
||||
$link = @mysqli_connect($this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_sourcename);
|
||||
} else {
|
||||
$link = @mysqli_connect($this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_passwd, $this->db_sourcename);
|
||||
}
|
||||
if ($link) {
|
||||
if (mysqli_ping($link)) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
$this->errno = 0;
|
||||
} else {
|
||||
$this->error = "Lost MySql Connection";
|
||||
$this->errstr = "NET::MYSQL->Lost Connection";
|
||||
$this->errno = 10010;
|
||||
}
|
||||
} else {
|
||||
$this->error = "MySql connection refused!";
|
||||
$this->errstr = "NET::MYSQL->The connection was refused";
|
||||
|
||||
try {
|
||||
InstallerModule::setNewConnection('NET', $this->ip, $this->db_user, $this->db_passwd, $this->db_sourcename, $this->db_port);
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = '';
|
||||
$this->errno = 0;
|
||||
} catch (Exception $exception) {
|
||||
$this->error = 'MySql connection refused!';
|
||||
$this->errstr = 'NET::MYSQL->The connection was refused';
|
||||
$this->errno = 10001;
|
||||
}
|
||||
break;
|
||||
case 'pgsql':
|
||||
//todo
|
||||
$this->db_port = ($this->db_port == "") ? "5432" : $this->db_port;
|
||||
$link = @pg_connect("host='$this->ip' port='$this->db_port' user='$this->db_user' password='$this->db_passwd' dbname='$this->db_sourcename'");
|
||||
if ($link) {
|
||||
@@ -260,6 +252,7 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
//todo
|
||||
if ($this->db_instance != "") {
|
||||
$str_port = "";
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
@@ -279,6 +272,7 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'oracle':
|
||||
//todo
|
||||
try {
|
||||
if ($flagTns == 0) {
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0) ? "1521" : $this->db_port;
|
||||
@@ -349,28 +343,23 @@ class Net
|
||||
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
|
||||
switch ($pDbDriver) {
|
||||
case 'mysql':
|
||||
$link = mysqli_connect($this->ip . (($this->db_port !== '') && ($this->db_port !== 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_passwd, $this->db_sourcename);
|
||||
$db = mysqli_select_db($link, $this->db_sourcename);
|
||||
$this->error = 'MySql connection refused!';
|
||||
$this->errstr = 'NET::MYSQL->The connection was refused';
|
||||
$this->errno = 10001;
|
||||
try {
|
||||
$this->errstr = 'NET::MYSQL->The connection was refused';
|
||||
$this->errno = 10001;
|
||||
$connection = 'NET_' . $this->db_sourcename;
|
||||
InstallerModule::setNewConnection($connection, $this->ip, $this->db_user, $this->db_passwd, $this->db_sourcename, $this->db_port);
|
||||
|
||||
if ($link) {
|
||||
$this->error = 'The $this->db_sourcename data base does\'n exist!';
|
||||
$this->errstr = 'NET::MYSQL->Select data base failed';
|
||||
$this->errno = 10011;
|
||||
if ($db) {
|
||||
$result = mysqli_query($link, 'show tables;');
|
||||
$this->error = 'the user $this->db_user doesn\'t have privileges to run queries!';
|
||||
$this->errstr = 'NET::MYSQL->Test query failed';
|
||||
$this->errno = 10100;
|
||||
if ($result) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = '';
|
||||
$this->errno = 0;
|
||||
mysqli_free_result($result);
|
||||
}
|
||||
$this->errstr = 'NET::MYSQL->Test query failed';
|
||||
$this->errno = 10100;
|
||||
|
||||
$result = DB::connection($connection)->statement('show tables');
|
||||
if ($result) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = '';
|
||||
$this->errno = 0;
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$this->error = $exception->getMessage();
|
||||
}
|
||||
break;
|
||||
case 'pgsql':
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,43 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Content.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseContent.php';
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'CONTENT' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Content extends BaseContent
|
||||
{
|
||||
public $langs;
|
||||
@@ -335,51 +299,56 @@ class Content extends BaseContent
|
||||
$this->rowsUnchanged = 0;
|
||||
$this->rowsClustered = 0;
|
||||
|
||||
//Creating table CONTENT_BACKUP
|
||||
$connection = Propel::getConnection('workflow');
|
||||
$oStatement = $connection->prepareStatement("CREATE TABLE IF NOT EXISTS `CONTENT_BACKUP` (
|
||||
$workSpace = new WorkspaceTools($workSpace);
|
||||
$workSpace->getDBInfo();
|
||||
|
||||
$connection = 'regenerate';
|
||||
InstallerModule::setNewConnection(
|
||||
$connection,
|
||||
$workSpace->dbHost,
|
||||
$workSpace->dbUser,
|
||||
$workSpace->dbPass,
|
||||
$workSpace->dbName,
|
||||
'',
|
||||
['PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET SESSION SQL_BIG_SELECTS=1']);
|
||||
|
||||
$query = "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,
|
||||
`CON_LANG` VARCHAR(10) default '' NOT NULL,
|
||||
`CON_VALUE` MEDIUMTEXT NOT NULL,
|
||||
CONSTRAINT CONTENT_BACKUP_PK PRIMARY KEY (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG)
|
||||
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content';");
|
||||
$oStatement->executeQuery();
|
||||
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content'";
|
||||
|
||||
$sql = ' SELECT DISTINCT CON_LANG FROM CONTENT ';
|
||||
$stmt = $connection->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$language = $row['CON_LANG'];
|
||||
if (array_search($row['CON_LANG'], $langs) === false) {
|
||||
Content::removeLanguageContent($row['CON_LANG']);
|
||||
DB::connection($connection)->statement($query);
|
||||
|
||||
$languages = DB::table('CONTENT')->select('CON_LANG')->distinct()->get();
|
||||
|
||||
foreach ($languages as $value) {
|
||||
if (array_search($value->CON_LANG, $langs) === false) {
|
||||
Content::removeLanguageContent($value->CON_LANG);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = " SELECT CON_ID, CON_CATEGORY, CON_LANG, CON_PARENT, CON_VALUE
|
||||
FROM CONTENT
|
||||
ORDER BY CON_ID, CON_CATEGORY, CON_PARENT, CON_LANG";
|
||||
DB::connection($connection)->statement('SET NAMES "utf8"');
|
||||
DB::connection($connection)->statement('SET FOREIGN_KEY_CHECKS=0');
|
||||
DB::connection($connection)->statement('SET SQL_BIG_SELECTS=1');
|
||||
|
||||
$workSpace = new WorkspaceTools($workSpace);
|
||||
$workSpace->getDBInfo();
|
||||
|
||||
$mysqli = new mysqli($workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass, $workSpace->dbName) or die("Could not connect");
|
||||
|
||||
$mysqli->query( 'SET NAMES "utf8";');
|
||||
$mysqli->query( 'SET FOREIGN_KEY_CHECKS=0;');
|
||||
$mysqli->query( 'SET OPTION SQL_BIG_SELECTS=1');
|
||||
$result = $mysqli->query( $sql, MYSQLI_USE_RESULT);
|
||||
$result = DB::table('CONTENT')
|
||||
->select('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
|
||||
->orderBy('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
|
||||
->get();
|
||||
$list = [];
|
||||
$default = [];
|
||||
$sw = array('CON_ID' => '','CON_CATEGORY' => '','CON_PARENT' => ''
|
||||
);
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$sw = ['CON_ID' => '', 'CON_CATEGORY' => '', 'CON_PARENT' => ''];
|
||||
|
||||
foreach ($result as $value) {
|
||||
$row = (array)$value;
|
||||
if ($sw['CON_ID'] === $row['CON_ID'] && $sw['CON_CATEGORY'] === $row['CON_CATEGORY'] && $sw['CON_PARENT'] === $row['CON_PARENT']) {
|
||||
$list[] = $row;
|
||||
} else {
|
||||
$this->rowsClustered ++;
|
||||
$this->rowsClustered++;
|
||||
if (count($langs) !== count($list)) {
|
||||
$this->checkLanguage($list, $default);
|
||||
} else {
|
||||
@@ -399,37 +368,30 @@ class Content extends BaseContent
|
||||
if ($sw['CON_LANG'] === $langs[$key]) {
|
||||
$default = $row;
|
||||
}
|
||||
$this->rowsProcessed ++;
|
||||
$this->rowsProcessed++;
|
||||
}
|
||||
|
||||
if (count($langs) !== count($list)) {
|
||||
$this->checkLanguage($list, $default);
|
||||
} else {
|
||||
$this->rowsUnchanged += count($langs);
|
||||
}
|
||||
mysqli_free_result($result);
|
||||
$total = $this->rowsProcessed + $this->rowsInserted;
|
||||
|
||||
$result->close();
|
||||
|
||||
$statement = $connection->prepareStatement("REPLACE INTO CONTENT
|
||||
DB::connection($connection)->statement('REPLACE INTO CONTENT
|
||||
SELECT CON_CATEGORY, CON_PARENT, CON_ID , CON_LANG, CON_VALUE
|
||||
FROM CONTENT_BACKUP");
|
||||
$statement->executeQuery();
|
||||
FROM CONTENT_BACKUP');
|
||||
|
||||
$statement = $connection->prepareStatement("DROP TABLE CONTENT_BACKUP");
|
||||
$statement->executeQuery();
|
||||
DB::connection($connection)->statement('DROP TABLE CONTENT_BACKUP');
|
||||
|
||||
//close connection
|
||||
$sql = "SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
|
||||
$stmt = $connection->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$oStatement = $connection->prepareStatement("kill ". $row['ID']);
|
||||
$oStatement->executeQuery();
|
||||
$result = DB::connection($connection)
|
||||
->select("SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id");
|
||||
|
||||
foreach ($result as $value) {
|
||||
DB::connection($connection)->statement('kill ' . $value->ID);
|
||||
}
|
||||
|
||||
if (! isset($_SERVER['SERVER_NAME'])) {
|
||||
if (!isset($_SERVER['SERVER_NAME'])) {
|
||||
CLI::logging("Rows Processed ---> $this->rowsProcessed ..... \n");
|
||||
CLI::logging("Rows Clustered ---> $this->rowsClustered ..... \n");
|
||||
CLI::logging("Rows Unchanged ---> $this->rowsUnchanged ..... \n");
|
||||
@@ -457,12 +419,14 @@ class Content extends BaseContent
|
||||
|
||||
public function fastInsertContent($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
{
|
||||
$connection = Propel::getConnection('workflow');
|
||||
$ConValue = mysqli_real_escape_string($connection, $ConValue);
|
||||
$statement = $connection->prepareStatement("INSERT INTO CONTENT_BACKUP (
|
||||
CON_CATEGORY, CON_PARENT, CON_ID , CON_LANG, CON_VALUE)
|
||||
VALUES ('$ConCategory', '$ConParent', '$ConId', '$ConLang', '$ConValue');");
|
||||
$statement->executeQuery();
|
||||
DB::table('CONTENT_BACKUP')
|
||||
->insert([
|
||||
'CON_CATEGORY' => $ConCategory,
|
||||
'CON_PARENT' => $ConParent,
|
||||
'CON_ID' => $ConId,
|
||||
'CON_LANG' => $ConLang,
|
||||
'CON_VALUE' => $ConValue
|
||||
]);
|
||||
}
|
||||
|
||||
public function removeLanguageContent($lanId)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user