Download the PHP package zeretei/php-core without Composer

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

PHP Core

A lightweight, zero-dependency PHP MVC micro-framework.

Latest Version on Packagist Total Downloads MIT License PHP 8.2+ PSR-4 Compliant


A minimal PHP 8.2+ MVC micro-framework with a service container, router, PDO query builder, model abstractions, middleware pipeline, and session flash bags. Zero runtime dependencies.

Features

Table of Contents


Installation

Require via Composer:

Then add your application namespace to your project's composer.json:


Project Structure

A typical project using PHP Core looks like this:


Bootstrap

Create public/index.php as the single entry point:


Configuration

Create config.php in your project root:


Container

Application extends Container, giving you a static service registry accessible from anywhere:

Bind your own services the same way:


Routing

Define routes in app/routes.php. The file must return a callable that receives the Router instance:

Wildcard tokens

Token Matches Example
:int Digits only 42
:char Letters only abc
:str Word characters hello_world
:any Anything foo/bar/baz

Captured values are passed as positional arguments to the action:

HTML form method spoofing

HTML forms only support GET and POST. For PUT/PATCH/DELETE, add a hidden field:


Request & Validation

Accessing input

Validating input

Call $request->validate() inside a controller action. On failure it automatically redirects back with session errors — on success it returns the validated values:

Available rules

Rule Description
required Must be non-empty
string Must be a string
email Must be a valid email address
min:N Minimum N characters
max:N Maximum N characters
same:field Must equal the value of another field
confirm Must equal {field}_confirmation (e.g. password_confirmation)

Response


Database

The QueryBuilder wraps PDO with parameterized statements. All queries use bound parameters — no raw string interpolation.


Models

Extend Model, declare $fillable, and get CRUD for free. Keys not in $fillable are silently stripped on write — this is the mass-assignment guard.


Controllers

Extend Controller and define public methods that map to route actions. Use registerMiddleware() in the constructor to attach middleware — optionally scoped to specific actions.


Middleware

Extend Middleware and implement execute(). Pass action names to the constructor to scope the middleware — an empty array means it runs on every action.


Session


Migrations

File naming

Migration files live in app/Databases/migrations/. Each file name must follow this convention:

Filename Expected class
0001_create_users_table.php CreateUsersTable
0002_add_email_to_users.php AddEmailToUsers

Writing a migration

Running migrations

Applied migrations are tracked in a migrations table so they are never run twice.


License

This project is open-source software licensed under the MIT License.


All versions of php-core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
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 zeretei/php-core contains the following files

Loading the files please wait ...