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
Original file line number Diff line number Diff line change
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
*/
function FeedWordPressAdminPage ($page = 'feedwordpressadmin', $link = NULL) {
function __construct( $page = 'feedwordpressadmin', $link = NULL ) {
$this->link = $link;

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

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

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

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

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

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

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

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

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

class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
function FeedWordPressDiagnosticsPage () {
function __construct() {
// Set meta-box context name
FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressdiagnosticspage');
$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);
}

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

function has_link () { return false; }

function display () {
Expand Down
6 changes: 5 additions & 1 deletion feedfinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FeedFinder {
var $_obvious_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)) :
$params = array("verify" => $params);
endif;
Expand All @@ -59,6 +59,10 @@ function FeedFinder ($uri = NULL, $params = array(), $fallbacks = 3) {
$this->fallbacks = $fallbacks;
} /* FeedFinder::FeedFinder () */

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

function find ($uri = NULL, $params = array()) {
$params = wp_parse_args($params, array( // Defaults
"authentication" => -1,
Expand Down
6 changes: 5 additions & 1 deletion feeds-page.php
Original file line number Diff line number Diff line change
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
*/
function FeedWordPressFeedsPage ($link = -1) {
function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link();
endif;
Expand All @@ -102,6 +102,10 @@ function FeedWordPressFeedsPage ($link = -1) {
$this->special_settings = apply_filters('syndicated_feed_special_settings', $this->special_settings, $this);
} /* FeedWordPressFeedsPage constructor */

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

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

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

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

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

// 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->encoding = $pie->get_encoding();
} /* MagpieFromSimplePie constructor */

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

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

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

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( $rss, $url ) {
self::__construct( $rss, $url );
}

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

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

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

function has_link () { return false; }

function display () {
Expand Down
6 changes: 5 additions & 1 deletion posts-page.php
Original file line number Diff line number Diff line change
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
*/
function FeedWordPressPostsPage ($link = -1) {
function __construct( $link = -1 ) {
if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link();
endif;
Expand All @@ -28,6 +28,10 @@ function FeedWordPressPostsPage ($link = -1) {
);
} /* FeedWordPressPostsPage constructor */

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

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

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

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

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

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

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

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

0 comments on commit 4f98470

Please sign in to comment.