Download the PHP package roolith/framework without Composer

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

roolith-framework

Roolith PHP micro-framework. Very minimalistic and less overhead.

Architecture

Roolith is a minimal synchronous PHP micro-framework with an MVC shape: one entrypoint (index.php) boots shared services through App\Core\System, routes one HTTP request to one controller action, optionally touches MySQL through a thin model layer, then renders a PHP view or returns data and tears down per-request resources.

Shared services are exposed through small singleton factories (RouterFactory, DatabaseFactory, TemplateEngineFactory) and static facades (Request, Storage, Sanitize, Validator), composed from standalone roolith/* packages plus Carbon and Whoops. The database is optional, and frontend assets are built with Vite (source/ -> assets/).

Interested in the whole picture? Start with Architecture in the docs site. ARCHITECTURE.md is canonical; the docs page mirrors it.

Requirements

Install

Run with Docker

Then open http://localhost:8080. See DOCKER-README.md for details.

Documentation

If you want to use this or need any help, you may reach to [email protected] Free to use for any purpose. Support: see CHANGELOG.md for releases.

Generator

Define route

Open app/Http/routes.php and define routes as per documentation. Prefer the callable form [WelcomeController::class, 'index']; the string form WelcomeController::class . "@index" still works but is legacy. Lint with php roolith route:list.

Error page

If there is no route defined then by default it will look for 404.php in views/ folder.

Config

All application configuration has been stored in config/config.php for more details read documentation

Constant

Application constants have been defined in constant.php

Frontend workflow

The framework uses Vite for SCSS and JavaScript. Actual scripts from package.json:

For development with hot module replacement set viteDevServer to http://localhost:5173 in config/config.php and run

Browse via http://localhost:8080 for direct PHP or http://localhost:5173 for HMR (the dev server proxies everything except @vite, @id, @fs, node_modules, source, __open-in-editor to PHP on :8080, so sessions plus HMR share one origin; see documentation/docs/frontend-workflow.md for proxy limits).

To rebuild assets on change without the dev server use

Entries are source/js/app.js (Vite input key app) and source/scss/app.scss (input key style). To add SCSS and JS use those two files.

Use

for production build. It creates minified, content-hashed files in the assets/build folder (for example assets/build/js/app-[hash].js plus assets/build/css/app-[hash].css plus assets/build/.vite/manifest.json; views resolve via viteJs() plus viteCss()). Uploads must live outside the build output, e.g. public/uploads/ (web-accessible fixture survives rebuilds) or storage/ (outside the docroot); npm run build wipes only assets/build.

Model

Model files located in app/Models. One model maps to one table via protected string $table plus $primaryColumn (default id); php roolith migrate creates those tables under database/migrations.

Validated write path (filter plus validate plus transaction):

Migrations plus transactions (via roolith/migration; files in database/migrations as *.migration.php, seeders in database/seeders as *.seeder.php, rows in the shared migrations table):

Controllers

Controller files located in app/Controllers

Views

View files are in views/ and view files are straight forward documentation. Escape every untrusted value at render with escape() or $this->escape(); Request::input() stays raw so O'Reilly keeps its form.

Let's keep it simple!

Print route URL inside template

Request

Request::input() returns raw values (no stripping); validate by type, escape at render with escape(). only() plus except() accept a string or array via _::only plus _::except. JSON bodies parse via php://input; all() returns raw plus _files on POST. Pass ['sanitize' => true] only for narrow slug or email paths.

Full form plus JSON plus files example with validation and error display:

hasFile() checks $_FILES; size plus MIME limits live in App\Core\File (see documentation/docs/file-upload.md).

Middleware, rate limiter, and i18n

Attach middleware per route or group:

Reset the limiter on success:

Translate with fallback (missing key or locale returns null):

Note: Settings::setLang('es') writes a cookie, so the new locale applies on the next request, not the current one.

Cache and events

Cache expensive reads, fire events for side effects (see documentation/docs/cache.md and documentation/docs/events.md):

Validator

String example plus array example (see App\Core\Validator.php:8-31 usage block):

Full example with email plus conditional plus URL plus numeric:

Note: notExists() plus exists() check the database (notExists(User::class)); keep them on fields that truly need uniqueness or existence checks.

Sanitize

Narrow helpers for slug plus email lookups; general input stays raw and is escaped at render with escape().

Array methods

Example:

List of methods -

Localization

Get message with fallback (missing key returns null, so coalesce):

Set local

Once es lang is set it will look in lang/es/message.php. So when es has been set then below code will output -

Dependencies use caret deliberately (roolith/*: ^2.x, nesbot/carbon: ^2.73) so patches flow; exact pins need a comment. Run composer audit regularly.

Observability and checks

Logs carry a per-request trace ID via App\Core\Logger plus App\Core\Log (bootstrap, router, 404, controller, unhandled).

Cookie

Set cookie

Get cookie

Delete cookie

Session


All versions of framework with dependencies

PHP Build Version
Package Version
Requires roolith/cache Version ^2.0
roolith/config Version ^2.0
roolith/database Version ^2.0
roolith/event Version ^2.0
roolith/generator Version ^2.0
roolith/router Version ^2.1
roolith/template-engine Version ^1.1
nesbot/carbon Version ^2.73
filp/whoops Version ^2.18
psr/log Version ^3.0
php Version >=8.2
roolith/migration Version ^2.0
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 roolith/framework contains the following files

Loading the files please wait ...