Commit graph

101 commits

Author SHA1 Message Date
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
3e97f71b33 allow bbcode in register_text 2014-09-11 20:03:36 -07:00
friendica
844087bc71 implement service class for feed polling frequenecy, fixed a service class bug, moved service class stuff from plugin to account.php where it belongs and load that by default instead of on demand 2014-09-03 19:07:14 -07:00
friendica
9a96ae041f make sure we don't block new folks if there's a different register policy and the hub admin turns on email verify 2014-07-09 21:13:48 -07:00
friendica
fa706c8e86 finish implementing email verification. Currently it only applies if REGISTER_OPEN is in effect. 2014-07-09 21:10:56 -07:00
friendica
eda7c24c4e improve the register text until the new register page is finished 2013-12-25 16:53:59 -08:00
friendica
ca05565fcc one step closer to merging register and pubsites pages 2013-12-22 20:07:18 -08:00
friendica
d7ee552c57 Protocol: now set data['alg'] on all encapsulated encrypted packets, so that we can more easily retire 'aes256cbc' once it is no longer viable. 2013-11-20 15:20:12 -08:00
friendica
a88437a1ef issue #107 2013-09-04 22:23:53 -07:00
friendica
62afdf3820 more register_approve stuff - like the admin page. Hopefully this won't conflict with Thomas's admin page "list users" changes 2013-02-08 03:51:31 -08:00
friendica
982034b87d update friends in common tool now that poco is working 2013-01-31 17:55:52 -08:00
friendica
7df33bb963 fix register_policy globally 2013-01-03 13:50:23 -08:00
Thomas Willingham
3b140d6e2f Fix register policy 2013-01-03 12:44:23 +00:00
friendica
dca20f4227 zchannel rename to new_channel 2012-10-29 21:59:49 -07:00
friendica
3b394ea43f comments sort of working again but now need to fix the threading which was ported when it was only half working 2012-10-25 18:42:42 -07:00
friendica
3ebb4a3dc7 updates 2012-09-09 21:17:06 -07:00
friendica
6e08f39820 simplify 2012-07-21 03:48:59 -07:00
friendica
0165d5dd2c registration issue after re-factor 2012-06-01 15:42:13 -07:00
friendica
93bc29a711 turn registration code into a standalone function for re-use 2012-05-31 19:06:17 -07:00
friendica
7d77cfef56 Create a "potential default group" called "Friends" on registration. 2012-05-30 04:20:01 -07:00
friendica
afaf9ec74f rev update 2012-05-20 18:30:02 -07:00
Klaus Weidenbach
1f9fe8b5ee Remove Gravatar from core and add new hook avatar_lookup.
This patch removes all occurances of Gravatar from friendica's core and adds a new hook "avatar_lookup" inside the function avatar_img($email) where the new *avatar-plugins should hook in.
I haven't touched the language files yet. Are they updated automatically somehow?
2012-04-09 21:22:09 +02:00
Klaus Weidenbach
93ffba58cc Rename gravatar_img() more generic to avatar_img().
I would like to extend the Gravatar support to also use Libravatar, a decentralized avatar service.
First step to extract Gravatar from core and put it into its own plugin. Later the Libravatar plugin can be done, too as a plugin.
2012-04-09 21:22:09 +02:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
friendica
2147e0a71f ensure all new users get a timezone. We'll use UTC until they choose otherwise. 2012-03-31 16:08:40 -07:00
friendica
adebc2793e register hooks for a COPA plugin 2012-03-31 06:15:33 -07:00
friendica
ebdf0ee99e prevent re-registrations using a deleted username - not an issue with Friendica but could create a serious privacy issue with federated platforms 2012-03-22 01:46:52 -07:00
friendica
c0c0f2dc15 add closeness attribute 2012-01-31 23:54:53 -08:00
friendica
8aa2552372 add remove_user hook (it looks like dreamhost changed all my file permissions, this will make a nasty commit) 2012-01-18 16:21:30 -08:00
friendica
d9ede7f7bd implement max daily registrations 2011-12-20 20:12:29 -08:00
friendica
102ea901c3 cannot register at all when multiple_pages is not allowed 2011-12-09 16:50:13 -08:00
Friendika
573670fa0c more social graph stuff 2011-11-01 16:08:07 -07:00
Friendika
6a9e22550d . 2011-09-24 05:45:34 -07:00
Friendika
b28b468b21 cleanup 2011-08-16 20:05:02 -07:00
Friendika
1eec10329a guid functions 2011-08-07 16:56:26 -07:00
Friendika
2637831d90 some more zot changes migrating back to f9a mainline 2011-08-01 21:02:25 -07:00
Friendika
b27d68633b register hook 2011-07-19 23:10:09 -07:00
Friendika
c0b8e63a3f basic diaspora discovery 2011-07-18 18:13:46 -07:00
Friendika
1fa2231c20 invite system 2011-07-17 21:12:31 -07:00
Friendika
2d2b500639 input the admin email address during install/setup. 2011-07-07 19:12:35 -07:00
Friendika
ae0275ec2c collapse multiple spaces in usernames 2011-06-29 19:26:18 -07:00
Friendika
040fc247a0 bug #85 2011-05-23 20:30:37 -07:00
Fabio Comuni
e1107b55c6 add info() function. Works like notice() but show messages in a div with class info-message.
update code to use info() instead of notice() when appropriate (non-error message)
add info-message class style in themes
2011-05-23 11:39:57 +02:00
Friendika
b2e92e0af3 deprecate load_view_file 2011-05-11 04:37:13 -07:00
Friendika
5eea0d5ecb photo lockview not working, temp fix for po2php 2011-05-10 20:10:13 -07:00
Friendika
c052d68828 don't use load_view_file() except in email templates and install of htconfig - to avoid getting wrong file when package is updated by copying over an older version. 2011-05-10 16:12:50 -07:00
Friendika
de131c9e58 set utf-8 on all emails 2011-04-14 17:13:13 -07:00
Friendika
17a7dae67d doco 2011-04-13 16:58:21 -07:00
Friendika
6728a11ee3 support feed attachments/enclosures, and fix for bug #30 2011-04-06 19:42:35 -07:00
Friendika
6bc5d6f17b repair duplicate nickname accounts caused by race condition 2011-03-24 15:45:27 -07:00