35
0
plg_content_componentbuilde.../script.php

63 lines
1.9 KiB
PHP
Raw Normal View History

2022-01-10 14:11:20 +00:00
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
2022-08-20 16:38:51 +00:00
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
2022-01-10 14:11:20 +00:00
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
2022-01-10 14:11:20 +00:00
/**
* Content - Componentbuilder Dynamic Get Headers Tabs script file.
*
* @package PlgContentComponentbuilderDynamicGetHeadersTabs
*/
class plgContentComponentbuilderDynamicGetHeadersTabsInstallerScript
{
/**
* Called before any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install|update)
2022-08-20 16:38:51 +00:00
* @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script
2022-01-10 14:11:20 +00:00
*
* @return boolean True on success
*/
2022-08-20 16:38:51 +00:00
public function preflight($route, $adapter)
2022-01-10 14:11:20 +00:00
{
// get application
$app = Factory::getApplication();
2022-01-10 14:11:20 +00:00
// the default for both install and update
$jversion = new JVersion();
if (!$jversion->isCompatible('3.8.0'))
{
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
return false;
}
if ('install' === $route)
{
2022-09-20 11:36:38 +00:00
// check that componentbuilder is installed
$pathToCore = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php';
if (!JFile::exists($pathToCore))
{
$app->enqueueMessage('Joomla Component Builder must first be installed from <a href="https://www.joomlacomponentbuilder.com/ " target="_blank">Joomla Component Builder</a>.', 'error');
return false;
}
2022-01-10 14:11:20 +00:00
}
return true;
}
}