Skip to content

Commit d59d6b0

Browse files
committed
[REF] $modx to $evo.
1 parent 5228f62 commit d59d6b0

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

core/src/Legacy/Cache.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ public function getParents($id, $path = '')
107107
}
108108

109109
/**
110-
* @param null|DocumentParser $modx
110+
* @param null|DocumentParser $evo
111111
*/
112-
public function emptyCache($modx = null)
112+
public function emptyCache($evo = null)
113113
{
114-
if (!($modx instanceof Interfaces\CoreInterface)) {
115-
$modx = $GLOBALS['modx'];
114+
if (!($evo instanceof Interfaces\CoreInterface)) {
115+
$evo = $GLOBALS['evo'];
116116
}
117117
if (!isset($this->cachePath)) {
118-
$modx->getService('ExceptionHandler')->messageQuit("Cache path not set.");
118+
$evo->getService('ExceptionHandler')->messageQuit("Cache path not set.");
119119
}
120120
\Illuminate\Support\Facades\Cache::flush();
121121
Models\UserSetting::query()->whereIn('setting_name', ['password', 'password_confirmation', 'clearPassword'])->delete();
@@ -141,7 +141,7 @@ public function emptyCache($modx = null)
141141
}
142142
}
143143

144-
$this->buildCache($modx);
144+
$this->buildCache($evo);
145145

146146
$this->publishTimeConfig();
147147

@@ -229,10 +229,10 @@ public function getCacheRefreshTime()
229229

230230
/**
231231
* build siteCache file
232-
* @param Interfaces\CoreInterface $modx
232+
* @param Interfaces\CoreInterface $evo
233233
* @return boolean success
234234
*/
235-
public function buildCache($modx)
235+
public function buildCache($evo)
236236
{
237237
$content = "<?php\n";
238238

@@ -317,12 +317,12 @@ public function buildCache($modx)
317317
$content .= '$s[\'' . $row['name'] . '\']=\'return false;\';';
318318
} else {
319319
$value = trim($row['snippet']);
320-
if ($modx->getConfig('minifyphp_incache')) {
320+
if ($evo->getConfig('minifyphp_incache')) {
321321
$value = $this->php_strip_whitespace($value);
322322
}
323323
$content .= '$s[\'' . $row['name'] . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
324-
$properties = $modx->parseProperties($row['properties']);
325-
$sharedproperties = $modx->parseProperties($row['sharedproperties']);
324+
$properties = $evo->parseProperties($row['properties']);
325+
$sharedproperties = $evo->parseProperties($row['sharedproperties']);
326326
$properties = array_merge($sharedproperties, $properties);
327327
if (0 < count($properties)) {
328328
$content .= '$s[\'' . $row['name'] . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
@@ -339,13 +339,13 @@ public function buildCache($modx)
339339
$content .= '$p=&$this->pluginCache;';
340340
foreach ($plugins->toArray() as $row) {
341341
$value = trim($row['plugincode']);
342-
if ($modx->getConfig('minifyphp_incache')) {
342+
if ($evo->getConfig('minifyphp_incache')) {
343343
$value = $this->php_strip_whitespace($value);
344344
}
345345
$content .= '$p[\'' . $row['name'] . '\']=\'' . $this->escapeSingleQuotes($value) . '\';';
346346
if ($row['properties'] != '' || $row['sharedproperties'] != '') {
347-
$properties = $modx->parseProperties($row['properties']);
348-
$sharedproperties = $modx->parseProperties($row['sharedproperties']);
347+
$properties = $evo->parseProperties($row['properties']);
348+
$sharedproperties = $evo->parseProperties($row['sharedproperties']);
349349
$properties = array_merge($sharedproperties, $properties);
350350
if (0 < count($properties)) {
351351
$content .= '$p[\'' . $row['name'] . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';';
@@ -378,10 +378,10 @@ public function buildCache($modx)
378378
$content .= "\n";
379379

380380
// close and write the file
381-
$filename = $modx->getSiteCacheFilePath();
381+
$filename = $evo->getSiteCacheFilePath();
382382

383383
// invoke OnBeforeCacheUpdate event
384-
$modx->invokeEvent('OnBeforeCacheUpdate');
384+
$evo->invokeEvent('OnBeforeCacheUpdate');
385385

386386
if (@file_put_contents($filename, $content) === false) {
387387
exit("Cannot write $filename! Make sure file or its directory is writable!");
@@ -392,7 +392,7 @@ public function buildCache($modx)
392392
}
393393

394394
// invoke OnCacheUpdate event
395-
$modx->invokeEvent('OnCacheUpdate');
395+
$evo->invokeEvent('OnCacheUpdate');
396396

397397
return true;
398398
}

0 commit comments

Comments
 (0)