Download the PHP package alexius-byte/rider-php without Composer
On this page you can find all versions of the php package alexius-byte/rider-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rider-php
Rider X Framework
PHP 8.1+ mini framework. Zero external dependencies.
Dotenv
Existing $_ENV keys are never overwritten.
Router
Apache — .htaccess
Nginx
Basic routes
Route parameters arrive as $params['id'] inside the handler.
Groups
Middleware
Returning false from run() stops the chain — the route handler is not executed.
AbstractMiddleware provides json(array, status) and redirect(url, status) helpers.
Route classes
Groups and middleware are available inside AbstractRoute via $this->group(), $this->middleware(), $this->resetGroup(), $this->resetMiddleware().
Tracker
Auto-registers all public methods of a controller as routes.
Magic methods and inherited methods are ignored.
ORM
Model setup
timestamps adds created_at / updated_at automatically on create() and update().
fillable is a whitelist — columns outside it are discarded on create() and update().
Read
Sort
In-memory sort by a key extracted from each item. The callback receives one item and returns any comparable value — lower values come first.
Each key is computed once (O(n)), not once per comparison.
Write
upsert() uses INSERT ... ON DUPLICATE KEY UPDATE. The primary key must be present in the array. On conflict, all fields are updated except the primary key and created_at. Requires a PRIMARY KEY or UNIQUE constraint on the target column.
Raw
Transaction
Rolls back automatically on any exception.
Export
Truncate multiple tables
Paginator
Simple mode
Loads all rows into PHP memory, then slices. Suitable for small tables only.
Efficient mode
Two queries — COUNT(*) first, then SELECT … LIMIT ? OFFSET ?. Use this for any table that can grow.
Page object
Requesting a page beyond lastPage returns data: [], from: 0, to: 0, hasNext: false, hasPrev: false.
perPage is silently capped at 1 000.
Migrations
Migration
Migration files live in database/migrations/ and are named with a timestamp prefix (2025_01_01_120000_create_users_table.php) for ordering. The migrations table is created automatically on first run.
Each php migrate.php call groups all pending migrations into a batch. rollback undoes the entire last batch at once.
Seeder
Seeder files live in database/seeders/. insert() uses prepared statements — all rows in a single query.
Upload
Custom size limit (default 5 MB):
Allowed types
| Case | Accepted MIMEs | Extensions |
|---|---|---|
AllowedType::Image |
image/jpeg, image/png, image/gif, image/webp | jpg, png, gif, webp |
AllowedType::Zip |
application/zip, application/x-zip-compressed | zip |
AllowedType::Pdf |
application/pdf | |
AllowedType::Video |
video/mp4, video/mpeg, video/quicktime, video/x-msvideo | mp4, mpeg, mov, avi |
AllowedType::Document |
application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document | doc, docx |
MIME is detected via finfo — $_FILES['type'] is never trusted. The stored filename is a random 32-char hex string; the original name is discarded. The storage directory must be outside public/.
CORS
Call before any output or routing logic — OPTIONS preflight requests are answered with 204 and execution stops immediately.
credentials: true is silently ignored when origins is '*' — browsers block that combination regardless.
Parameters
| Parameter | Type | Default |
|---|---|---|
origins |
string\|array |
'*' |
methods |
array |
['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'] |
headers |
array |
['Content-Type', 'Authorization', 'X-Requested-With'] |
credentials |
bool |
false |
maxAge |
int |
86400 |
When origins is an array, the request Origin is matched against the list. If no match is found, no CORS headers are emitted. A Vary: Origin header is added automatically for specific-origin responses so proxies cache them correctly.
Container
Binding
Resolving
Auto-wiring
Classes with typed constructor parameters are resolved automatically — no registration needed.
Constructor parameters are resolved recursively. Unresolvable built-in types without a default value throw ContainerException.
Exceptions
| Exception | When |
|---|---|
NotFoundException |
get() called with an id that has no binding and is not an existing class |
ContainerException |
Class is not instantiable, parameter cannot be resolved, or circular dependency detected |
SSL
Symmetric encryption (AES-256-GCM)
$key is hashed with SHA-256 internally — any string length is accepted. Output is base64-encoded and carries the IV and authentication tag.
decode() throws SslException if the data is tampered or the key is wrong.
RSA key pair generation
The private key is saved with 0600 permissions. The directory must exist before calling.
Cache
Drivers
Both implement CacheInterface (PSR-16 compatible) and are interchangeable.
Basic operations
Multiple keys
getMultiple and setMultiple return/accept generators — no intermediate array allocation.
TTL
| Value | Behavior |
|---|---|
null |
No expiry |
int |
Seconds from now |
DateInterval |
Resolved via DateTime::add() |
FileCache stores entries as SHA-256-named files; expired entries are evicted lazily on read.
Validation
Custom messages
message() only applies to the rule immediately before it. If that rule passed, message() is a no-op.
Rules
| Rule | Accepts | Behavior |
|---|---|---|
required() |
— | Fails if null or '' |
string() |
— | Fails if not a string |
int() |
— | Fails if not a valid integer representation |
float() |
— | Fails if not a valid float representation |
email() |
— | Validates via filter_var |
url() |
— | Validates via filter_var |
min(int\|float) |
limit | Numeric value ≥ limit · String length ≥ limit (mb-safe) |
max(int\|float) |
limit | Numeric value ≤ limit · String length ≤ limit (mb-safe) |
in(array) |
options | Strict type comparison |
regex(string) |
pattern | preg_match — pattern must include delimiters |
nullable() |
— | Skips all other rules if value is null or '' |
cpf() |
— | Validates Brazilian CPF — accepts 000.000.000-00 or 00000000000 |
The first error per field wins — subsequent failing rules on the same field are silently ignored.
Schema
Declarative shorthand validator. All fields are required by default. Returns only the declared fields. Throws SchemaException on failure.
Rules are pipe-separated (|); parameters use a colon (min:6, in:a,b,c).
The first failing rule per field wins.
Fields not declared in the schema are discarded from the return value.
Schema rules
| Rule | Parameter | Behavior |
|---|---|---|
optional |
— | Field is not required — skips all other rules if value is null or '' |
string |
— | Fails if not a string |
int |
— | Fails if not a valid integer representation |
float |
— | Fails if not a valid float representation |
email |
— | Validates via filter_var |
url |
— | Validates via filter_var |
min |
limit | Numeric value ≥ limit · String length ≥ limit (mb-safe) |
max |
limit | Numeric value ≤ limit · String length ≤ limit (mb-safe) |
in |
values | Comma-separated list — strict string comparison |
regex |
pattern | preg_match — pattern must include delimiters |
cpf |
— | Validates Brazilian CPF — accepts 000.000.000-00 or 00000000000 |
All versions of rider-php with dependencies
ext-pdo Version *
ext-iconv Version *
ext-curl Version *
ext-openssl Version *
ext-fileinfo Version *
ext-mbstring Version *