Quellcode durchsuchen

Operation "foo_once".
functions Folder
Step 1: Check file including and change it to the _once system.

philippe_mingo vor 24 Jahren
Ursprung
Commit
b630edc905

+ 5 - 5
functions/addressbook.php

@@ -30,17 +30,17 @@
 
 
    // Include backends here.
-   include('../functions/abook_local_file.php');
-   include('../functions/abook_ldap_server.php');
+   require_once('../functions/abook_local_file.php');
+   require_once('../functions/abook_ldap_server.php');
 
    // Use this if you wanna have a global address book
    if (isset($address_book_global_filename))
-      include('../functions/abook_global_file.php');
+      include_once('../functions/abook_global_file.php');
 
    // Only load database backend if database is configured
    global $addrbook_dsn;
    if(isset($addrbook_dsn))
-      include('../functions/abook_database.php');
+      include_once('../functions/abook_database.php');
 
 
    // Create and initialize an addressbook object. 
@@ -478,4 +478,4 @@
 
    }
 
-?>
+?>

+ 2 - 2
functions/i18n.php

@@ -785,7 +785,7 @@
    // If we can fake gettext, try that
    elseif ($gettext_flags == 0) {
       $use_gettext = true;
-      include('../functions/gettext.php');
+      include_once('../functions/gettext.php');
    } else {
       // Uh-ho.  A weird install
       if (! $gettext_flags & 1) {
@@ -858,4 +858,4 @@
      if ($my_charset) $default_charset=$my_charset;
    }
 
-?>
+?>

+ 5 - 5
functions/imap.php

@@ -11,8 +11,8 @@
 
    $imap_backend = 'imap';
    
-   include ('../functions/' . $imap_backend . '_mailbox.php');
-   include ('../functions/' . $imap_backend . '_messages.php');
-   include ('../functions/' . $imap_backend . '_general.php');
-   include ('../functions/' . $imap_backend . '_search.php');
-?>
+   require_once('../functions/' . $imap_backend . '_mailbox.php');
+   require_once('../functions/' . $imap_backend . '_messages.php');
+   require_once('../functions/' . $imap_backend . '_general.php');
+   require_once('../functions/' . $imap_backend . '_search.php');
+?>

+ 5 - 6
functions/imap_mailbox.php

@@ -11,6 +11,9 @@
       return;
    define ('imap_mailbox_php', true);
 
+   require_once('../src/load_prefs.php');
+   require_once('../functions/array.php');
+
    /******************************************************************************
     **  Expunges a mailbox 
     ******************************************************************************/
@@ -210,8 +213,7 @@
       $inbox_in_list = false;
       $inbox_subscribed = false;
 
-      include "../src/load_prefs.php";
-      include "../functions/array.php";
+
 
       $dm = sqimap_get_delimiter ($imap_stream);
 
@@ -358,9 +360,6 @@
    function sqimap_mailbox_list_all ($imap_stream) {
       global $list_special_folders_first, $folder_prefix;
       
-      if (!function_exists ("ary_sort"))
-         include ("../functions/array.php");
-      
       $dm = sqimap_get_delimiter ($imap_stream);
 
       fputs ($imap_stream, "a001 LIST \"$folder_prefix\" *\r\n");
@@ -445,4 +444,4 @@
       return $boxes;
    }
    
-?>
+?>

+ 6 - 6
functions/imap_search.php

@@ -8,11 +8,11 @@
       return;
    define ('imap_search_php', true);
    
-   include("../functions/imap.php");
-   include("../functions/date.php");
-   include("../functions/array.php");
-   include("../functions/mailbox_display.php");
-   include("../functions/mime.php");
+   require_once('../functions/imap.php');
+   require_once('../functions/date.php');
+   require_once('../functions/array.php');
+   require_once('../functions/mailbox_display.php');
+   require_once('../functions/mime.php');
 
 
 function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$color) {
@@ -152,4 +152,4 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
       }
    }
 
-?>
+?>

+ 1 - 1
functions/mime.php

@@ -14,7 +14,7 @@
    global $debug_mime;
    $debug_mime = false;
    
-   include "../functions/imap.php";
+   require_once('../functions/imap.php');
 
    /** Setting up the objects that have the structure for the message **/
 

+ 2 - 2
functions/plugin.php

@@ -32,7 +32,7 @@
       if (file_exists('../plugins/'.$name.'/setup.php')) {
          if ($plugin_general_debug)
 	    echo "plugin:  --  Loading $name/setup.php<br>\n";
-         include ('../plugins/'.$name.'/setup.php');
+         include_once('../plugins/'.$name.'/setup.php');
          $function = 'squirrelmail_plugin_init_'.$name;
          if (function_exists($function))
 	 {
@@ -87,4 +87,4 @@
       }
    }
 
-?>
+?>

+ 6 - 6
functions/smtp.php

@@ -11,8 +11,8 @@
       return;
    define('smtp_php', true);
 
-   include('../functions/addressbook.php');
-   include('../functions/plugin.php');
+   require_once('../functions/addressbook.php');
+   require_once('../functions/plugin.php');
 
    global $username, $popuser, $domain;
 
@@ -448,7 +448,7 @@
       if ($num != 250) {
          $tmp = nl2br(htmlspecialchars($tmp));
          displayPageHeader($color, 'None');
-         include ("../functions/display_messages.php");
+         include_once('../functions/display_messages.php');
          $msg  = "Message not sent!<br>\nReason given: $tmp";
          plain_error_message($msg, $color);
          return(0);
@@ -554,9 +554,9 @@
       }
 
       if ($status == 0) {
-         include '../functions/page_header.php';
+         include_once('../functions/page_header.php');
          displayPageHeader($color, 'None');
-		 include ("../functions/display_messages.php");
+         include_once('../functions/display_messages.php');
          $lines = nl2br(htmlspecialchars($lines));
 		 $msg  = $message . "<br>\nServer replied: $lines";
 		 plain_error_message($msg, $color);
@@ -622,4 +622,4 @@
       return $length;
    }
    
-?>
+?>

+ 2 - 2
functions/strings.php

@@ -172,7 +172,7 @@
       global $where, $what; // from searching
       global $color; // color theme
 
-      include '../functions/url_parser.php';
+      require_once('../functions/url_parser.php');
       
       $body_ary = explode("\n", $body);
       $PriorQuotes = 0;
@@ -515,4 +515,4 @@
        return ereg_replace('(["\\])', '\\\\1', $str);
    }
 
-?>
+?>

+ 2 - 2
functions/tree.php

@@ -6,7 +6,7 @@
        return;
    define('tree_php', true);
 
-   include('../functions/imap.php');
+   require_once('../functions/imap.php');
 
    // Recursive function to find the correct parent for a new node
    function findParentForChild($value, $treeIndexToStart, $tree) {
@@ -126,4 +126,4 @@
          echo $tree[$index]['value'] . '<br>';
       }
    }
-?>
+?>