private function listValues($tableName)
    {
        $this->prepareListValues($tableName);

        $onlyOnce = true;
        $lineSize = 0;

        // colStmt is used to form a query to obtain row values
        $colStmt = $this->getColumnStmt($tableName);
        // colNames is used to get the name of the columns when using complete-insert
        if ($this->dumpSettings['complete-insert']) {
            $colNames = $this->getColumnNames($tableName);
        }

        $stmt = "SELECT ".implode(",", $colStmt)." FROM `$tableName`";

        // Table specific conditions override the default 'where'
        $condition = $this->getTableWhere($tableName);

        if ($condition) {
            $stmt .= " WHERE {$condition}";
        }

        $limit = $this->getTableLimit($tableName);

        if ($limit) {
            $stmt .= " LIMIT {$limit}";
        }

        $resultSet = $this->dbHandler->query($stmt);
        $resultSet->setFetchMode(PDO::FETCH_ASSOC);

        $ignore = $this->dumpSettings['insert-ignore'] ? '  IGNORE' : '';

        $count = 0;
        foreach ($resultSet as $row) {
            $count++;
            $vals = $this->prepareColumnValues($tableName, $row);
            if ($onlyOnce || !$this->dumpSettings['extended-insert']) {
                if ($this->dumpSettings['complete-insert']) {
                    $lineSize += $this->compressManager->write(
                        "INSERT$ignore INTO `$tableName` (".
                        implode(", ", $colNames).
                        ") VALUES (".implode(",", $vals).")"
                    );
                } else {
                    $lineSize += $this->compressManager->write(
                        "INSERT$ignore INTO `$tableName` VALUES (".implode(",", $vals).")"
                    );
                }
                $onlyOnce = false;
            } else {
                $lineSize += $this->compressManager->write(",(".implode(",", $vals).")");
            }
            if (($lineSize > $this->dumpSettings['net_buffer_length']) ||
                    !$this->dumpSettings['extended-insert']) {
                $onlyOnce = true;
                $lineSize = $this->compressManager->write(";".PHP_EOL);
            }
        }
        $resultSet->closeCursor();

        if (!$onlyOnce) {
            $this->compressManager->write(";".PHP_EOL);
        }

        $this->endListValues($tableName, $count);
    }
private function listValues($tableName)
    {
        $this->prepareListValues($tableName);

        $onlyOnce = true;
        $lineSize = 0;

        // colStmt is used to form a query to obtain row values
        $colStmt = $this->getColumnStmt($tableName);
        // colNames is used to get the name of the columns when using complete-insert
        if ($this->dumpSettings['complete-insert']) {
            $colNames = $this->getColumnNames($tableName);
        }

        $stmt = "SELECT ".implode(",", $colStmt)." FROM `$tableName`";

        // Table specific conditions override the default 'where'
        $condition = $this->getTableWhere($tableName);

        if ($condition) {
            $stmt .= " WHERE {$condition}";
        }

        $limit = $this->getTableLimit($tableName);

        if ($limit) {
            $stmt .= " LIMIT {$limit}";
        }

        $resultSet = $this->dbHandler->query($stmt);
        $resultSet->setFetchMode(PDO::FETCH_ASSOC);

        $ignore = $this->dumpSettings['insert-ignore'] ? '  IGNORE' : '';

        $count = 0;
        foreach ($resultSet as $row) {
            $count++;
            $vals = $this->prepareColumnValues($tableName, $row);
            if ($onlyOnce || !$this->dumpSettings['extended-insert']) {
                if ($this->dumpSettings['complete-insert']) {
                    $lineSize += $this->compressManager->write(
                        "INSERT$ignore INTO `$tableName` (".
                        implode(", ", $colNames).
                        ") VALUES (".implode(",", $vals).")"
                    );
                } else {
                    $lineSize += $this->compressManager->write(
                        "INSERT$ignore INTO `$tableName` VALUES (".implode(",", $vals).")"
                    );
                }
                $onlyOnce = false;
            } else {
                $lineSize += $this->compressManager->write(",(".implode(",", $vals).")");
            }
            if (($lineSize > $this->dumpSettings['net_buffer_length']) ||
                    !$this->dumpSettings['extended-insert']) {
                $onlyOnce = true;
                $lineSize = $this->compressManager->write(";".PHP_EOL);
            }
        }
        $resultSet->closeCursor();

        if (!$onlyOnce) {
            $this->compressManager->write(";".PHP_EOL);
        }

        $this->endListValues($tableName, $count);
    }
private function listValues ( $ tableName ) { $ this -> prepareListValues ( $ tableName ) ; $ onlyOnce = true ; $ lineSize = 0 ; // colStmt is used to form a query to obtain row values $ colStmt = $ this -> getColumnStmt ( $ tableName ) ; // colNames is used to get the name of the columns when using complete-insert if ( $ this -> dumpSettings [ 'complete-insert' ] ) { $ colNames = $ this -> getColumnNames ( $ tableName ) ; } $ stmt = "SELECT " . implode ( "," , $ colStmt ) . " FROM `$tableName`" ; // Table specific conditions override the default 'where' $ condition = $ this -> getTableWhere ( $ tableName ) ; if ( $ condition ) { $ stmt .= " WHERE {$condition}" ; } $ limit = $ this -> getTableLimit ( $ tableName ) ; if ( $ limit ) { $ stmt .= " LIMIT {$limit}" ; } $ resultSet = $ this -> dbHandler -> query ( $ stmt ) ; $ resultSet -> setFetchMode ( PDO :: FETCH_ASSOC ) ; $ ignore = $ this -> dumpSettings [ 'insert-ignore' ] ? '  IGNORE' : '' ; $ count = 0 ; foreach ( $ resultSet as $ row ) { $ count ++ ; $ vals = $ this -> prepareColumnValues ( $ tableName , $ row ) ; if ( $ onlyOnce || ! $ this -> dumpSettings [ 'extended-insert' ] ) { if ( $ this -> dumpSettings [ 'complete-insert' ] ) { $ lineSize += $ this -> compressManager -> write ( "INSERT$ignore INTO `$tableName` (" . implode ( ", " , $ colNames ) . ") VALUES (" . implode ( "," , $ vals ) . ")" ) ; } else { $ lineSize += $ this -> compressManager -> write ( "INSERT$ignore INTO `$tableName` VALUES (" . implode ( "," , $ vals ) . ")" ) ; } $ onlyOnce = false ; } else { $ lineSize += $ this -> compressManager -> write ( ",(" . implode ( "," , $ vals ) . ")" ) ; } if ( ( $ lineSize > $ this -> dumpSettings [ 'net_buffer_length' ] ) || ! $ this -> dumpSettings [ 'extended-insert' ] ) { $ onlyOnce = true ; $ lineSize = $ this -> compressManager -> write ( ";" . PHP_EOL ) ; } } $ resultSet -> closeCursor ( ) ; if ( ! $ onlyOnce ) { $ this -> compressManager -> write ( ";" . PHP_EOL ) ; } $ this -> endListValues ( $ tableName , $ count ) ; }
Table rows extractor

@param string $tableName  Name of table to export

@return null
Table rows extractor