@param int  $iLimit How many cast members should be returned?
@param bool $bMore  Add … if there are more cast members than printed.

@return string A list with cast members or $sNotFound.
977589
public function getCast($iLimit = 0, $bMore = true)
        {
            if (true === $this->isReady) {
                $aMatch = IMDBHelper::matchRegex($this->sSource, self::IMDB_CAST);
                if (count($aMatch[2])) {
                    foreach ($aMatch[2] as $i => $sName) {
                        if (0 !== $iLimit && $i >= $iLimit) {
                            break;
                        }

                        $aReturn[] = IMDBHelper::cleanString($sName);
                    }

                    $bMore = (0 !== $iLimit && $bMore && (count($aMatch[2]) > $iLimit) ? '…' : '');

                    $bHaveMore = ($bMore && (count($aMatch[2]) > $iLimit));

                    return IMDBHelper::arrayOutput($this->bArrayOutput, $this->sSeparator, $this->sNotFound, $aReturn, $bHaveMore);
                }
            }

            return IMDBHelper::arrayOutput($this->bArrayOutput, $this->sSeparator, $this->sNotFound);
        }
1052206
public function loadTop5Articles($iLimit = null)
    {
        //has module?
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$myConfig->getConfigParam('bl_perfLoadPriceForAddList')) {
            $this->getBaseObject()->disablePriceLoad();
        }

        switch ($myConfig->getConfigParam('iTop5Mode')) {
            case 0:
                // switched off, do nothing
                break;
            case 1:
                // manually entered
                $this->loadActionArticles('oxtop5', $iLimit);
                break;
            case 2:
                $sArticleTable = getViewName('oxarticles');

                //by default limit 5
                $sLimit = ($iLimit > 0) ? "limit " . $iLimit : 'limit 5';

                $sSelect = "select * from $sArticleTable ";
                $sSelect .= "where " . $this->getBaseObject()->getSqlActiveSnippet() . " and $sArticleTable.oxissearch = 1 ";
                $sSelect .= "and $sArticleTable.oxparentid = '' and $sArticleTable.oxsoldamount>0 ";
                $sSelect .= "order by $sArticleTable.oxsoldamount desc $sLimit";

                $this->selectString($sSelect);
                break;
        }
    }
977205
public function shrink($sInput, $iMaxSize, $blRemoveNewline = true)
    {
        if ($blRemoveNewline) {
            $sInput = str_replace("\r\n", " ", $sInput);
            $sInput = str_replace("\n", " ", $sInput);
        }

        $sInput = str_replace("\t", "    ", $sInput);

        // remove html entities, remove html tags
        $sInput = $this->_unHTMLEntities(strip_tags($sInput));

        $oStr = getStr();
        if ($oStr->strlen($sInput) > $iMaxSize - 3) {
            $sInput = $oStr->substr($sInput, 0, $iMaxSize - 5) . "...";
        }

        return $sInput;
    }
929014
public function substring($indexStart, $indexEnd = null)
    {
        if (is_null($indexEnd) === true) {
            $indexEnd = $this->length();
        }

        $temp = [$indexStart, $indexEnd];
        sort($temp);

        return $this->slice($temp[0], $temp[1]);
    }
1228997
public function addVote($intItemId, $fltValue, $blnLock = false)
    {
        if ($this->getSessionBag()->get($this->getLockId($intItemId))) {
            return;
        }

        $arrData = $this->getDataFor([$intItemId]);

        if (!$arrData || !$arrData[$intItemId]['votecount']) {
            $voteCount   = 0;
            $prevPercent = 0;
        } else {
            $voteCount   = $arrData[$intItemId]['votecount'];
            $prevPercent = (float) $arrData[$intItemId]['meanvalue'];
        }

        $grandTotal = ($voteCount * $this->get('rating_max') * $prevPercent);
        $hundred    = ($this->get('rating_max') * (++$voteCount));

        // Calculate the percentage.
        $value = (1 / $hundred * ($grandTotal + $fltValue));

        $arrSet = [
            'mid' => $this->getMetaModel()->get('id'),
            'aid' => $this->get('id'),
            'iid' => $intItemId,
            'votecount' => $voteCount,
            'meanvalue' => $value,
        ];

        $queryBuilder = $this->connection->createQueryBuilder();

        if (!$arrData || !$arrData[$intItemId]['votecount']) {
            $queryBuilder
                ->insert('tl_metamodel_rating')
                ->values($arrSet);
        } else {
            foreach ($arrSet as $key => $value) {
                $queryBuilder
                    ->set($key, ':' . $key)
                    ->setParameter($key, $value);
            }

            $queryBuilder
                ->update('tl_metamodel_rating')
                ->andWhere('mid=:mid AND aid=:aid AND iid=:iid')
                ->setParameter('mid', $this->getMetaModel()->get('id'))
                ->setParameter('aid', $this->get('id'))
                ->setParameter('iid', $intItemId);
        }

        $queryBuilder->execute();

        if ($blnLock) {
            $this->getSessionBag()->set($this->getLockId($intItemId), true);
        }
    }
695050
protected function _releaseFile($sIdent, $iLockMode = LOCK_EX)
    {
        $blSuccess = true;
        if (isset($this->_aLockedFileHandles[$iLockMode][$sIdent]) &&
            $this->_aLockedFileHandles[$iLockMode][$sIdent] !== false
        ) {
            // release the lock and close file
            $blSuccess = flock($this->_aLockedFileHandles[$iLockMode][$sIdent], LOCK_UN) &&
                         fclose($this->_aLockedFileHandles[$iLockMode][$sIdent]);
            unset($this->_aLockedFileHandles[$iLockMode][$sIdent]);
        }

        return $blSuccess;
    }
91380
def _imul(self, n):
        """"""
        assert n >= 0
        if not n:
            self._clear()
            return self
        m = 1
        old_len = self.len
        while m * 2 < n:
            self._append(self)
            m *= 2
        self._append(self[0:(n - m) * old_len])
        return self
1079514
public function readInt($isCollectionElement = false) {
		if ($isCollectionElement) {
			$length = $this->readShort();
			return unpack('l', strrev($this->read($length)))[1];
		}
		return unpack('l', strrev($this->read(4)))[1];
	}
377487
private function readBIFF5CellRangeAddressFixed($subData)
    {
        // offset: 0; size: 2; index to first row
        $fr = self::getInt2d($subData, 0) + 1;

        // offset: 2; size: 2; index to last row
        $lr = self::getInt2d($subData, 2) + 1;

        // offset: 4; size: 1; index to first column
        $fc = ord($subData{4});

        // offset: 5; size: 1; index to last column
        $lc = ord($subData{5});

        // check values
        if ($fr > $lr || $fc > $lc) {
            throw new PHPExcel_Reader_Exception('Not a cell range address');
        }

        // column index to letter
        $fc = PHPExcel_Cell::stringFromColumnIndex($fc);
        $lc = PHPExcel_Cell::stringFromColumnIndex($lc);

        if ($fr == $lr and $fc == $lc) {
            return "$fc$fr";
        }
        return "$fc$fr:$lc$lr";
    }
732931
protected function execExternalOptimizer($if, &$binaryContent)
	{
	    $of = $this->getTempnam("of", $this->getOutputFileExtension());
	    $cmd = [
	        $this->getOption('gifsicle', 'gifsicle'),
	        $this->getOption('gifsicle_options', '-O3'),
	        $if,
	        '-o',
	        $of,
	    ];
	    $output = [];
	    $ret = null;
	    exec(implode(' ', $cmd) . ' 2>&1', $output, $ret);
	    if ($ret !== 0) {
	        throw new ImageOptimizerException(sprintf('Exec error gifsicle (%d): %s', $ret, implode("\n", $output)), ImageOptimizerException::EXEC_ERROR);
	    }
	    if (false === ($binaryContent = file_get_contents($of))) {
	        throw new ImageOptimizerException(sprintf('Cannot read tmpfile : %s', $of), ImageOptimizerException::CANNOT_READ_TMPFILE);
	    }
	    unlink($of);
	    return 'image/gif';
	}
250407
public function getDescendants($levelLimit = 0, $includeNode = false)
	{
		$left = $this->getLeftValue();
		$right = $this->getRightValue();
		$level = $this->getLevel();

		$searchCondition = $this->repository->createSearchCondition();
		if ($includeNode) {
			$searchCondition->leftGreaterThanOrEqualsTo($left)
					->rightLessThanOrEqualsTo($right);
		} else {
			$searchCondition->leftGreaterThan($left)
					->rightLessThan($right);
		}

		if ($levelLimit < 0) {
			throw new Exception\Domain("Level limit cannot be negative in getDescendants method");
		} elseif ($levelLimit > 0) {
			$searchCondition->levelLessThanOrEqualsTo($level + $levelLimit);
		}

		$orderRule = $this->repository->createSelectOrderRule()
				->byLeftAscending();

		$descendants = $this->repository->search($searchCondition, $orderRule);
		
		return $descendants;
	}
267228
public function loadNewestArticles($iLimit = null)
    {
        //has module?
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        if (!$myConfig->getConfigParam('bl_perfLoadPriceForAddList')) {
            $this->getBaseObject()->disablePriceLoad();
        }

        $this->_aArray = [];
        switch ($myConfig->getConfigParam('iNewestArticlesMode')) {
            case 0:
                // switched off, do nothing
                break;
            case 1:
                // manually entered
                $this->loadActionArticles('oxnewest', $iLimit);
                break;
            case 2:
                $sArticleTable = getViewName('oxarticles');
                if ($myConfig->getConfigParam('blNewArtByInsert')) {
                    $sType = 'oxinsert';
                } else {
                    $sType = 'oxtimestamp';
                }
                $sSelect = "select * from $sArticleTable ";
                $sSelect .= "where oxparentid = '' and " . $this->getBaseObject()->getSqlActiveSnippet() . " and oxissearch = 1 order by $sType desc ";
                if (!($iLimit = (int) $iLimit)) {
                    $iLimit = $myConfig->getConfigParam('iNrofNewcomerArticles');
                }
                $sSelect .= "limit " . $iLimit;

                $this->selectString($sSelect);
                break;
        }
    }
1282519
public function getMimeFromExt($sExt)
    {
        $sExt   = $this->sanitiseExtension($sExt);
        $aMimes = $this->oMimeService->getMimesForExtension($sExt);
        $sMime  = reset($aMimes);
        return !empty($sMime) ? $sMime : 'application/octet-stream';
    }
629871
private function getFieldOutputEnumSet($tblSrc, $fldType, $val, $iar = [])
    {
        $adnlThings = $this->establishDefaultEnumSet($fldType);
        if (array_key_exists('readonly', $val)) {
            return $this->getFieldOutputEnumSetReadOnly($val, $adnlThings);
        }
        $inAdtnl = $adnlThings['additional'];
        if ($iar !== []) {
            $inAdtnl = array_merge($inAdtnl, $iar);
        }
        $vlSlct    = explode(',', $this->getFieldValue($val));
        $slctOptns = $this->getSetOrEnum2Array($tblSrc, $val['COLUMN_NAME']);
        return $this->setArrayToSelect($slctOptns, $vlSlct, $val['COLUMN_NAME'] . $adnlThings['suffix'], $inAdtnl);
    }
354776
function read($inByte = null)
    {
        if ($this->getSegmentLimit() == -1)
            return $this->_t__wrap_stream->read($inByte);


        $inByte = ($inByte === null)
            ? (
                ($this->getBuffer() === null) ? $this->getSize() : $this->getBuffer()

            ) : $inByte;

        $remain = $this->getSegmentLimit() - $this->getCurrOffset();
        if ($remain > 0)
            return $this->_t__wrap_stream->read(min($remain, $inByte));

        return '';
    }
529735
private static function getNumPages(int $limit, int $count): int
    {
        return (int) ceil($count / $limit);
    }
1341247
public function readStringMulti($delims, &$delimfound = null)
    {

        // Get position of delimiters
        $pos = [];
        foreach ($delims as $delim) {
            if ($p = strpos($this->data, $delim, min($this->index, $this->length))) {
                $pos[] = $p;
            }
        }

        // If none are found then return whole buffer
        if (empty($pos)) {
            return $this->read(strlen($this->data) - $this->index);
        }

        // Read the string and remove the delimiter
        sort($pos);
        $string = $this->read($pos[0] - $this->index);
        $delimfound = $this->read();

        return $string;
    }