Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

Drop readonly database tables (was: Drop $_TABLES['dateformats'] table) #1112

Closed mystralkk closed 2 years ago

mystralkk commented 2 years ago

The $_TABLES['dateformats'] table is readonly, so it is meaningless to have the data as a database table. I suggest making the table into an array of the Locale class.

eSilverStrike commented 2 years ago

Makes sense. I guess it was put in a table to allow plugins to add more date formats?? (just guessing or maybe it was more of a potential language thing)

How about $_TABLES['cookiecodes']? (any other tables?)

I don't think that one gets touched either and it should be faster to keep it in an array.

mystralkk commented 2 years ago

As far as I know, $_TABLES['dateformats'] is just read by MediaGallery, so no plugins including the Geeklog core write into the table. I'll look into $_TABLES['cookiecodes'].

mystralkk commented 2 years ago

Converted the $_TABLES['dateformats'] table into an array of Locale class with change set 35affb8912bbf5e2b16bceb04e6a97775eb09f6e.

mystralkk commented 2 years ago

As for $_TABLES['cookiecodes'], this table is readonly, too. I'll convert this one into an array. By the way, what is the $_TABLES['maillist'] table for? This one does not seem to be used anywhere...

mystralkk commented 2 years ago

Done with change set 020cee1e549991c72ff1165215441e3613e333fa. Now, cookie codes can be obtained by calling COM_getCookieCodes().

eSilverStrike commented 2 years ago

By the way, what is the $_TABLES['maillist'] table for? This one does not seem to be used anywhere...

Never noticed that one. Maybe at some point was used with the Daily Digest by the language used in the one record it has.

Definitely should be removed.

mystralkk commented 2 years ago

Done with change set 86d3a2cd7da17d549fc1261ac9c2a0419ddb4aa0