vqmod.php (895B)
1 <?php 2 /* 3 * location: admin/model/extension/d_opencart_patch/vqmod.php 4 * 5 */ 6 7 class ModelExtensionDOpencartPatchVqmod extends Model { 8 9 /* 10 * Vqmod: turn on or off 11 */ 12 public function setModification($xml, $action = 1){ 13 $dir_vqmod = str_replace("system", "vqmod/xml", DIR_SYSTEM); 14 $on = $dir_vqmod.$xml; 15 $off = $dir_vqmod.$xml.'_'; 16 if($action){ 17 if (file_exists($off)) { 18 return rename($off, $on); 19 } 20 }else{ 21 if (file_exists($on)) { 22 return rename($on, $off); 23 } 24 } 25 return false; 26 } 27 28 public function refreshCache(){ 29 $dir_vqmod = str_replace("system", "vqmod", DIR_SYSTEM); 30 $file = $dir_vqmod.'mods.cache'; 31 32 if (file_exists($file)) { 33 return unlink($file); 34 } 35 36 return false; 37 } 38 }