Skip to content

Commit

Permalink
Improve putContents function
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Jul 9, 2024
1 parent 58eb5df commit d32460c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions framework/library/astroid/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Filesystem\Folder;
use Joomla\Filesystem\File;
use Joomla\Registry\Registry;
use Joomla\CMS\Version;
use Joomla\CMS\Router\Route;
Expand Down Expand Up @@ -262,12 +263,7 @@ public static function getFileHash($file)
public static function putContents($file, $content, $append = false)
{
Framework::getReporter('Logs')->add('Saved Cached to <code>' . str_replace(JPATH_SITE . '/', '', $file) . '</code>');
self::createDir($file);
if ($append) {
file_put_contents($file, $content, FILE_APPEND);
} else {
file_put_contents($file, $content);
}
File::write($file, $content, false, $append);
}

public static function minifyCSS($css)
Expand Down

0 comments on commit d32460c

Please sign in to comment.