Skip to content

Commit

Permalink
Merge pull request #66 from alexiskulash/master
Browse files Browse the repository at this point in the history
PHP 7 Compatibility Changes
  • Loading branch information
radgeek committed Sep 24, 2016
2 parents 30028f9 + 8a0435d commit 4f98470
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 13 deletions.
6 changes: 5 additions & 1 deletion admin-ui.php
Expand Up @@ -14,7 +14,7 @@ class FeedWordPressAdminPage {
* *
* @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings * @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings
*/ */
function FeedWordPressAdminPage ($page = 'feedwordpressadmin', $link = NULL) { function __construct( $page = 'feedwordpressadmin', $link = NULL ) {
$this->link = $link; $this->link = $link;


// Set meta-box context name // Set meta-box context name
Expand All @@ -24,6 +24,10 @@ function FeedWordPressAdminPage ($page = 'feedwordpressadmin', $link = NULL) {
endif; endif;
} /* FeedWordPressAdminPage constructor */ } /* FeedWordPressAdminPage constructor */


function FeedWordPressAdminPage( $page = 'feedwordpressadmin', $link = NULL ) {
self::__construct( $page, $link );
}

function pageslug () { function pageslug () {
$slug = preg_replace('/FeedWordPress(.*)Page/', '$1', get_class($this)); $slug = preg_replace('/FeedWordPress(.*)Page/', '$1', get_class($this));
return strtolower($slug); return strtolower($slug);
Expand Down
6 changes: 5 additions & 1 deletion authors-page.php
Expand Up @@ -5,7 +5,7 @@ class FeedWordPressAuthorsPage extends FeedWordPressAdminPage {
var $authorlist = NULL; var $authorlist = NULL;
var $rule_count = 0; var $rule_count = 0;


function FeedWordPressAuthorsPage ($link = -1) { function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) : if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link(); $link = FeedWordPressAdminPage::submitted_link();
endif; endif;
Expand All @@ -21,6 +21,10 @@ function FeedWordPressAuthorsPage ($link = -1) {
'open-sheet' => 'Syndicated Author', 'open-sheet' => 'Syndicated Author',
); );
} }

function FeedWordPressAuthorsPage( $link = -1 ) {
self::__construct( $link );
}


function refresh_author_list () { function refresh_author_list () {
$this->authorlist = fwp_author_list(); $this->authorlist = fwp_author_list();
Expand Down
6 changes: 5 additions & 1 deletion categories-page.php
Expand Up @@ -2,7 +2,7 @@
require_once(dirname(__FILE__) . '/admin-ui.php'); require_once(dirname(__FILE__) . '/admin-ui.php');


class FeedWordPressCategoriesPage extends FeedWordPressAdminPage { class FeedWordPressCategoriesPage extends FeedWordPressAdminPage {
function FeedWordPressCategoriesPage ($link = -1) { function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) : if (is_numeric($link) and -1 == $link) :
$link = $this->submitted_link(); $link = $this->submitted_link();
endif; endif;
Expand All @@ -17,6 +17,10 @@ function FeedWordPressCategoriesPage ($link = -1) {
$this->filename = __FILE__; $this->filename = __FILE__;
} }


function FeedWordPressCategoriesPage( $link = -1 ) {
self::__construct( $link );
}

function unfamiliar_category_label ($name) { function unfamiliar_category_label ($name) {
if (preg_match('/^create:(.*)$/', $name, $refs)) : if (preg_match('/^create:(.*)$/', $name, $refs)) :
$tax = get_taxonomy($refs[1]); $tax = get_taxonomy($refs[1]);
Expand Down
6 changes: 5 additions & 1 deletion diagnostics-page.php
Expand Up @@ -2,7 +2,7 @@
require_once(dirname(__FILE__) . '/admin-ui.php'); require_once(dirname(__FILE__) . '/admin-ui.php');


class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage { class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
function FeedWordPressDiagnosticsPage () { function __construct() {
// Set meta-box context name // Set meta-box context name
FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressdiagnosticspage'); FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressdiagnosticspage');
$this->dispatch = 'feedwordpress_diagnostics'; $this->dispatch = 'feedwordpress_diagnostics';
Expand All @@ -12,6 +12,10 @@ function FeedWordPressDiagnosticsPage () {
add_action('feedwordpress_diagnostics_do_http_test', array($this, 'do_http_test'), 10, 1); add_action('feedwordpress_diagnostics_do_http_test', array($this, 'do_http_test'), 10, 1);
} }


function FeedWordPressDiagnosticsPage() {
self::__construct();
}

function has_link () { return false; } function has_link () { return false; }


function display () { function display () {
Expand Down
6 changes: 5 additions & 1 deletion feedfinder.class.php
Expand Up @@ -37,7 +37,7 @@ class FeedFinder {
var $_obvious_feed_url = array('[./]rss', '[./]rdf', '[./]atom', '[./]feed', '\.xml'); var $_obvious_feed_url = array('[./]rss', '[./]rdf', '[./]atom', '[./]feed', '\.xml');
var $_maybe_feed_url = array ('rss', 'rdf', 'atom', 'feed', 'xml'); var $_maybe_feed_url = array ('rss', 'rdf', 'atom', 'feed', 'xml');


function FeedFinder ($uri = NULL, $params = array(), $fallbacks = 3) { function __construct( $uri = NULL, $params = array(), $fallbacks = 3 ) {
if (is_bool($params)) : if (is_bool($params)) :
$params = array("verify" => $params); $params = array("verify" => $params);
endif; endif;
Expand All @@ -59,6 +59,10 @@ function FeedFinder ($uri = NULL, $params = array(), $fallbacks = 3) {
$this->fallbacks = $fallbacks; $this->fallbacks = $fallbacks;
} /* FeedFinder::FeedFinder () */ } /* FeedFinder::FeedFinder () */


function FeedFinder( $uri = NULL, $params = array(), $fallbacks = 3 ) {
self::__construct( $uri, $params, $fallbacks );
}

function find ($uri = NULL, $params = array()) { function find ($uri = NULL, $params = array()) {
$params = wp_parse_args($params, array( // Defaults $params = wp_parse_args($params, array( // Defaults
"authentication" => -1, "authentication" => -1,
Expand Down
6 changes: 5 additions & 1 deletion feeds-page.php
Expand Up @@ -83,7 +83,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
* *
* @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings * @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings
*/ */
function FeedWordPressFeedsPage ($link = -1) { function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) : if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link(); $link = FeedWordPressAdminPage::submitted_link();
endif; endif;
Expand All @@ -102,6 +102,10 @@ function FeedWordPressFeedsPage ($link = -1) {
$this->special_settings = apply_filters('syndicated_feed_special_settings', $this->special_settings, $this); $this->special_settings = apply_filters('syndicated_feed_special_settings', $this->special_settings, $this);
} /* FeedWordPressFeedsPage constructor */ } /* FeedWordPressFeedsPage constructor */


function FeedWordPressFeedsPage( $link = -1 ) {
self::__construct( $link );
}

function display () { function display () {
global $fwp_post; global $fwp_post;
global $post_source; global $post_source;
Expand Down
6 changes: 5 additions & 1 deletion feedtime.class.php
Expand Up @@ -24,10 +24,14 @@ class FeedTime {
var $rep; var $rep;
var $ts; var $ts;


function FeedTime ($time) { function __construct( $time ) {
$this->set($time); $this->set($time);
} /* FeedTime constructor */ } /* FeedTime constructor */


function FeedTime( $time ) {
self::__construct( $time );
}

function set ($time, $recurse = false) { function set ($time, $recurse = false) {
$this->rep = $time; $this->rep = $time;
$this->ts = NULL; $this->ts = NULL;
Expand Down
6 changes: 5 additions & 1 deletion magpiefromsimplepie.class.php
Expand Up @@ -66,7 +66,7 @@ class MagpieFromSimplePie {
* @uses MagpieFromSimplePie::normalize * @uses MagpieFromSimplePie::normalize
* @uses MagpieFromSimplePie::is_atom * @uses MagpieFromSimplePie::is_atom
*/ */
function MagpieFromSimplePie ($pie, $item = true) { function __construct( $pie, $item = true ) {
$this->pie = $pie; $this->pie = $pie;


// item in {NULL, true} = process channel data // item in {NULL, true} = process channel data
Expand Down Expand Up @@ -95,6 +95,10 @@ function MagpieFromSimplePie ($pie, $item = true) {
$this->feed_version = $this->feed_version(); $this->feed_version = $this->feed_version();
$this->encoding = $pie->get_encoding(); $this->encoding = $pie->get_encoding();
} /* MagpieFromSimplePie constructor */ } /* MagpieFromSimplePie constructor */

function MagpieFromSimplePie( $pie, $item = true ) {
self::__construct( $pie, $item );
}


/** /**
* MagpieFromSimplePie::get_items: returns an array of MagpieRSS format arrays * MagpieFromSimplePie::get_items: returns an array of MagpieRSS format arrays
Expand Down
6 changes: 5 additions & 1 deletion magpiemocklink.class.php
Expand Up @@ -4,7 +4,7 @@
class MagpieMockLink extends SyndicatedLink { class MagpieMockLink extends SyndicatedLink {
var $url; var $url;


function MagpieMockLink ($rss, $url) { function __construct( $rss, $url ) {
$this->link = $rss; $this->link = $rss;


if (is_array($rss) and isset($rss['simplepie']) and isset($rss['magpie'])) : if (is_array($rss) and isset($rss['simplepie']) and isset($rss['magpie'])) :
Expand All @@ -22,6 +22,10 @@ function MagpieMockLink ($rss, $url) {
); );
} /* function MagpieMockLink::MagpieMockLink () */ } /* function MagpieMockLink::MagpieMockLink () */


function MagpieMockLink( $rss, $url ) {
self::__construct( $rss, $url );
}

function poll ($crash_ts = NULL) { function poll ($crash_ts = NULL) {
// Do nothing but update copy of feed // Do nothing but update copy of feed
$this->simplepie = FeedWordPress::fetch($this->url); $this->simplepie = FeedWordPress::fetch($this->url);
Expand Down
6 changes: 5 additions & 1 deletion performance-page.php
Expand Up @@ -2,13 +2,17 @@
require_once(dirname(__FILE__) . '/admin-ui.php'); require_once(dirname(__FILE__) . '/admin-ui.php');


class FeedWordPressPerformancePage extends FeedWordPressAdminPage { class FeedWordPressPerformancePage extends FeedWordPressAdminPage {
function FeedWordPressPerformancePage () { function __construct() {
// Set meta-box context name // Set meta-box context name
FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressperformancepage'); FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressperformancepage');
$this->dispatch = 'feedwordpress_performance'; $this->dispatch = 'feedwordpress_performance';
$this->filename = __FILE__; $this->filename = __FILE__;
} }


function FeedWordPressPerformancePage() {
self::__construct();
}

function has_link () { return false; } function has_link () { return false; }


function display () { function display () {
Expand Down
6 changes: 5 additions & 1 deletion posts-page.php
Expand Up @@ -11,7 +11,7 @@ class FeedWordPressPostsPage extends FeedWordPressAdminPage {
* *
* @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings * @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings
*/ */
function FeedWordPressPostsPage ($link = -1) { function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) : if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link(); $link = FeedWordPressAdminPage::submitted_link();
endif; endif;
Expand All @@ -28,6 +28,10 @@ function FeedWordPressPostsPage ($link = -1) {
); );
} /* FeedWordPressPostsPage constructor */ } /* FeedWordPressPostsPage constructor */


function FeedWordPressPostsPage( $link = -1 ) {
self::__construct( $link );
}

function save_settings ($post) { function save_settings ($post) {
// custom post settings // custom post settings
$custom_settings = $this->custom_post_settings(); $custom_settings = $this->custom_post_settings();
Expand Down
6 changes: 5 additions & 1 deletion syndicatedlink.class.php
Expand Up @@ -43,7 +43,7 @@ class SyndicatedLink {
public $simplepie = null; public $simplepie = null;
var $magpie = null; var $magpie = null;


function SyndicatedLink ($link) { function __construct( $link ) {
global $wpdb; global $wpdb;


if (is_object($link)) : if (is_object($link)) :
Expand All @@ -61,6 +61,10 @@ function SyndicatedLink ($link) {
add_filter('feedwordpress_update_complete', array($this, 'process_retirements'), 1000, 1); add_filter('feedwordpress_update_complete', array($this, 'process_retirements'), 1000, 1);
} /* SyndicatedLink::SyndicatedLink () */ } /* SyndicatedLink::SyndicatedLink () */


function SyndicatedLink( $link ) {
self::__construct( $link );
}

function found () { function found () {
return is_object($this->link) and !is_wp_error($this->link); return is_object($this->link) and !is_wp_error($this->link);
} /* SyndicatedLink::found () */ } /* SyndicatedLink::found () */
Expand Down
6 changes: 5 additions & 1 deletion updatedpostscontrol.class.php
@@ -1,10 +1,14 @@
<?php <?php
class UpdatedPostsControl { class UpdatedPostsControl {
var $page; var $page;
function UpdatedPostsControl (&$page) { function __construct( &$page ) {
$this->page =& $page; $this->page =& $page;
} /* UpdatedPostsControl constructor */ } /* UpdatedPostsControl constructor */


function UpdatedPostsControl( &$page ) {
self::__construct( $page );
}

function display () { function display () {
$settings = array( $settings = array(
// This is all bass-ackwards because the actual yes/no // This is all bass-ackwards because the actual yes/no
Expand Down

0 comments on commit 4f98470

Please sign in to comment.