Skip to content

Latest commit

 

History

History
713 lines (621 loc) · 26.1 KB

CHANGELOG.md

File metadata and controls

713 lines (621 loc) · 26.1 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unrelease]

Added

  • orderBymethod in DAO and AbstractRepository classes

Fixed

  • php8.2 depreciation in UDateTime elapsed (dynamic properties)

[2.5.2] 2023-02-05

composer global update is required before creating a new project

Added

  • Latte template engine integration (see #204 )
  • Plates template engine integration

For creating a new project with Latte as default template engine:

Ubiquity new myProject -v=latte -a

Updated (breaking change)

  • Default template engine (Twig) is relocated in \Ubiquity\views\engine\twig\Twig and was before in \Ubiquity\views\engine\Twig

[2.5.1] 2023-01-01

Added

Updated

In ORM:

  • support for primary keys updating (with DAO::update($object))

Tests:

  • Improvement of the test coverage => 71%

Fixed (no open issue)

[2.5.0] 2022-12-18

Before creating a new project, be sure to update the devtools if they are installed globally:

composer global update

Added

  • setIsolationLevel for transactions with DAO and Database in Mysql/MariaDb.

Breaking changes

  • env var support for config files:
    • Cache initialization is required for config
    • loaded config file is located in app/cache/config/config.cache.php after cache initialization

Fixed

  • Injected attribute parsing in DiControllerParser (pb with name) - no open issue -

[2.4.12] 2022-04-25

Added

  • count method to AbstractRepository
  • app methods to Logger: appLog, appInfo, appError...
  • regenerateId for USession
  • DataFormHelper class for model form generation
  • forward method to UResponse

Fixed

  • php 8.1 deprecation in Validator, UModel, UArrayModel classes
  • checkConnection in AuthController
  • data-target bug in MultiResourceCrudController
  • UCookie pb with transformers

Deleted

  • diSemantic and diBootstrap in Framework => use Ajax\php\ubiquity\JsUtils::diSemantic(...) instead.

[2.4.11] 2022-02-22

Updated (breaking change)

  • AuthControllers refactoring
  • CRUDControllers (return types added on methods to override)

With an update on an existing project, the following error may occur in derived classes of AuthController, AuthFiles, CRUDController, CRUDFiles:

Fatal error: Declaration of controllers\auth\files\MyAuthFiles::getViewIndex() must be compatible with Ubiquity\controllers\auth\AuthFiles::getViewIndex(): string

The signature of the methods of AuthController, AuthFiles, CRUDController, CRUDFiles has changed, by adding the return types:

It is therefore necessary to add this return types on the overridden methods

	public function getViewIndex():string {
		return 'MyAuth/index.html';
	}

Added

In Auth controllers:

  • Account recovery (password reset)
  • AuthControllerConfig, UASystem, UConfigFile classes

[2.4.10] 2022-02-13

Added

In Auth controllers:

  • Two factor authentification
  • Default account creation + email validation

In Router:

  • Action parameters typing with Router (int, float, bool)

Fixed

  • RestServer Fix php 8.1 depreciation
  • php 8.1 depreciations in ModelsCacheUpdated, ValidatorMultiple...

Updated

  • Default index css style

[2.4.9] 2022-01-01

Added

  • image insertion in AssetsManager, img twig function see #188
  • reverse to Transformers
  • nonce in default template files

Fixed

  • typo in MultiResourceCrudController (no open issue)
  • php 8.1 depreciation warnings (UbiquityException, UCookie, UResponse...)

[2.4.8] 2021-12-01

Added

  • Pseudo-migrations in webtools and devtools
Ubiquity info-migrations
Ubiquity migrations
  • Models creation command in devtools
Ubiquity new-model User
Ubiquity new-model user,group

Updated

  • Db wrappers for migrations
  • Added DbOperations

Fixed

  • Fix absolute path pb in router with #/ (no open issue)
  • Fix mainParams pb in router cache generation (no open issue)

[2.4.7] 2021-11-01

Added

  • Domain Driven design approach with DDDManager class
DDDManager::setDomain('users');

Sample file structure:

app/
    domains/
        users/
            models/
            controllers/
            views/
            services/
            ...
        posts/
            models/
            controllers/
            views/
            services/
            ...
  • Route main parameters
#[Route('/foo/{mainParam}')]
public class FooController {
	public $mainParam;
}
#[Route('/foo/{_setMainParam()}')]
public class FooController {
        private $mainParam;

	pubic function _setMainParam(string $p){
	    $this->mainParam=$p;
     }
}

Fixed

  • Tests pb (codeception vulnerability)
  • AssetsManager js and css attributes pb (no open issue)
  • default index.html W3C validation errors

Updated

  • light opt : parseURI and getNS methods

[2.4.6] 2021-09-06

Added

  • [ORM] Update cascade behavior
  • boolean transformer
  • main params for routes
  • MultiResourceCRUDController Crud controller with index for several models
  • [ORM] aggregate uQueries (count, sum, min, max, avg)

Fixed

  • [DAO] Fix Where pb with count method
  • [DAO] Fix Where pb with exists method

Updated

  • default index page

[2.4.5] 2021-06-15

Before creating a new project, be sure to update the devtools if they are installed globally:

composer global update

Added

  • mass update in DAO class (updateAll)
  • type checker for routes params (int, bool=>regex)
  • status code for router (200, 404, 405)

Fixed

  • autowiring pb with ReflectionType
  • Mysql pb: replace parser cast for Mysql/mariaDB diff
  • ManyToMany update pb (no open issue)

Updated

Models generation

  • The regeneration of models preserves the code implemented on the existing models.

CRUD controllers

  • Add custom default buttons to dataTable (returned by ModelViewer::getDataTableRowButtons())
  • Add onNewInstance($instance) event
  • Add name paramteter in onGenerateFormField($field, $nb, $name) event
  • Add methods for modal title and message (getFormModalTitle($instance) and formHasMessage())
  • Add hook for form modal buttons (onFormModalButtons($btOkay, $btCancel))

Application root (breaking change)

  • For apache and nginX, root folder is set to public folder

For an old project (created with a version prior to 2.4.5), you have to modify index.php and move the index.php and .htaccess files to the public folder.

   <?php
   define('DS', DIRECTORY_SEPARATOR);
   //Updated with index.php in public folder
   define('ROOT', __DIR__ . DS . '../app' . DS);
   $config = include_once ROOT . 'config/config.php';
   require_once ROOT . './../vendor/autoload.php';
   require_once ROOT . 'config/services.php';
   \Ubiquity\controllers\Startup::run($config);

[2.4.4] 2021-04-25

Before creating a new project, be sure to update the devtools:

composer global update

Added

  • UArrayModels class for array of models manipulation (GroupBy, asKeyValues, sorting...)
  • UModel class for models manipulation (property updating...)
  • ubiquity-debug integration

Fixed

  • Boolean types pb #174
  • ResponseFormatter import #173
  • DAO PostgreSQL
    • ConditionParser pb with cast #172
    • Null values on fk #171

[2.4.3] 2021-03-07

Added

  • Dark mode for CRUD controllers (setStyle('inverted'))
  • CRUD hooks
    • onBeforeUpdate(object $instance, bool $isNew)
    • onBeforeUpdateRequest(array &$requestValues, bool $isNew)
  • Twig
    • isAllowedRoute(role, routeName) added if ubiquity-acl is present.

Updated

Validators

  • Model validators can be used on the client side (used by default for CRUD controllers).

Routing

  • Start router cache indexing (for routes with parameters) => This cache indexing is not yet used in production.

Fixed

  • fix Startup::getTemplateEngineInstance method name.
  • AuthController finalize and initialize pb with bad creditentials(no open issue)
  • Make manyToOne dropdowns clearable in CRUD controllers for fk null values.
  • DI parser pb (no open issue)

Breaking change possible

Rest controllers refactoring

  • Removed: SimpleRestController, RestController => Use the RestBaseController or RestResourceController class instead
  • Added:
    • JsonRestController => for simple Json REST API
    • RequestFormatter, JsonRequestFormatter, JsonApiRequestFormatter => for JSON api, JSON or url-encoded requests
  • Updated (for request with authorization - accesstoken):
    • The checkPermissions method in REST controllers must be overridden to check the data associated with an authentication token.
    • checkPermissions must be used in conjunction with the connect method to override as well.

[2.4.2] 2021-02-08

Added

  • ViewRepository CRUD operations + Automatic passing of the handled objects to the view
  • AbstractRepository only CRUD operations for overriding
  • Repository a default repository for any model
  • getAllByIds method in DAO part

Fixed

  • Fix cache generation pb for field names & dbTypes

Updated

  • Update route default name (ControllerName-{controller}.action)

devtools

  • livereload for php embedded web server

[2.4.1] 2021-01-17

Fixed

Added

  • Dark theme for CRUD controllers

[2.4.0] 2020-12-31

Added

  • PHP8 attributes support => with PHP8, Ubiquity uses the PHP8 attributes system for annotations.
  • password_verify method to URequest

Updated

  • CRUD and Auth controllers no longer use twig inheritance on views by default: It is easier to customize the display.

[2.3.13] 2020-12-11

Added

Fixed

[2.3.12] 2020-09-30

Added

  • Named db statements for async platforms
  • Rest events on insert and update BEFORE_INSERT = 'rest.before.insert' and BEFORE_UPDATE = 'rest.before.update'
  • insertGroups method (inserts in an implicit transaction)
  • quote options for PDO wrappers
  • ApplicationStorage for global variables with async platforms (Swoole, Workerman, ngx_php...)

Fixed

  • [orm] oneToMany and manyToMany loading pb with 2.3.11 version see #145

Tests

  • Adding tests
  • increase of coverage to 73%.

[2.3.11] 2020-07-28

Added

  • DAOCache (caches objects loaded by id)
  • MemcachedDriver system
  • RedisDriversystem

Updated

  • fomantic-ui 2.8.6
  • default index view relooking
  • Cache system and ArrayCache refactoring
  • light opt for async view and dbWrapper getStatement

Fixed

  • [rest] no violations on insert with ValidatorManager see #122
  • [rest] Validation on insertion should be complete see #123
  • [postgresql] pb wth PgsqlDriverMetas (names protection) see #128
  • [postgresql] Insert fail with non autoinc pk see #129
  • [webtools][models] click on Nothing to display generates an error see #130
  • [webtools][models] instances count not updated see #131
  • Session names with non allowed characters see #134
  • SimpleViewAsyncController pb with cache (no open issue)

[2.3.10] 2020-06-27

Added

  • transformer for UCookie (for Crypto)
  • getter on session Csrf protection
  • security level to csrf protection (0 => no secure)

Updated

  • fomantic-ui 2.8.5

Fixed

  • DAOPrepared queries pb (with memberList) -> no open issue
  • update with field column names different from member names -> no open issue

[2.3.9] 2020-06-04

Added

  • put, patch, delete, options annotations added for router (see #108)

Fixed

  • Router cache Content-Type omited see #120
  • ORM: pbs on column annotation see #116 and #117

[2.3.8] 2020-05-06

Added

  • Add csrf functions to twig templates

Updated

  • Update client libraries for new projects (Fomantic 2.8.4, jQuery 3.5.1)
  • Update to Twig 3.0

[2.3.7] 2020-04-30

Added

  • add password_hash to URequest
  • add exists method in DAO
  • Add Csrf protection to session

Updated

  • AuthController simplification
  • remove unnecessary "No route found log"

[2.3.6] 2020-04-13

Fixed

  • Fix require php7.4 in composer.json file #111
  • Fix @transient annotation pb #113
  • Fix non autoinc pk not affected on insert #114

[2.3.5] 2020-04-08

Fixed

  • Fix persistent /_default/ for default url (twig path) (no open issue)
  • Fix redirectToRoute pb (with _default route) (no open issue)

[2.3.4] 2020-03-23

Added

  • updateGroups method for batch updates (mysql bulks)
  • Aditional fields in queries Fixes #83
  • Composer part in webTools

Updated

  • PostgreSQL PDO Driver created for PostgreSQL Database Support Fixes #98
  • Sqlite PDO Driver created for SQLite Database Support Fixes #90

Fixed

  • @idcolumn name pb #107
  • [REST] with POST method returns 500 error, and 'controllers/rest' class not found #89

[2.3.3] 2020-01-25

Added

  • mailer module see https://github.com/phpMv/ubiquity-mailer
  • SimpleViewController, SimpleViewAsyncController for php views (without template engine)
  • PHP 7.4 preloading see #88
  • ObjectCache cache system
  • SDAO class for simple objects loading (popo with public members)
  • Prepared DAO queries for getOne, getById & getAll (async)

Improved

  • Add warmup methods for controllers & models metas
  • StartupAsync for asynchronous platforms (Swoole, Workerman)
  • unpack replace cufa in Startup::runAction

[2.3.2] 2019-10-28

Added

  • bulk queries in DAO class
    • DAO::toAdd($instance)
    • DAO::toUpdate($instance)
    • DAO::toDelete($instance)
    • DAO::flush()
  • Composer create-project
composer create-project phpmv/ubiquity-project {projectName}

Changed

  • MicroTemplateEngine optimization (cache)

Added

[2.3.1] 2019-09-25

Added

  • workerman server Usage:
Ubiquity serve -t=workerman -p=8091
  • Memcached support
  • multi db types support (Db Wrapper)
    • Tarantool database support on a proposal from @zilveer
    • Swoole coroutine Mysql database support
    • Mysqli database support
    • PDO default wrapper (updated)

Updated

  • PhpFastCache to ^7.0

Fixed

  • UQuery multi models fatal error (see #63)

[2.3.0] 2019-08-01

Added

Changed

  • Startup class optimization

Breaking change possible

Induced by multi database functionality:

  • Database startup with DAO::startDatabase($config) in services.php file is useless, no need to start the database, the connection is made automatically at the first request.
  • Use DAO::start() in services.php file when using several databases (with multi db feature)

For optimization reasons:

  • the classes used only in development (common to devtools and webtools) have been relocated in the phpmv/ubiquity-dev package.

Migration

  • Update devtools: composer global update

Fixed

  • route caching pb for routes with variables (no open issue)

Documentation

[2.2.0] - 2019-07-03

Added

  • Web-tools
    • Maintenance mode (see #49)
    • Updates checking for caches
    • Customization (tools)

Deleted/updated

  • Webtools removed from Ubiquity main repository and are in there own repo

Use composer require phpmv/ubiquity-webtools to install them.

Breaking change possible:

Classes relocation

  • Ubiquity\controllers\admin\utils\CodeUtils->Ubiquity\utils\base\CodeUtils
  • Ubiquity\controllers\admin\interfaces\HasModelViewerInterface->Ubiquity\controllers\crud\interfaces\HasModelViewerInterface
  • Ubiquity\controllers\admin\viewers\ModelViewer->Ubiquity\controllers\crud\viewers\ModelViewer
  • Ubiquity\controllers\admin\popo\CacheFile -> Ubiquity\cache\CacheFile
  • Ubiquity\controllers\admin\popo\ControllerSeo -> Ubiquity\seo\ControllerSeo
  • Ubiquity\controllers\admin\traits\UrlsTrait -> Ubiquity\controllers\crud\traits\UrlsTrait

Migration

  • Update devtools: composer global update
  • In existing projects: composer require phpmv/ubiquity-webtools for webtools installation.

Fixed

  • Router: pb with route priority attribute see #54

Changes

  • Models generation (Engineering-Forward) by UbiquityMyadmin interface was updated to avoid wrong outputs from __toString() function. #58
    • Field name is checked on different names which could be a hint for a password field.
    • The following field names are supported:
      • American English: password
      • Brazilian Portuguese: senha
      • Croatian: lozinka
      • Czech: heslotajne OR helslo_tajne
      • Danish: password
      • Dutch: wachtwoord
      • European Spanish: contrasena
      • Finnish: salasana
      • French: motdepasse OR mot_de_passe
      • German: passwort
      • Italian: password
      • Norwegian: passord
      • Polish: haslo
      • European Portuguese: senha
      • Romanian: parola
      • Russian: naponb
      • Latin American Spanish: contrasena
      • Swedish: loesenord OR losenord
      • Turkish: sifre
      • Ukrainian: naponb
      • Vietnamese: matkhau OR mat_khau

[2.1.4] - 2019-06-13

Added

  • Translate module in webtools
  • transChoice method for translations with pluralization (tc in twig templates)
  • Transactions and nested transactions in Database and DAO classes see #42
  • getById method in DAO class (optimization)
  • Ubiquity-swoole server (Ubiquity serve --type=swoole)

Fixed

  • Fatal error in startup (not 404) fix #43
  • Version 2.1.3 displays the number of version 2.1.2

[2.1.3] - 2019-05-09

Added

  • Support for Http methods customization (for URequest & Uresponse) via Ubiquity\utils\http\foundation\AbstractHttp class.
  • Support for session customization via Ubiquity\utils\http\session\AbstractSession
  • multisites session Ubiquity\utils\http\session\MultisiteSession(1.0.0-beta)
  • ReactPHP server available from the devtools with Ubiquity serve -t=react command

Fixed

  • [ORM] model Table annotation : fix #39

Fixed

  • [Logging] init logger fails if debug=false : fix #31

Documentation

[2.1.2] - 2019-04-27

Fixed

  • Twig views caching : fix #26
  • ORM : sync $instance->_rest array with $instance updates
  • REST:
    • pb on adding in SimpleRestController : fix #27
    • pb an update with manyToOne members : fix #30

[2.1.1] - 2019-04-19

Added

  • Transformer module see in documentation
  • SimpleRestController + SimpleApiRestController classes for Rest part

Changed

  • Translation module use default cache system (ArrayCache) and no more APC (performances ++)

Fixed

  • webtools Rest section
    • Authorization Bearer pb in input field (no open issue)
    • POST request for adding an instance with RestController (no open issue)
  • webtools Models section, CRUDControllers
    • Model adding or updating in modal form fail see #25
  • JsonAPI finalization

Documentation

[2.1.0] - 2019-04-01

Added

  • Themes manager with bootstrap, Semantic-ui and foundation
    • AssetsManager for css,js, fonts and images integration
    • ThemesManager for css framework integration
    • Themes part in webtools interface
  • Dependency injection annotations
    • @injected inject a member in a controller defined by a dependency in config
    • @autowired inject an instance of class defined by type with @var annotation

Changed

  • dependency injection mecanism
    • controller cache for di
    • @execkey in config[di] for injections at runtime

Breaking change possible:

use "di"=>["@exec"=>[your injections]] instead of "di"=>[your injections]

Fixed

  • An exception is thrown In case of problem with the Database connection (in DataBase::connect method) see #12

The connection to the database must be protected by a try/catch in app/config/services.php

try{
	\Ubiquity\orm\DAO::startDatabase($config);
}catch(Exception $e){
	echo $e->getMessage();
}

Documentation

[2.0.11] - 2019-03-14

Added

  • Rest JsonAPI implementation
    • JsonApiRestController class
  • methods in UCookie
    • exists: Tests the existence of a cookie
    • setRaw: Sends a raw cookie without urlencoding the cookie value
  • method in UResponse
    • enableCORS: enables globaly CORS for a domain (this was possible before by using setAccessControl* methods)

Changed

  • method set in UCookie (parameters $secure & $httpOnly added)

Fixed

[2.0.10] - 2019-02-22

Added

  • Webtools
    • validation info in models part
  • Acceptance, functionnal and unit tests (70% coverage)

Changed

  • Webtools
    • models metadatas presentation
  • Documentation
  • Restoration of Translation class
  • Compatibility with devtools 1.1.5

[2.0.9] - 2019-01-21

Removed

  • Usage of @ (replaced with ?? operator)

[2.0.8] - 2019-01-20

Changed

  • Optimizations
    • ORM & relations oneToMany
    • apc to apcu cache for Translations
    • Router : routes array minification
    • Scrutinizer debugging : 0 bug !
    • Scrutinizer evaluation : 9.61 very good!
    • Translator=>TranslatorManager with static methods

[2.0.7] - 2019-01-11

Changed

  • Scrutinizer cleaning

Added

  • String validators

[2.0.6] - 2018-12-29

Update for phpbenchmarks compatibility

[2.0.5] - 2018-12-28

Changed

  • TranslatorManager
  • ValidatorsManager
  • NormalizersManager

[2.0.4] - 2018-11-21

Added

  • UQL (Ubiquity Query Language)
  • AuthControllers
  • CRUDControllers

Changed

  • SQL Queries optimization (groupings)

[2.0.3] - 2018-04-16

Added

  • Config file edition and checking
  • @framework location for internal default views

[2.0.2] - 2018-03-13

Changed

  • manyToMany annot bug fixed
  • quote in SqlUtils

[2.0.1] - 2018-03-11

Added

  • SEO controller for generating robots.txt and sitemap.xml files (webtools interface)
  • Adding new utility classes
    • Ubiquity\utils\http\UResponse
    • Ubiquity\utils\http\UCookie

Changed

  • Renaming utility classes:
    • Ubiquity\utils\RequestUtils -> Ubiquity\utils\http\URequest
    • Ubiquity\utils\SessionUtils -> Ubiquity\utils\http\USession
    • Ubiquity\utils\StrUtils -> Ubiquity\utils\base\UString
    • Ubiquity\utils\JArray -> Ubiquity\utils\base\UArray
    • Ubiquity\utils\FsUtils -> Ubiquity\utils\base\UFileSystem
    • Ubiquity\utils\Introspection -> Ubiquity\utils\base\UIntrospection