Download the PHP package giovanni-venturelli/sophia without Composer

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

Sophia Framework — Lightweight PHP Components, DI, and Router

Minimal, production‑oriented PHP framework with:

Components are plain PHP classes (annotated), services are auto‑wired, routes map to components (views) or callbacks (APIs).

Quick navigation

What you get (features)

Architecture at a glance

Flow for a component route: 1) Router matches the incoming path → selects a component class 2) ComponentRegistry lazily registers it and Renderer creates a ComponentProxy 3) ComponentProxy opens a DI scope, warms providers, creates the component, runs property injection, then onInit() 4) Renderer collects public properties/zero‑arg getters and renders the PHP template

Installation

If you use environment variables, add a .env file (Dotenv is included in composer.json) and configure the database as needed (see Database integration).

Project structure

Quick start (index.php + routes.php)

Minimal bootstrap in index.php:

Define routes in routes.php:

Create your first component

Component class under pages/... and a PHP template next to it:

Template home.php:

The renderer passes route params (:id) as initial data to the root component.

Dependency Injection (services)

Example service + usage in a component:

See the full DI reference: Injector (DI).

Routing basics (components, params, urls)

Template helpers:

More details: Router.

Redirections and Guards

(Existing content for Routing basics...)

Performance & Build System

Sophia includes a build system to optimize performance in production (up to 40% faster).

How it works

In development mode (DEBUG=true), the framework scans folders and uses the Reflection API on every request. In production (DEBUG=false), the framework loads pre-generated static maps.

CLI Commands

From the project root:

When to run the build?

The build is only necessary when the structure of the application changes:

Note: It is not necessary to rebuild if you only modify the database content, the logic code inside a method, or the HTML markup of an existing template.

Database integration (optional)

The ConnectionService is a root‑provided service with a fluent QueryBuilder and an Active Record‑style ORM via Entity.

Example entity:

Query examples:

Full guide: Database.

Troubleshooting

Deep dives (module READMEs)


Using this repository as a package + demo

This repo is organized so that the core framework (package) is published to Packagist, while the demo app stays in-repo only.

Install the package (as a dependency) in another project

Run the demo locally from this repo

1) Install dependencies for the demo (uses a path repo to the root library):

2) Start a PHP dev server pointing to the demo folder (or your web server root to demo/):

Then open:

Notes

Publishing to Packagist

1) Push this repository to GitHub under giovanni-venturelli/sophia. 2) Create a version tag, e.g.:

3) Submit the repository URL to Packagist and set up the GitHub Service Hook so Packagist auto-updates on new tags.

After publish, consumers can composer require giovanni-venturelli/sophia.

Forms — end-to-end example

Route (already present in routes.php):

Template:

The $form_action('send') helper generates a URL like /sophia/forms/submit/<token>. Make sure the base path is set in index.php.

Named routes — quick tip

Always add name to routes you want to link to from templates:

Then in templates:


All versions of sophia with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-pdo Version *
ext-pdo_mysql Version *
ext-pdo_sqlite Version *
vlucas/phpdotenv Version ^5.6
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 giovanni-venturelli/sophia contains the following files

Loading the files please wait ...