Commit graph

12073 commits

Author SHA1 Message Date
Habeas Codice
a2d9dd1882 violates new sql standards
missed during merge
2014-11-13 13:58:04 -08:00
RedMatrix
9132a1c195 Merge pull request #690 from habeascodice/master
Initial postgres support
2014-11-14 08:52:38 +11:00
Klaus Weidenbach
e4859d4bd7 Changed two strange looking places in boot.php.
There have been two places that looked wrong, but I don't know how I can test
them. So please review and test if I am not wrong.
2014-11-13 22:40:06 +01:00
habeascodice
2dbecf9545 Merge branch 'master' of https://github.com/habeascodice/red 2014-11-13 13:30:29 -08:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -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
Jeroen
109cb93663 update nl 2014-11-13 16:27:33 +00:00
friendica
306f5d9cbe let's try this without a timeout 2014-11-13 01:04:26 -08:00
friendica
226d695525 make it a bit personal 2014-11-12 23:55:04 -08:00
friendica
1c1705e060 ok, I think I'll give it a break now. 2014-11-12 19:43:54 -08:00
friendica
a77abb0694 minor word tweaks 2014-11-12 19:04:24 -08:00
friendica
800e457290 populate initial ACL before the ajax loader gets called, just in case the form is submitted before it completes. Related to issue #615 2014-11-12 18:35:33 -08:00
friendica
a2cf1900c8 this should make all the 'sys' webpage design tools useable by the admin 2014-11-12 18:04:00 -08:00
friendica
634475164e wordsmith 2014-11-12 16:11:18 -08:00
friendica
9478fd7fd4 more minor wordsmithing 2014-11-12 16:04:49 -08:00
friendica
f41c748fe2 Some dates couldn't be verified without going way back in the archives so at least make this document accurate based on what I have in front of me. 2014-11-12 15:47:29 -08:00
friendica
c1c33a1795 Merge https://github.com/friendica/red into pending_merge 2014-11-12 15:40:31 -08:00
friendica
40e3da7b4f add history link 2014-11-12 15:40:11 -08:00
RedMatrix
f9248453fa Merge pull request #689 from dawnbreak/docu
Some Doxygen documentation.
2014-11-13 10:37:55 +11:00
friendica
f42a16ca04 Merge https://github.com/friendica/red into pending_merge 2014-11-12 15:32:15 -08:00
friendica
4e7567ffa2 History of RedMatrix, Friendica, Mike Macgirvin, and associated other stuff. 2014-11-12 15:31:24 -08:00
Klaus Weidenbach
fc2bf4c29b Some Doxygen documentation.
Add some more Doxygen formating for boot.php and dba_driver.php.
Cleaning a bit up, too.
2014-11-13 00:00:50 +01:00
friendica
498344e81f sys edit ability to menus and menu items 2014-11-12 01:43:34 -08:00
marijus
1ed144b83c make search and advanced search use the same input form 2014-11-12 10:27:13 +01:00
friendica
ada2e43ea2 extend sys support to layouts 2014-11-12 00:48:09 -08:00
friendica
9be4fcce55 uid not set in webpages.php, start on editwebpage.php 2014-11-11 22:55:24 -08:00
friendica
4b9ec6645b cleanup 2014-11-11 20:44:43 -08:00
friendica
b5af667985 slow progress on sys publishing, making sure all the data we need is in the places we need it but validate it anyway 2014-11-11 19:29:30 -08:00
friendica
37742be6af some more work on sys publishing 2014-11-11 18:57:59 -08:00
friendica
570577a990 a couple of places where we need to look for a sys channel euid. 2014-11-11 18:05:50 -08:00
friendica
06e5d0798c and urlencode that. 2014-11-11 16:09:45 -08:00
friendica
09b09dedbc Most directory searches are POST. get_query_args() only handles GET so that had to be fixed or page 2 of directory search results wouldn't match the search. 2014-11-11 16:06:16 -08:00
friendica
f2d5f23d58 Nothing here, move along. 2014-11-11 15:50:27 -08:00
friendica
3fa003b5a8 add some subtle delineation to directory entries, remove forced link on homepage element (SECURITY) 2014-11-11 15:13:18 -08:00
marijus
d145ef2021 some work on directory widgets 2014-11-11 23:09:55 +01:00
marijus
f72035ec93 tie the narrow nav-pills to .widget instead of aside 2014-11-11 21:09:05 +01:00
friendica
325b269b22 the code is a bit crufty, but this should fix issue #687 2014-11-11 01:05:29 -08:00
friendica
0a84b45793 Merge https://github.com/friendica/red into pending_merge 2014-11-10 19:22:23 -08:00
friendica
d432f4ccd5 issue #683 - don't linkify homepage field without validating 2014-11-10 19:20:23 -08:00
RedMatrix
7cd06b736a Merge pull request #685 from zzottel/master
set channel_w_stream to 0 for forum roles
2014-11-11 13:40:46 +11:00
RedMatrix
ecdfa0b96d Merge pull request #686 from beardy-unixer/master
Add a new theme flag - library.  Not directly available to be used itsel...
2014-11-11 13:40:03 +11:00
friendica
5619902776 indicate public forums in directory results (there will be some [possibly considerable] lag time before existing forums are correctly tagged). 2014-11-10 17:44:02 -08:00
friendica
6209465233 add public forum identification to libzot. No attempt is made to identify other types of forums or weird custom channel permissions. If the channel is auto-accept and taggable, it's a public forum. 2014-11-10 15:21:04 -08:00
friendica
0b4575a40b class is a reserved word 2014-11-10 14:23:06 -08:00
Thomas Willingham
9ddf49c661 Add a new theme flag - library. Not directly available to be used itself but
installed as a lib for other themes.  Like SDL, or GTK.

Get rid of mobility - it's better done with Comanche and schemas.

Describe themes instead of restricting them.  Mobile themes can be used as
the desktop theme and vice-versa.  This deals with the problem of "but my
device is something inbetween".

Presently not exposed to members.
2014-11-10 19:34:39 +00:00
zottel
e7b634f81d set channel_w_stream to 0 for forum roles 2014-11-10 12:25:35 +01:00
friendica
3b74e3c1e1 add defaults to database tables 2014-11-09 19:24:14 -08:00
friendica
2e695d1da2 menu page cleanup 2014-11-09 17:39:54 -08:00
friendica
d5d1f655d9 remove extraneous logging 2014-11-09 16:11:56 -08:00
friendica
50b9cc6f39 directory listing shows phantom keywords 2014-11-09 16:11:03 -08:00