2026-06-23 11:02:19 -05:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* @package MokoSuiteStoreLocator
|
|
|
|
|
* @subpackage pkg_mokosuitestorelocator
|
|
|
|
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
|
|
|
|
* @license GNU General Public License version 3 or later; see LICENSE
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
|
|
use Joomla\CMS\Installer\InstallerAdapter;
|
2026-06-23 11:08:46 -05:00
|
|
|
use Joomla\CMS\Installer\InstallerScriptInterface;
|
2026-06-23 11:02:19 -05:00
|
|
|
use Joomla\CMS\Log\Log;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Package installation script for MokoSuiteStoreLocator.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
class Pkg_MokosuitestorelocatorInstallerScript implements InstallerScriptInterface
|
2026-06-23 11:02:19 -05:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Minimum PHP version required.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
protected string $minimumPhp = '8.2';
|
2026-06-23 11:02:19 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Minimum Joomla version required.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
protected string $minimumJoomla = '5.0.0';
|
2026-06-23 11:02:19 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called before any type of action.
|
|
|
|
|
*
|
|
|
|
|
* @param string $type Installation type (install, update, discover_install).
|
|
|
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
|
|
|
*
|
|
|
|
|
* @return boolean True on success.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
public function preflight(string $type, InstallerAdapter $parent): bool
|
2026-06-23 11:02:19 -05:00
|
|
|
{
|
|
|
|
|
if (version_compare(PHP_VERSION, $this->minimumPhp, '<'))
|
|
|
|
|
{
|
|
|
|
|
Log::add(
|
|
|
|
|
'MokoSuiteStoreLocator requires PHP ' . $this->minimumPhp . ' or later.',
|
|
|
|
|
Log::WARNING,
|
|
|
|
|
'jerror'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (version_compare(JVERSION, $this->minimumJoomla, '<'))
|
|
|
|
|
{
|
|
|
|
|
Log::add(
|
|
|
|
|
'MokoSuiteStoreLocator requires Joomla ' . $this->minimumJoomla . ' or later.',
|
|
|
|
|
Log::WARNING,
|
|
|
|
|
'jerror'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-06-23 11:08:46 -05:00
|
|
|
* Called on installation.
|
2026-06-23 11:02:19 -05:00
|
|
|
*
|
2026-06-23 11:08:46 -05:00
|
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
|
|
|
*
|
|
|
|
|
* @return boolean True on success.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function install(InstallerAdapter $parent): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called on update.
|
|
|
|
|
*
|
|
|
|
|
* @param InstallerAdapter $parent The parent installer object.
|
2026-06-23 11:02:19 -05:00
|
|
|
*
|
|
|
|
|
* @return boolean True on success.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
public function update(InstallerAdapter $parent): bool
|
2026-06-23 11:02:19 -05:00
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called on uninstallation.
|
|
|
|
|
*
|
|
|
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
|
|
|
*
|
2026-06-23 11:08:46 -05:00
|
|
|
* @return boolean True on success.
|
2026-06-23 11:02:19 -05:00
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
2026-06-23 11:08:46 -05:00
|
|
|
public function uninstall(InstallerAdapter $parent): bool
|
2026-06-23 11:02:19 -05:00
|
|
|
{
|
2026-06-23 11:08:46 -05:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called after any type of action.
|
|
|
|
|
*
|
|
|
|
|
* @param string $type Installation type.
|
|
|
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
|
|
|
*
|
|
|
|
|
* @return boolean True on success.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function postflight(string $type, InstallerAdapter $parent): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
2026-06-23 11:02:19 -05:00
|
|
|
}
|
|
|
|
|
}
|