NexusLeads Webshell
NexusLeads


Server : LiteSpeed
System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : alsaif ( 1057)
PHP Version : 7.4.33
Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/alsaif/domains/alsaif.group/public_html/plugins/system/nrframework/NRFramework/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alsaif/domains/alsaif.group/public_html/plugins/system/nrframework/NRFramework/Factory.php
<?php

/**
 *  @author          Tassos.gr <info@tassos.gr>
 *  @link            https://www.tassos.gr
 *  @copyright       Copyright © 2024 Tassos All Rights Reserved
 *  @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
 */

namespace NRFramework;

use \NRFramework\WebClient;
use \NRFramework\CacheManager;
use Joomla\CMS\Factory as JoomlaFactory;
use Joomla\CMS\Uri\Uri;

defined('_JEXEC') or die;

/**
*  Framework Factory Class
*  
*  Used to decouple the framework from it's dependencies and make unit testing easier.
*
*  @todo Rename class to Container and make all methods static.
*/
class Factory
{
    public function isFrontend()
    {
        return $this->getApplication()->isClient('site');
    }

    public static function getCondition($name)
    {
        return \NRFramework\Conditions\ConditionsHelper::getInstance()->getCondition($name);
    }

    public function getDbo()
    {
        return JoomlaFactory::getDbo();
    }

    public function getApplication()
    {
        $app = JoomlaFactory::getApplication();

        // The 'forward_context' parameter is used to forward data from one page to another. This is rather useful in XHR requests. 
        // This is mainly used in Convert Forms to make the {article} Smart Tag work after form submission.
        if ($context = $app->input->get('forward_context', '', 'raw'))
        {   
            if (is_string($context))
            {
                try
                {
                    $context = json_decode($context, true);
                    $app->input->set('forward_context', $context);
                } catch (\Throwable $th)
                {
                }
            }
        }

        return $app;
    }

    public function getCookie($cookie_name)
    {
        return JoomlaFactory::getApplication()->input->cookie->get($cookie_name, null, 'string');
    }

    public function getDocument()
    {
        return JoomlaFactory::getDocument();
    }

    public function getUser($id = null)
    {
        return \NRFramework\User::get($id);
    }

    public function getCache()
    {
        return CacheManager::getInstance(JoomlaFactory::getCache('tassos', ''));
    }

    public function getDate($date = 'now', $tz = null)
    {
        return JoomlaFactory::getDate($date, $tz);
    }

    public function getURI()
    {
        return Uri::getInstance();
    }

    public function getURL()
    {
        return Uri::getInstance()->toString();
    }

    public function getLanguage()
    {
        return JoomlaFactory::getLanguage();
    }

    public function getSession()
    {
        return JoomlaFactory::getSession();
    }

    public function getDevice()
    {
        return WebClient::getDeviceType();
    }

    public function getBrowser()
    {
        return WebClient::getBrowser();
    }

    public function getExecuter($php_code)
    {
        return new \NRFramework\Executer($php_code);
    }
}

NexusLeads