Update to php7 and PDO
Needs ReviewPublic

Authored by ognarb on Sun, Sep 1, 11:49 AM.

Details

Summary

Move planet feed reader to Feed class

Test Plan

Not tested yet

Diff Detail

Branch
/trunk/www/sites/www
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16815
Build 16833: arc lint + arc unit
ognarb requested review of this revision.Sun, Sep 1, 11:49 AM
ognarb created this revision.
ognarb updated this revision to Diff 65182.Sun, Sep 1, 10:12 PM

Add my copyright to aetherlibs/feeds.php

Aside from the comments above, this looks fine.
Are all other parts of the codebase good to go from the perspective of PHP7? (including the Paypal donations stuff?)

aetherlibs/DB.php
21 ↗(On Diff #65182)

Just curious, what is this trying to do?

We already make sure that the path containing the files with the credentials is in the PHP include_path (as part of the general server setup) so no explicit code for that is needed.

24 ↗(On Diff #65182)

We should probably use UTC for this.

ognarb updated this revision to Diff 65233.Mon, Sep 2, 12:20 PM
ognarb marked 2 inline comments as done.
  • Update fundraisers/yearend2017

@bcooksley Can you send me the content of fundraisers/yearend2016/donations_auth.inc with the password removed? Same probably for other directory in fundraisers.

aetherlibs/DB.php
21 ↗(On Diff #65182)

This was in the original code of the DB class, I will remove it.

ognarb updated this revision to Diff 65387.Wed, Sep 4, 9:41 PM

More fundraiser pages update to php7 and PDO

ognarb updated this revision to Diff 65389.Wed, Sep 4, 9:56 PM

Fix fundraisers/*/stat.php

ognarb updated this revision to Diff 65412.Thu, Sep 5, 11:05 AM

More conversion to pdo

Remaining file is community/donations/statistics/index.php

One of the current outstanding issues with the KDE.org site is that it uses not one or two, but three different configuration files for the same database details.
These probably need to be unified.

The current content of donations_auth.inc is as follows:

<?php

$host = "localhost";
$db = "kdeorg";
$user = "kdeorg";
$pass = "<removed>";

$sq = mysql_connect($host,$user,$pass);
mysql_select_db($db);
mysql_set_charset('utf8', $sq);

?>

The contents of db_auth.inc is as follows:

<?php

$db_username = "kdeorg";
$db_password = "<removed>";
$db_database = "kdeorg";

?>

and finally, the contents of config.php is as follows:

<?php
$currency = 'EUR';
$kdeEvMail = "kde-ev-board@kde.org";
$dbhost = '<removed';
$dbuser = 'kdeorg';
$dbpass = '<removed>';
$dbname = 'kdeorg';
$dbConnection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die (mysqli_connect_error());

?>
ognarb updated this revision to Diff 66509.Thu, Sep 19, 9:28 PM

Fix notify.php with php7

ognarb planned changes to this revision.Thu, Sep 19, 9:38 PM

There was so many error/warning in community/donations/graph.php that I decided to rewrite it using graph.js

I tested the paypal code using the sandbox and it works :)

TODO:

  • remove all the notify.php
  • Unify the database access to the following config.php located in capacity/includes:
<?php

$currency = 'EUR';
$kdeEvMail = "kde-ev-board@kde.org";
$dbhost = 'localhost';
$dbuser = 'kdeorg';
$dbpass = '';
$dbname = 'kdeorg';

$dbConnection = new PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass);
  • Write fixtures for all the donation compaign for testing purpose disabled by default (see setup-db.php)
  • Fix the error I just found ;)
fundraisers/yearend2016/index.php
26–27

query not used

64–65

I forgot execute()

aacid added inline comments.Thu, Sep 19, 9:52 PM
aetherlibs/DB.php
5 ↗(On Diff #66509)

Affero isn't really one of our "approved" licenses https://community.kde.org/Policies/Licensing_Policy

community/donations/index.php
59 ↗(On Diff #66509)

you left the sandbox here

69 ↗(On Diff #66509)

and here

community/donations/notify.php
43

and here

ognarb updated this revision to Diff 66510.Thu, Sep 19, 9:58 PM
  • Remove DB.php (not used anymore)
  • Cache request to planet rss feed

@aacid I see in the licensing policies that the AGPL is recommended for stuff running on a server and some part of capacity (where the first version of this file was copied) are licensed under AGPL. I deleted this file since it is not needed anymore.

ognarb updated this revision to Diff 66512.Thu, Sep 19, 10:04 PM

Remove sandbox

aacid added inline comments.Thu, Sep 19, 10:05 PM
aetherlibs/DB.php
5 ↗(On Diff #66509)

Actually it is, the thing only says AGPL and no Affero so my search failed ^_^

ognarb marked 5 inline comments as done.Thu, Sep 19, 10:05 PM

Thanks for your continue work on this Carl! Just one thing I spotted while having a look through...

community/donations/graph.php
6

Given we're in 2019 maybe we should increase the limit to something like 2030?

aacid added a comment.Sat, Sep 21, 6:01 PM

is there anything this is waiting on? otherwise i'd just commit it and be aware thing changed in case something breaks and fix it fast

community/donations/notify.php
34

do we need this?

59

i think we're always running in debug (double check with ben, so no need to have these error_log calls?)

67

this doesn't seem like an error