Commit Graph

215 Commits

Author SHA1 Message Date
Hugo Sales
3a6b4cca1e [CORE][DATABASE] Replace zero dates with CURRENT_TIMESTAMP and add defaults to all 'created' or 'modified'
This commit is a port from v2's 9a515b9234 ([SCHEMA] Improve timestamp storage) to v3.

As explained by Alexei Sorokin:

Avoid the use of deprecated MariaDATABASE "zero dates" globally. If they're present
as attribute defaults somewhere, they will be replaced with NULL implicitly.
The existing "zero dates" in MariaDATABASE storage will be left intact and this
should not present any issues.

The "timestamp" type in table definitions now corresponds to DATETIME in
MariaDATABASE with "DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", which
should be close enough to the original behaviour for compatibility purposes.
It is now the recommended type for "modified" attributes, because of the
update trigger on MariaDATABASE. But there is no such trigger implemented on
PostgreSQL as of this moment.
2021-04-14 15:37:21 +00:00
Hugo Sales
6fe35833e7 [CORE][DATABASE] Restructure the database 2021-04-14 15:37:21 +00:00
Hugo Sales
4b4f235481 [ROUTE][ADMIN][CONFIG] Add route to update values in the config table 2021-04-14 15:37:21 +00:00
Hugo Sales
6c0c84c284 [DEFAULTS] Small fixes and add check of SOCIAL_NO_RELOAD_DEFAULTS from the environment, to override the reloading of default values 2021-04-14 15:37:21 +00:00
Hugo Sales
26c966084a [DOCUMENTATION] Fixed type annotations and documentation of Common::size_str_to_int 2021-04-14 15:37:21 +00:00
Hugo Sales
bf92c44d81 [CORE][Event] Move GSEvent to Event, no longer a name collision 2021-04-14 15:37:21 +00:00
Hugo Sales
07422c4e1a [FORM] Added Symfony Form wrapper 2021-04-14 15:37:21 +00:00
Hugo Sales
6e6e50939b [CORE][Symfony] Fixed deprecation resultant from Symfony 5.1 upgrade
User Deprecated: Since symfony/framework-bundle 5.1: Using type
"Symfony\Component\Routing\RouteCollectionBuilder" for argument 1 of
method "App\Kernel:configureRoutes()" is deprecated, use
"Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator"
instead.
2021-04-14 15:37:21 +00:00
Hugo Sales
15cf498e75 [I18N] Fix implementation of I18nHelper::formatICU 2021-04-14 15:37:21 +00:00
Hugo Sales
377965d100 [ROUTES] Add easier support for using TemplateController and improved documentation 2021-04-14 15:37:21 +00:00
Hugo Sales
c9b0e994c1 [I18N] Small fixes. Still broken, though :') 2021-04-14 15:37:21 +00:00
Hugo Sales
652c3b5d62 [DEPENDENCY] Upgrade Symfony framework from 5.0 to 5.1 2021-04-14 15:37:21 +00:00
Hugo Sales
26be897578 [I18N] Overhaul _m() implementation to support ICU message formats 2021-04-14 15:37:21 +00:00
Hugo Sales
3108d82a4d [I18N] Added ability to call _m_dynamic from any class, allowing it to define translations for dynamic-valued calls to _m 2021-04-14 15:37:21 +00:00
Hugo Sales
a8cd9034ff [I18N] Custom translation extractor based on Symfony's PhpExtractor, since we use instead of 2021-04-14 15:37:21 +00:00
Hugo Sales
d73840352b [I18N] Refactor since rfc/use-static-function is not implemented
As the above mentioned RFC is not implemented, `_m` needs to be
outside of the I18n class, otherwise it would have to always be called
with `I18n::_m`.
2021-04-14 15:37:21 +00:00
Hugo Sales
766eac8467 [ROUTES] Add static wrapper around Symfony's router 2021-04-14 15:37:20 +00:00
Hugo Sales
0fe5ae7675 [CORE] Refactoring core 2021-04-14 15:37:20 +00:00
Hugo Sales
66c4ab7e24 [UI][CONFIG] Added admin configuration form 2021-04-14 15:37:20 +00:00
Hugo Sales
34f49edf2c [I18N] Fix i18n and add default domain 'Core' 2021-04-14 15:37:20 +00:00
Hugo Sales
27bb76706c [DEFAULTS] Fix default config loading logic 2021-04-14 15:37:20 +00:00
Hugo Sales
ce00acdb39 [TOOLS] Fixed all licence blocks, to use the same, foldable, format 2021-04-14 15:37:20 +00:00
Hugo Sales
d2f49e56bc [DOCUMENTATION][DEFAULTS] Documented all defaults and updated some. Restructured other documentation. 2021-04-14 15:37:20 +00:00
Hugo Sales
520989bc59 [DEFAULTS] Remove deprecated defaults and convert them to snake_case 2021-04-14 15:37:20 +00:00
Hugo Sales
ccc0d7d401 [DATABASE] Change the way defaults are loaded, bulk insert, reload everything in debug mode, only on http requests (not command line) 2021-04-14 15:37:20 +00:00
Hugo Sales
b0fece57ea [DATABASE] Fix 'relation config doesn't exist' 2021-04-14 15:37:20 +00:00
Hugo Sales
7dda377a79 [DATABASE] Postgres doesn't understand '0000-00-00 00:00:00' for datetime, use '-infinity' 2021-04-14 15:37:20 +00:00
Hugo Sales
074797384d [DATABASE][CONFIG] Loading defaults into database, doctrine static wrapper 2021-04-14 15:37:20 +00:00
Hugo Sales
7718b167c3 [DATABASE][CONFIG] Bring default configs from V2 and implement DATABASE wrapper 2021-04-14 15:37:20 +00:00
Hugo Sales
40ec37bd27 [CORE][UTIL] Moved classes from util to core
And splitted up Common
2021-04-14 15:37:20 +00:00
Hugo Sales
0d5f66e8b8 [FORMATTING] Cherry-pick of Diogo's 763ac735c0758624ebd5957993dc0676b865927a 2021-04-14 15:37:20 +00:00
Diogo Cordeiro
4efbf9361c [DOCUMENTATION][TOOL] Small bug fixes and docblock elaboration 2021-04-14 15:37:20 +00:00
Hugo Sales
87a768ac8d [CORE] Rename GNU social constants 2021-04-14 15:37:09 +00:00
Hugo Sales
3b5789639b [TOOLS][DOCUMENTATION] Improvements to entity generation script 2021-04-14 15:36:35 +00:00
Hugo Sales
c2add5e1d1 [UTIL] Wrote HTML library to convert arrays to html 2021-04-14 15:36:35 +00:00
Hugo Sales
3ad81ab730 [DATABASE] Changed the type of the 'id' field of the ProfileList table from serial to int, as doctrine complains otherwise 2021-04-14 15:36:35 +00:00
Hugo Sales
160b811669 [DATABASE][AUTOCODE] Update autocode to use \DateTimeInterface instead of DateTime 2021-04-14 15:36:35 +00:00
Hugo Sales
57298da60e [SCHEMADEF] Bug fixes 2021-04-14 15:36:35 +00:00
Hugo Sales
d14ac1edf6 [DATABASE] Add missing table names 2021-04-14 15:36:35 +00:00
Hugo Sales
8ca49ab511 [MODULES] Fix small error in modules manager 2021-04-14 15:36:35 +00:00
Hugo Sales
04202b59ef [DATABASE][AUTOCODE] Autogenerated fields, setters and getters for each entity 2021-04-14 15:36:35 +00:00
Hugo Sales
36bc871c65 [TOOLS] Change autocode tag to allow editor folding 2021-04-14 15:36:35 +00:00
Hugo Sales
1589f6e26f [DATABASE] Removed calls to common_config 2021-04-14 15:36:35 +00:00
Hugo Sales
b52f0c795e [FORMATTING] Changed license block format to allow folding 2021-04-14 15:36:35 +00:00
Hugo Sales
8f13d331ad [DATABASE] Extracted schemaDef method from old files and refactored onto new files 2021-04-14 15:36:35 +00:00
Hugo Sales
b46e3d5bf4 [COMMON] Added toCamelCase and toSnakeCase functions 2021-04-14 15:36:35 +00:00
Hugo Sales
e3ef58bd8e [CORE][DATABASE] Import old classes folder into src/Entity 2021-04-14 15:36:35 +00:00
Hugo Sales
57f7f40fa9 [DATABASE] Remove testing entity 2021-04-14 15:36:35 +00:00
Hugo Sales
1caab62200 [MODULES] Rename extensions to modules, add example plugin, change plugin location 2021-04-14 15:36:35 +00:00
Hugo Sales
6c8da48efa [DOCUMENTATION] Document All The Things! 2021-04-14 15:36:35 +00:00
Hugo Sales
10a304ab83 [CORE][ROUTES] Implemented custom router, with an interface similar to the old one, which allows routes to be seperated into files 2021-04-14 15:36:35 +00:00
Hugo Sales
a1d83bd2a8 [COMMAND][EVENTS] Added command to list events and handlers, and search by regex 2021-04-14 15:36:35 +00:00
Hugo Sales
df6da4d941 [CORE][COMMAND] Register internal structures on command event 2021-04-14 15:36:35 +00:00
Hugo Sales
d8d2ad3e10 [CORE][EXTENSIONS] Added extension (modules, plugins) loading and test plugin, which is able to handle events 2021-04-14 15:36:35 +00:00
Hugo Sales
2f5bdeed62 [CORE][SCHEMADEF] Clean up SchemaDef compiler pass 2021-04-14 15:36:35 +00:00
Hugo Sales
40b0812d9b [CS-FIXER] Updated cs-fixer rules and added a temporary exception to the src/Entity folder (awaiting pr merge) 2021-04-14 15:36:35 +00:00
Hugo Sales
26ea268fed [DOCTRINE][SCRIPT] Created a script to generate the class fields and accessors from the schema definition 2021-04-14 15:36:35 +00:00
Hugo Sales
04a5d2bfef [DOCTRINE][SCHEMADEF] Small refactoring 2021-04-14 15:36:35 +00:00
Hugo Sales
06d76a649f [CORE][DOCTRINE] Implement SchemaDefDriver, which transforms the old syntax from to doctrine's metadata 2021-04-14 15:36:35 +00:00
Hugo Sales
6546c088d9 [DOCTRINE][SCHEMADEF] Create a new metadata driver to allow us to continue using static schemaDef functions
This has the benefit of requiring fewer code changes, as well as providing a better isolation
between GNU social and symfony, useful in case the framework needs to be changed
2021-04-14 15:36:35 +00:00
Hugo Sales
027726205d [CORE][I18N] Fix the translation system 2021-04-14 15:36:35 +00:00
Hugo Sales
4d2b8c26fa [CORE][I18N] Port the translation system to rely on symfony's 2021-04-14 15:36:35 +00:00
Hugo Sales
cc47efe4b5 [CORE][EVENTS] Bring existing Events and Boostrapper back
- Adapt the existing event system to rely on Symfony's event dispatcher
2021-04-14 15:36:35 +00:00
Hugo Sales
c0e53ae658 [CORE][ROUTES] Example route 2021-04-14 15:36:35 +00:00
Hugo Sales
86b5bfe075 [V3] Big Bang
Beginning anew, this time with a modern framework: symfony
2021-04-14 15:36:35 +00:00