Created
October 13, 2017 12:05
-
-
Save krasnikovdev/a36a9e706691fbcd806d041d11b51c79 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//mgr events | |
if($modx->context->key == "mgr"){ | |
switch($modx->event->name){ | |
case "OnBeforeCacheUpdate": | |
if (!$obj = $modx->getObject('modSystemSetting', array('key' => 'site_file_version'))) { | |
$obj = $modx->newObject('modSystemSetting'); | |
$obj->fromArray(array( | |
'key' => 'site_file_version', | |
'xtype' => 'textfield', | |
'namespace' => 'core', | |
'area' => 'site', | |
'editedon' => null, | |
), '', TRUE); | |
} | |
$obj->set('value',substr(md5(time()), 0, 12)); | |
$obj->save(); | |
break; | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment