Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmonllao/a2ad3c0983385b743a1b7526c89e21e2 to your computer and use it in GitHub Desktop.
Save dmonllao/a2ad3c0983385b743a1b7526c89e21e2 to your computer and use it in GitHub Desktop.
static_acceleration_returns_references_to_obj.php
<?php
define('CLI_SCRIPT', true);
require_once(__DIR__ . '/config.php');
$options = [
'simpledata' => true,
'staticacceleration' => true
];
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_myplugin', 'mycache', [], $options);
$modules = $DB->get_records('modules');
$cache->set_many($modules);
$moduleone = $cache->get('1');
var_dump($moduleone->name);
$moduleone->name = 'OUUU';
var_dump($cache->get('1')->name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment