示例#1
0
文件: Atos.php 项目: bibich/Atos
 public function destroy(ConnectionInterface $con = null, $deleteModuleData = false)
 {
     if ($deleteModuleData) {
         $database = new Database($con);
         $database->execute('drop table `atos_currency`');
         MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)->delete();
     }
 }
示例#2
0
 public function destroy(ConnectionInterface $con = null, $deleteModuleData = false)
 {
     // Delete config table and messages if required
     if ($deleteModuleData) {
         $database = new Database($con);
         $database->execute("DROP TABLE ?", PayzenConfigTableMap::TABLE_NAME);
         MessageQuery::create()->findOneByName(self::CONFIRMATION_MESSAGE_NAME)->delete();
     }
 }
示例#3
0
 protected function manageSecret(Database $database)
 {
     $secret = TokenProvider::generateToken();
     $sql = "UPDATE `config` SET `value`=? WHERE `name`='form.secret'";
     $database->execute($sql, [$secret]);
 }
示例#4
0
 public function update($currentVersion, $newVersion, ConnectionInterface $con = null)
 {
     $uploadDir = __DIR__ . '/Config/prices.json';
     $database = new Database($con);
     $table_exists = $database->execute("SELECT COUNT(*)\n             FROM information_schema.tables\n             WHERE table_schema = 'thelia'\n             AND table_name = 'colissimo_freeshipping'")->fetch()["COUNT(*)"] ? true : false;
     if (Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, null) == null && $table_exists) {
         $result = $database->execute('SELECT active FROM colissimo_freeshipping WHERE id=1')->fetch()["active"];
         Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, $result);
     }
     if (is_readable($uploadDir) && Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null) == null) {
         Colissimo::setConfigValue(ColissimoConfigValue::PRICES, file_get_contents($uploadDir));
     }
 }
示例#5
0
 public function update($currentVersion, $newVersion, ConnectionInterface $con = null)
 {
     $uploadDir = __DIR__ . '/Config/prices.json';
     $database = new Database($con);
     $tableExists = $database->execute("SHOW TABLES LIKE 'colissimo_freeshipping'")->rowCount();
     if (Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, null) == null && $tableExists) {
         $result = $database->execute('SELECT active FROM colissimo_freeshipping WHERE id=1')->fetch()["active"];
         Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, $result);
         $database->execute("DROP TABLE `colissimo_freeshipping`");
     }
     if (is_readable($uploadDir) && Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null) == null) {
         Colissimo::setConfigValue(ColissimoConfigValue::PRICES, file_get_contents($uploadDir));
     }
 }