Get rid of some include_once() & require_once() calls
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 28 Aug 2010 08:05:22 +0000 (02:05 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 28 Aug 2010 18:22:08 +0000 (12:22 -0600)
horde/lib/Block/metar.php
horde/lib/Block/vatid.php
horde/lib/Block/weatherdotcom.php
turba/config/sources.php.dist
turba/scripts/import_squirrelmail_file_abook.php
turba/scripts/import_squirrelmail_sql_abook.php

index f6f2012..eb0971f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-if ((@include_once 'Services/Weather.php') &&
+if (class_exists('Services_Weather') &&
     !empty($GLOBALS['conf']['sql']['phptype'])) {
     $block_name = _("Metar Weather");
 }
@@ -105,7 +105,7 @@ class Horde_Block_Horde_metar extends Horde_Block
      */
     protected function _content()
     {
-        if (!@include_once 'Services/Weather.php') {
+        if (!class_exists('Services_Weather')) {
             Horde::logMessage('The metar block will not work without Services_Weather from PEAR. Run pear install Services_Weather.', 'ERR');
             throw new Horde_Block_Exception(_("Metar block not available. Details have been logged for the administrator."));
         }
index fc5be38..0463b16 100644 (file)
@@ -54,7 +54,6 @@ class Horde_Block_Horde_vatid extends Horde_Block
 
         if (!empty($matches)) {
             $html .= '<br />';
-            @include_once 'SOAP/Client.php';
             if (!class_exists('SOAP_Client')) {
                 $html .= $this->_error(sprintf(_("%s not found."), '<a href="http://pear.php.net/SOAP" target="_blank">SOAP</a>'));
             } else {
index 459099b..b25e730 100644 (file)
@@ -39,9 +39,9 @@ class Horde_Block_Horde_weatherdotcom extends Horde_Block
      */
     protected function _params()
     {
-        if (!(@include_once 'Services/Weather.php') ||
-            !(@include_once 'Cache.php') ||
-            !(@include_once 'XML/Serializer.php') ||
+        if (!class_exists('Services_Weather') ||
+            !class_exists('Cache') ||
+            !class_exists('XML_Serializer') ||
             !ini_get('allow_url_fopen')) {
             Horde::logMessage('The weather.com block will not work without PEAR\'s Services_Weather, Cache, and XML_ Serializer packages, and allow_url_fopen enabled. Run `pear install Services_Weather Cache XML_Serializer´ and ensure that allow_url_fopen is enabled in php.ini.', 'ERR');
             $params = array(
@@ -99,8 +99,8 @@ class Horde_Block_Horde_weatherdotcom extends Horde_Block
      */
     protected function _content()
     {
-        if (!(@include_once 'Services/Weather.php') ||
-            !(@include_once 'Cache.php') ||
+        if (!class_exists('Services_Weather') ||
+            !class_exists('Cache') ||
             !ini_get('allow_url_fopen')) {
             Horde::logMessage('The weather.com block will not work without the PEARServices_Weather and Cache packages, and allow_url_fopen enabled. Run pear install Services_Weather Cache, and ensure that allow_url_fopen_wrappers is enabled in php.ini.', 'ERR');
             throw new Horde_Block_Exception(_("The weather.com block is not available."));
index cf384a4..11b5a77 100644 (file)
@@ -830,7 +830,6 @@ if (!empty($GLOBALS['conf']['imsp']['enabled']) ||
      * will override any entries gathered dynamically below.
      */
      if (empty($cfgSources['imsp']['use_shares'])) {
-        require_once 'Net/IMSP/Utils.php';
         $result = Net_IMSP_Utils::getAllBooks($cfgSources['imsp']);
 
         if (!is_a($result, 'PEAR_Error')) {
index f8dc023..7892ed4 100755 (executable)
@@ -20,8 +20,6 @@
 require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
 
-require_once TURBA_BASE . '/lib/Object/Group.php';
-
 // Read command line parameters.
 if ($argc != 2) {
     $cli->message('Too many or too few parameters.', 'cli.error');
index b7882fa..0cedbd5 100755 (executable)
@@ -19,8 +19,6 @@
 require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('turba', array('authentication' => 'none', 'cli' => true, 'user_admin' => true));
 
-require_once TURBA_BASE . '/lib/Object/Group.php';
-
 // Read command line parameters.
 if ($argc != 2) {
     $cli->message('Too many or too few parameters.', 'cli.error');