Commit graph

24 commits

Author SHA1 Message Date
Mike Macgirvin
864e6f19fa code cleanup 2022-08-14 19:20:43 +10:00
Mike Macgirvin
67a3365cc8 ensure App::$sys_channel is set for all processes, both web and cli. 2022-05-10 15:33:56 -07:00
nobody
d46dd6aeb8 psr12 rewrites, continued 2021-12-03 14:01:39 +11:00
zotlabs
7428e1358e cleanup 2019-05-14 22:16:49 -07:00
redmatrix
096fdfc61b consolidate all the sys_boot functionality that is common between the web server and the cli daemon manager. Get rid of yet another global variable ($default_timezone) whilst doing so. 2016-05-26 16:33:01 -07:00
redmatrix
da19ac98dd Just set it and forget it. 2016-05-25 13:46:19 -07:00
redmatrix
516c43ba15 more work associated with DBA and index.php shuffle 2016-05-24 17:54:45 -07:00
redmatrix
84ba6393ad relocate index and db 2016-05-24 16:36:55 -07:00
redmatrix
2dcedd6951 more work on sessions and cookies, as some anomalies appeared in caldav and firefox which suggested deeper issues 2016-05-16 17:07:39 -07:00
redmatrix
d62f490814 Setup was horked after this commit and I couldn't easily make it right so reverting - will try again at a future date
Revert "remove global db variable"

This reverts commit c3b0c0f32a.
2016-04-25 20:12:36 -07:00
redmatrix
c3b0c0f32a remove global db variable 2016-04-25 16:55:33 -07:00
redmatrix
9b66b5eee3 objectify all the session management stuff 2016-04-08 04:44:10 -07:00
redmatrix
44283dbbbb change the App constructor 2016-03-31 20:24:30 -07:00
redmatrix
0cda431456 create miniApp to convert existing settings files to the static App class 2016-03-31 20:15:47 -07:00
redmatrix
9abd95fad3 static App 2016-03-31 16:06:03 -07:00
redmatrix
b4e3cd000f rev update 2016-02-05 00:06:35 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
f8468b4c3a allow custom role permissions and fix site timezone. 2014-09-29 23:36:41 -07:00
friendica
f835737cb7 fix some anomolies in config functions 2013-06-21 21:36:48 -07:00
friendica
6f7e002922 add db_port to setup and cli_startup - still need to set the port in mod/setup 2013-05-10 03:37:41 -07:00
friendica
552f03122c db abstraction layer 2013-04-22 20:02:21 -07:00
friendica
ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
friendica
c6b8ab534f fixed several little nit bugs that cropped up during deployment 2012-12-06 00:03:24 -08:00
friendica
a7abe24382 more file cleanup 2012-10-22 19:46:18 -07:00