A simple module to try on caching external requests

This commit is contained in:
ahwelp
2023-01-24 20:39:32 +00:00
parent 5320f602f8
commit 78bd7cc06d
10 changed files with 306 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
use Schema\Wrapper as Wrapper;
use App\Core\Sanity\MigratorController as Migrator;
//https://book.cakephp.org/phinx/0/en/migrations.html#valid-column-types
function core_cache_upgrade($pluginversion) {
if ($pluginversion < "0.0.1") {
$table = Wrapper::get_table("core_caches");
$table->addColumn("key", "string", Array("null" => false));
$table->addColumn("type", "string", Array("null" => false));
$table->addColumn("format", "string", Array("null" => false));
$table->addColumn("value", "text", Array("null" => true));
$table->addTimestamps();
$table->create();
Migrator::getInstance()->update_plugin_version("core_cache", "1.0.0");
return;
}
}
function core_cache_rollback($pluginversion) {
if($pluginversion > "0.0.1"){
$table = Wrapper::get_table("core_caches");
$table->drop();
return;
}
}