The Pragma Core Module for Pragma Framework

v3.17.2 2024-04-17 07:13 UTC

README

Pragma Core Module for the Pragma Framework (ORM, Models, View, Controllers)

For a project skeleton using this module, see: https://github.com/pragma-framework/framework

stable packagist Build Status license

Installation

Using composer

$ composer require pragma-framework/core:dev-master

Auto-migrate database

Add in composer.json:

"scripts": {
	"post-package-install": [
		"Pragma\\Helpers\\Migrate::postPackageInstall"
	],
	"post-package-update": [
		"Pragma\\Helpers\\Migrate::postPackageUpdate"
	],
	"pre-package-uninstall": [
		"Pragma\\Helpers\\Migrate::prePackageUninstall"
	]
}

These scripts run DB migration for core and all associated plugins (ex: pragma-framework/historic, ...)

PostgreSQL & uidmysql

sudo su postgres -c "psql <db name> -c \"CREATE EXTENSION IF NOT EXISTS \\\"uuid-ossp\\\"\""

Run tests

$ vendor/bin/phpunit --bootstrap ./tests/bootstrap.config.sqlite.php tests/
$ vendor/bin/phpunit --bootstrap ./tests/bootstrap.config.mysql.php tests/