Vergelijk commits

...

2 Commits

Auteur SHA1 Bericht Datum
MaxBUhe d24cd1490b final working state 2021-03-02 15:05:05 +01:00
MaxBUhe 95e6e77f56 first upgrade to 6.x 2021-03-02 10:47:39 +01:00
1 gewijzigde bestanden met toevoegingen van 94 en 74 verwijderingen

Bestand weergeven

@ -1,11 +1,16 @@
<?php <?php
use OxidEsales\Eshop\Core\Base;
use OxidEsales\Eshop\Core\DatabaseProvider;
use OxidEsales\Eshop\Core\Model\BaseModel;
use OxidEsales\Eshop\Core\Registry;
include(__DIR__ . '/bootstrap.php'); include(__DIR__ . '/bootstrap.php');
/** /**
* Class deletePictures * Class deletePictures
*/ */
class deletePictures extends oxSuperCfg class deletePictures extends Base
{ {
/*DO NOT CHANGE START */ /*DO NOT CHANGE START */
public $sFolder = 'out/pictures/master/product/'; public $sFolder = 'out/pictures/master/product/';
@ -40,9 +45,6 @@ class deletePictures extends oxSuperCfg
/*CHANGE BY USER END */ /*CHANGE BY USER END */
/**
* @throws oxConnectionException
*/
public function render() public function render()
{ {
if($this->checkForCookieAgreement()) if($this->checkForCookieAgreement())
@ -118,18 +120,20 @@ class deletePictures extends oxSuperCfg
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<form method="post"> <form method="post">
<input type="hidden" name="action" value="getFolderContents"> <input type="hidden" name="action" value="'.$this->getFolderContents().'">
<input class="btn btn-sm btn-primary" type="submit" value="Bilder suchen / Verzeichnisse einlesen" title="Bilder suchen"> <input class="btn btn-sm btn-primary" type="submit" value="Bilder suchen / Verzeichnisse einlesen" title="Bilder suchen">
</form> </form>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
Was geschieht hier: Was geschieht hier:<br><br>
<p>In den Unterverzeichnissen in '.$this->sFolder.' werden die enthalten Dateien ausgelesen. Bei diesem Vorgang wird sofort gepr&uuml;ft welche Dateien in der Tabelle oxarticles nicht mehr enthalten sind. <p>In den Unterverzeichnissen in <b>'.$this->sFolder.'</b> werden die enthalten Dateien ausgelesen.
Bei diesem Vorgang wird sofort gepr&uuml;ft welche Dateien <b>in der Tabelle oxarticles nicht</b> mehr enthalten sind.
Ist ein Bild nicht mehr an einem Artikel hinterlegt, dann erfolgt die Abspeicherung in der Tabelle d3lostpictures. Ist ein Bild nicht mehr an einem Artikel hinterlegt, dann erfolgt die Abspeicherung in der Tabelle d3lostpictures.
<br> <br><br>
Die Pr&uuml;fung erfolgt pro Bildslot und nicht global auf alle Verzeichnisse und Bildfelder in der Tabelle oxarticles. Dies bedeuted: Die Pr&uuml;fung erfolgt pro Bildslot und <b>nicht global</b> auf alle Verzeichnisse und Bildfelder in der Tabelle oxarticles.<br>
z.B. die Bilder im Ordner "'.$this->sFolder.'1" werden nur gegen das Feld oxpic1 gepr&uuml;ft und nicht gegen oxpic2 oder oxthumb. Dies bedeuted:
z.B. die Bilder im Ordner <b>"'.$this->sFolder.'1"</b> werden nur gegen das Feld <b>oxpic1</b> gepr&uuml;ft und nicht gegen oxpic2 oder oxthumb.
</p> </p>
</div> </div>
</div> </div>
@ -276,6 +280,8 @@ class deletePictures extends oxSuperCfg
*/ */
public function getAgreementForm() public function getAgreementForm()
{ {
$oRegistry = oxNew(Registry::class);
$sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI']; $sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI'];
$sPath = basename($sPath); $sPath = basename($sPath);
$sOutput = $this->getHtmlHeader(); $sOutput = $this->getHtmlHeader();
@ -298,7 +304,7 @@ class deletePictures extends oxSuperCfg
</div> </div>
<div class="form-group col-xs-12"> <div class="form-group col-xs-12">
<form method="get" action="'.oxRegistry::getConfig()->getSslShopUrl().$sPath.'"> <form method="get" action="'.$oRegistry::getConfig()->getSslShopUrl().$sPath.'">
<input type="hidden" name="action" value="setAgreement"> <input type="hidden" name="action" value="setAgreement">
<div class="checkbox"> <div class="checkbox">
<label for="agreement"><input name="agreement" id="agreement" type="checkbox" value="true">Ich habe die oben genannten Punkte gelesen und f&uuml;hre das Script auf eigene Verantwortung aus.</label> <label for="agreement"><input name="agreement" id="agreement" type="checkbox" value="true">Ich habe die oben genannten Punkte gelesen und f&uuml;hre das Script auf eigene Verantwortung aus.</label>
@ -336,31 +342,35 @@ class deletePictures extends oxSuperCfg
public function setAgreement() public function setAgreement()
{ {
$oRegistry = oxNew(Registry::class);
$sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI']; $sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI'];
$sPath = basename($sPath); $sPath = basename($sPath);
//action=setAgreement - entfernen //action=setAgreement - entfernen
$aUrl = parse_url(oxRegistry::getConfig()->getSslShopUrl().$sPath); $aUrl = parse_url($oRegistry::getConfig()->getSslShopUrl().$sPath);
$sPath = ltrim($aUrl['path'],'/'); $sPath = ltrim($aUrl['path'],'/');
if(oxRegistry::getConfig()->getRequestParameter('agreement') == true) if($oRegistry::getConfig()->getRequestParameter('agreement') == true)
{ {
setcookie($this->sCookieName, true, strtotime( '+7 days' )); setcookie($this->sCookieName, true, strtotime( '+7 days' ));
} }
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getSslShopUrl().$sPath,false); $oRegistry::getUtils()->redirect($oRegistry::getConfig()->getSslShopUrl().$sPath,false);
} }
public function removeAgreement() public function removeAgreement()
{ {
$oRegistry = oxNew(Registry::class);
$sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI']; $sPath = $_SERVER["ORIG_PATH_INFO"]?$_SERVER["ORIG_PATH_INFO"]:$_SERVER['REQUEST_URI'];
$sPath = basename($sPath); $sPath = basename($sPath);
//action=removeAgreement - entfernen //action=removeAgreement - entfernen
$aUrl = parse_url(oxRegistry::getConfig()->getSslShopUrl().$sPath); $aUrl = parse_url($oRegistry::getConfig()->getSslShopUrl().$sPath);
$sPath = ltrim($aUrl['path'],'/'); $sPath = ltrim($aUrl['path'],'/');
setcookie($this->sCookieName, false, time()-1000); setcookie($this->sCookieName, false, time()-1000);
oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getSslShopUrl().$sPath,false); $oRegistry::getUtils()->redirect($oRegistry::getConfig()->getSslShopUrl().$sPath,false);
} }
/** /**
@ -430,17 +440,16 @@ class deletePictures extends oxSuperCfg
/** /**
* todo: Pr&uuml;fung af unvollst&auml;ndig eingelesenen Ordner * todo: Pr&uuml;fung af unvollst&auml;ndig eingelesenen Ordner
*
* @throws oxConnectionException
* @throws oxSystemComponentException
*/ */
public function getFolderContents() public function getFolderContents()
{ {
//Tabelle leeren //Tabelle leeren
//$this->truncateTable(); //$this->truncateTable();
$aSlotsFromLostPictures = $this->getLostPicturesSlotsFromTable(); $aSlotsFromLostPictures = $this->getLostPicturesSlotsFromTable();
$sFolder = $this->getPathToShop().$this->sFolder; $sFolder = $this->getPathToShop().$this->sFolder;
$aFolder = $this->getFolders(); $aFolder = $this->getFolders();
natsort($aFolder); natsort($aFolder);
@ -464,7 +473,9 @@ class deletePictures extends oxSuperCfg
if ($handle = opendir($sFolder.$sTmpFolder)) if ($handle = opendir($sFolder.$sTmpFolder))
{ {
$aFilesOxPics = $this->getAllPicturesFromTable($sTmpFolder); $aFilesOxPics = $this->getAllPicturesFromTable($sTmpFolder);
$this->setStartStopFlag($sTmpFolder,'START'); $this->setStartStopFlag($sTmpFolder,'START');
while (false !== ($entry = readdir($handle))) while (false !== ($entry = readdir($handle)))
{ {
if ($entry == "." || $entry == ".." || $entry == "dir.txt" || trim($entry) == '') if ($entry == "." || $entry == ".." || $entry == "dir.txt" || trim($entry) == '')
@ -491,12 +502,12 @@ class deletePictures extends oxSuperCfg
$aPictureData['D3DATE'] = date ("Y-m-d H:i:s"); $aPictureData['D3DATE'] = date ("Y-m-d H:i:s");
$aPictureData['OXID'] = md5($entry.$sTmpFolder.date ("Y-m-d H:i:s")); $aPictureData['OXID'] = md5($entry.$sTmpFolder.date ("Y-m-d H:i:s"));
/** @var oxbase $oItem */ $oItem = oxNew(BaseModel::class);
$oItem = oxNew("oxbase");
$oItem->init("d3lostpictures"); $oItem->init("d3lostpictures");
$oItem->assign($aPictureData); $oItem->assign($aPictureData);
$oItem->save(); $oItem->save();
} }
//die(); //die();
$this->setStartStopFlag($sTmpFolder,'STOP'); $this->setStartStopFlag($sTmpFolder,'STOP');
@ -515,11 +526,12 @@ class deletePictures extends oxSuperCfg
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function getLostPicturesSlotsFromTable() public function getLostPicturesSlotsFromTable()
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select d3folder from d3lostpictures select d3folder from d3lostpictures
@ -565,17 +577,18 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return array * @return array
* @throws oxConnectionException
*/ */
public function getAllPicturesFromTable($sSlot) public function getAllPicturesFromTable($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class);
//echo $sSlot; //echo $sSlot;
$sPictureDbField = 'oxpic'.$sSlot; $sPictureDbField = 'oxpic'.$sSlot;
if($sSlot == 'thumb' || $sSlot == 'icon'){ if($sSlot == 'thumb' || $sSlot == 'icon'){
$sPictureDbField = 'ox'.$sSlot; $sPictureDbField = 'ox'.$sSlot;
} }
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select {$sPictureDbField} from oxarticles where {$sPictureDbField} != '' select {$sPictureDbField} from oxarticles where {$sPictureDbField} != ''
@ -596,7 +609,9 @@ MYSQL;
*/ */
public function getPathToShop() public function getPathToShop()
{ {
return oxRegistry::getConfig()->getConfigParam('sShopDir'); $oRegistry = oxNew(Registry::class);
return $oRegistry::getConfig()->getConfigParam('sShopDir');
} }
@ -622,8 +637,6 @@ MYSQL;
/** /**
* @param $sSlot * @param $sSlot
*
* @throws oxConnectionException
*/ */
public function getLostPicturesSlot($sSlot) public function getLostPicturesSlot($sSlot)
{ {
@ -635,14 +648,15 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPictureAsTableContent($aPictures) public function getLostPictureAsTableContent($aPictures)
{ {
$oRegistry = oxNew(Registry::class);
$this->sOutPutTitle = 'Anzeige Bilder'; $this->sOutPutTitle = 'Anzeige Bilder';
//dumpvar($aPictures); //dumpvar($aPictures);
$sUrlToFolder = oxRegistry::getConfig()->getShopUrl().$this->sFolder; $sUrlToFolder = $oRegistry::getConfig()->getShopUrl().$this->sFolder;
$sContent = '<table class="table table-striped table-hover table-sm"> $sContent = '<table class="table table-striped table-hover table-sm">
<tr> <tr>
@ -660,7 +674,7 @@ MYSQL;
$sContent .= ' $sContent .= '
<tr> <tr>
<td><a href="'.$sPathWithPicture.'" target="_blank"><img src="'.$sPathWithPicture.'" style="max-height: 100px"></a></td> <td><a href="'.$sPathWithPicture.'" target="_blank"><img src="'.$sPathWithPicture.'" style="max-height: 100px" alt="'.$sPathWithPicture.'"></a></td>
<td>'.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.'</td> <td>'.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.'</td>
<td>'.$aPicture['D3WIDTH'].'px * '.$aPicture['D3HEIGHT'].'px</td> <td>'.$aPicture['D3WIDTH'].'px * '.$aPicture['D3HEIGHT'].'px</td>
<td>'.$this->formatBytes($aPicture['D3FILESIZE']).'</td> <td>'.$this->formatBytes($aPicture['D3FILESIZE']).'</td>
@ -675,10 +689,11 @@ MYSQL;
/** /**
* @param $sSlot * @param $sSlot
* @throws oxConnectionException
*/ */
public function getLostPicturesInCsvFile($sSlot) public function getLostPicturesInCsvFile($sSlot)
{ {
$oRegistry = oxNew(Registry::class);
//$sUrlToFolder = oxRegistry::getConfig()->getShopUrl().$this->sFolder; //$sUrlToFolder = oxRegistry::getConfig()->getShopUrl().$this->sFolder;
$sSeparator = '"'; $sSeparator = '"';
$sColumn = ";".PHP_EOL; $sColumn = ";".PHP_EOL;
@ -693,7 +708,7 @@ MYSQL;
$sFileContent .= $sSeparator.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.$sSeparator.$sColumn; $sFileContent .= $sSeparator.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.$sSeparator.$sColumn;
} }
$oUtils = oxRegistry::getUtils(); $oUtils = $oRegistry::getUtils();
$sFilename = 'Folder_'.$sSlot.'.csv'; $sFilename = 'Folder_'.$sSlot.'.csv';
ob_start(); ob_start();
//$sPDF = ob_get_contents(); //$sPDF = ob_get_contents();
@ -704,7 +719,7 @@ MYSQL;
$oUtils->setHeader("Expires: 0"); $oUtils->setHeader("Expires: 0");
$oUtils->setHeader("Content-type: application/csv"); $oUtils->setHeader("Content-type: application/csv");
$oUtils->setHeader("Content-Disposition: attachment; filename=" . $sFilename); $oUtils->setHeader("Content-Disposition: attachment; filename=" . $sFilename);
oxRegistry::getUtils()->showMessageAndExit($sCsv); $oRegistry::getUtils()->showMessageAndExit($sCsv);
} }
@ -712,11 +727,12 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return mixed * @return mixed
* @throws oxConnectionException
*/ */
public function getLostPictures($sSlot) public function getLostPictures($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
/* /*
$sPictureDbField = 'oxpic'.$sSlot; $sPictureDbField = 'oxpic'.$sSlot;
@ -751,11 +767,12 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function getCountLostPictures($sSlot) public function getCountLostPictures($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select count(oxid) as files from d3lostpictures select count(oxid) as files from d3lostpictures
@ -768,7 +785,6 @@ MYSQL;
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function getLostPictureGroupByFolder() public function getLostPictureGroupByFolder()
{ {
@ -777,7 +793,9 @@ MYSQL;
return array(); return array();
} }
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select d3folder, count(oxid) as files, sum(d3filesize) as size from d3lostpictures select d3folder, count(oxid) as files, sum(d3filesize) as size from d3lostpictures
@ -800,7 +818,6 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function getCountLostPictureGroupByFolder($sSlot) public function getCountLostPictureGroupByFolder($sSlot)
{ {
@ -809,7 +826,9 @@ MYSQL;
$sPictureDbField = 'ox'.$sSlot; $sPictureDbField = 'ox'.$sSlot;
} }
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select count(oxid) from select count(oxid) from
@ -828,7 +847,6 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPictureGroupByFolderAsHtml() public function getLostPictureGroupByFolderAsHtml()
{ {
@ -912,7 +930,6 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesDeleteButtonsAsHtml() public function getLostPicturesDeleteButtonsAsHtml()
{ {
@ -957,7 +974,6 @@ MYSQL;
} }
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesAsCsvFile() public function getLostPicturesAsCsvFile()
{ {
@ -1002,7 +1018,6 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesDisplayButtonsAsHtml() public function getLostPicturesDisplayButtonsAsHtml()
{ {
@ -1065,11 +1080,12 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return string * @return string
* @throws oxConnectionException
*/ */
public function deleteLostPictures($sSlot) public function deleteLostPictures($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
SELECT oxid, D3FILENAME as File SELECT oxid, D3FILENAME as File
@ -1103,8 +1119,6 @@ MYSQL;
/** /**
* @param $sSlot * @param $sSlot
* @param $sType * @param $sType
*
* @throws oxSystemComponentException
*/ */
public function setStartStopFlag($sSlot,$sType) public function setStartStopFlag($sSlot,$sType)
{ {
@ -1121,8 +1135,7 @@ MYSQL;
$aPictureData['D3DATE'] = date ("Y-m-d H:i:s"); $aPictureData['D3DATE'] = date ("Y-m-d H:i:s");
$aPictureData['OXID'] = md5($sType.$sSlot.date ("Y-m-d H:i:s")); $aPictureData['OXID'] = md5($sType.$sSlot.date ("Y-m-d H:i:s"));
/** @var oxbase $oItem */ $oItem = oxNew(BaseModel::class);
$oItem = oxNew("oxbase");
$oItem->init("d3lostpictures"); $oItem->init("d3lostpictures");
$oItem->assign($aPictureData); $oItem->assign($aPictureData);
@ -1133,11 +1146,14 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return object * @return object
* @throws oxConnectionException
*/ */
public function deleteStartStopFlag($sSlot) public function deleteStartStopFlag($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
DELETE FROM `d3lostpictures` DELETE FROM `d3lostpictures`
@ -1151,11 +1167,12 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function hasFinishedImport($sSlot) public function hasFinishedImport($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
SELECT count(oxid) as countflag FROM `d3lostpictures` SELECT count(oxid) as countflag FROM `d3lostpictures`
@ -1175,11 +1192,12 @@ MYSQL;
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function checkAllSlotsIfFinished() public function checkAllSlotsIfFinished()
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
SELECT d3folder, count(oxid) as countflag FROM `d3lostpictures` SELECT d3folder, count(oxid) as countflag FROM `d3lostpictures`
@ -1225,17 +1243,11 @@ MYSQL;
return true; return true;
} }
/**
* @throws oxConnectionException
*/
public function createTable() public function createTable()
{ {
return setupDeletePicturesTable::createTable(); return setupDeletePicturesTable::createTable();
} }
/**
* @throws oxConnectionException
*/
public function dropTable() public function dropTable()
{ {
if($this->tableExist() == true) { if($this->tableExist() == true) {
@ -1249,7 +1261,6 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return bool|void * @return bool|void
* @throws oxConnectionException
*/ */
public function truncateTable($sSlot) public function truncateTable($sSlot)
{ {
@ -1260,7 +1271,6 @@ MYSQL;
/** /**
* @return bool * @return bool
* @throws oxConnectionException
*/ */
public function tableExist() public function tableExist()
{ {
@ -1283,7 +1293,7 @@ MYSQL;
/** /**
* Class setupDeletePicturesTable * Class setupDeletePicturesTable
*/ */
class setupDeletePicturesTable extends oxSuperCfg class setupDeletePicturesTable extends Base
{ {
public $_sTable = 'd3lostpictures'; public $_sTable = 'd3lostpictures';
@ -1292,7 +1302,9 @@ class setupDeletePicturesTable extends oxSuperCfg
*/ */
public static function createTable() public static function createTable()
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
@ -1325,7 +1337,9 @@ MYSQL;
*/ */
public static function dropTable() public static function dropTable()
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
Drop table `d3lostpictures`; Drop table `d3lostpictures`;
@ -1341,7 +1355,9 @@ MYSQL;
*/ */
public static function truncateTable($sSlot) public static function truncateTable($sSlot)
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
TRUNCATE `d3lostpictures`; TRUNCATE `d3lostpictures`;
@ -1365,7 +1381,9 @@ MYSQL;
*/ */
public static function tableExist() public static function tableExist()
{ {
$oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC); $oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = <<<MYSQL $sQuery = <<<MYSQL
SHOW TABLES LIKE 'd3lostpictures'; SHOW TABLES LIKE 'd3lostpictures';
MYSQL; MYSQL;
@ -1376,8 +1394,10 @@ MYSQL;
/** @var deletePictures $oBilderLesen */ /** @var deletePictures $oBilderLesen */
$oDeletePictures = oxNew('deletePictures'); $oDeletePictures = oxNew('deletePictures');
$sAction = oxRegistry::getConfig()->getRequestParameter('action'); $oRegistry = oxNew(Registry::class);
$sParameter = oxRegistry::getConfig()->getRequestParameter('parameter');
$sAction = $oRegistry::getConfig()->getRequestParameter('action');
$sParameter = $oRegistry::getConfig()->getRequestParameter('parameter');
if(trim($sAction) != '') if(trim($sAction) != '')
{ {
$oDeletePictures->{$sAction}($sParameter); $oDeletePictures->{$sAction}($sParameter);