Download the PHP package tihloh/prefab-core without Composer

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

Prefab Core

prefab-core is the shared infrastructure layer used by Prefab feature modules.

It is not a business feature module. Applications normally install a feature package such as tihloh/prefab-users; Composer installs Core automatically as a dependency. You may also install Core directly when you only need its infrastructure APIs.

Core responsibilities

Core provides infrastructure shared across Prefab:

Core does not own user management, authentication rules, permissions, audit logging, routing, validation, file management, messaging or notifications. Those remain separate feature packages.

Universal values

val() wraps an ordinary PHP value with small fluent operations while keeping native PHP underneath.

The wrapper deliberately remains fluent so an operation can be extended safely:

Use value() only when external code specifically requires the native scalar/array value:

Nested data uses get():

Formatting is terminal and returns display text directly:

Prefab-owned database boundaries understand Value objects and unwrap them automatically:

An unresolved failed conversion is not silently written to the database; the boundary propagates the failure.

Environment (.env)

Core automatically looks for a .env file when Composer loads Prefab. Existing process/server values win over .env values.

Prefer Prefab's collision-safe accessor in reusable/framework-integrated code:

Values are also available through getenv() and $_ENV. A global env() convenience helper may be available when another library/application has not already defined it, but reusable Prefab code should prefer prefab_env() to avoid global-helper ownership conflicts.

A specific dotenv file can be loaded explicitly:

Date and time

Use Prefab's explicit helper when reusable code must avoid collisions with application/framework globals:

Date/time values can also be reached through val():

Common global names such as now() can conflict with helpers declared by an application or framework depending on Composer load order. Prefer the Prefab-prefixed API in reusable code.

Database

Database infrastructure is part of Core. New applications should use the Core namespace:

Core intentionally stays small: named PDO connections, parameterized SQL, transactions and a lightweight query builder. It is not an ORM and does not own models, relations, migrations or schema design.

Session

Authentication behavior remains in prefab-auth; Core only provides session mechanics.

Cache

Available lightweight stores include ArrayCache and FileCache.

CLI

Composer exposes Core's console executable as vendor/bin/prefab.

Linux/macOS:

Windows:

Register commands with:

When bootstrap/prefab.php exists in the current project directory, the CLI loads it before dispatching a command.

Runtime and diagnostics

Core owns the canonical Prefab runtime and diagnostics. Feature modules use the Core runtime instead of carrying duplicate infrastructure.

Normal trace:

Detailed trace:

Tracing is temporary developer diagnostics; persistent application/audit history belongs to Prefab Logs.

Development

The monorepo is the development source of truth. Package splitting publishes packages/core to tihloh/prefab-core.


All versions of prefab-core with dependencies

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

Loading the files please wait ...