Skip to content

Commit

Permalink
Add host to log file name. New 2019.06.20
Browse files Browse the repository at this point in the history
  • Loading branch information
GHSVS-de committed Jun 18, 2019
1 parent b79a6ea commit 3c2eaee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions backupslogghsvs.php
@@ -1,8 +1,10 @@
<?php
defined('JPATH_BASE') or die;

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Uri\Uri;

class PlgSystemBackupslogghsvs extends CMSPlugin
{
Expand All @@ -29,10 +31,21 @@ public function onUserAfterLogin($options)
{
return;
}


$root = Uri::root();

if(!empty($root))
{
$root = implode('-', array_filter(explode('/', str_replace(array('http://', 'https://'), '', $root))));
}
else
{
$root = Uri::getInstance()->getHost();
}

$query = $this->db->getQuery(true)
->select('*');

foreach ($this->backuptables as $component => $table)
{
$query->clear('from')->from($table);
Expand All @@ -53,9 +66,10 @@ public function onUserAfterLogin($options)
{
$lines = array();
$newLines = array();

// .txt for opening in EXCEL with chance to make settings for tab separated.
$logFile = $this->backuppaths[$component] . '/' . $this->log_file_name . '_' . $component . '.csv.txt';
$logFile = $this->backuppaths[$component] . '/' . $this->log_file_name
. '_' . $root . '_' . $component . '.csv.txt';

if (is_file($logFile))
{
Expand Down
2 changes: 1 addition & 1 deletion backupslogghsvs.xml
Expand Up @@ -7,7 +7,7 @@
<license>GNU General Public License version 3 or later; see LICENSE file</license>
<authorEmail></authorEmail>
<authorUrl>https://www.ghsvs.de</authorUrl>
<version>2019.06.09</version>
<version>2019.06.20</version>
<description>Joomla plugin that copies db entries of Akeeba Backup and Easy Joomla Backup into a tab separated csv file inside each backups folder</description>

<updateservers><server type="extension" priority="1" name="PLG_SYSTEM_BACKUPSLOGGHSVS">https://raw.githubusercontent.com/GHSVS-de/upadateservers/master/backupslogghsvs-update.xml</server></updateservers>
Expand Down

0 comments on commit 3c2eaee

Please sign in to comment.