Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure extension package cache is cleared on save/remove

  • Loading branch information...
commit aad3073c45c8dc407131bd4b073ff55f8825d639 1 parent 1e9d4c3
Shaun McCormick authored
Showing with 14 additions and 1 deletion.
  1. +14 −1 core/model/modx/modextensionpackage.class.php
View
15 core/model/modx/modextensionpackage.class.php
@@ -17,9 +17,22 @@ public function save($cacheFlag= null) {
$this->set('updated_at',strftime('%Y-%m-%d %H:%M:%S'));
}
}
- return parent::save($cacheFlag);
+ $saved = parent::save($cacheFlag);
+ if ($saved && !$this->getOption(xPDO::OPT_SETUP)) {
+ $this->xpdo->call('modExtensionPackage','clearCache',array(&$this->xpdo));
+ }
+ return $saved;
}
+ public function remove(array $ancestors = array()) {
+ $removed = parent::remove($ancestors);
+ if ($removed && !$this->getOption(xPDO::OPT_SETUP)) {
+ $this->xpdo->call('modExtensionPackage','clearCache',array(&$this->xpdo));
+ }
+ return $removed;
+ }
+
+
/**
* @static
* @param xPDO|modX $modx
Please sign in to comment.
Something went wrong with that request. Please try again.