Download the PHP package lampager/lampager without Composer

On this page you can find all versions of the php package lampager/lampager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lampager

lampager

Build Status Coverage Status Scrutinizer Code Quality

Lampager Core

The core package of Lampager

Requirements

Installing

Usage

Basically you don't need to directly use this package. For example, if you use Laravel, install lampager/lampager-laravel.

However, you can manually use like this:

It will run the optimized query.

And you'll get

Question: How about Tuple Comparison?

With this feature, SQL statements should be simpler. However, according to SQL Feature Comparison, some RDBMS, such as SQLServer, do not support this syntax. Therefore, Lampager continuously uses redundant statements.

It is also useful for Doctrine 2 since its DQL lexer does not support the syntax and triggers parse errors.

Classes

Name Type Parent Class
Implemented Interface
Description
Lampager\Paginator Class Fluent factory for building Query
Lampager\AbstractProcessor Abstract Class Receive fetched records and format them
Lampager\PaginationResult Class Processor wraps result with this by default
Lampager\ArrayProcessor Class Lampager\AbstractProcessor Simple Processor implementation for pure PDO
Lampager\ArrayCursor Class Lampager\Contracts\Cursor Simple Cursor implementation for pure PDO
Arrays are automatically wrapped with this
Lampager\Query Class SQL configuration container generated by Paginator
Lampager\Query\... Class Child components of Query
Lampager\Contracts\Cursor Interface Indicates parameters for retrieving previous/next records
Lampager\Contracts\Formatter Interface Formatter interface pluggable to Processor
Lampager\Concerns\HasProcessor Trait Helper for extended Paginator providing convenient accessibility to Processor

API

Paginator::orderBy()
Paginator::orderByDesc()
Paginator::clearOrderBy()

Add or clear cursor parameter name for ORDER BY statement.
At least one parameter required.

IMPORTANT: The last key MUST be the primary key.

e.g. $paginator->orderBy('updated_at')->orderBy('id')

Arguments

Paginator::limit()

Define the pagination limit.

Arguments

Paginator::forward()
Paginator::backward()

Define the pagination direction.

Forward (Default)

Backward

IMPORTANT: You need previous cursor to retrieve more results.

Paginator::inclusive()
Paginator::exclusive()

Change the behavior of handling cursor.

Inclusive (Default)

Current cursor will be included in the current page.

Exclusive

Current cursor will not be included in the current page.

Paginator::unseekable()
Paginator::seekable()

Define that the pagination result should contain both of the next cursor and the previous cursor.

Unseekable (Default)

Seekable

Always when the current cursor parameters are empty

Paginator::fromArray()

Define options from an associative array.

Arguments

e.g.

Paginator::configure()

Generate Query corresponding to the current cursor.

Arguments

AbstractProcessor::process()

Receive a pair of Query and fetched rows to analyze and format them.

Arguments

Return Value

(mixed)

By default, an instance of \Lampager\PaginationResult is returned. All fields are public.

e.g.

Note that

PaginationResult::getIterator()

It can be directly traversed using foreach thanks to the interface \IteratorAggregate.

Return Value

(mixed)

ArrayIterator instance that wraps records.

AbstractProcessor::useFormatter()
AbstractProcessor::restoreFormatter()

Override or restore the formatter for the pagination result.

Callable Formatter Example

Class Formatter Example

AbstractProcessor::setDefaultFormatter()
AbstractProcessor::restoreDefaultFormatter()

Globally override or restore the formatter.

Example (Laravel)


All versions of lampager with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lampager/lampager contains the following files

Loading the files please wait ....