Download the PHP package ray/input-query without Composer

On this page you can find all versions of the php package ray/input-query. 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 input-query

Ray.InputQuery

Continuous Integration Type Coverage codecov

Convert HTTP query parameters into hierarchical PHP objects automatically.

Quick Example

Key Point: addressStreet and addressCity automatically compose the AddressInput object.

Overview

Ray.InputQuery transforms flat HTTP data into structured PHP objects through explicit type declarations. Using the #[Input] attribute, you declare which parameters come from query data, while other parameters are resolved via dependency injection.

Core Features:

Installation

Optional: File Upload Support

For file upload functionality, also install:

Documentation

Comprehensive documentation including design philosophy, AI prompts for development assistance, and sample data examples can be found in the docs/ directory.

Framework Integration

For framework-specific integration examples, see the Framework Integration Guide which covers:

Usage

Ray.InputQuery converts flat query data into typed PHP objects automatically.

Basic Usage

Define your input class with the #[Input] attribute on parameters that come from query data:

Create input objects from query data:

Nested Objects

Ray.InputQuery automatically creates nested objects from flat query data:

Array Support

Ray.InputQuery supports arrays and ArrayObject collections with the item parameter:

Query data format for arrays

Arrays should be submitted as indexed arrays. Here's how to structure HTML forms and the resulting data:

This will be received as:

Simple array values (e.g., checkboxes)

For simple arrays like checkboxes or multi-select:

This will be received as:

Note: For non-array parameters, use flat naming without brackets:

ArrayObject Inheritance Support

Custom ArrayObject subclasses are also supported:

Mixed with Dependency Injection

Parameters without the #[Input] attribute are resolved via dependency injection:

Key Normalization

All query keys are normalized to camelCase:

File Upload Integration

Ray.InputQuery provides comprehensive file upload support through integration with Koriym.FileUpload:

When using file upload features, instantiate InputQuery with FileUploadFactory:

Using #[InputFile] Attribute

For file uploads, use the dedicated #[InputFile] attribute which provides validation options:

// Method usage example - Direct attribute approach

Test-Friendly Design

File upload handling is designed to be test-friendly:

Multiple File Uploads

Support for multiple file uploads using array types with validation:

Converting Objects to Arrays

Ray.InputQuery provides the ToArray functionality to convert objects with #[Input] parameters into flat associative arrays, primarily for SQL parameter binding with libraries like Aura.Sql:

Basic ToArray Usage

SQL Param¥¥eter Binding

The flattened arrays work seamlessly with Aura.Sql and other SQL libraries:

Property Name Conflicts

When flattened properties have the same name, later values overwrite earlier ones:

Key Features

Complex Example

Demo

Web Demo

To see file upload integration in action:

Then visit http://localhost:8080 in your browser.

Console Demos

Run various examples from the command line:


All versions of input-query with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ray/di Version ^2.18
symfony/polyfill-php83 Version ^1.28
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 ray/input-query contains the following files

Loading the files please wait ....