X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FConverter%2FFunctions%2FCacheSet.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FConverter%2FFunctions%2FCacheSet.php;h=d539682360dda5654b2d8e168b4c1fb80e3f1244;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/CacheSet.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/CacheSet.php new file mode 100644 index 000000000..d53968236 --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/CacheSet.php @@ -0,0 +1,40 @@ +getArguments(); + + $cache = ClassMethodCallNode::create('\Drupal', 'cache'); + if (sizeof($arguments) > 2) { + $cache->appendArgument(clone $arguments[2]); + } + + $set = $cache->appendMethodCall('set') + ->appendArgument(clone $arguments[0]) + ->appendArgument(clone $arguments[1]); + + // Include the expiration time, if given. + if (sizeof($arguments) == 4) { + $set->appendArgument(clone $arguments[3]); + } + + return $set; + } + +}