Download the PHP package neophp-dev/neophp without Composer

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

NeoPHP

PHP 8.5 framework centered around:

NeoPHP aims for a different balance than Symfony or Laravel. The goal is not to stack layers, bundles, or a very large ecosystem, but to provide a readable, compact PHP core that can be used directly to build a complete application without leaving the repository. The framework relies on a simple structure, an integrated CLI, auto-discovered core modules, and a multi-project workflow that stays explicit.

In practice, NeoPHP is aimed mainly at projects that want to move fast without adopting all the organizational complexity of large general-purpose frameworks. Compared to Symfony, it greatly reduces configuration ceremony and fragmentation between components. Compared to Laravel, it is more minimal, more direct in its architecture, and less dependent on a "magic" layer or a set of external tools. If what you need is a smaller, more predictable framework that's easier to follow end-to-end in the source code, that's exactly where NeoPHP fits.

Table of contents

Overview

NeoPHP relies on two entry points:

The core goes through Neo\App, which:

Repository architecture

The example project present in the repository is src/Test/.

Core map

The neo/Core/ core is organized by subsystem:

Module Description Complexity Progress Doc
Application/ Current project detection (HTTP/CLI), path resolution, project:* commands 🟢 Low ✅ Stable README
Asset/ CSS / JS / Less compilation, manifest versioning, asset() Twig helper 🟡 Medium ✅ Stable README
Console/ CLI framework: command scanning, AbstractCommand, colorized Input/Output 🟡 Medium ✅ Stable README
Controller/ AbstractController with HTTP helpers, auth, events, upload, dynamic extensions 🟢 Low ✅ Stable README
Cron/ #[Cron] attribute, scanner, runner with lock, standard cron expressions 🟡 Medium ✅ Stable README
Database/ Full Data Mapper ORM, QueryBuilder, diff migrations, forms, seeding 🔴 High ✅ Stable README
DI/ PSR-11 container, reflection-based autowiring, circular dependency detection 🟡 Medium ✅ Stable README
Error/ ErrorHandler, FrameworkException, differentiated dev/prod behavior 🟢 Low ✅ Stable README
Event/ Dispatcher, #[AsListener], subscribers, priorities, JSON cache in prod 🟡 Medium ✅ Stable README
Extension/ Utility extensions (Array, Date, File, Html, Json, Number, Path, String, Url) 🟢 Low ✅ Stable README
Http/ Request, Response, JsonResponse, RedirectResponse, HttpClient, Session, Flash, Cookie, Upload 🟡 Medium ✅ Stable README
Module/ Discovery of *Module.php, topological sort of dependencies, register()/boot() cycle 🟡 Medium ✅ Stable README
Profiler/ Dev debug bar, pluggable collectors (SQL, router, events, logs…) 🟡 Medium ✅ Stable README
Routing/ #[Route]/#[MainRoute] attributes, prod JSON cache, parameter injection, debug:router 🟡 Medium ✅ Stable README
Security/ Session/token auth, JWT, #[IsGranted], middlewares, CSRF 🔴 High ✅ Stable README
Testing/ TestCase, DatabaseTestCase, FeatureTestCase, auto scaffold via #[Test] 🟡 Medium 🔧 In progress README
Tools/Markdown/ Dependency-free Markdown parser, block array, markdown_blocks() Twig function and md_inline filter 🟢 Low ✅ Stable README
Translation/ Domains, LocaleManager, cache, Twig, translation:sync 🟡 Medium ✅ Stable README
Utils/ Cache (File/Redis/Array), Config, Logger, Notifications (Email/Slack/SMS), Scanner 🟡 Medium ✅ Stable README
Validator/ Attribute constraints + separate validators, ValidatorManager, 11 constraints 🟡 Medium ✅ Stable README
View/ Twig 3.x integration, extensions, app global variable, template cache 🟢 Low ✅ Stable README

Notable subfolders in neo/Core/:

Execution cycle

Over HTTP

Neo\App looks for a project by reading src/*/Config/app.config.php and compares the access key to HTTP_HOST / SERVER_NAME.

If only one project exists in src/, it is selected automatically.

In the CLI

Commands that operate on an existing project generally expect --project=ProjectName.

Notable exceptions:

Example:

Project structure

A project generated by app:make:project first contains:

Without the --skeleton option, the generator also adds:

Some folders are created later, when the feature is enabled:

The sensitive configs database.config.php, deploy.config.php, api.config.php, and mailer.config.php are meant to be ignored by Git in the generated .gitignore. The generator also ignores Storage/.

DI container and configuration

The Neo\Core\DI\Container container provides:

Example:

Configuration

The Config service loads every *.config.php file in the project and can merge *.config.test.php files during tests.

Example:

Example app.config.php:

HTTP layer

The HTTP layer is made up mainly of:

Request

Request notably exposes:

Example:

Response

Response is used to build basic HTTP responses.

Example:

Shortcut examples via AbstractController:

HttpClient

HttpClientManager lets you make outgoing HTTP requests via cURL. It returns a standard Response object.

Common options: base_uri, query, headers, bearer, json, body, auth_basic, timeout, max_redirects.

Session, cookie, and flash

The framework automatically configures the session from session.config.php.

Example in a controller:

Twig exposes flash messages via flashes():

Routing and controllers

Routing is based on PHP attributes scanned in src/<Project>/App/Controllers.

Confirmed features:

Simple example:

More complete example:

Helpers exposed by AbstractController:

Twig also exposes:

Twig views, assets, and translations

Twig views

Views are loaded from src/<Project>/App/Views.

Twig is initialized with:

Example:

Assets

Source assets live in src/<Project>/Assets/.

The AssetHandler component:

Twig example:

Source tree:

Translations

Translations are loaded from src/<Project>/Translations/<locale>.php.

Available Twig functions:

Notable behavior:

Example src/Blog/Translations/fr.php file:

Twig example:

Example in a controller:

Utility extensions

The neo/Core/Extension/ folder exposes reusable helpers at two levels:

Available families:

Examples:

Database and QueryBuilder

The PDO connection is driven by Config/database.config.php via DatabaseConnection.

Minimal example:

Schema tools

The framework ships a dedicated database CLI:

Notable behaviors:

Examples:

QueryBuilder

QueryBuilder notably covers:

Example:

Example with a transaction:

Migrations

Migrations live in src/<Project>/Database/Migrations/.

Each migration exposes:

The runner maintains two technical tables:

The snapshot lets database:migration:status warn when the current schema has changed since the last generated or applied migration.

Example workflow:

Minimal migration example:

ORM and repositories

NeoPHP's ORM is a Data Mapper. Entities are POPOs annotated with mapping attributes. No parent class is required. Persistence goes through the EntityManager.

EntityManager

EntityManager is the entry point for all persistence operations.

Main API:

In a controller, EntityManager is accessible via $this->entityManager (registered by DatabaseControllerExtension).

Example:

EntityRepository

EntityRepository is the base class generated by make:entity.

Available API:

Repository example:

Usage in a controller:

Relations

Relations available via attributes:

Collections (OneToMany, ManyToMany) use the Collection class. Loading is lazy by default, handled through transparent proxies.

Example entity with relations:

See the Data Mapper ORM (entities) section for creating entities via the CLI and the migration workflow.

Data Mapper ORM (entities)

NeoPHP's ORM is built on the Data Mapper pattern. make:entity creates an entity and its repository. database:orm:diff generates the migration from the difference between the entities and the database.

Creating an entity

The generator is interactive: it asks for the name, then the properties and their types.

Example entity generated in Database/Entity/Post.php:

Available scalar types:

Available relations:

OneToMany and ManyToMany sides use Collection to manage collections of related objects.

ManyToMany note — automatic persistence on flush: ManyToMany collections are now persisted automatically on flush(). A snapshot of the collection is taken when the entity is loaded; at flush time, the UoW computes the diff (additions/removals) and syncs the join table without manual action.

Data Mapper repository

The generated repository extends EntityRepository:

--no-repository option available to skip repository generation.

Generating the migration from entities

On a multi-database project, the --connection=<name> option targets a specific connection.

Migrations generated by database:orm:diff follow the same up() / down() format as manual migrations and are stored in Database/Migrations/.

Forms, upload, and validation

Forms

NeoPHP ships:

Field types available via FieldType:

Available Twig helpers:

Example built via FormFactory:

Twig example:

Upload in a controller

The application entry point is AbstractController::upload().

Signature:

This helper:

Example:

Then display it:

Validation

The validator relies on constraint attributes placed on the properties of any class (entity, DTO, etc.).

Since the refactor, each constraint is split into two files: a PHP attribute in Assert/ (which declares the parameters) and a validator in Validator/ (which contains the logic). ValidatorManager resolves the validator via the DI container using the constraint's validatedBy() method.

Constraints present in the framework:

Example on a DTO:

Seeding

The Seeder module lets you populate the database with reference or demo data.

A seeder is a class annotated #[Seeder] that implements SeedInterface::run(EntityManager $em):

The #[Seeder] attribute configures two parameters:

Parameter Default Description
order 0 Increasing execution order
group 'reference' 'reference' for stable data, 'demo' for development data

Available commands:

Security: auth, password, middlewares, csrf

Authentication

Auth is driven from app.config.php.

The framework supports two guards:

The token guard relies on JwtManager.

Typical configuration:

AuthManager API:

Session login example:

Token login example:

Twig exposes:

PasswordManager

The PasswordManager service provides:

Example:

Middlewares

Supported attributes:

Core middlewares:

Application middleware example:

Usage example with #[Middleware]:

Example with #[IsGranted]:

CSRF

The CSRF manager stores tokens in the session under _csrf_tokens.

Behavior:

Events

NeoPHP ships an event dispatcher and several core events:

Application listeners are expected in src/<Project>/App/Event/Listener.

They can be declared:

Full example:

Example in a controller:

Crons

NeoPHP ships a scheduled task system runnable via the CLI.

Application crons are expected in the current project and can be run manually or automatically via the operating system.

Creating a cron

To generate a new cron:

Example:

The generator automatically creates the cron file in the target project.

Listing crons

To display all crons available in a project:

This command notably shows:

Running crons

To run all of a project's crons:

This is the command that should be scheduled automatically by the operating system.

Automatic cron execution

Linux

On Linux, crons are usually driven via crontab.

Open the cron configuration:

Run NeoPHP crons every minute:

Concrete example:

Check cron logs:

macOS

macOS also supports crontab.

Open the configuration:

Add:

Example:

Check scheduled tasks:

Windows

On Windows, use Task Scheduler.

Command to run:

Example:

Recommended configuration:

Task Scheduler can be opened with:

Docker

Example with a simple loop:

Example via docker-compose:

Recommendations

In production, it is recommended to:

Cache, logs, mailer, profiler, and errors

Cache

The Cache service is driven by cache.config.php.

Available drivers:

API:

Example:

Logger

The Logger service reads logger.config.php and handles:

Supported levels:

Example:

Mailer

The neo/Core/Utils/Mailer/ folder registers a Mailer service based on PHPMailer.

Configuration:

Main API:

In a controller, getMailer() is available via the controller extension.

Example:

If the mailer is disabled, sending is skipped and a warning is logged.

Profiler

The neo/Core/Profiler/ folder activates a debug bar only over HTTP and only when app.config.php sets environment = dev.

Exposed collectors:

The toolbar is injected into HTML responses. It is skipped for JsonResponse, RedirectResponse, and non-HTML content.

Error handling

ErrorHandler:

Example error views:

Example 404.html.twig:

Markdown

The Tools/Markdown module provides a dependency-free Markdown parser. It converts Markdown text or a .md file into an array of structured blocks, rendered via Twig.

Usage from a template

The markdown_blocks() function is available in every Twig template:

The md_inline filter applies inline formatting (bold, italic, code, links):

Usage from PHP

Block types returned: heading, paragraph, code, list, table, quote, hr.

CLI and generators

Display global help:

Display help for a command:

The console automatically loads:

Available native commands:

Main generators

Examples:

Example interactive config command:

You could then enter, for example:

The generator will write a nested PHP array.

Application commands

app:make:command lets you generate a command in the target project. Once created in src/<Project>/App/Commands/, it is automatically detected by the console alongside native commands.

Example:

Project maintenance

Examples:

PHPUnit tests

The framework ships a per-project test layer with PHPUnit 13.2.

Available commands:

On the first make:test or make:test:auto, NeoPHP generates:

Base classes:

Confirmed features:

Manual tests

Examples:

Automatic generation with #[Test]

The automatic system relies on the Neo\Core\Testing\Attribute\Test attribute.

It can be placed:

Current signature:

What make:test:auto does:

Type inference when type = auto:

Example on a service class:

Example on a repository:

Example on a controller method:

Useful options:

Deployment

The app:make:deployment command prepares an FTP deployment from src/<Project>/Config/deploy.config.php.

The flow implements:

Expected keys in deploy.config.php:

Example:

Dependencies and requirements

PHP

Required PHP extensions

Main dependencies

Development dependencies

Summary

NeoPHP currently covers:

The key point of the repository stays the same:


All versions of neophp with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
twig/twig Version ^3.0
psr/container Version ^2.0
matthiasmullie/minify Version ^1.3
ext-pdo Version *
ext-zip Version *
ext-libxml Version *
ext-dom Version *
wikimedia/less.php Version ^5.4
wikimedia/composer-merge-plugin Version ^2.1
twig/intl-extra Version ^3.23
ext-ftp Version *
ext-iconv Version *
ext-curl Version *
ext-simplexml Version *
phpmailer/phpmailer Version ^7.1
ext-fileinfo Version *
predis/predis Version ^3.5
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 neophp-dev/neophp contains the following files

Loading the files please wait ...