Pop a URL to crawl off the queue, or null if no URLs left

@return string|null
480654
public function getNextUrl() {
        $urls = $this->_readUrlQueue();
        $nextUrl = array_shift($urls);
        $this->_writeUrlQueue($urls);
        return $nextUrl;
    }
1234344
public function pop()
    {
        if (null !== $this->getDraft()) {
            return $this->getDraft()->pop();
        }

        $last = $this->last();

        if (null === $last) {
            return;
        }

        array_pop($this->_data);
        $content = null;
        if (isset($this->subcontentmap[$last->getUid()])) {
            $content = $this->_subcontent->get($this->subcontentmap[$last->getUid()]);
            $this->_subcontent->removeElement($content);
            unset($this->subcontentmap[$last->getUid()]);
        }

        $this->rewind();

        return $content;
    }
706449
public function pop()
    {
        $handler = $this->isolator->set_error_handler(function () {});

        if (null !== $handler) {
            $this->isolator->restore_error_handler();
        }

        $this->isolator->restore_error_handler();

        return $handler;
    }
567108
public function nextPageUrl()
	{
		if ( $this->lastPage() > $this->currentPage() )
			return $this->url( $this->currentPage() + 1 );

		return null;
	}
944775
public function queuePull()
    {
        if ($this->isSingle()) {
            $queue_config = $this->getQueueConfig();
            if (isset($queue_config['driver'])) {
                /** @var BaseQueue $driver */
                $driver = $queue_config['driver'];
                return $driver::component()->pull();
            }
        }

        return null;
    }
1350956
public function popRight(): ?string
    {
        $ret = $this->handle->rPop($this->name);
        return $ret === false ? null : $ret;
    }
1265337
public static function returnUrl()
    {
        if (self::$returnUrl === null) {
            $url = ['/' . ltrim(Yii::$app->requestedRoute, '/')];
            foreach (Yii::$app->request->queryParams as $key => $value) {
                $url[$key] = $value;
            }
            self::$returnUrl = Url::to($url);

        }
        return self::$returnUrl;
    }
1112294
public function pop()
    {
        if (count($this->_heap) == 0) {
            return null;
        }

        $top = $this->_heap[0];
        $lastId = count($this->_heap) - 1;

        /**
         * Find appropriate position for last node
         */
        $nodeId  = 0;     // Start from a top
        $childId = 1;     // First child

        // Choose smaller child
        if ($lastId > 2  &&  $this->_less($this->_heap[2], $this->_heap[1])) {
            $childId = 2;
        }

        while ($childId < $lastId  &&
               $this->_less($this->_heap[$childId], $this->_heap[$lastId])
          ) {
            // Move child node up
            $this->_heap[$nodeId] = $this->_heap[$childId];

            $nodeId  = $childId;               // Go down
            $childId = ($nodeId << 1) + 1;     // First child

            // Choose smaller child
            if (($childId+1) < $lastId  
                && $this->_less($this->_heap[$childId+1], $this->_heap[$childId])
            ) {
                $childId++;
            }
        }

        // Move last element to the new position
        $this->_heap[$nodeId] = $this->_heap[$lastId];
        unset($this->_heap[$lastId]);

        return $top;
    }
1360219
public function pop()
    {
        if (!$this->count()) {
            return null;
        }

        $task = $this->getQueue()->dequeue();

        return $this->unserializeTask($task, '');
    }
1166109
public function getBackURL()
    {
        $request = $this->getRequest();
        if (!$request) {
            return null;
        }
        $backURL = $request->requestVar('BackURL');
        // Fall back to X-Backurl header
        if (!$backURL && $request->isAjax() && $request->getHeader('X-Backurl')) {
            $backURL = $request->getHeader('X-Backurl');
        }
        if (!$backURL) {
            return null;
        }
        if (Director::is_site_url($backURL)) {
            return $backURL;
        }
        return null;
    }
483794
public static function path()
    {
        $url = '';

        // Get the rest of the URL
        if (!Arr::key('REQUEST_URI', $_SERVER)) {
            // Microsoft IIS doesn't set REQUEST_URI by default
            if ($queryString = Arr::key('QUERY_STRING', $_SERVER, true)) {
                $url .= '?' . $queryString;
            }
        } else {
            $url .= $_SERVER['REQUEST_URI'];
        }

        return $url ?: null;
    }
968397
protected function _readUrlQueue() {
        $readQueue = @unserialize(
            Mage::app()->loadCache(self::CRAWLER_URLS_CACHE_ID) );
        if ( ! is_array($readQueue)) {
            // This is the first time the queue has been read since the last
            // cache flush (or the queue is corrupt)
            // Returning an empty array here would be the proper behavior,
            // but causes the queue to not be saved on the full cache flush event
            return $this->getAllUrls();
        } else {
            return $readQueue;
        }
    }
1318497
public function getUrl()
    {
        $urlParts = array_filter([$this->domain, $this->getNickname()]);

        return count($urlParts) ? implode('/', $urlParts) : null;
    }
412010
private function url()
    {
        if (isset($this->_options[self::ENTRY_BASEURL])) {
            return $this->_options[self::ENTRY_BASEURL];
        }

        // this is the fallback
        return Urls::URL_CURSOR;
    }
720575
public static function exceedingPaginationFallback() {
		
		$self = static::$instance;
		
		if (!$self) return NULL;
		
		if ($self->page > 1) {
			$self->resetPage();
			$app = Application::getInstance();
			$app->redirect($self->getUrl());
		}
		
	}
1137363
public function currentUrl()
    {
        $context = $this->contextObject();

        if ($context && isset($context['url'])) {
            return $this->createAbsoluteUrl($context['url']);
        }

        return null;
    }
501407
public function getUrlWithoutArgs()
    {
        $url = $this->getUrl();
        if (($pos = strpos($url, '?')) !== false) {
            $url = substr($url, 0, $pos);
        }
        return $url;
    }