uawdijnntqw1x1x1
IP : 216.73.217.142
Hostname : localhost.localdomain
Kernel : Linux localhost.localdomain 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
consult-e-syn
/
public_html
/
components
/
com_ats
/
Model
/
InstantReplies.php
/
/
<?php /** * @package ats * @copyright Copyright (c)2011-2022 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\TicketSystem\Site\Model; defined('_JEXEC') or die; use Akeeba\TicketSystem\Admin\Model\DefaultDataModel; use FOF40\Container\Container; use FOF40\Model\DataModel\Exception\RecordNotLoaded; class InstantReplies extends DefaultDataModel { public function __construct(Container $container, array $config = []) { // Let's fake a table for this model, so it won't complain $config['idFieldName'] = 'ats_attempt_id'; $config['tableName'] = '#__ats_attempts'; parent::__construct($container, $config); } public function &getItemsArray($limitstart = 0, $limit = 0, $overrideLimits = false) { // We need to do that since we are returning by reference. $blankResults = []; // Make sure our search string is at least 6 characters long (it's unusable if it's less than that) $search = $this->getState('search', ''); if (empty($search) || (strlen($search) < 6)) { return $blankResults; } // Get the Category I am fetching results for $catId = $this->getState('catid', 0); /** @var Categories $category */ $category = $this->container->factory->model('Categories')->tmpInstance(); try { $category->findOrFail($catId); } catch (RecordNotLoaded $e) { return $blankResults; } // Should I display the site's template chrome? $alwaysShowChrome = $this->getState('alwaysShowChrome', 0); $showChrome = $this->container->params->get('instantreplies_sitechrome', 1); $showChrome = $alwaysShowChrome ? 1 : $showChrome; // Search using plugins $platform = $this->container->platform; $oldAllowPluginsValue = $platform->isAllowPluginsInCli(); $platform->setAllowPluginsInCli(true); $platform->importPlugin('atsinstantreply'); $pluginResults = $platform->runPlugins('onATSInstantReply', [$category, $search, $showChrome]); $platform->setAllowPluginsInCli($oldAllowPluginsValue); $sort_results = []; foreach ($pluginResults as $someResults) { if (!is_array($someResults) || empty($someResults)) { continue; } $sort_results = array_merge($sort_results, $someResults); } if (empty($sort_results)) { return $blankResults; } // Merge the results ordered by score and pick only the first 10 items, re-keying them with integer keys. usort($sort_results, function ($a, $b) { if ($a->score == $b->score) { return 0; } return ($a->score > $b->score) ? -1 : 1; }); $results = array_values(array_slice($sort_results, 0, 15)); return $results; } }
/var/www/consult-e-syn/public_html/components/com_ats/Model/InstantReplies.php