Compare commits

..

No commits in common. "modules/rel_mod_v6.x" and "master" have entirely different histories.

View File

@ -1,16 +1,11 @@
<?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 Base class deletePictures extends oxSuperCfg
{ {
/*DO NOT CHANGE START */ /*DO NOT CHANGE START */
public $sFolder = 'out/pictures/master/product/'; public $sFolder = 'out/pictures/master/product/';
@ -45,6 +40,9 @@ class deletePictures extends Base
/*CHANGE BY USER END */ /*CHANGE BY USER END */
/**
* @throws oxConnectionException
*/
public function render() public function render()
{ {
if($this->checkForCookieAgreement()) if($this->checkForCookieAgreement())
@ -120,20 +118,18 @@ class deletePictures extends Base
<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="'.$this->getFolderContents().'"> <input type="hidden" name="action" value="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:<br><br> Was geschieht hier:
<p>In den Unterverzeichnissen in <b>'.$this->sFolder.'</b> werden die enthalten Dateien ausgelesen. <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.
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 <b>nicht global</b> auf alle Verzeichnisse und Bildfelder in der Tabelle oxarticles.<br> Die Pr&uuml;fung erfolgt pro Bildslot und nicht global auf alle Verzeichnisse und Bildfelder in der Tabelle oxarticles. Dies bedeuted:
Dies bedeuted: z.B. die Bilder im Ordner "'.$this->sFolder.'1" werden nur gegen das Feld oxpic1 gepr&uuml;ft und nicht gegen oxpic2 oder oxthumb.
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>
@ -280,8 +276,6 @@ class deletePictures extends Base
*/ */
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();
@ -304,7 +298,7 @@ class deletePictures extends Base
</div> </div>
<div class="form-group col-xs-12"> <div class="form-group col-xs-12">
<form method="get" action="'.$oRegistry::getConfig()->getSslShopUrl().$sPath.'"> <form method="get" action="'.oxRegistry::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>
@ -342,35 +336,31 @@ class deletePictures extends Base
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($oRegistry::getConfig()->getSslShopUrl().$sPath); $aUrl = parse_url(oxRegistry::getConfig()->getSslShopUrl().$sPath);
$sPath = ltrim($aUrl['path'],'/'); $sPath = ltrim($aUrl['path'],'/');
if($oRegistry::getConfig()->getRequestParameter('agreement') == true) if(oxRegistry::getConfig()->getRequestParameter('agreement') == true)
{ {
setcookie($this->sCookieName, true, strtotime( '+7 days' )); setcookie($this->sCookieName, true, strtotime( '+7 days' ));
} }
$oRegistry::getUtils()->redirect($oRegistry::getConfig()->getSslShopUrl().$sPath,false); oxRegistry::getUtils()->redirect(oxRegistry::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($oRegistry::getConfig()->getSslShopUrl().$sPath); $aUrl = parse_url(oxRegistry::getConfig()->getSslShopUrl().$sPath);
$sPath = ltrim($aUrl['path'],'/'); $sPath = ltrim($aUrl['path'],'/');
setcookie($this->sCookieName, false, time()-1000); setcookie($this->sCookieName, false, time()-1000);
$oRegistry::getUtils()->redirect($oRegistry::getConfig()->getSslShopUrl().$sPath,false); oxRegistry::getUtils()->redirect(oxRegistry::getConfig()->getSslShopUrl().$sPath,false);
} }
/** /**
@ -440,16 +430,17 @@ class deletePictures extends Base
/** /**
* 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);
@ -473,9 +464,7 @@ class deletePictures extends Base
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) == '')
@ -502,12 +491,12 @@ class deletePictures extends Base
$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"));
$oItem = oxNew(BaseModel::class); /** @var oxbase $oItem */
$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');
@ -526,12 +515,11 @@ class deletePictures extends Base
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function getLostPicturesSlotsFromTable() public function getLostPicturesSlotsFromTable()
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select d3folder from d3lostpictures select d3folder from d3lostpictures
@ -577,18 +565,17 @@ 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 = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select {$sPictureDbField} from oxarticles where {$sPictureDbField} != '' select {$sPictureDbField} from oxarticles where {$sPictureDbField} != ''
@ -609,9 +596,7 @@ MYSQL;
*/ */
public function getPathToShop() public function getPathToShop()
{ {
$oRegistry = oxNew(Registry::class); return oxRegistry::getConfig()->getConfigParam('sShopDir');
return $oRegistry::getConfig()->getConfigParam('sShopDir');
} }
@ -637,6 +622,8 @@ MYSQL;
/** /**
* @param $sSlot * @param $sSlot
*
* @throws oxConnectionException
*/ */
public function getLostPicturesSlot($sSlot) public function getLostPicturesSlot($sSlot)
{ {
@ -648,15 +635,14 @@ 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 = $oRegistry::getConfig()->getShopUrl().$this->sFolder; $sUrlToFolder = oxRegistry::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>
@ -674,7 +660,7 @@ MYSQL;
$sContent .= ' $sContent .= '
<tr> <tr>
<td><a href="'.$sPathWithPicture.'" target="_blank"><img src="'.$sPathWithPicture.'" style="max-height: 100px" alt="'.$sPathWithPicture.'"></a></td> <td><a href="'.$sPathWithPicture.'" target="_blank"><img src="'.$sPathWithPicture.'" style="max-height: 100px"></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>
@ -689,11 +675,10 @@ 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;
@ -708,7 +693,7 @@ MYSQL;
$sFileContent .= $sSeparator.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.$sSeparator.$sColumn; $sFileContent .= $sSeparator.$this->sFolder.$aPicture['D3FOLDER'].'/'.$sFileName.$sSeparator.$sColumn;
} }
$oUtils = $oRegistry::getUtils(); $oUtils = oxRegistry::getUtils();
$sFilename = 'Folder_'.$sSlot.'.csv'; $sFilename = 'Folder_'.$sSlot.'.csv';
ob_start(); ob_start();
//$sPDF = ob_get_contents(); //$sPDF = ob_get_contents();
@ -719,7 +704,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);
$oRegistry::getUtils()->showMessageAndExit($sCsv); oxRegistry::getUtils()->showMessageAndExit($sCsv);
} }
@ -727,12 +712,11 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return mixed * @return mixed
* @throws oxConnectionException
*/ */
public function getLostPictures($sSlot) public function getLostPictures($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
/* /*
$sPictureDbField = 'oxpic'.$sSlot; $sPictureDbField = 'oxpic'.$sSlot;
@ -767,12 +751,11 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function getCountLostPictures($sSlot) public function getCountLostPictures($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$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
@ -785,6 +768,7 @@ MYSQL;
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function getLostPictureGroupByFolder() public function getLostPictureGroupByFolder()
{ {
@ -793,9 +777,7 @@ MYSQL;
return array(); return array();
} }
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$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
@ -818,6 +800,7 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function getCountLostPictureGroupByFolder($sSlot) public function getCountLostPictureGroupByFolder($sSlot)
{ {
@ -826,9 +809,7 @@ MYSQL;
$sPictureDbField = 'ox'.$sSlot; $sPictureDbField = 'ox'.$sSlot;
} }
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
select count(oxid) from select count(oxid) from
@ -847,6 +828,7 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPictureGroupByFolderAsHtml() public function getLostPictureGroupByFolderAsHtml()
{ {
@ -930,6 +912,7 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesDeleteButtonsAsHtml() public function getLostPicturesDeleteButtonsAsHtml()
{ {
@ -974,6 +957,7 @@ MYSQL;
} }
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesAsCsvFile() public function getLostPicturesAsCsvFile()
{ {
@ -1018,6 +1002,7 @@ MYSQL;
/** /**
* @return string * @return string
* @throws oxConnectionException
*/ */
public function getLostPicturesDisplayButtonsAsHtml() public function getLostPicturesDisplayButtonsAsHtml()
{ {
@ -1080,12 +1065,11 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return string * @return string
* @throws oxConnectionException
*/ */
public function deleteLostPictures($sSlot) public function deleteLostPictures($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
SELECT oxid, D3FILENAME as File SELECT oxid, D3FILENAME as File
@ -1119,6 +1103,8 @@ MYSQL;
/** /**
* @param $sSlot * @param $sSlot
* @param $sType * @param $sType
*
* @throws oxSystemComponentException
*/ */
public function setStartStopFlag($sSlot,$sType) public function setStartStopFlag($sSlot,$sType)
{ {
@ -1135,7 +1121,8 @@ 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"));
$oItem = oxNew(BaseModel::class); /** @var oxbase $oItem */
$oItem = oxNew("oxbase");
$oItem->init("d3lostpictures"); $oItem->init("d3lostpictures");
$oItem->assign($aPictureData); $oItem->assign($aPictureData);
@ -1146,14 +1133,11 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return object * @return object
* @throws oxConnectionException
*/ */
public function deleteStartStopFlag($sSlot) public function deleteStartStopFlag($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDatabaseProvider = oxNew(DatabaseProvider::class);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
DELETE FROM `d3lostpictures` DELETE FROM `d3lostpictures`
@ -1167,12 +1151,11 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return false|string * @return false|string
* @throws oxConnectionException
*/ */
public function hasFinishedImport($sSlot) public function hasFinishedImport($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$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`
@ -1192,12 +1175,11 @@ MYSQL;
/** /**
* @return array * @return array
* @throws oxConnectionException
*/ */
public function checkAllSlotsIfFinished() public function checkAllSlotsIfFinished()
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$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`
@ -1243,11 +1225,17 @@ 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) {
@ -1261,6 +1249,7 @@ MYSQL;
* @param $sSlot * @param $sSlot
* *
* @return bool|void * @return bool|void
* @throws oxConnectionException
*/ */
public function truncateTable($sSlot) public function truncateTable($sSlot)
{ {
@ -1271,6 +1260,7 @@ MYSQL;
/** /**
* @return bool * @return bool
* @throws oxConnectionException
*/ */
public function tableExist() public function tableExist()
{ {
@ -1293,7 +1283,7 @@ MYSQL;
/** /**
* Class setupDeletePicturesTable * Class setupDeletePicturesTable
*/ */
class setupDeletePicturesTable extends Base class setupDeletePicturesTable extends oxSuperCfg
{ {
public $_sTable = 'd3lostpictures'; public $_sTable = 'd3lostpictures';
@ -1302,9 +1292,7 @@ class setupDeletePicturesTable extends Base
*/ */
public static function createTable() public static function createTable()
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
@ -1337,9 +1325,7 @@ MYSQL;
*/ */
public static function dropTable() public static function dropTable()
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
Drop table `d3lostpictures`; Drop table `d3lostpictures`;
@ -1355,9 +1341,7 @@ MYSQL;
*/ */
public static function truncateTable($sSlot) public static function truncateTable($sSlot)
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = $sQuery =
<<<MYSQL <<<MYSQL
TRUNCATE `d3lostpictures`; TRUNCATE `d3lostpictures`;
@ -1381,9 +1365,7 @@ MYSQL;
*/ */
public static function tableExist() public static function tableExist()
{ {
$oDatabaseProvider = oxNew(DatabaseProvider::class); $oDb = oxDb::getDb(oxDb::FETCH_MODE_ASSOC);
$oDb = $oDatabaseProvider::getDb($oDatabaseProvider::FETCH_MODE_ASSOC);
$sQuery = <<<MYSQL $sQuery = <<<MYSQL
SHOW TABLES LIKE 'd3lostpictures'; SHOW TABLES LIKE 'd3lostpictures';
MYSQL; MYSQL;
@ -1394,10 +1376,8 @@ MYSQL;
/** @var deletePictures $oBilderLesen */ /** @var deletePictures $oBilderLesen */
$oDeletePictures = oxNew('deletePictures'); $oDeletePictures = oxNew('deletePictures');
$oRegistry = oxNew(Registry::class); $sAction = oxRegistry::getConfig()->getRequestParameter('action');
$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);