fafc9b2656
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 1s
Store locator listing package with component (com_mokojoomstorelocator), map module (mod_mokojoomstorelocator_map), and search module (mod_mokojoomstorelocator_search). Includes database schema, admin/site MVC, language files, Joomla 4/5 package manifest, and CI/CD workflows from Template-Joomla. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
107 lines
2.1 KiB
PHP
107 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* @package MokoJoomStoreLocator
|
|
* @subpackage pkg_mokojoomstorelocator
|
|
* @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\Factory;
|
|
use Joomla\CMS\Installer\InstallerAdapter;
|
|
use Joomla\CMS\Language\Text;
|
|
use Joomla\CMS\Log\Log;
|
|
|
|
/**
|
|
* Package installation script for MokoJoomStoreLocator.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
class Pkg_MokojoomstorelocatorInstallerScript
|
|
{
|
|
/**
|
|
* Minimum PHP version required.
|
|
*
|
|
* @var string
|
|
* @since 1.0.0
|
|
*/
|
|
protected $minimumPhp = '8.1';
|
|
|
|
/**
|
|
* Minimum Joomla version required.
|
|
*
|
|
* @var string
|
|
* @since 1.0.0
|
|
*/
|
|
protected $minimumJoomla = '4.4.0';
|
|
|
|
/**
|
|
* 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
|
|
*/
|
|
public function preflight($type, $parent)
|
|
{
|
|
if (version_compare(PHP_VERSION, $this->minimumPhp, '<'))
|
|
{
|
|
Log::add(
|
|
'MokoJoomStoreLocator requires PHP ' . $this->minimumPhp . ' or later.',
|
|
Log::WARNING,
|
|
'jerror'
|
|
);
|
|
|
|
return false;
|
|
}
|
|
|
|
if (version_compare(JVERSION, $this->minimumJoomla, '<'))
|
|
{
|
|
Log::add(
|
|
'MokoJoomStoreLocator requires Joomla ' . $this->minimumJoomla . ' or later.',
|
|
Log::WARNING,
|
|
'jerror'
|
|
);
|
|
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Called after installation.
|
|
*
|
|
* @param string $type Installation type.
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
*
|
|
* @return boolean True on success.
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function postflight($type, $parent)
|
|
{
|
|
// TODO: Post-installation tasks (enable modules, set defaults, etc.)
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Called on uninstallation.
|
|
*
|
|
* @param InstallerAdapter $parent The parent installer object.
|
|
*
|
|
* @return void
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
public function uninstall($parent)
|
|
{
|
|
// TODO: Cleanup tasks on uninstall
|
|
}
|
|
}
|