[Svn] r4678 - in trunk/roundcubemail: . program/include program/steps/mail

trac at roundcube.net trac at roundcube.net
Wed Apr 20 15:58:23 CEST 2011


Author: alec
Date: 2011-04-20 08:58:21 -0500 (Wed, 20 Apr 2011)
New Revision: 4678

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/index.php
   trunk/roundcubemail/program/include/clisetup.php
   trunk/roundcubemail/program/include/iniset.php
   trunk/roundcubemail/program/include/main.inc
   trunk/roundcubemail/program/include/rcmail.php
   trunk/roundcubemail/program/include/rcube_mdb2.php
   trunk/roundcubemail/program/steps/mail/func.inc
Log:
- Improve performance by including files with absolute path (#1487849) 


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/CHANGELOG	2011-04-20 13:58:21 UTC (rev 4678)
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Improve performance by including files with absolute path (#1487849)
 - TinyMCE 3.4.2 now compatible with IE9
 - Move folder name truncation to client/skin (#1485412)
 - PEAR::Net_SMTP 1.5.2, fixed timeout issue (#1487843)

Modified: trunk/roundcubemail/index.php
===================================================================
--- trunk/roundcubemail/index.php	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/index.php	2011-04-20 13:58:21 UTC (rev 4678)
@@ -208,13 +208,13 @@
   $OUTPUT->send();
 }
 else if ($RCMAIL->action == 'save-pref') {
-  include 'steps/utils/save_pref.inc';
+  include INSTALL_PATH . 'program/steps/utils/save_pref.inc';
 }
 
 
 // include task specific functions
-if (is_file($incfile = 'program/steps/'.$RCMAIL->task.'/func.inc'))
-  include_once($incfile);
+if (is_file($incfile = INSTALL_PATH . 'program/steps/'.$RCMAIL->task.'/func.inc'))
+  include_once $incfile;
 
 // allow 5 "redirects" to another action
 $redirects = 0; $incstep = null;
@@ -230,9 +230,9 @@
   }
   // try to include the step file
   else if (($stepfile = $RCMAIL->get_action_file())
-    && is_file($incfile = 'program/steps/'.$RCMAIL->task.'/'.$stepfile)
+    && is_file($incfile = INSTALL_PATH . 'program/steps/'.$RCMAIL->task.'/'.$stepfile)
   ) {
-    include($incfile);
+    include $incfile;
     $redirects++;
   }
   else {

Modified: trunk/roundcubemail/program/include/clisetup.php
===================================================================
--- trunk/roundcubemail/program/include/clisetup.php	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/include/clisetup.php	2011-04-20 13:58:21 UTC (rev 4678)
@@ -23,7 +23,7 @@
   die('Not on the "shell" (php-cli).');
 }
 
-require_once 'iniset.php';
+require_once INSTALL_PATH . 'program/include/iniset.php';
 
 
 /**

Modified: trunk/roundcubemail/program/include/iniset.php
===================================================================
--- trunk/roundcubemail/program/include/iniset.php	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/include/iniset.php	2011-04-20 13:58:21 UTC (rev 4678)
@@ -57,10 +57,9 @@
 // RC include folders MUST be included FIRST to avoid other
 // possible not compatible libraries (i.e PEAR) to be included
 // instead the ones provided by RC
-$include_path = INSTALL_PATH . PATH_SEPARATOR;
-$include_path.= INSTALL_PATH . 'program' . PATH_SEPARATOR;
-$include_path.= INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
+$include_path = INSTALL_PATH . 'program' . PATH_SEPARATOR;
 $include_path.= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
+$include_path.= INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
 $include_path.= ini_get('include_path');
 
 if (set_include_path($include_path) === false) {
@@ -133,5 +132,5 @@
 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error');
 
 // include global functions
-require_once 'include/main.inc';
-require_once 'include/rcube_shared.inc';
+require_once INSTALL_PATH . 'program/include/main.inc';
+require_once INSTALL_PATH . 'program/include/rcube_shared.inc';

Modified: trunk/roundcubemail/program/include/main.inc
===================================================================
--- trunk/roundcubemail/program/include/main.inc	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/include/main.inc	2011-04-20 13:58:21 UTC (rev 4678)
@@ -26,12 +26,9 @@
  * @author Thomas Bruederli <roundcube at gmail.com>
  */
 
-require_once('lib/utf7.inc');
-require_once('include/rcube_shared.inc');
+require_once 'lib/utf7.inc';
+require_once INSTALL_PATH . 'program/include/rcube_shared.inc';
 
-// fallback if not PHP modules are available
- at include_once('lib/utf8.class.php');
-
 // define constannts for input reading
 define('RCUBE_INPUT_GET', 0x0101);
 define('RCUBE_INPUT_POST', 0x0102);
@@ -290,7 +287,7 @@
     }
     $error = true;
   }
-  
+
   // encode string for output
   if ($from == 'UTF-8') {
     // @TODO: we need a function for UTF-7 (RFC2152) conversion
@@ -312,7 +309,7 @@
     }
     $error = true;
   }
-  
+
   // report error
   if ($error && !$convert_warning) {
     raise_error(array(
@@ -322,10 +319,10 @@
       'line' => __LINE__,
       'message' => "Could not convert string from $from to $to. Make sure iconv/mbstring is installed or lib/utf8.class is available."
       ), true, false);
-    
+
     $convert_warning = true;
   }
-  
+
   // return UTF-8 or original string
   return $str;
   }
@@ -1975,14 +1972,14 @@
 function rcube_print_time($timer, $label='Timer', $dest='console')
 {
   static $print_count = 0;
-  
+
   $print_count++;
   $now = rcube_timer();
   $diff = $now-$timer;
-  
+
   if (empty($label))
     $label = 'Timer '.$print_count;
-  
+
   write_log($dest, sprintf("%s: %0.4f sec", $label, $diff));
 }
 
@@ -2013,7 +2010,7 @@
     if ($terminate) {
         $ERROR_CODE = $arg['code'];
         $ERROR_MESSAGE = $arg['message'];
-        include('program/steps/utils/error.inc');
+        include INSTALL_PATH . 'program/steps/utils/error.inc';
         exit;
     }
 }

Modified: trunk/roundcubemail/program/include/rcmail.php
===================================================================
--- trunk/roundcubemail/program/include/rcmail.php	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/include/rcmail.php	2011-04-20 13:58:21 UTC (rev 4678)
@@ -1343,7 +1343,7 @@
     $rcmail = rcmail::get_instance();
     $convert  = $rcmail->config->get('im_convert_path', false);
     $identify = $rcmail->config->get('im_identify_path', false);
-    
+
     // imagemagick is required for this
     if (!$convert)
         return false;

Modified: trunk/roundcubemail/program/include/rcube_mdb2.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_mdb2.php	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/include/rcube_mdb2.php	2011-04-20 13:58:21 UTC (rev 4678)
@@ -724,7 +724,7 @@
      */
     private function _sqlite_prepare()
     {
-        include_once('include/rcube_sqlite.inc');
+        include_once(INSTALL_PATH . 'program/include/rcube_sqlite.inc');
 
         // we emulate via callback some missing MySQL function
         sqlite_create_function($this->db_handle->connection,

Modified: trunk/roundcubemail/program/steps/mail/func.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/func.inc	2011-04-20 13:10:45 UTC (rev 4677)
+++ trunk/roundcubemail/program/steps/mail/func.inc	2011-04-20 13:58:21 UTC (rev 4678)
@@ -682,7 +682,7 @@
   // text/enriched
   else if ($data['type'] == 'enriched') {
     $part->ctype_secondary = 'html';
-    require_once('lib/enriched.inc');
+    require_once(INSTALL_PATH . 'program/lib/enriched.inc');
     $body = Q(enriched_to_html($data['body']), 'show');
   }
   else {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list