Returns current page performance info.

@return array perf info
326290
public static function get_performance_info() {
        global $CFG, $PERF;

        if (!session_id()) {
            return array();
        }

        self::load_handler();
        $size = display_size(strlen(session_encode()));
        $handler = get_class(self::$handler);

        $info = array();
        $info['size'] = $size;
        $info['html'] = html_writer::div("Session ($handler): $size", "sessionsize");
        $info['txt'] = "Session ($handler): $size ";

        if (!empty($CFG->debugsessionlock)) {
            $sessionlock = self::get_session_lock_info();
            if (!empty($sessionlock['held'])) {
                // The page displays the footer and the session has been closed.
                $sessionlocktext = "Session lock held: ".number_format($sessionlock['held'], 3)." secs";
            } else {
                // The session hasn't yet been closed and so we assume now with microtime.
                $sessionlockheld = microtime(true) - $PERF->sessionlock['gained'];
                $sessionlocktext = "Session lock open: ".number_format($sessionlockheld, 3)." secs";
            }
            $info['txt'] .= $sessionlocktext;
            $info['html'] .= html_writer::div($sessionlocktext, "sessionlockstart");
            $sessionlockwaittext = "Session lock wait: ".number_format($sessionlock['wait'], 3)." secs";
            $info['txt'] .= $sessionlockwaittext;
            $info['html'] .= html_writer::div($sessionlockwaittext, "sessionlockwait");
        }

        return $info;
    }
20143
protected static function getPageRange()
    {
        $currentPage = static::$pagination->getPage();
        $pageCount = static::$pagination->getPageCount();
        $beginPage = max(0, $currentPage - (int) (static::$params['maxButtonCount'] / 2));
        if (($endPage = $beginPage + static::$params['maxButtonCount'] - 1) >= $pageCount) {
            $endPage = $pageCount - 1;
            $beginPage = max(0, $endPage - static::$params['maxButtonCount'] + 1);
        }
        return [$beginPage, $endPage];
    }
965892
public function getCurrentPageAttributes()
    {
        // Create Attributes Array:
        
        $attributes = [];
        
        // Define Attributes Array:
        
        if ($id = $this->getCurrentPageClassID()) {
            $attributes['id'] = $id;
        }
        
        if ($class = $this->getCurrentPageAncestry()) {
            $attributes['class'] = $class;
        }
        
        // Extend Attributes Array:
        
        $this->extend('updateCurrentPageAttributes', $attributes);
        
        // Answer Attributes Array:
        
        return $attributes;
    }
242726
public function current()
    {
        if (!$this->page) {
            $this->page = $this->executeCall();
        }

        $this->moreResultsType = isset($this->page['batch']['moreResults'])
            ? $this->page['batch']['moreResults']
            : null;

        return $this->get($this->itemsPath, $this->page);
    }
1268247
public function getRequestParameters()
    {
        // $page current page of the grid
        $page = (int) $this->getRequest()->get('page', 0);
        
        // $orderBy column name to sort datagrid records
        $orderBy = $this->getRequest()->get('sidx', false);
        
        // ASC | DESC $sort
        $sort = strtoupper($this->getRequest()->get('sord', 'asc'));
        
        // $records  number of records to display
        $records = (int) $this->getRequest()->get('rows', 0);
        
        // $search is search in the query
        $search = ($this->getRequest()->get('_search', false) === 'true');
 
        // $filters Filters from the search query
        $filters = (array) json_decode($this->getRequest()->get('filters', '{}'));
        
        // $masterRowId Id of the master grid record
        $masterGridRowId = (int) $this->getRequest()->get('masterGridRowId', 0);
        
        $parameters = array(
            'page'            => $page,
            'orderBy'         => $orderBy,
            'sort'            => $sort,
            'records'         => $records,
            'search'          => $search,
            'filters'         => $filters,
            'masterGridRowId' => $masterGridRowId
        );
        
        return $parameters;
    }
393271
public function getStatus()
    {
        $reports = [];

        $rootPageFlagStatus = $this->getRootPageFlagStatus();
        if (!is_null($rootPageFlagStatus)) {
            $reports[] = $rootPageFlagStatus;

            // intended early return, no sense in going on if there are no root pages
            return $reports;
        }

        $domainRecordAvailableStatus = $this->getDomainRecordAvailableStatus();
        if (!is_null($domainRecordAvailableStatus)) {
            $reports[] = $domainRecordAvailableStatus;
        }

        $configIndexEnableStatus = $this->getConfigIndexEnableStatus();
        if (!is_null($configIndexEnableStatus)) {
            $reports[] = $configIndexEnableStatus;
        }

        return $reports;
    }
1090496
public function current()
    {
        return call_user_func(
            $this->fetchCallback,
            pg_fetch_array( $this->resource, $this->fetchRowNumber, $this->fetchType )
        );
    }
724384
public function getPagesRange()
    {
        $pageRange  = $this->getPageRange();
        $pageNumber = $this->getCurrentPageNumber();
        $pageCount  = $this->getNumberOfPages();

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2 );

        if ($pageNumber - $delta > $pageCount - $pageRange) {
            $lowerBound = $pageCount - $pageRange + 1;
            $upperBound = $pageCount;
        } else {
            if ($pageNumber - $delta < 0) {
                $delta = $pageNumber;
            }

            $offset     = $pageNumber - $delta;
            $lowerBound = $offset + 1;
            $upperBound = $offset + $pageRange;
        }

        $pages = array();
        for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; $pageNumber++) {
            $pages[$pageNumber] = $pageNumber;
        }

        return $pages;
    }
882572
public function getUnitPrice()
    {
        // Performance
        if (!\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('bl_perfLoadPrice') || !$this->_blLoadPrice) {
            return;
        }

        $oPrice = null;
        if ((double) $this->getUnitQuantity() && $this->oxarticles__oxunitname->value) {
            $oPrice = clone $this->getPrice();
            $oPrice->divide((double) $this->getUnitQuantity());
        }

        return $oPrice;
    }
1299962
protected function perPage()
    {
        // If the user specified a limit, use it
        if ($this->take) {
            return $this->take;
        }

        // If a sidebar, use the default
        if ($this->layout == 'sidebar') {
            $name = $this->controller_name;

            return $name::$per_sidebar;
        }

        // Else, use the controller's pagination logic
        return $this->controller->perPage();
    }
216345
public function currentPage()
    {
        if (isset($this->pages[self::NEXT])) {
            $page = $this->pages[self::NEXT] - 1;
        } else {
            $page = $this->pages[self::PREV] + 1;
        }

        return $page;
    }
847415
function current()
    {
        if (!isset($this->_curPage)
            || $this->_curPage->getPage() != $this->_position
        ) {
            $this->_curPage = $this->_pages->get($this->_position);
        }
        return $this->_curPage;
    }
928687
public function getCurrentPage()
    {
        $currentPage = Director::get_current_page();
        if ($currentPage instanceof ContentController) {
            $currentPage = $currentPage->data();
        }
        return $currentPage;
    }
1354429
public function getVariables() 
	{
		$pages 	= ceil($this->total / $this->range);
		$page 	= floor($this->start / $this->range) + 1;
		
		$min 	= $page - $this->show;
		$max 	= $page + $this->show;
		
		if($min < 1) {
			$min = 1;
		}
		
		if($max > $pages) {
			$max = $pages;
		}
		
		return array(
			'class'	=> $this->class,
			'url'	=> $this->url,
			'query' => $this->query,
			'start' => $this->start,
			'range' => $this->range,
			'total' => $this->total,
			'show'	=> $this->show,
			'min'	=> $min,
			'max'	=> $max, 
			'pages' => $pages,
			'page'	=> $page);
	}
1023768
public function getItemsPerPage()
    {
        $query = $this->getSessionCurrentQuery();
        if ($query) {
            return $query->getItemsPerPage();
        } else {
            return $this->entity->getItemsPerPage();
        }
    }
623269
public function getTotalPages()
    {
        // Pages before
        $pages = ceil(($this->getFirstShown() - 1) / $this->getItemsPerPage());

        // Current page
        $pages++;

        // Pages after
        $pages += ceil(($this->getTotalRecords() - $this->getLastShown()) / $this->getItemsPerPage());

        return (int) $pages;
    }
727689
public function getLast() {
        return ($this->current_page < $this->getMax() - $this->range ) ? $this->getMax() : false;
    }