Count number of records in file (excluding header if first record is used as header).

@return int
510098
public function count()
    {
        $total = 0;
        foreach ($this->file as $line)
        {
            $total++;
        }
        if ($this->useFirstRecordAsHeader && $total > 0)
        {
            $total--;
        }
        return $total;
    }
804496
public function getFileCount( $pattern = NULL )
	{
		$count	= 0;
		foreach( $this->getFileList( $pattern ) as $entry )
			$count++;
		return $count;
	}
1219784
public function current()
	{
		$line = $this->file->current();
		if ($this->useFirstRecordAsHeader)
		{
			$header = $this->header;
			if (count($line) != count($header))
			{
				$size = min(count($header), count($line));
				$header = array_slice($this->header, 0, $size);
				$line = array_slice($line, 0, $size);
			}
			return array_combine($header, $line);
		}
		return $line;
	}
437756
public function getCount()
    {
        if ($this->_count !== null) {
            return $this->_count;
        }

        while ($this->_hasMore) {
            $this->fetchOutstanding();
        }

        return $this->_length;
    }
1352785
public function count()
	{
		$count = 0;

		for ($index = 0, $length = strlen($this->data); $index < $length; $index++)
		{
			$count += self::$count[ord($this->data[$index])];
		}

		return $count;
	}
1196882
protected function getFileCount($resultsCount, $maxLinesInFile, $fileCounter)
    {
        $leftToInsert = $resultsCount - ($fileCounter * $maxLinesInFile);
        if ($leftToInsert <= $maxLinesInFile) {
            $count = $leftToInsert;
        } else {
            $count = $maxLinesInFile;
        }

        return $count;
    }
451448
public function countBanLogEntries(): int
    {
        $this->db->qb([
            'table' => 'core_bans',
            'fields' => 'COUNT(ip)',
            'filter' => 'ip=:ip AND logstamp+:ttl > :expires AND code>0',
            'params' => [
                ':ip' => $this->ip,
                ':ttl' => $this->ttl_banlog_entry,
                ':expires' => time()
            ]
        ]);

        return $this->db->value();
    }
855032
private function getFile()
    {
        $columnParams = explode('.',$this->column);
        return count($columnParams) == 1 ? $this->$columnParams[0] : $this->$columnParams[1];
    }
1105215
public function count()
    {
        $handle = $this->createHandle($this->getFilePath());
        $lineCount = 0;

        while (!feof($handle)) {
            $line = $this->readLine($handle, null);
            if ($line !== '') {
                ++$lineCount;
            }
        }

        fclose($handle);

        return $lineCount;
    }
12749
public function countMessages()
    {
        $count = 0; // "Declare" variable before first usage.
        $octets = 0; // "Declare" variable since it's passed by reference
        $this->_protocol->status($count, $octets);
        return (int)$count;
    }
129729
public function count()
    {
        $query = clone $this;
        $query->select = 'count(*)';
        return (int)$query->execute()->fetch(PDO::FETCH_NUM)[0];
    }
534898
public function NumberOfRecordsLeftToIndex()
    {
        $iCount = 0;
        if ($this->fieldIndexRunning) {
            $sIndexTableName = $this->GetIndexRawTableName();
            $query = "SHOW TABLES LIKE '".MySqlLegacySupport::getInstance()->real_escape_string($sIndexTableName)."'";
            $tRes = MySqlLegacySupport::getInstance()->query($query);
            $bTableExists = (MySqlLegacySupport::getInstance()->num_rows($tRes) >= 1);
            if ($bTableExists) {
                $query = 'SELECT COUNT(sysid) AS reccount FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($sIndexTableName).'`';
                if ($trow = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {
                    $iCount = $trow['reccount'];
                }
            }
            if ($iCount < 1) {
                $this->StopIndex();
            }
        }

        return $iCount;
    }
560741
protected function filteredCount()
    {
        $this->filteredRecords = $this->filteredRecords ?: $this->count();
        if ($this->skipTotalRecords) {
            $this->totalRecords = $this->filteredRecords;
        }

        return $this->filteredRecords;
    }
611844
private function countFiles($fieldName = null)
    {
        $finder = new Finder();
        $finder->files()->in($this->getFilePath($fieldName));
        return count($finder);
    }
1336971
public static function rowCount(String $file = '/', Bool $recursive = true) : Int
    {
        $file = self::rpath($file);

        if( ! file_exists($file) )
        {
            throw new Exception\FileNotFoundException(NULL, $file);
        }

        if( is_file($file) )
        {
            return count( file($file) );
        }
        elseif( is_dir($file) )
        {
            $files = FileList::allFiles($file, $recursive);

            $rowCount = 0;

            foreach( $files as $f )
            {
                if( is_file($f) )
                {
                    $rowCount += count( file($f) );
                }
            }

            return $rowCount;
        }
        else
        {
            return false;
        }
    }
1126438
public function count(): ?int
    {
        // no where, count all simply
        $where = $this->query['where'] ?? null;
        if ($where == null) {
            return $this->agent->count($this->table);
        }

        $from = '';
        if ($this->query) {
            $isSub = $this->isSub;
            $this->isSub = true;
            $from = $this->toString();
            $this->isSub = $isSub; // restore
        }

        if ($from == '') {
            $from = "SELECT 1 FROM {$this->table} ". trim($this->toQueryString('where', false));
        }
        $from = trim($from);

        $query = "SELECT count(*) AS count FROM (\n\t{$from}\n) AS tmp";
        $result = $this->agent->get($query, null, 'object');

        return isset($result->count) ? intval($result->count) : null;
    }
506136
public function getTotalRecordCount()
    {

        if (!isset($this->rs)) {
            $this->doRs();
        }

        if (empty($this->recordCount)) {
            $this->countCriteria = clone $this->criteria;
            $this->countCriteria->setLimit(0);
            $this->countCriteria->setOffset(0);

            $this->recordCount = call_user_func(array($this->getPeerClass(), $this->getPeerCountMethod()), $this->countCriteria);
        }

        return $this->recordCount;
    }