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.
orderBy
method inDAO
andAbstractRepository
classes
- php8.2 depreciation in
UDateTime
elapsed
(dynamic properties)
composer global update
is required before creating a new project
- 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
- Default template engine (Twig) is relocated in
\Ubiquity\views\engine\twig\Twig
and was before in\Ubiquity\views\engine\Twig
- Translations for Ubiquity guide into Spanish => thanks to @alnux for his work in progress
- Translations for Ubiquity guide into french
In ORM:
- support for primary keys updating (with
DAO::update($object)
)
Tests:
- Improvement of the test coverage => 71%
Before creating a new project, be sure to update the devtools if they are installed globally:
composer global update
setIsolationLevel
for transactions withDAO
andDatabase
in Mysql/MariaDb.
- 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
Injected
attribute parsing inDiControllerParser
(pb with name) - no open issue -
count
method toAbstractRepository
- app methods to Logger:
appLog
,appInfo
,appError
... - regenerateId for
USession
DataFormHelper
class for model form generationforward
method toUResponse
- php 8.1 deprecation in
Validator
,UModel
,UArrayModel
classes checkConnection
inAuthController
data-target
bug inMultiResourceCrudController
UCookie
pb with transformers
diSemantic
anddiBootstrap
inFramework
=> useAjax\php\ubiquity\JsUtils::diSemantic(...)
instead.
- 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';
}
In Auth controllers:
- Account recovery (password reset)
AuthControllerConfig
,UASystem
,UConfigFile
classes
In Auth controllers:
- Two factor authentification
- Default account creation + email validation
In Router:
- Action parameters typing with Router (int, float, bool)
- RestServer Fix php 8.1 depreciation
- php 8.1 depreciations in ModelsCacheUpdated, ValidatorMultiple...
- Default index css style
- image insertion in AssetsManager,
img
twig function see #188 reverse
to Transformers- nonce in default template files
- typo in MultiResourceCrudController (no open issue)
- php 8.1 depreciation warnings (UbiquityException, UCookie, UResponse...)
- 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
- Db wrappers for migrations
- Added
DbOperations
- Fix absolute path pb in router with
#/
(no open issue) - Fix
mainParams
pb in router cache generation (no open issue)
- 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;
}
}
- Tests pb (codeception vulnerability)
- AssetsManager js and css attributes pb (no open issue)
- default
index.html
W3C validation errors
- light opt :
parseURI
andgetNS
methods
- [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)
- [DAO] Fix Where pb with
count
method - [DAO] Fix Where pb with
exists
method
- default index page
Before creating a new project, be sure to update the devtools if they are installed globally:
composer global update
- mass update in DAO class (
updateAll
) - type checker for routes params (int, bool=>regex)
- status code for router (200, 404, 405)
- autowiring pb with ReflectionType
- Mysql pb: replace parser cast for Mysql/mariaDB diff
- ManyToMany update pb (no open issue)
- The regeneration of models preserves the code implemented on the existing models.
- Add custom default buttons to dataTable (returned by
ModelViewer::getDataTableRowButtons()
) - Add
onNewInstance($instance)
event - Add
name
paramteter inonGenerateFormField($field, $nb, $name)
event - Add methods for modal title and message (
getFormModalTitle($instance)
andformHasMessage()
) - Add hook for form modal buttons (
onFormModalButtons($btOkay, $btCancel)
)
- 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);
Before creating a new project, be sure to update the devtools:
composer global update
UArrayModels
class for array of models manipulation (GroupBy, asKeyValues, sorting...)UModel
class for models manipulation (property updating...)ubiquity-debug
integration
- 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.
- Model validators can be used on the client side (used by default for CRUD controllers).
- Start router cache indexing (for routes with parameters) => This cache indexing is not yet used in production.
- 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)
- Removed:
SimpleRestController
,RestController
=> Use theRestBaseController
orRestResourceController
class instead - Added:
JsonRestController
=> for simple Json REST APIRequestFormatter
,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 theconnect
method to override as well.
- The
ViewRepository
CRUD operations + Automatic passing of the handled objects to the viewAbstractRepository
only CRUD operations for overridingRepository
a default repository for any modelgetAllByIds
method inDAO
part
- Fix cache generation pb for field names & dbTypes
- Update route default name (ControllerName-{controller}.action)
- livereload for php embedded web server
- Dark theme for CRUD controllers
- PHP8 attributes support => with PHP8, Ubiquity uses the PHP8 attributes system for annotations.
password_verify
method toURequest
- CRUD and Auth controllers no longer use twig inheritance on views by default: It is easier to customize the display.
- ACL Manager in ubiquity-acl repository
- Update php version in composer.json for php 8
- DAOUqueries pb with parentheses in condition
- Password hash algo type (no open issue)
- DB Logging omitted (no open issue)
- Named db statements for async platforms
- Rest events on insert and update
BEFORE_INSERT = 'rest.before.insert'
andBEFORE_UPDATE = 'rest.before.update'
insertGroups
method (inserts in an implicit transaction)quote
options for PDO wrappersApplicationStorage
for global variables with async platforms (Swoole, Workerman, ngx_php...)
- [orm]
oneToMany
andmanyToMany
loading pb with 2.3.11 version see #145
- Adding tests
- increase of coverage to 73%.
DAOCache
(caches objects loaded by id)MemcachedDriver
systemRedisDriver
system
- fomantic-ui 2.8.6
- default index view relooking
- Cache system and ArrayCache refactoring
- light opt for async view and dbWrapper getStatement
- [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)
- transformer for
UCookie
(for Crypto) - getter on session Csrf protection
- security level to csrf protection (0 => no secure)
- fomantic-ui 2.8.5
- DAOPrepared queries pb (with memberList) -> no open issue
- update with field column names different from member names -> no open issue
put
,patch
,delete
,options
annotations added for router (see #108)
- Add csrf functions to twig templates
- Update client libraries for new projects (Fomantic 2.8.4, jQuery 3.5.1)
- Update to Twig 3.0
- add
password_hash
to URequest - add
exists
method in DAO - Add Csrf protection to session
- AuthController simplification
- remove unnecessary "No route found log"
- Fix
require php7.4
in composer.json file #111 - Fix
@transient
annotation pb #113 - Fix non autoinc pk not affected on insert #114
- Fix persistent
/_default/
for default url (twig path) (no open issue) - Fix redirectToRoute pb (with
_default
route) (no open issue)
updateGroups
method for batch updates (mysql bulks)- Aditional fields in queries Fixes #83
- Composer part in webTools
- PostgreSQL PDO Driver created for PostgreSQL Database Support Fixes #98
- Sqlite PDO Driver created for SQLite Database Support Fixes #90
@id
column name pb #107- [REST] with POST method returns 500 error, and 'controllers/rest' class not found #89
- 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 systemSDAO
class for simple objects loading (popo with public members)- Prepared DAO queries for getOne, getById & getAll (async)
- Add warmup methods for controllers & models metas
StartupAsync
for asynchronous platforms (Swoole, Workerman)- unpack replace cufa in
Startup::runAction
- bulk queries in
DAO
classDAO::toAdd($instance)
DAO::toUpdate($instance)
DAO::toDelete($instance)
DAO::flush()
- Composer create-project
composer create-project phpmv/ubiquity-project {projectName}
MicroTemplateEngine
optimization (cache)
workerman
server Usage:
Ubiquity serve -t=workerman -p=8091
Memcached
support- multi db types support (Db Wrapper)
PhpFastCache
to ^7.0
- UQuery multi models fatal error (see #63)
Startup
class optimization
Induced by multi database functionality:
- Database startup with
DAO::startDatabase($config)
inservices.php
file is useless, no need to start the database, the connection is made automatically at the first request. - Use
DAO::start()
inservices.php
file when using several databases (withmulti 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.
- Update devtools:
composer global update
- route caching pb for routes with variables (no open issue)
- Web-tools
- Maintenance mode (see #49)
- Updates checking for caches
- Customization (tools)
- Webtools removed from Ubiquity main repository and are in there own repo
Use composer require phpmv/ubiquity-webtools
to install them.
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
- Update devtools:
composer global update
- In existing projects:
composer require phpmv/ubiquity-webtools
for webtools installation.
- Router: pb with route priority attribute see #54
- 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
Translate
module in webtoolstransChoice
method for translations with pluralization (tc
in twig templates)- Transactions and nested transactions in
Database
andDAO
classes see #42 getById
method inDAO
class (optimization)Ubiquity-swoole
server (Ubiquity serve --type=swoole
)
- Fatal error in startup (not 404) fix #43
- Version 2.1.3 displays the number of version 2.1.2
- 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 withUbiquity serve -t=react
command
- [ORM] model Table annotation : fix #39
- [Logging] init logger fails if debug=false : fix #31
- DAO querying, updates
- In doc for di : fix #41
- Twig views caching : fix #26
- ORM : sync
$instance->_rest
array with$instance
updates - REST:
Transformer
module see in documentationSimpleRestController
+SimpleApiRestController
classes for Rest part
Translation
module use default cache system (ArrayCache) and no more APC (performances ++)
- webtools Rest section
Authorization Bearer
pb in input field (no open issue)POST
request for adding an instance withRestController
(no open issue)
- webtools Models section, CRUDControllers
- Model adding or updating in modal form fail see #25
- JsonAPI finalization
- REST module rest doc
- Transformers module Transformers doc
- Themes manager with bootstrap, Semantic-ui and foundation
AssetsManager
for css,js, fonts and images integrationThemesManager
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
- dependency injection mecanism
- controller cache for di
@exec
key inconfig[di]
for injections at runtime
use "di"=>["@exec"=>[your injections]]
instead of "di"=>[your injections]
- 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
inapp/config/services.php
try{
\Ubiquity\orm\DAO::startDatabase($config);
}catch(Exception $e){
echo $e->getMessage();
}
- Dependency injection updates di doc
- Themes managment Assets and themes doc
- Rest JsonAPI implementation
JsonApiRestController
class
- methods in
UCookie
exists
: Tests the existence of a cookiesetRaw
: Sends a raw cookie without urlencoding the cookie value
- method in
UResponse
enableCORS
: enables globaly CORS for a domain (this was possible before by usingsetAccessControl*
methods)
- method
set
inUCookie
(parameters$secure
&$httpOnly
added)
- issue pb with config variable in Twig views
- deprecated ref to apcu in Translation
ArrayLoader
removed
- Webtools
- validation info in models part
- Acceptance, functionnal and unit tests (70% coverage)
- Webtools
- models metadatas presentation
- Documentation
- Restoration of Translation class
- Compatibility with devtools 1.1.5
- Usage of
@
(replaced with??
operator)
- 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
- Scrutinizer cleaning
- String validators
Update for phpbenchmarks compatibility
- TranslatorManager
- ValidatorsManager
- NormalizersManager
- UQL (Ubiquity Query Language)
- AuthControllers
- CRUDControllers
- SQL Queries optimization (groupings)
- Config file edition and checking
- @framework location for internal default views
- manyToMany annot bug fixed
- quote in SqlUtils
- SEO controller for generating robots.txt and sitemap.xml files (webtools interface)
- Adding new utility classes
- Ubiquity\utils\http\UResponse
- Ubiquity\utils\http\UCookie
- 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