Operation "foo_once".
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Sep 2001 10:43:39 +0000 (10:43 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Sep 2001 10:43:39 +0000 (10:43 +0000)
functions Folder
Step 1: Check file including and change it to the _once system.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1526 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/addressbook.php
functions/i18n.php
functions/imap.php
functions/imap_mailbox.php
functions/imap_search.php
functions/mime.php
functions/plugin.php
functions/smtp.php
functions/strings.php
functions/tree.php

index 11cb7d0..ecb8cd6 100644 (file)
 
 
    // 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. 
 
    }
 
-?>
+?>
\ No newline at end of file
index 28bb04e..ca477c3 100644 (file)
    // 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) {
      if ($my_charset) $default_charset=$my_charset;
    }
 
-?>
+?>
\ No newline at end of file
index 824501c..fc65a68 100644 (file)
@@ -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');
+?>
\ No newline at end of file
index ebad86d..f244876 100755 (executable)
@@ -11,6 +11,9 @@
       return;
    define ('imap_mailbox_php', true);
 
+   require_once('../src/load_prefs.php');
+   require_once('../functions/array.php');
+
    /******************************************************************************
     **  Expunges a mailbox 
     ******************************************************************************/
       $inbox_in_list = false;
       $inbox_subscribed = false;
 
-      include "../src/load_prefs.php";
-      include "../functions/array.php";
+
 
       $dm = sqimap_get_delimiter ($imap_stream);
 
    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");
       return $boxes;
    }
    
-?>
+?>
\ No newline at end of file
index a92e897..7efff2d 100644 (file)
@@ -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
       }
    }
 
-?>
+?>
\ No newline at end of file
index 044a486..6271141 100644 (file)
@@ -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 **/
 
index a6371df..de8d468 100644 (file)
@@ -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 @@
       }
    }
 
-?>
+?>
\ No newline at end of file
index 0d0edd1..fd179db 100644 (file)
@@ -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;
 
       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);
       }
 
       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);
       return $length;
    }
    
-?>
+?>
\ No newline at end of file
index dcef5bd..ac71e9d 100644 (file)
       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;
        return ereg_replace('(["\\])', '\\\\1', $str);
    }
 
-?>
+?>
\ No newline at end of file
index cda8c8e..f37c842 100644 (file)
@@ -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) {
          echo $tree[$index]['value'] . '<br>';
       }
    }
-?>
+?>
\ No newline at end of file