get_status

Get the status message of our response, or generate one

@access public
@return string
347062
public function get_status() {
		// If a status is already set
		if ( isset($this->response->status) && !is_null($this->response->status) ) {
			return $this->response->status;
		}
		// If the status code has a corresponding message in our config
		elseif ( array_key_exists($this->response->code(), $this->config['rest']['status_codes']) ) {
			return $this->config['rest']['status_codes'][$this->response->code()];
		}
		// If there's a default
		elseif ( isset($this->config['rest']['defaults']['status']) ) {
			return $this->config['rest']['defaults']['status'];
		}
		else {
			return 'NULL';
		}
	}
534418
protected function getStatus()
    {
        if ($this->detail instanceof \Throwable) {
            $this->status = $this->createStatusFromException();
        }

        return $this->status;
    }
788673
public function getStatusString()
    {
        if (!empty(TicketMessageInterface::STATUSES[$this->status])) {
            return TicketMessageInterface::STATUSES[$this->status];
        }

        return TicketMessageInterface::STATUSES[0];
    }
381524
public function getStatus(){

        // set response to json
        $this->setEndpoint('json');

        // get response
        $obj = json_decode( $this->get(), true);

        return array_get($obj, 'status', null);

    }
618824
public function getResultMessage() {
    // We're only handling the results that our code actually generates.
    switch ($this->result_code) {
      case self::RES_SUCCESS:
        return "SUCCESS";
      case self::RES_FAILURE:
        return "FAILURE";
      case self::RES_NOTSTORED:
        return "NOT STORED";
      case self::RES_NOTFOUND:
        return "NOT FOUND";
    }
    return "UNKNOWN";
  }
1145117
public static function getStatusMessage($code) {
		if (!$code) {
			return '';
		}

		return isset(self::$statusMessages[$code]) ? self::$statusMessages[$code] : '';
	}
1163420
public function getStatus($raw_output = true)
    {
        if ($raw_output) {
            return $this->_status;
        }
        return self::$_statusToString[$this->_status];
    }
1065052
public function status()
    {
        $system = app()->make(System::class)->getStatus();

        return $this->item([
            'status'  => $system['system_status'],
            'message' => $system['system_message'],
        ]);
    }
526410
public function getStatus()
    {
        $statuses = array();

        $statuses['core_version'] = array(
            'title' => $this->translation->text('Core version'),
            'description' => '',
            'severity' => 'info',
            'status' => gplcart_version(),
            'weight' => 0,
        );

        $statuses['database_version'] = array(
            'title' => $this->translation->text('Database version'),
            'description' => '',
            'severity' => 'info',
            'status' => $this->db->getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION),
            'weight' => 1,
        );

        $statuses['php_version'] = array(
            'title' => $this->translation->text('PHP version'),
            'description' => '',
            'severity' => 'info',
            'status' => PHP_VERSION,
            'weight' => 2,
        );

        $statuses['php_os'] = array(
            'title' => $this->translation->text('PHP operating system'),
            'description' => '',
            'severity' => 'info',
            'status' => PHP_OS,
            'weight' => 3,
        );

        $statuses['php_memory_limit'] = array(
            'title' => $this->translation->text('PHP Memory Limit'),
            'description' => '',
            'severity' => 'info',
            'status' => ini_get('memory_limit'),
            'weight' => 4,
        );

        $statuses['php_apc_enabled'] = array(
            'title' => $this->translation->text('PHP APC cache enabled'),
            'description' => '',
            'severity' => 'info',
            'status' => ini_get('apc.enabled') ? $this->translation->text('Yes') : $this->translation->text('No'),
            'weight' => 5,
        );

        $statuses['server_software'] = array(
            'title' => $this->translation->text('Server software'),
            'description' => '',
            'severity' => 'info',
            'status' => filter_input(INPUT_SERVER, 'SERVER_SOFTWARE', FILTER_SANITIZE_STRING),
            'weight' => 6
        );

        $date_format = $this->config->get('date_full_format', 'd.m.Y H:i');

        $statuses['cron'] = array(
            'title' => $this->translation->text('Cron last run'),
            'description' => '',
            'severity' => 'info',
            'status' => date($date_format, $this->config->get('cron_last_run')),
            'weight' => 7,
        );

        $filesystem = $this->checkFilesystem();

        $statuses['filesystem'] = array(
            'title' => $this->translation->text('Filesystem is protected'),
            'description' => '',
            'severity' => 'danger',
            'status' => $filesystem === true ? $this->translation->text('Yes') : $this->translation->text('No'),
            'details' => $filesystem === true ? array() : $filesystem,
            'weight' => 8,
        );

        $statuses['search_index'] = array(
            'title' => $this->translation->text('Search index'),
            'description' => '',
            'severity' => 'info',
            'status' => $this->translation->text('@num rows', array('@num' => $this->countSearchIndex())),
            'weight' => 9,
        );

        $this->hook->attach('report.statuses', $statuses, $this);

        gplcart_array_sort($statuses);
        return $statuses;
    }
844853
public function getStatusLine() : string
    {
        return sprintf('HTTP/%s %s %s', self::HTTP_VERSION, $this->statusCode, self::getStatusText($this->statusCode));
    }
759430
protected function getStatus()
    {
        if (!$this->getModuleSetting('status')) {
            return false;
        }

        if ($this->getModuleSetting('test')) {
            return $this->getModuleSetting('test_key') && $this->getModuleSetting('test_public_key');
        }

        return $this->getModuleSetting('live_key') && $this->getModuleSetting('live_public_key');
    }
1108280
public function getStatus() {
        if ($this->pid) {
            $waitPID = \pcntl_waitpid($this->pid, $status, WNOHANG);

            if ($waitPID == $this->pid) {
                return Thread::THREAD_EXITED;
            } else {
                return Thread::THREAD_RUNNING;
            }
        }
    }
599502
public function getStatus()
    {
        $entries = $this->_query('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode');
        if ($entries->length != 1) {
            return null;
        }
        $status = $entries->item(0)->getAttribute('Value');
        return $status;
    }
910750
public function getStatus()
    {
        if ($this->config->has('fake_status')) {
            return new Status($this, $this->config->get('fake_status'));
        }

        try {
            if ($this->config->has('status_test')) {
                if ($this->getConnection()->has($this->config->get('status_test'))) {
                    return Status::working($this, [ 'message' => 'Expected file path exists.' ]);
                }
                return Status::failing($this, [ 'message' => 'Expected file path does not exist.' ]);
            }

            $this->getConnection()->has('some-probably-non-existant-filepath');
            return Status::working($this);
        } catch (Exception $e) {
            error_log('[' . static::CLASS . '] Error on file path existance check: ' . $e->getTraceAsString());
            return Status::failing(
                $this,
                [ 'message' => 'Exception on file path existance check: ' . $e->getMessage() ]
            );
        }
    }
627942
public function getStatus()
    {
        if (isset($this->_statuses[(int) $this->status])) {
            return $this->_statuses[(int) $this->status];
        }
        throw new \Exception('Status "' . $this->status . '" not found for Page with id ' . $this->id . '.');
    }
534775
public function getStatus()
    {
        if ($this->_getField(self::STORAGE_ID)) {
            return ( $this->_getField(self::$PAYMENT_INFORMATION) ) ? self::STATE_NOT_EMPTY : self::STATE_EXISTING;
        } else {
            return ( $this->_getField(self::$ERRORS) ) ? self::STATE_FAILURE : self::STATE_NOT_EXISTING;
        }
    }
1196347
public function getStatus()
    {
        if (   !strlen($this->getValue('status'))
            && !in_array($this->getType(), array('validation-error', 'error')))
        {
            $this->offsetSet('status', 'processing');
        }

        return strtolower($this->getValue('status'));
    }