All notable changes to VELOX will be documented in this file.
- Update
App
class:- Make constructor final.
- Update
instance()
method. - Update
terminate()
method. - Update
shutdown()
method.
- Update
Globals
class:- Update
initialize()
method.
- Update
- Update
Database
class:- Add
#[\ReturnTypeWillChange]
attribute where necessary.
- Add
- Update
Element
class:- Add
#[\ReturnTypeWillChange]
attribute where necessary.
- Add
- Update
Dumper
class:- Update
VAR_DUMP_CONVERSIONS
class constant. - Update
dump()
method. - Update
varExport()
method. - Update
varDump()
method.
- Update
- Update
autoload.php
:- Add
$_VELOX
superglobal.
- Add
- PHP
8.1
support: - Update tests:
- Update
DumperTest
class.
- Update
- Update
Dumper
class:- Update
VAR_EXPORT_CONVERSIONS
class constant to fix an issue with multiline strings. - Refactor
exportExpression()
method and fix an issue whenvar_export()
fails.
- Update
- Update
Exception
class:- Update
create()
method to fix an issue with returned namespace. - Update
throw()
method to accept$previous
as\Throwable
instead of\Exception
. - Update
handle()
method.
- Update
- Update
Misc
class:- Update
transform()
method to add new cases.
- Update
- Update
Event
class:- Update
listen()
method to add the$priority
argument. - Refactor
dispatch()
method to allow listeners to attach events when executed.
- Update
- Update
Dumper
class:- Add
VAR_EXPORT_CONVERSIONS
class constant. - Add
VAR_DUMP_CONVERSIONS
class constant. - Update
$styles
static property. - Add
varExport()
method. - Add
verDump()
method. - Refactor
exportExpression()
method and change visibility topublic
. - Refactor
getDumpingBlocks()
method. - Update
dump()
method.
- Add
- Update tests:
- Add
EventTest
class. - Add
MiscTest
class. - Add
DumperTest
class.
- Add
- Update
composer.json
:- Update required
php
version. - Add required PHP extensions
ext-mbstring
.
- Update required
- Add
Exception
class. - Update the following classes to improve thrown exceptions classes and messages:
- Update
App
class. - Update
Auth
class. - Update
Controller
class. - Update
Globals
class. - Update
Router
class. - Update
Database
class. - Update
Model
class. - Update
DBAL
class. - Update
Element
class.
- Update
- Update
Dumper
class:- Update
$styles
property to improve exceptions page styling. - Update
exportExpression()
method. - Update
exportExpressionWithSyntaxHighlighting()
method. - Update
dump()
method to fix an issue with block styling. - Update
dumpException()
method to add code snippet for each item in the stacktrace. - Add
highlightedFile()
method. - Add
tabulatedStacktrace()
method.
- Update
- Update
Config
class:- Add
getReference()
method. - Update
getAll()
method.
- Add
- Update
Data
class:- Update
load()
method to make use ofConfig::getReference()
instead of resetting the config array.
- Update
- Update
loader.php
:- Update error handler function.
- Update exception handler function to allow for rendering specific error pages using exception code.
- Update tests:
- Add
ExceptionTest
class.
- Add
- Update
App
class:- Remove
__get()
magic method.
- Remove
- Update
Database
class:- Update
mock()
method.
- Update
- Update
View
class:- Refactor class by extracting parts of it to
View/Compiler
.
- Refactor class by extracting parts of it to
- Add
Compiler
class. - Update
Session
class:- Refactor class by extracting parts of it to
Session/Flash
andSession/CSRF
.
- Refactor class by extracting parts of it to
- Add
Session\Flash
class. - Add
Session\CSRF
class. - Update tests:
- Update
AppTest
class. - Update
EngineTest
class.
- Update
- Update
Engine
class:- Update
getCompiledContent()
method. - Update
printVariables()
method to print escaped and unescaped variables. - Remove
printUnescapedVariables()
method. - Refactor
wrapControlStructures()
method.
- Update
- Update
Router
class:- Update
start()
method to allow forON_START
event to be dispatched when CSRF check fails. - Rename
doEchoResponse()
method torespond()
.
- Update
- Update
App
class:- Update
abort()
method.
- Update
- Update
Dumper
class:- Add
$styles
property. - Add
getDumpingBlocks()
method. - Refactor
dump()
method. - Update
dumpException()
method. - Update
exportExpressionWithSyntaxHighlighting()
method.
- Add
- Update
Router
class:- Add
HANDLER_ROUTE
class constant. - Add
MIDDLEWARE_ROUTE
class constant. - Change visibility of
getValidParameters()
,getRoutePath()
,getRouteRegex()
,getRouteArguments()
,doEchoResponse(
) methods from private to protected.
- Add
- Update
Element
class:- Rename class from
Base
toElement
. This shouldn't introduce any problems as theBase
class was marked as@internal
. - Fix
set()
method return type hint. - Fix
setAttributes()
method return type hint.
- Rename class from
- Update
App
class:- Add
$instance
property. - Update
instance()
method.
- Add
- Update
Engine
class:- Update class namespace (
MAKS\Velox\Frontend\Engine
->MAKS\Velox\Frontend\View\Engine
). This shouldn't introduce any problems as this class is marked as@internal
.
- Update class namespace (
- Update
Model
class:- Refactor the class by extracting parts of it to
Model\DBAL
andModel\Base
.
- Refactor the class by extracting parts of it to
- Add
Model\DBAL
class. - Add
Model\Base
class. - Update tests:
- Update
EngineTest
class. - Update
ModelTest
class.
- Update
- Update
Event
class:- Update
dispatch()
method. - Update
listen()
method. - Add
isDispatched()
method. - Add
hasListener()
method. - Add
get()
method. - Add
create()
method.
- Update
- Update
Router
class:- Remove
$routeNotFoundCallback
property. - Remove
$methodNotAllowedCallback
property. - Remove
handleRouteNotFound()
deprecated method. - Remove
handleMethodNotAllowed()
deprecated method.
- Remove
- Update
loader.php
:- Add default timezone setting.
- Update
global.php
config file:- Update
timezone
config entry.
- Update
- Update
composer.json
:- Update
branch-alias
. - Add
blend
as a development dependency. - Add
document
script.
- Update
- Update tests:
- Update
RouterTest
class. - Update
EventTest
class.
- Update
- Update
App
class:- Update
shutdown()
method to fix an issue preventing functions registered viaregister_shutdown_function()
from executing.
- Update
- Update
Router
class:- Update
__construct()
method to fix an issue where shutdown function is registered multiple times.
- Update
- Update
loader.php
:- Update exception handler function.
- Update shutdown function.
- Update
App
class:- Add events as class constants.
- Add
shutdown()
method. - Update
terminate()
method. - Update
abort()
method.
- Update
Auth
class:- Update
fail()
method.
- Update
- Update
Controller
class:- Update
$crudRoutes
ID regex to make them start from1
instead of0
.
- Update
- Update
Router
class:- Update
__construct()
method. - Update
getRouteRegex()
method to fix issues with route placeholder.
- Update
- Update
Session
class:- Update
csrf()
method.
- Update
- Update
Path
class:- Update
current()
method to strip query string from the returned path.
- Update
- Update
PersonsController
class:- Update
createTestData()
method.
- Update
- Update
UsersController
class:- Update
registerAction()
method. - Update
loginAction()
method.
- Update
- Update
system/events.php
:- Add
App::ON_SHUTDOWN
event listener.
- Add
- Update
velox
theme:- Update error pages (
401
,403
,404
,405
,500
).
- Update error pages (
- Update
composer.json
:- Update
description
. - Update
keywords
. - Update
support
. - Update
branch-alias
.
- Update
- Update tests:
- Update
TestCase
class. - Update
AppTest
class.
- Update
- Improve DocBlocks of classes, methods, functions, config files, ...
- Generate documentation for the full API on
marwanalsoltany.github.io/velox
.
- Add
Auth
class. - Add
UsersController
class. - Update
App
class:- Add
instance()
method. - Add
$auth
property. - Update
abort()
method.
- Add
- Update
Controller
class:- Swap class properties with calls to the app class instance.
- Remove hard coded dependencies.
- Update
doRegisterRoutes()
method to allow for registering middlewares via annotations.
- Update
Router
class:- Add
sort()
method. - Update
start()
method to sort routes when starting the router (middlewares now have priority over handlers). - Update
getRouteRegex()
method to add support for the*
wildcard in route expression. - Update
redirect()
method to allow for setting the HTTP status code.
- Add
- Update
Engine
class:- Update
printVariables()
andprintUnescapedVariables()
methods to explicitly cast expressions to strings ($varA ?? $varB
=>(string)($varA ?? $varB)
).
- Update
- Update
Dumper
class:- Update
dump()
method to fix some styling issues with dump block.
- Update
- Update tests:
- Add
AuthTest
class. - Update
AppTest
class. - Update
ControllerTest
class. - Update
EngineTest
class.
- Add
- Update
loader.php
:- Add
Auth
class to the list of aliased classes.
- Add
- Update
intellisense.php
:- Add alias for the
Auth
class.
- Add alias for the
- Update
helpers.php
:- Update
app()
function. - Add
auth()
function.
- Update
- Update
global.php
config file:- Update
errorPages
config entry.
- Update
- Add
auth.php
config file. - Update
routes/web.php
:- Add instantiation for
UsersController
. - Add
401
error page.
- Add instantiation for
- Update
system/events.php
:- Add
Auth::ON_REGISTER
event listener.
- Add
- Update
velox
theme:- Add
401.phtml
. - Add
UsersController
views. - Update
persons/edit
view. - Update navigation partial.
- Add
- Update
App
class:- Update
terminate()
method to allow for ignoring the shutdown function.
- Update
- Update
Dumper
class:- Swap usage of
exit
withApp::terminate()
for consistency.
- Swap usage of
- Update
Model
class:- Add
findBy*()
magic method where*
is an attribute name in PascalCase.
- Add
- Update
loader.php
:- Update shutdown function.
- Update
Database
class.- Fix
connect()
method DocBlock.
- Fix
- Update
Engine
class.- Fix wrong property name
$templatesFileDirectory
->$templatesFileExtension
.
- Fix wrong property name
- Update
Config
class:- Add events as class constants.
- Update
Controller
class:- Add events as class constants.
- Update
Router
class:- Add events as class constants.
- Update
Data
class:- Add events as class constants.
- Update
View
class:- Add events as class constants.
- Update
events/system.php
:- Swap listened-on events with constants of the corresponding class.
- Update
PersonsController
class:- Update
createTestData()
method to use static data instead of API call.
- Update
- Update
Database
class:- Update class properties data types.
- Update
instance()
method, to return a fake if DB config is invalid, to make the Database an optional requirement. - Update
transactional()
method. - Update
prepare()
method. - Add
mock()
method.
- Update
Dumper
class:- Update
dumpException()
method.
- Update
- Update
Model
class:- Update
isMigrated()
method.
- Update
- Update
velox
theme:- Add missing CSRF tokens in some views.
- Add
Session
class. - Add
Database
class. - Add
Model
class. - Add
Engine
class. - Add
Person
class. - Add
PersonsController
class. - Update
App
class:- Add
$session
property. - Add
$database
property. - Update
abort()
method to not clear all opened buffers. - Update
terminate()
method to renameUNIT_TESTING
constant toEXIT_EXCEPTION
.
- Add
- Update
Controller
class:- Add
$crudRoutes
property. - Add
$session
property. - Add
$database
property. - Add
$model
property. - Add
associateModel()
anddoAssociateModel()
methods. - Add
registerRoutes()
anddoRegisterRoutes()
methods.
- Add
- Update
Router
class:- Update
redirect()
method. - Update
forward()
method. - Update
start()
method to check fot CSRF. - Update
doEchoResponse()
method to fall back to error pages in config.
- Update
- Update
View
class:- Add
parse()
method. - Update
compile()
method. - Update
require()
method. - Update
clearCache()
method. - Add
engine
config default inDEFAULTS
constant.
- Add
- Update
Misc
class:- Add
transform()
method.
- Add
- Update
Globals
class:- Update
initialize()
method to replace direct use of session function withSession
class.
- Update
- Update
TestCase
class:- Rename
UNIT_TESTING
constant toEXIT_EXCEPTION
.
- Rename
- Update tests:
- Add
SessionTest
class. - Add
DatabaseTest
class. - Add
ModelTest
class. - Add
EngineTest
class. - Add
DatabaseMock
class. - Add
ModelMock
class. - Add
ControllerMock
class. - Add
TestObjectMock
class. - Update
AppTest
class. - Update
ControllerTest
class. - Update
ViewTest
class. - Update
MiscTest
class.
- Add
- Update
loader.php
:- Add
Session
class to the list of aliased classes. - Add
Database
class to the list of aliased classes. - Update exception handler function.
- Add
- Update
intellisense.php
:- Add alias for the
Session
class. - Add alias for the
Database
class.
- Add alias for the
- Update
helper.php
:- Add
session()
function - Add
flash()
function - Add
csrf()
function - Add
database()
function
- Add
- Add
session.php
config file. - Add
database.php
config file. - Update
global.php
config file:- Add
errorPages
config entry - Remove
errorPage
config entry
- Add
- Update
view.php
config file:- Add
engine
config entry
- Add
- Update
routes/web.php
:- Add instantiation for
PersonsController
. - Update error pages routes and demo routes documentation.
- Add instantiation for
- Update
app-mirror
command:- Update blacklisted directories and files regex.
- Update
velox
theme:- Update
navigation.phtml
partial. - Add
500.phtml
. - Add
403.phtml
. - Update
404.phtml
. - Update
405.phtml
. - Add
PersonsController
views.
- Update
- Update
composer.json
:- Add new required PHP extensions
ext-pdo
andext-intl
. - Update
branch-alias
. - Update
keywords
.
- Add new required PHP extensions
- Update
.travis.yml
:- Add database config.
- Update
App
class:- Add
abort()
method. - Add
terminate()
method.
- Add
- Update
Globals
class:- Add
cut()
method. - Fix an issue in
initialize()
method with$_SESSION
reference.
- Add
- Update
Router
class:- Update
getRequestMethod()
method to remove_method
variable from$_POST
. - Refactor
doEchoResponse()
method.
- Update
- Update
View
class:- Remove
VIEWS_CACHE_DIR
class constant (config is used now instead). - Update
cache()
method to replaceVIEWS_CACHE_DIR
with value from config. - Update
cacheClear()
method to replaceVIEWS_CACHE_DIR
with value from config. - Update
resolveCachePath()
method to replaceVIEWS_CACHE_DIR
with value from config. - Update
include()
method to accept a parameter for variables. - Update
require()
method to minimize variables leaking into the view. - Refactor
compile()
method.
- Remove
- Update
HTML
class:- Update
minify()
method.
- Update
- Update
Path
class:- Fix an issue with regex in
normalize()
method.
- Fix an issue with regex in
- Update
Misc
class:- Add
cutArrayValueByKey()
method.
- Add
- Update
Dumper
class:- Refactor
dumpException()
method to decode HTML in stack trace function arguments.
- Refactor
- Update
loader.php
:- Update exception handler function.
- Update
helpers.php
:- Add
abort()
function. - Add
terminate()
function.
- Add
- Update
html.php
:- Add
string
casting to functions parameters.
- Add
- Update
TestCase
class:- Add
UNIT_TESTING
constant.
- Add
- Update tests:
- Update
GlobalsTest
class. - Update
MiscTest
class. - Update
RouterTest
class.
- Update
- Update
velox
theme:- Replace filler text in pages with actual text.
- Update
global.php
config file:- Add
baseUrl
config entry.
- Add
- Update
theme.php
config file:- Update
paths
.
- Update
- Update
Router
class:- Update
redirect()
method to make use of 'baseUrl' config value.
- Update
- Update
Path
class:- Update
resolveUrl()
method to make use of 'baseUrl' config value.
- Update
- Update
Misc
class:- Fix an issue in
getArrayValueByKey()
method with default return value.
- Fix an issue in
- Update
HTML
class:- Update
minify()
method to fix invalid HTML minification.
- Update
- Update tests:
- Update
GlobalsTest
class. - Update
HTMLTest
class.
- Update
- Update
Globals
class:- Update
__get()
magic method.
- Update
- Update
Router
class:- Refactor
echoResponse()
method. - Rename
echoResponse()
method todoEchoResponse()
. - Update
start()
method to make use ofdoEchoResponse()
method.
- Refactor
- Update
Dumper
class:- Update
dd()
method to make it skip shutdown function.
- Update
- Update
loader.php
:- Add a check for
$GLOBALS['_DIE']
in shutdown function to allow for exiting the script.
- Add a check for
- Update
events/system.php
:- Remove use statement for
Event
class. - Update events handling examples.
- Remove use statement for
- Update
routes/web.php
:- Remove use statement for
Router
class. - Replace
hse()
function call withhtmlspecialchars()
.
- Remove use statement for
- Update tests:
- Update
RouterTest
class.
- Update
- Update
App
class:- Add magic methods signatures in class DocBlock.
- Update
additional.php
:- Remove
includes
directory path. - Remove
includes/events
directory path. - Remove
includes/routes
directory path.
- Remove
- Update
Controller
class:- Fix wrong name of the dispatched event in
__construct()
method.
- Fix wrong name of the dispatched event in
- Update
Router
class:- Refactor
echoResponse()
method.
- Refactor
- Update
events/system.php
:- Add use statement for
Event
class to avoid class name collision. - Update events handling examples.
- Add use statement for
- Update
routes/web.php
:- Add use statement for
Router
class to avoid class name collision.
- Add use statement for
- Add
Event
class. - Update
App
class:- Add new property
$event
(Event
class). - Refactor
log()
method.
- Add new property
- Update
Controller
class:- Add new property
$event
(Event
class).
- Add new property
- Update
Router
class:- Add
Event::dispatch()
calls in different methods. - Update
__construct()
method to add auto start functionality. - Refactor
echoResponse()
method to echo an auto-generated fallback pages for404
and405
responses.
- Add
- Update
Dumper
class:- Update HTML markup in
dumpException()
method. - Refactor
isCli()
method.
- Update HTML markup in
- Update
Config
class:- Add
Event::dispatch()
calls in different methods.
- Add
- Update
Data
class:- Add
Event::dispatch()
calls in different methods.
- Add
- Update
View
class:- Add
Event::dispatch()
calls in different methods.
- Add
- Update
helpers.php
:- Add
event()
function.
- Add
- Update
router.php
config file:- Add
allowAutoStart
config entry.
- Add
- Update
global.php
config file:- Add
includes
path to the available paths.
- Add
- Update
.htaccess.dist
- Add
includes/
to the black-listed directories
- Add
- Update
additional.php
:- Add
includes
directory path.
- Add
- Update
intellisense.php
:- Add alias for the
Event
class.
- Add alias for the
- Update
loader.php
:- Add
Event
class to the list of aliased classes. - Extract error handler and exception handler functions into variables.
- Add shutdown function.
- Add
- Update directory structure
- Add
includes/
directory.
- Add
- Add
events/system.php
. - Add
routes/web.php
. - Update
index.php
- Remove routes registration (moved to
/includes/routes/web.php
). - Add
includes
to the black-listed directories.
- Remove routes registration (moved to
- Update tests:
- Add
EventTest
class. - Update
RouterTest
class. - Fix tests namespaces to be compliant with PSR-4
- Add
- Update
composer.json
:- Update
branch-alias
.
- Update
- Update
composer.json
:- Update
branch-alias
. - Update
docs
link.
- Update
- Update
App
class:- Add
extendStatic()
method. - Refactor
log()
method.
- Add
- Update
Router
class:- Add
registerRoute()
method. - Refactor
handle()
andmiddleware()
methods to make use ofregisterRoute()
.
- Add
- Update
Globals
class:- Add
$globals
static property. - Add
$isInitialized
static property. - Add
instance()
method. - Refactor
initialize()
method.
- Add
- Update tests:
- Add new tests to the newly created methods.
- Update
App
class:- Add
extend()
method. - Add
log()
method.
- Add
- Update
Path
class:- Add
normalize()
method.
- Add
- Update
Misc
class:- Remove
log()
method (moved toApp::log()
). - Remove
getNormalizedPath()
method (moved toPath::normalize()
).
- Remove
- Update
Data
class:- Refactor
load()
method to makeConfig::$config['data']
referenceData::$bag
.
- Refactor
- Update
View
class:- Swap usage of
Misc::log()
withApp:log()
. - Swap usage of
Misc::getNormalizedPath()
withPath:normalize()
.
- Swap usage of
- Update
Config
class:- Refactor
include()
method to allow concatenating files and directories with the same name. - Refactor
include()
to exclude files that are not.php
files. - Swap usage of
Misc::log()
withApp:log()
.
- Refactor
- Update
Router
class:- Swap usage of
Misc::log()
withApp:log()
.
- Swap usage of
- Update
loader.php
:- Swap usage of
Misc::log()
withApp:log()
.
- Swap usage of
- Update
global.php
config file:- Add
logging
config entry. - Remove
loggingEnabled
config entry.
- Add
- Update tests:
- Add new tests to the newly created methods.
- Update
loader.php
:- Make autoload function use
BASE_PATH
instead ofdirname(__DIR__)
. - Update additional include paths array.
- Make autoload function use
- Update
Config
class:- Refactor
parse()
method to allow referencing items of all data types. - Refactor
include()
method to skip files/directories that have dots in their names as this will conflict with array access separator.
- Refactor
- Update
Misc
class:- Add
getObjectProperty()
method. - Add
setObjectProperty()
method. - Add
callObjectMethod()
method.
- Add
- Update
Dumper
class:- Add support for syntax highlighting in the CLI.
- Refactor various class methods.
- Add
config-dump
command.
- Update
composer.json
:- Add required PHP extensions
ext-json
andext-dom
.
- Add required PHP extensions
- Update
app-mirror
command:- Fix file permissions issues with generated files/directories.
- Fix platform related issue when removing old links.
- Update
app-serve
command:- Remove
declare(ticks=1)
execution directive that was introduced by mistake.
- Remove
- Update
autoload.php
:- Use
require()
to load./loader.php
instead ofinclude()
.
- Use
- Update
Globals
class:- Make the class final.
- Update
Config
class:- Change class constants from protected to public.
- Change
$config
property from private to protected. - Update
parse()
method to make it parse for the count of config files.
- Update
View
class:- Change class constants from protected to public.
- Update
Data
class:- Make use of
Globals
class instead of direct access to superglobals.
- Make use of
- Update
Dumper
class:- Refactor
dumpException()
method. - Update
exportExpression()
array construct to square brackets regex.
- Refactor
- Update
global.php
config file:- Add
public
path to the available paths.
- Add
- Add
cli.php
config file. - Update all commands to make use of
cli.php
config file. - Update
cache-config
command:- Rename
cache-config
toconfig-cache
.
- Rename
- Add
app-mirror
command:- Rename
cache-config
toconfig-cache
.
- Rename
- Fix typos and update DocBlocks:
- Fix some typos in DocBlocks and other parts of the codebase.
- Initial release.
- Release candidate.
- Beta release.