Download the PHP package preflow/data without Composer

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

preflow/data

Multi-storage data layer for Preflow. Supports JSON files and SQLite out of the box; different models can use different backends simultaneously.

Installation

Requires PHP 8.4+, ext-pdo, ext-pdo_sqlite.

What it does

Models are annotated with PHP attributes. DataManager is the single entry point — it reads model metadata via reflection, selects the right storage driver, and returns typed results. QueryBuilder provides a fluent API for filtering, sorting, searching, and pagination. Migrations are handled by Schema + Table + Migrator.

API

Attributes

Attribute Target Description
#[Entity(table: 'posts', storage: 'sqlite')] Class Maps model to a table/collection and a named driver. storage defaults to 'default'.
#[Id] Property Marks the primary key field. Works on any property — use string $uuid for UUIDs or int $id for auto-increment.
#[Field(searchable: true)] Property Marks a field; searchable: true includes it in full-text search.
#[Timestamps] Class Adds created_at / updated_at handling.

Model

DataManager

save() detects an empty ID field and automatically issues an INSERT, then reads back lastInsertId() into the model — no need to pre-generate IDs for auto-increment tables.

QueryBuilder

All methods return $this for chaining except the terminal methods.

Storage drivers

Class Backend
JsonFileDriver One .json file per record at {basePath}/{table}/{id}.json
SqliteDriver PDO-based SQLite via PdoDriver + QueryCompiler

Migrations

Schema methods: create(string $table, callable $callback), drop(string $table).

Table builder: uuid, string, text, integer, boolean, json, timestamps, nullable(), primary(), index().

Auto-increment IDs

Place #[Id] on an int property and leave it at 0 (or unset). save() / insert() will issue an INSERT and read the generated ID back via lastInsertId().

Raw SQL

Use raw() to run a query that the fluent builder cannot express. Results are returned as plain arrays.

Usage

Model:

Querying:

Saving:

Migration:

Multi-storage setup:

Models with #[Entity(storage: 'sqlite')] use SQLite; all others fall back to 'default'.


All versions of data with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
ext-pdo_sqlite Version *
preflow/core Version ^0.1 || @dev
preflow/validation Version ^0.1 || @dev
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 preflow/data contains the following files

Loading the files please wait ...