tivins / framework
PHP Framework for web applications
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tivins/framework
Requires
- php: >=8.1
- ext-readline: *
- erusev/parsedown: ^1.7
- tivins/database: dev-main
- tivins/php-common: dev-main
Requires (Dev)
- phpunit/phpunit: ^9.5.10
This package is auto-updated.
Last update: 2025-10-17 05:51:47 UTC
README
PHP framework for web applications
Requirements:
- PHP8.0+
Dependencies:
- tivins/database (facultative. Only if a database is used for the project)
- erusev/parsedown
Usage
-
Install
composer require tivins/framework
-
Prepare folders
mkdir -p settings # create folder for settings files cp vendor/tivins/framework/references/reference.settings.php settings/my-app.test.settings.php # See settings echo "settings/" >> .gitignore # do not commit settings files mkdir -p htdocs/cache # public data and its cache dir mkdir -p pdata/cache # private data and its cache dir touch boot.php # see Boot touch htdocs/index.php # see Index
-
Init settings
mkdir settings # create folder for settings files touch settings/my-app.test.settings.phpNota: Colons
:are replaced by hyphens-in the host name (eg: if the hostname ismy-app.test:8080, the settings filename should bemy-app.test-8080.settings.php.Here is an example of the setting file:
<?php use Tivins\Framework\App; use Tivins\Database\Connectors\MySQLConnector; App::initDB(new MySQLConnector( dbname: "my_database", user: "db_user", password: "password", ));
Nota: you can add a
common.settings.phpfor shared rules (called first). -
Boot
<?php use Tivins\Framework\App; require __dir__ . '/vendor/autoload.php'; define('FRAMEWORK_ROOT_PATH', __dir__); App::init();
-
Index
<?php use Tivins\Framework\App; require __dir__ . '/../boot.php'; App::doc()->deliver();
Fresh install
{
"minimum-stability": "dev",
"require": {
"tivins/framework": "dev-main"
},
"autoload": {
"psr-4": {
}
}
}
composer u echo "vendor/" >> .gitignore echo "composer.lock" >> .gitignore