Download the PHP package fogito/core without Composer

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

fogito-core

fogito-core

Shared PHP MVC and service-foundation library for Fogito applications, with routing, bootstrap helpers, request and response abstractions, local and remote model layers, and bundled Core service wrappers.

Table of Contents

โœจ Overview

fogito-core is the shared PHP foundation used across the Fogito backend ecosystem. It is not a standalone product application by itself. Instead, it provides the reusable pieces that Fogito services and internal apps build on:

If you are onboarding into a Fogito backend repo and want to understand why its boot files, modules, routes, models, and auth flow look the way they do, this is the reference repo that explains that shape.

๐Ÿงฉ What This Repo Contains

Application kernel and dispatch flow

Routing and route patterns

Bootstrap and configuration helpers

HTTP and utility layer

Data access layer

Shared Fogito service wrappers

The src/Models directory ships prebuilt remote wrappers for common platform services:

These classes are meant to save consuming repos from rebuilding the same service contracts over and over.

Auth, language, company, and cache helpers

Example application and docs

๐Ÿ—บ Runtime Modes And Routes

Consumer application bootstrap

The example site in example/sites/api/public/index.php shows the intended boot flow for a Fogito service that consumes this library:

  1. define an application path
  2. load shared environment bootstrap from example/core.php
  3. load Composer autoloading
  4. register project namespaces such as Lib, Models, and Middlewares
  5. create a Fogito\App instance
  6. register services such as config and router
  7. point the app at a modules directory
  8. configure controller or action suffix behavior
  9. call $app->handle()

This is the core runtime contract that many Fogito backend repos follow, even when their domain logic is different.

Module and controller conventions

The dispatch layer expects a site to follow a module-first structure:

Each module's Module.php is responsible for:

In the bundled example, products/Module.php attaches both auth and an API middleware before dispatch.

Route patterns

The example route config in example/sites/api/config/routes.php exposes:

The router can also create similar defaults internally when constructed with default routes enabled.

URI source and CLI support

Routing and request parsing support more than browser traffic:

That makes the core usable in traditional HTTP entrypoints and internal scripted or maintenance flows.

Remote service conventions

Remote model wrappers use the following pattern:

This is the contract behind the bundled CoreUsers, CoreFiles, CoreSettings, and related wrappers.

๐Ÿ— Architecture

Bootstrap layer

Routing layer

Request and response layer

Utility and context layer

Data layer

Example layer

This split mirrors how larger Fogito backend repos often separate application-wide helpers from site-specific module trees.

๐Ÿ“ Directory Guide

Where to start when making changes

๐Ÿ”Œ Related Repositories

This repo is typically developed together with the following Fogito repositories:

If you are trying to understand how this library is used in practice, backend.general is usually the best backend companion repo to read next.

๐Ÿ“ฆ Installation

This is the package install string used by the existing repo docs and description. See the development notes below for the current metadata mismatch in composer.json.

๐Ÿš€ Available Scripts

No Composer scripts are defined in this repository.

Typical command patterns for consumer apps built on this library are:

Command Purpose
composer require fogito/core Installs the library into a consuming project.
php sites/<site>/public/index.php _url=/module/controller/action Simulates a routed request in CLI mode for apps that follow the Fogito bootstrap pattern.

This repo itself is primarily a library plus example structure, not a turnkey service with its own start or serve script.

๐Ÿ›  Development Notes

Package metadata drift

There is an internal packaging inconsistency in the current repo state:

If you are publishing or consuming this package outside the usual internal environment, verify which package name your Composer registry actually exposes before documenting or automating around it.

Example app bootstrap drift

The example site is useful for structure, but it is not fully self-contained in the committed tree:

That means the example documents the expected runtime shape, but local execution depends on internal bootstrap or packaging steps that are not committed here.

Request handling

Request is broader than a simple wrapper over $_GET and $_POST:

That behavior matters when debugging differences between web traffic, cron jobs, and manual CLI calls.

Response format

Response standardizes Fogito JSON responses:

It also sets CORS headers and writes directly to stdout in CLI mode, so consumers should treat it as a terminating response helper rather than a value-returning abstraction.

Service URL generation

Config::getUrl(...) derives backend endpoints from the current host and environment mode. The built-in service-path map currently covers:

If a consuming repo depends on another service path, this is one of the first places to check before adding hardcoded URLs elsewhere.

Auth bootstrap

Lib/Auth is an important piece of the shared runtime contract:

If a domain service behaves differently depending on account, branch, permissions, or translations, this bootstrap path is often the reason.

๐Ÿ” Feature-Level Notes For Contributors

Boot and application lifecycle

When changing runtime flow, read these pieces together:

Together, they show the real Fogito lifecycle from environment bootstrap to controller execution.

Routing and dispatch

If you need to add custom route syntax, adjust placeholder behavior, or debug why a controller is not resolving:

Most "route not found" or "class not found" issues in consumer repos come from one of those three places.

Local models

Use src/Db/ModelManager.php when you are working on data that belongs to the current service's own database. This layer is appropriate for:

Remote models and shared platform wrappers

Use src/Db/RemoteModelManager.php and src/Models/* when the data lives in another Fogito service and you want model-style access from the current codebase.

This is the right layer for:

If a new remote wrapper is needed, CoreCustomModel is the simplest place to start before specializing behavior.

Model usage docs

The files in README/ are worth reading before changing remote wrapper behavior. They capture how the shared models are expected to be used in application code, including common operations such as:

Those docs are part of the repo's public contract, not just historical notes.

Example module patterns

The bundled products example is intentionally small, but it demonstrates the main conventions contributors should preserve:

๐Ÿงช Tooling


All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
fogito/core Version ^1.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 fogito/core contains the following files

Loading the files please wait ...