Skip to content

Commit

Permalink
[REFACTOR] Remove Explicit Include/Require
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWeinert committed Oct 26, 2021
1 parent 48124ac commit 2d32f2a
Show file tree
Hide file tree
Showing 22 changed files with 13 additions and 167 deletions.
1 change: 0 additions & 1 deletion src/Feed/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public function __construct($owner) {
*/
public function getBaseModuleOptionsObject() {
if (!is_object($this->_baseModuleOptionsObject)) {
include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');
$this->_baseModuleOptionsObject = new base_module_options();
}
return $this->_baseModuleOptionsObject;
Expand Down
3 changes: 1 addition & 2 deletions src/Feed/Fetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function loadFeed($url) {
libxml_clear_errors();
$dom = new PapayaXmlDocument();
if ($dom->loadXml($feedContents)) {
include_once(PAPAYA_INCLUDE_PATH.'system/xml/feeds/atom/papaya_atom_feed.php');
$feed = new papaya_atom_feed();
if ($feed->load($dom, $url)) {
$result = $feed;
Expand Down Expand Up @@ -119,4 +118,4 @@ public function fetchInto(PapayaXmlElement $parent,
}
return ($counter >= $min && $counter > 0);
}
}
}
5 changes: 0 additions & 5 deletions src/Robot.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: Robot.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Load necessary libraries
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_cronjob.php');

/**
* Cron job module for creating and sending mailings automatically.
*
Expand Down
5 changes: 0 additions & 5 deletions src/UserProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: UserProfile.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Basic class page module
*/
require_once PAPAYA_INCLUDE_PATH.'system/base_content.php';

/**
* Newsletter user profile page module.
*
Expand Down
2 changes: 0 additions & 2 deletions src/UserProfile/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ public function getPageObject() {
} elseif (isset($GLOBALS['PAPAYA_PAGE']) && $GLOBALS['PAPAYA_PAGE'] instanceof papaya_page) {
$result = $GLOBALS['PAPAYA_PAGE'];
} else {
include_once(PAPAYA_INCLUDE_PATH.'system/papaya_page.php');
$result = new papaya_page;
}
return $result;
Expand Down Expand Up @@ -306,7 +305,6 @@ public function sendEmailReport($receiver, $lists, $newSubscriptions = array(),
'SALUTATION' => $salutation
);
// generate email and send it
include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');
$emailObj = new email();
$emailObj->setSender($this->data['senderEMail'], $this->data['senderName']);
$emailObj->setSubject($this->data['mailSubject']);
Expand Down
6 changes: 0 additions & 6 deletions src/actbox_newsletter_subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* @version $Id: actbox_newsletter_subscribe.php 6 2014-02-13 15:40:43Z SystemVCS $
*/

require_once(PAPAYA_INCLUDE_PATH.'system/base_actionbox.php');

/**
* Newsletter Box to subscribe to a Newsletter.
*
Expand Down Expand Up @@ -225,7 +223,6 @@ function getForm($dialogTitlePrefix = '', $dialogIcon = '') {
*/
function getContentToolbar() {
$contentMode = empty($this->params['contentmode']) ? 0 : (int)$this->params['contentmode'];
include_once(PAPAYA_INCLUDE_PATH.'system/base_btnbuilder.php');
$toolbar = new base_btnbuilder;
$toolbar->images = $GLOBALS['PAPAYA_IMAGES'];
$toolbar->addButton(
Expand Down Expand Up @@ -505,7 +502,6 @@ function getParsedData() {
$this->newsletterObject->addProtocolEntry(
$subscriberId, $newsletterListId, 0, $token, FALSE, $subscriberData);
//send confirmation request email
include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');
$email = new email();

$email->setSender($this->data['mail_from'], $this->data['addresser_name']);
Expand Down Expand Up @@ -590,7 +586,6 @@ function getURLParams($paramNames) {

function initializeOutputForm() {
if (!(isset($this->subscribeDialog) && is_object($this->subscribeDialog))) {
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
$data = array();
$hidden = array(
'cmd' => 'subscribe'
Expand Down Expand Up @@ -717,4 +712,3 @@ function getOutputForm() {
return $this->subscribeDialog->getDialogXML();
}
}

7 changes: 0 additions & 7 deletions src/admin_newsletter_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ function getForm() {
* @return toolbar string
*/
function getContentToolbar() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_btnbuilder.php');
$toolbar = new base_btnbuilder;
$toolbar->images = $GLOBALS['PAPAYA_IMAGES'];

Expand Down Expand Up @@ -277,7 +276,6 @@ function getContentToolbar() {
*/
function initializeDialog() {
if (!@is_object($this->dialog)) {
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
if (isset($this->parentObj) && is_object($this->parentObj)) {
$hidden['page_id'] = $this->parentObj->topicId;
}
Expand Down Expand Up @@ -517,7 +515,6 @@ function &getItemRef($id = '') {
* @return string dialog
*/
function getDialog() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
$hidden = array(
'contentmode' => @$this->params['contentmode'],
'cmd' => @$this->params['cmd'],
Expand Down Expand Up @@ -555,7 +552,6 @@ function getDialog() {
* @return string dialog
*/
function getIntroFooterDialog() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
$hidden = array(
'contentmode' => @$this->params['contentmode'],
'cmd' => @$this->params['cmd'],
Expand Down Expand Up @@ -597,7 +593,6 @@ function getIntroFooterDialog() {
* @return string dialog
*/
function getDelDialog() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_msgdialog.php');
$hidden = array(
'contentmode' => @$this->params['contentmode'],
'cmd' => 'del',
Expand Down Expand Up @@ -743,7 +738,6 @@ function moveUp() {
* @return string dialog
*/
function getImportDialog() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_msgdialog.php');
$hidden = array(
'contentmode' => @$this->params['contentmode'],
'cmd' => 'import',
Expand Down Expand Up @@ -1057,4 +1051,3 @@ function loadMailingContents($mailingsId) {
return FALSE;
}
}

7 changes: 0 additions & 7 deletions src/base_newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: base_newsletter.php 11 2014-02-19 18:24:09Z SystemVCS $
*/

/**
* Base class for database access
*/
require_once(PAPAYA_INCLUDE_PATH.'system/sys_base_db.php');

/**
* Newsletter administration
*
Expand Down Expand Up @@ -884,7 +879,6 @@ function requestConfirmation($data, $action, $newsletterListId = NULL) {
$this->setSubscriberToken($this->subscriber['subscriber_id'], $token);
}

include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');
$emailObj = new email();
$emailObj->setSender($this->module->data['mail_from'], $this->module->data['addresser_name']);
$emailObj->setSubject($data['mail_subject'], $data);
Expand Down Expand Up @@ -981,4 +975,3 @@ function loadOneMailingOutput($mailingoutputId) {
}
}
}

6 changes: 0 additions & 6 deletions src/base_newsletter_queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
* @version $Id: base_newsletter_queue.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Base class for database access
*/
require_once(dirname(__FILE__).'/base_newsletter.php');

/**
* Newsletter queue handling
Expand Down Expand Up @@ -193,7 +189,6 @@ function prepareQueueEmail($queueId) {
* @return boolean
*/
function sendNewsletterMail($data, $fillValues) {
include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');
$emailObj = new email;
$emailObj->setSubject($data['subject'], $fillValues);
if ($data['text']) {
Expand Down Expand Up @@ -232,7 +227,6 @@ public function moduleOptions(base_module_options $moduleOptions = NULL) {
$this->_moduleOptions = $moduleOptions;
}
if (is_null($this->_moduleOptions)) {
include_once(PAPAYA_INCLUDE_PATH.'system/base_module_options.php');
$this->_moduleOptions = base_module_options::getInstance();
}
return $this->_moduleOptions;
Expand Down
2 changes: 0 additions & 2 deletions src/bayesian.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

require_once(dirname(__FILE__).'/bayesian_db.php');
require_once(PAPAYA_INCLUDE_PATH.'system/sys_base_object.php');

/**
* implementation of a bayesian filter
Expand Down Expand Up @@ -328,4 +327,3 @@ function rateMessage($content, $category) {
}
}
}

6 changes: 0 additions & 6 deletions src/connector_newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: connector_newsletter.php 6 2014-02-13 15:40:43Z SystemVCS $
*/

/**
* Basic class plugin
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_plugin.php');

/**
* Basic class newsletter
*/
Expand Down Expand Up @@ -314,4 +309,3 @@ function callbackMailingListsCombo($name, $element, $data, $paramName = NULL) {
return $result;
}
}

5 changes: 0 additions & 5 deletions src/content_newsletter_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: content_newsletter_import.php 13 2014-02-20 12:13:35Z SystemVCS $
*/

/**
* Basic class page module
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_content.php');

/**
* Page module import newsletter
*
Expand Down
9 changes: 0 additions & 9 deletions src/content_newsletter_subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: content_newsletter_subscribe.php 6 2014-02-13 15:40:43Z SystemVCS $
*/

/**
* Basic class page module
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_content.php');

/**
* Page module newsletter
*
Expand Down Expand Up @@ -268,7 +263,6 @@ function getForm($dialogTitlePrefix = '', $dialogIcon = '') {
* @return string XML
*/
function getContentToolbar() {
include_once(PAPAYA_INCLUDE_PATH.'system/base_btnbuilder.php');
$toolbar = new base_btnbuilder;
$toolbar->images = $GLOBALS['PAPAYA_IMAGES'];
$toolbar->addButton(
Expand Down Expand Up @@ -545,7 +539,6 @@ function getParsedData($parseParams = NULL) {
$this->newsletterObject->addProtocolEntry(
$subscriberId, $newsletterListId, 0, $token, FALSE, $subscriberData);
//send confirmation request email
include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');
$email = new email();

$email->setSender($this->data['mail_from'], $this->data['addresser_name']);
Expand Down Expand Up @@ -670,7 +663,6 @@ function getURLParams($paramNames) {

function initializeOutputForm() {
if (!(isset($this->subscribeDialog) && is_object($this->subscribeDialog))) {
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
$data = array();
$hidden = array(
'cmd' => 'subscribe'
Expand Down Expand Up @@ -793,4 +785,3 @@ function getOutputForm() {
}

}

9 changes: 1 addition & 8 deletions src/content_newsletter_unsubscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: content_newsletter_unsubscribe.php 8 2014-02-17 16:54:45Z SystemVCS $
*/

/**
* Basic class page module
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_content.php');

/**
* Page module LinkDB
*
Expand Down Expand Up @@ -115,7 +110,6 @@ function getParsedTeaser($parseParams = NULL) {
*/
function getParsedData($parseParams = NULL) {
$this->setDefaultData();
include_once(PAPAYA_INCLUDE_PATH.'system/base_dialog.php');
include_once(dirname(__FILE__).'/base_newsletter.php');
$newsletterObject = new base_newsletter();
$newsletterObject->module = $this;
Expand Down Expand Up @@ -158,7 +152,7 @@ function getParsedData($parseParams = NULL) {
$this->getWebLink(NULL, NULL, NULL, $params)
);
$replValues['LINK'] = $this->getAbsoluteURL($this->getWebLink(NULL, NULL, NULL, $params));
include_once(PAPAYA_INCLUDE_PATH.'system/sys_email.php');

$email = new email();
$email->setSender($this->data['mail_from'], $this->data['addresser_name']);
$email->addAddress(
Expand Down Expand Up @@ -379,4 +373,3 @@ private function getTokenParameters() {
return NULL;
}
}

5 changes: 0 additions & 5 deletions src/cronjob_mailbox_reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
* @version $Id: cronjob_mailbox_reader.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Basic class cronjobs
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_cronjob.php');

/**
* Implements the access to an external mailbox account. Read-Only access.
*
Expand Down
6 changes: 0 additions & 6 deletions src/cronjob_newsletter_send.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: cronjob_newsletter_send.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Basic class cronjobs
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_cronjob.php');

/**
* Cronjob-module, send queued newsletters
*
Expand Down Expand Up @@ -69,4 +64,3 @@ function checkExecParams() {
return FALSE;
}
}

6 changes: 0 additions & 6 deletions src/edmodule_newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: edmodule_newsletter.php 13 2014-02-20 12:13:35Z SystemVCS $
*/

/**
* Basisklasse Aenderungsmodule
*/
require_once(PAPAYA_INCLUDE_PATH.'system/base_module.php');

/**
* Edit module for the newsletter application
*
Expand Down Expand Up @@ -120,7 +115,6 @@ function callbackOutputModes($name, $field, $data) {
if (empty($data) && isset($this->parentObj) && isset($this->parentObj->viewLink)) {
$data = $this->parentObj->viewLink['viewmode_ext'];
}
include_once(PAPAYA_INCLUDE_PATH.'system/base_viewlist.php');
$viewList = new base_viewlist();
$viewList->loadViewModesList();
if (isset($viewList->viewModes) && is_array($viewList->viewModes)) {
Expand Down
5 changes: 0 additions & 5 deletions src/newsletter_bounce_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
* @version $Id: newsletter_bounce_db.php 2 2013-12-09 15:38:42Z weinert $
*/

/**
* Database access
*/
require_once(PAPAYA_INCLUDE_PATH.'/system/sys_base_db.php');

/**
* {%SHORT_CLASS_DESCRIPTION%}
*
Expand Down
Loading

0 comments on commit 2d32f2a

Please sign in to comment.