Skip to content

Commit

Permalink
update wordpress to 5.3 and php 7.2
Browse files Browse the repository at this point in the history
* wordpress updated to >= 5.3.0
* php minimum requirement moved up to 7.2 (as per wordpress's needs)
* fix to deal with an ugly bug with php 7.1+ and pecl-memcached for sessions
* php 7.2 highlighted a few syntax errors that were fixed here
  • Loading branch information
iturgeon committed Nov 22, 2019
1 parent d63d88d commit 602548e
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 26 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
}
],
"require": {
"php": ">=5.4",
"php": ">=7.2",
"onelogin/php-saml": "2.10.2",
"monolog/monolog": "1.18.2",
"johnpbloch/wordpress": ">=5.1.1",
"johnpbloch/wordpress": ">=5.3.0",
"obojobo/obo-stats": "0.0.3",
"obojobo/rocketD": "0.0.3",
"obojobo-themes/obojobo": "0.0.3",
Expand Down
42 changes: 21 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions internal/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,22 @@ function classAutoLoader($className)
}
@include($file);
}

// Fix a bug with php7.1 + and php72-pecl-memcache which breaks the session handling w/ memcache
class PeclMemcacheBugFixForSessionsHandler extends SessionHandler
{
public function read($id)
{
$data = parent::read($id);
// the bug is a result of pecl-memcache not returning an empty string
// and that being incompatable with php 7.1's session handler
return empty($data) ? '' : $data;
}
}

if(\AppCfg::CACHE_MEMCACHE === true)
{
$sessionHandler = new PeclMemcacheBugFixForSessionsHandler();
session_set_save_handler($sessionHandler);
}
// END php72-pecl-memcache bug fix
2 changes: 1 addition & 1 deletion internal/classes/obo/log/LogManager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected function getInteractionLogs($query, $totalsOnly=false)
{
$toSection = (int) ($r->{\cfg_obo_Track::IN} == 0 ? 1 : $r->{\cfg_obo_Track::IN});
$pageIndex = '?';
if(isset($lo->pages) && count($lo->pages > 0))
if(isset($lo->pages) && count($lo->pages) > 0)
{
switch($toSection)
{
Expand Down
2 changes: 1 addition & 1 deletion internal/classes/obo/util/Cache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function clearLock($loid)
{
if($this->memEnabled)
{
$this->delete($this->ns.'\obo\Lock:'.$lock->lockID);
$this->delete($this->ns.'\obo\Lock:'.$loid);
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/classes/rocketD/auth/AuthManager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public function authenticate($requestVars, $authID=0 )
$authModList = $this->getAllAuthModules();

// loop through authmods
if(count($authModList > 0))
if(count($authModList) > 0)
{
foreach($authModList AS $authMod)
{
Expand Down

0 comments on commit 602548e

Please sign in to comment.