Download the PHP package abordji/php-generator-chunk without Composer

On this page you can find all versions of the php package abordji/php-generator-chunk. 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 php-generator-chunk

PHP Generator Chunk

A utility function to split a PHP Generator into chunks of a specified length, returning a Generator of Generators, with optional key preservation.

Description

This library provides a single function, generator_chunk, that allows you to efficiently process large datasets by splitting a PHP Generator into smaller, manageable chunks. This is particularly useful when dealing with data that cannot fit into memory all at once.

Features

Requirements

Installation

You can install this library using Composer:

(If you are contributing to this library, please refer to the Contributing section for development setup instructions. You do not need Composer on your host machine to contribute.)

API

generator_chunk(Generator $generator, int $length, bool $preserve_keys = false): Generator

Splits a PHP Generator into chunks of a specified length.

Returns: (Generator) A Generator where each yielded element is itself a Generator containing the items for that chunk.

Throws: ValueError if $length is less than or equal to 0.

Usage

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues on the repository.

Development Workflow

This project uses Make to automate common development tasks within a Dockerized environment. Ensure you have Docker, Docker Compose, and Make installed on your system. (You do not need PHP or Composer installed locally).

After cloning the repository, start by setting up the development environment:

This command performs the initial project setup: installs Composer dependencies (inside Docker), builds the required Docker image, and configures Git pre-commit hooks for automated quality checks.

Here are the main commands available for development:

Pre-commit Hooks: Note that after running make setup, Git hooks are installed. These hooks will automatically run tasks like make test and make fix before each commit to ensure code quality and consistency. You can also run these checks manually using the commands listed above.

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of php-generator-chunk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
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 abordji/php-generator-chunk contains the following files

Loading the files please wait ...