From 0ea079d604ef1f34cc47646ab23176a3c66f16ee Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 13 Oct 2014 08:41:55 -0400
Subject: [PATCH] dirname(__FILE__) -> __DIR__

---
 plugins/managesieve/tests/Managesieve.php                             |    2 
 bin/update.sh                                                         |    2 
 plugins/additional_message_headers/tests/AdditionalMessageHeaders.php |    2 
 plugins/database_attachments/tests/DatabaseAttachments.php            |    2 
 plugins/virtuser_file/tests/VirtuserFile.php                          |    2 
 plugins/identity_select/tests/IdentitySelect.php                      |    2 
 plugins/zipdownload/tests/Zipdownload.php                             |    2 
 plugins/redundant_attachments/tests/RedundantAttachments.php          |    2 
 plugins/archive/tests/Archive.php                                     |    2 
 plugins/http_authentication/tests/HttpAuthentication.php              |    2 
 bin/cleandb.sh                                                        |    2 
 bin/importgettext.sh                                                  |    2 
 bin/gc.sh                                                             |    2 
 plugins/enigma/tests/Enigma.php                                       |    2 
 plugins/example_addressbook/tests/ExampleAddressbook.php              |    2 
 bin/exportgettext.sh                                                  |    2 
 bin/indexcontacts.sh                                                  |    2 
 plugins/filesystem_attachments/tests/FilesystemAttachments.php        |    2 
 plugins/debug_logger/debug_logger.php                                 |    8 +-
 bin/deluser.sh                                                        |    2 
 plugins/password/tests/Password.php                                   |    2 
 tests/bootstrap.php                                                   |    4 
 plugins/virtuser_query/tests/VirtuserQuery.php                        |    2 
 program/lib/Roundcube/bootstrap.php                                   |    2 
 bin/moduserprefs.sh                                                   |    2 
 plugins/managesieve/tests/Vacation.php                                |    4 
 plugins/help/tests/Help.php                                           |    2 
 plugins/debug_logger/tests/DebugLogger.php                            |    2 
 plugins/legacy_browser/tests/LegacyBrowser.php                        |    2 
 bin/msgexport.sh                                                      |    2 
 installer/index.php                                                   |    2 
 tests/Selenium/bootstrap.php                                          |    4 
 plugins/newmail_notifier/tests/NewmailNotifier.php                    |    2 
 bin/decrypt.sh                                                        |    2 
 bin/msgimport.sh                                                      |    2 
 plugins/emoticons/tests/Emoticons.php                                 |    2 
 plugins/markasjunk/tests/Markasjunk.php                               |    2 
 plugins/example_addressbook/example_addressbook.php                   |    2 
 plugins/hide_blockquote/tests/HideBlockquote.php                      |    2 
 plugins/show_additional_headers/tests/ShowAdditionalHeaders.php       |    2 
 bin/installto.sh                                                      |    2 
 bin/updatecss.sh                                                      |    2 
 plugins/autologon/tests/Autologon.php                                 |    2 
 bin/dumpschema.sh                                                     |    2 
 plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php          |    2 
 plugins/managesieve/tests/Parser.php                                  |    4 
 plugins/new_user_identity/tests/NewUserIdentity.php                   |    2 
 plugins/jqueryui/tests/Jqueryui.php                                   |    2 
 plugins/new_user_dialog/tests/NewUserDialog.php                       |    2 
 tests/Framework/VCard.php                                             |    2 
 plugins/managesieve/tests/Tokenizer.php                               |    2 
 plugins/acl/tests/Acl.php                                             |    2 
 plugins/vcard_attachments/tests/VcardAttachments.php                  |    2 
 plugins/subscriptions_option/tests/SubscriptionsOption.php            |    2 
 bin/updatedb.sh                                                       |    2 
 plugins/userinfo/tests/Userinfo.php                                   |    2 
 56 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/bin/cleandb.sh b/bin/cleandb.sh
index 9edfeec..d811c8d 100755
--- a/bin/cleandb.sh
+++ b/bin/cleandb.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require INSTALL_PATH.'program/include/clisetup.php';
 
diff --git a/bin/decrypt.sh b/bin/decrypt.sh
index 7f83f3a..dd45259 100755
--- a/bin/decrypt.sh
+++ b/bin/decrypt.sh
@@ -52,7 +52,7 @@
  *  - you are dealing with counterfeit header data.
  */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__).'/..') . '/');
+define('INSTALL_PATH', realpath(__DIR__ .'/..') . '/');
 
 require INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/bin/deluser.sh b/bin/deluser.sh
index 0489f4d..1e93793 100755
--- a/bin/deluser.sh
+++ b/bin/deluser.sh
@@ -20,7 +20,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/bin/dumpschema.sh b/bin/dumpschema.sh
index 6d5cde7..32c90ac 100755
--- a/bin/dumpschema.sh
+++ b/bin/dumpschema.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require INSTALL_PATH.'program/include/clisetup.php';
 
diff --git a/bin/exportgettext.sh b/bin/exportgettext.sh
index b220b22..314cae7 100755
--- a/bin/exportgettext.sh
+++ b/bin/exportgettext.sh
@@ -15,7 +15,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 require INSTALL_PATH.'program/include/clisetup.php';
 
 if ($argc < 2) {
diff --git a/bin/gc.sh b/bin/gc.sh
index 1ee6107..e0d722a 100755
--- a/bin/gc.sh
+++ b/bin/gc.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require INSTALL_PATH.'program/include/clisetup.php';
 
diff --git a/bin/importgettext.sh b/bin/importgettext.sh
index 285f568..5a91e6b 100755
--- a/bin/importgettext.sh
+++ b/bin/importgettext.sh
@@ -15,7 +15,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 require INSTALL_PATH.'program/include/clisetup.php';
 
 if ($argc < 2) {
diff --git a/bin/indexcontacts.sh b/bin/indexcontacts.sh
index 9509dc0..2844742 100755
--- a/bin/indexcontacts.sh
+++ b/bin/indexcontacts.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH.'program/include/clisetup.php';
 ini_set('memory_limit', -1);
diff --git a/bin/installto.sh b/bin/installto.sh
index fbd951b..d239c63 100755
--- a/bin/installto.sh
+++ b/bin/installto.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/bin/moduserprefs.sh b/bin/moduserprefs.sh
index e892b1f..3d46baa 100755
--- a/bin/moduserprefs.sh
+++ b/bin/moduserprefs.sh
@@ -18,7 +18,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH.'program/include/clisetup.php';
 
diff --git a/bin/msgexport.sh b/bin/msgexport.sh
index f68688b..f76aefe 100755
--- a/bin/msgexport.sh
+++ b/bin/msgexport.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env php
 <?php
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 ini_set('memory_limit', -1);
 
 require_once INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/msgimport.sh b/bin/msgimport.sh
index 1fcc346..0c72622 100755
--- a/bin/msgimport.sh
+++ b/bin/msgimport.sh
@@ -1,7 +1,7 @@
 #!/usr/bin/env php
 <?php
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 ini_set('memory_limit', -1);
 
 require_once INSTALL_PATH.'program/include/clisetup.php';
diff --git a/bin/update.sh b/bin/update.sh
index f0c6d2f..cbacb94 100755
--- a/bin/update.sh
+++ b/bin/update.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/bin/updatecss.sh b/bin/updatecss.sh
index 53d237c..6ecfeac 100755
--- a/bin/updatecss.sh
+++ b/bin/updatecss.sh
@@ -18,7 +18,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/bin/updatedb.sh b/bin/updatedb.sh
index e981807..ffeac0b 100755
--- a/bin/updatedb.sh
+++ b/bin/updatedb.sh
@@ -19,7 +19,7 @@
  +-----------------------------------------------------------------------+
 */
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
 require_once INSTALL_PATH . 'program/include/clisetup.php';
 
diff --git a/installer/index.php b/installer/index.php
index b93ad2f..61ff400 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -39,7 +39,7 @@
 ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
 ini_set('display_errors', 1);
 
-define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
+define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');
 define('RCUBE_INSTALL_PATH', INSTALL_PATH);
 define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/');
 
diff --git a/plugins/acl/tests/Acl.php b/plugins/acl/tests/Acl.php
index e752ac9..56ae3b5 100644
--- a/plugins/acl/tests/Acl.php
+++ b/plugins/acl/tests/Acl.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../acl.php';
+        include_once __DIR__ . '/../acl.php';
     }
 
     /**
diff --git a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
index 1c54ffc..55e8c44 100644
--- a/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
+++ b/plugins/additional_message_headers/tests/AdditionalMessageHeaders.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../additional_message_headers.php';
+        include_once __DIR__ . '/../additional_message_headers.php';
     }
 
     /**
diff --git a/plugins/archive/tests/Archive.php b/plugins/archive/tests/Archive.php
index 0a1eeae..17fcdf7 100644
--- a/plugins/archive/tests/Archive.php
+++ b/plugins/archive/tests/Archive.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../archive.php';
+        include_once __DIR__ . '/../archive.php';
     }
 
     /**
diff --git a/plugins/autologon/tests/Autologon.php b/plugins/autologon/tests/Autologon.php
index 0de193e..f3f6b42 100644
--- a/plugins/autologon/tests/Autologon.php
+++ b/plugins/autologon/tests/Autologon.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../autologon.php';
+        include_once __DIR__ . '/../autologon.php';
     }
 
     /**
diff --git a/plugins/database_attachments/tests/DatabaseAttachments.php b/plugins/database_attachments/tests/DatabaseAttachments.php
index f260737..15ea5f4 100644
--- a/plugins/database_attachments/tests/DatabaseAttachments.php
+++ b/plugins/database_attachments/tests/DatabaseAttachments.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../database_attachments.php';
+        include_once __DIR__ . '/../database_attachments.php';
     }
 
     /**
diff --git a/plugins/debug_logger/debug_logger.php b/plugins/debug_logger/debug_logger.php
index 88237d7..07190e5 100644
--- a/plugins/debug_logger/debug_logger.php
+++ b/plugins/debug_logger/debug_logger.php
@@ -66,8 +66,8 @@
 {
     function init()
     {
-        require_once(dirname(__FILE__).'/runlog/runlog.php');
-        $this->runlog = new runlog(); 
+        require_once(__DIR__ . '/runlog/runlog.php');
+        $this->runlog = new runlog();
 
         if(!rcmail::get_instance()->config->get('log_dir')){
             rcmail::get_instance()->config->set('log_dir',INSTALL_PATH.'logs');
@@ -83,10 +83,10 @@
         $action = rcmail::get_instance()->action;
         $task = rcmail::get_instance()->task;
         if($action){
-               $start_string .= "Action: ".$action.". "; 
+               $start_string .= "Action: ".$action.". ";
         }
         if($task){
-               $start_string .= "Task: ".$task.". "; 
+               $start_string .= "Task: ".$task.". ";
         }
         $this->runlog->start($start_string);
 
diff --git a/plugins/debug_logger/tests/DebugLogger.php b/plugins/debug_logger/tests/DebugLogger.php
index de20a06..8dd0c03 100644
--- a/plugins/debug_logger/tests/DebugLogger.php
+++ b/plugins/debug_logger/tests/DebugLogger.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../debug_logger.php';
+        include_once __DIR__ . '/../debug_logger.php';
     }
 
     /**
diff --git a/plugins/emoticons/tests/Emoticons.php b/plugins/emoticons/tests/Emoticons.php
index 4b6c303..e045022 100644
--- a/plugins/emoticons/tests/Emoticons.php
+++ b/plugins/emoticons/tests/Emoticons.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../emoticons.php';
+        include_once __DIR__ . '/../emoticons.php';
     }
 
     /**
diff --git a/plugins/enigma/tests/Enigma.php b/plugins/enigma/tests/Enigma.php
index 0d0d8f8..3972694 100644
--- a/plugins/enigma/tests/Enigma.php
+++ b/plugins/enigma/tests/Enigma.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../enigma.php';
+        include_once __DIR__ . '/../enigma.php';
     }
 
     /**
diff --git a/plugins/example_addressbook/example_addressbook.php b/plugins/example_addressbook/example_addressbook.php
index 31077ad..22e230c 100644
--- a/plugins/example_addressbook/example_addressbook.php
+++ b/plugins/example_addressbook/example_addressbook.php
@@ -1,6 +1,6 @@
 <?php
 
-require_once(dirname(__FILE__) . '/example_addressbook_backend.php');
+require_once(__DIR__ . '/example_addressbook_backend.php');
 
 /**
  * Sample plugin to add a new address book
diff --git a/plugins/example_addressbook/tests/ExampleAddressbook.php b/plugins/example_addressbook/tests/ExampleAddressbook.php
index 4a54bd9..762ee73 100644
--- a/plugins/example_addressbook/tests/ExampleAddressbook.php
+++ b/plugins/example_addressbook/tests/ExampleAddressbook.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../example_addressbook.php';
+        include_once __DIR__ . '/../example_addressbook.php';
     }
 
     /**
diff --git a/plugins/filesystem_attachments/tests/FilesystemAttachments.php b/plugins/filesystem_attachments/tests/FilesystemAttachments.php
index dcab315..3b60e12 100644
--- a/plugins/filesystem_attachments/tests/FilesystemAttachments.php
+++ b/plugins/filesystem_attachments/tests/FilesystemAttachments.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../filesystem_attachments.php';
+        include_once __DIR__ . '/../filesystem_attachments.php';
     }
 
     /**
diff --git a/plugins/help/tests/Help.php b/plugins/help/tests/Help.php
index baba492..ff5771b 100644
--- a/plugins/help/tests/Help.php
+++ b/plugins/help/tests/Help.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../help.php';
+        include_once __DIR__ . '/../help.php';
     }
 
     /**
diff --git a/plugins/hide_blockquote/tests/HideBlockquote.php b/plugins/hide_blockquote/tests/HideBlockquote.php
index 030c053..90e2094 100644
--- a/plugins/hide_blockquote/tests/HideBlockquote.php
+++ b/plugins/hide_blockquote/tests/HideBlockquote.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../hide_blockquote.php';
+        include_once __DIR__ . '/../hide_blockquote.php';
     }
 
     /**
diff --git a/plugins/http_authentication/tests/HttpAuthentication.php b/plugins/http_authentication/tests/HttpAuthentication.php
index c172368..5de968d 100644
--- a/plugins/http_authentication/tests/HttpAuthentication.php
+++ b/plugins/http_authentication/tests/HttpAuthentication.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../http_authentication.php';
+        include_once __DIR__ . '/../http_authentication.php';
     }
 
     /**
diff --git a/plugins/identity_select/tests/IdentitySelect.php b/plugins/identity_select/tests/IdentitySelect.php
index 3d72697..461e79d 100644
--- a/plugins/identity_select/tests/IdentitySelect.php
+++ b/plugins/identity_select/tests/IdentitySelect.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../identity_select.php';
+        include_once __DIR__ . '/../identity_select.php';
     }
 
     /**
diff --git a/plugins/jqueryui/tests/Jqueryui.php b/plugins/jqueryui/tests/Jqueryui.php
index 3bcd27c..ee25818 100644
--- a/plugins/jqueryui/tests/Jqueryui.php
+++ b/plugins/jqueryui/tests/Jqueryui.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../jqueryui.php';
+        include_once __DIR__ . '/../jqueryui.php';
     }
 
     /**
diff --git a/plugins/legacy_browser/tests/LegacyBrowser.php b/plugins/legacy_browser/tests/LegacyBrowser.php
index 8e9762f..7a35ee5 100644
--- a/plugins/legacy_browser/tests/LegacyBrowser.php
+++ b/plugins/legacy_browser/tests/LegacyBrowser.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../legacy_browser.php';
+        include_once __DIR__ . '/../legacy_browser.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Managesieve.php b/plugins/managesieve/tests/Managesieve.php
index d802f56..6e930b8 100644
--- a/plugins/managesieve/tests/Managesieve.php
+++ b/plugins/managesieve/tests/Managesieve.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../managesieve.php';
+        include_once __DIR__ . '/../managesieve.php';
     }
 
     /**
diff --git a/plugins/managesieve/tests/Parser.php b/plugins/managesieve/tests/Parser.php
index 9050f09..33edce0 100644
--- a/plugins/managesieve/tests/Parser.php
+++ b/plugins/managesieve/tests/Parser.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../lib/Roundcube/rcube_sieve_script.php';
+        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_script.php';
     }
 
     /**
@@ -34,7 +34,7 @@
      */
     function data_parser()
     {
-        $dir_path = realpath(dirname(__FILE__) . '/src');
+        $dir_path = realpath(__DIR__ . '/src');
         $dir      = opendir($dir_path);
         $result   = array();
 
diff --git a/plugins/managesieve/tests/Tokenizer.php b/plugins/managesieve/tests/Tokenizer.php
index e71bae0..f50ed75 100644
--- a/plugins/managesieve/tests/Tokenizer.php
+++ b/plugins/managesieve/tests/Tokenizer.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../lib/Roundcube/rcube_sieve_script.php';
+        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_script.php';
     }
 
     function data_tokenizer()
diff --git a/plugins/managesieve/tests/Vacation.php b/plugins/managesieve/tests/Vacation.php
index e34eb7a..942525c 100644
--- a/plugins/managesieve/tests/Vacation.php
+++ b/plugins/managesieve/tests/Vacation.php
@@ -5,8 +5,8 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../lib/Roundcube/rcube_sieve_engine.php';
-        include_once dirname(__FILE__) . '/../lib/Roundcube/rcube_sieve_vacation.php';
+        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_engine.php';
+        include_once __DIR__ . '/../lib/Roundcube/rcube_sieve_vacation.php';
     }
 
     /**
diff --git a/plugins/markasjunk/tests/Markasjunk.php b/plugins/markasjunk/tests/Markasjunk.php
index cdf1325..73494b0 100644
--- a/plugins/markasjunk/tests/Markasjunk.php
+++ b/plugins/markasjunk/tests/Markasjunk.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../markasjunk.php';
+        include_once __DIR__ . '/../markasjunk.php';
     }
 
     /**
diff --git a/plugins/new_user_dialog/tests/NewUserDialog.php b/plugins/new_user_dialog/tests/NewUserDialog.php
index 3a52f20..e58489a 100644
--- a/plugins/new_user_dialog/tests/NewUserDialog.php
+++ b/plugins/new_user_dialog/tests/NewUserDialog.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../new_user_dialog.php';
+        include_once __DIR__ . '/../new_user_dialog.php';
     }
 
     /**
diff --git a/plugins/new_user_identity/tests/NewUserIdentity.php b/plugins/new_user_identity/tests/NewUserIdentity.php
index c1d3858..2119736 100644
--- a/plugins/new_user_identity/tests/NewUserIdentity.php
+++ b/plugins/new_user_identity/tests/NewUserIdentity.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../new_user_identity.php';
+        include_once __DIR__ . '/../new_user_identity.php';
     }
 
     /**
diff --git a/plugins/newmail_notifier/tests/NewmailNotifier.php b/plugins/newmail_notifier/tests/NewmailNotifier.php
index 571912a..ccddccd 100644
--- a/plugins/newmail_notifier/tests/NewmailNotifier.php
+++ b/plugins/newmail_notifier/tests/NewmailNotifier.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../newmail_notifier.php';
+        include_once __DIR__ . '/../newmail_notifier.php';
     }
 
     /**
diff --git a/plugins/password/tests/Password.php b/plugins/password/tests/Password.php
index a9663a9..b64c6b8 100644
--- a/plugins/password/tests/Password.php
+++ b/plugins/password/tests/Password.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../password.php';
+        include_once __DIR__ . '/../password.php';
     }
 
     /**
diff --git a/plugins/redundant_attachments/tests/RedundantAttachments.php b/plugins/redundant_attachments/tests/RedundantAttachments.php
index 386f97e..53f0c01 100644
--- a/plugins/redundant_attachments/tests/RedundantAttachments.php
+++ b/plugins/redundant_attachments/tests/RedundantAttachments.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../redundant_attachments.php';
+        include_once __DIR__ . '/../redundant_attachments.php';
     }
 
     /**
diff --git a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
index 902ce51..ab77351 100644
--- a/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
+++ b/plugins/show_additional_headers/tests/ShowAdditionalHeaders.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../show_additional_headers.php';
+        include_once __DIR__ . '/../show_additional_headers.php';
     }
 
     /**
diff --git a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
index 2e35509..0e3a5c4 100644
--- a/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
+++ b/plugins/squirrelmail_usercopy/tests/SquirrelmailUsercopy.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../squirrelmail_usercopy.php';
+        include_once __DIR__ . '/../squirrelmail_usercopy.php';
     }
 
     /**
diff --git a/plugins/subscriptions_option/tests/SubscriptionsOption.php b/plugins/subscriptions_option/tests/SubscriptionsOption.php
index 6932a95..1016831 100644
--- a/plugins/subscriptions_option/tests/SubscriptionsOption.php
+++ b/plugins/subscriptions_option/tests/SubscriptionsOption.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../subscriptions_option.php';
+        include_once __DIR__ . '/../subscriptions_option.php';
     }
 
     /**
diff --git a/plugins/userinfo/tests/Userinfo.php b/plugins/userinfo/tests/Userinfo.php
index 762d5a1..7eb0758 100644
--- a/plugins/userinfo/tests/Userinfo.php
+++ b/plugins/userinfo/tests/Userinfo.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../userinfo.php';
+        include_once __DIR__ . '/../userinfo.php';
     }
 
     /**
diff --git a/plugins/vcard_attachments/tests/VcardAttachments.php b/plugins/vcard_attachments/tests/VcardAttachments.php
index 35fd7f4..4b37cfc 100644
--- a/plugins/vcard_attachments/tests/VcardAttachments.php
+++ b/plugins/vcard_attachments/tests/VcardAttachments.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../vcard_attachments.php';
+        include_once __DIR__ . '/../vcard_attachments.php';
     }
 
     /**
diff --git a/plugins/virtuser_file/tests/VirtuserFile.php b/plugins/virtuser_file/tests/VirtuserFile.php
index a4362c3..80feecd 100644
--- a/plugins/virtuser_file/tests/VirtuserFile.php
+++ b/plugins/virtuser_file/tests/VirtuserFile.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../virtuser_file.php';
+        include_once __DIR__ . '/../virtuser_file.php';
     }
 
     /**
diff --git a/plugins/virtuser_query/tests/VirtuserQuery.php b/plugins/virtuser_query/tests/VirtuserQuery.php
index d5bd4ee..6c68f4c 100644
--- a/plugins/virtuser_query/tests/VirtuserQuery.php
+++ b/plugins/virtuser_query/tests/VirtuserQuery.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../virtuser_query.php';
+        include_once __DIR__ . '/../virtuser_query.php';
     }
 
     /**
diff --git a/plugins/zipdownload/tests/Zipdownload.php b/plugins/zipdownload/tests/Zipdownload.php
index f3b4e1b..3882dea 100644
--- a/plugins/zipdownload/tests/Zipdownload.php
+++ b/plugins/zipdownload/tests/Zipdownload.php
@@ -5,7 +5,7 @@
 
     function setUp()
     {
-        include_once dirname(__FILE__) . '/../zipdownload.php';
+        include_once __DIR__ . '/../zipdownload.php';
     }
 
     /**
diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php
index 98bbce5..fe9c389 100644
--- a/program/lib/Roundcube/bootstrap.php
+++ b/program/lib/Roundcube/bootstrap.php
@@ -58,7 +58,7 @@
 define('RCUBE_CHARSET', 'UTF-8');
 
 if (!defined('RCUBE_LIB_DIR')) {
-    define('RCUBE_LIB_DIR', dirname(__FILE__) . '/');
+    define('RCUBE_LIB_DIR', __DIR__ . '/');
 }
 
 if (!defined('RCUBE_INSTALL_PATH')) {
diff --git a/tests/Framework/VCard.php b/tests/Framework/VCard.php
index c23dba8..6eea2c1 100644
--- a/tests/Framework/VCard.php
+++ b/tests/Framework/VCard.php
@@ -10,7 +10,7 @@
 
     function _srcpath($fn)
     {
-        return realpath(dirname(__FILE__) . '/../src/' . $fn);
+        return realpath(__DIR__ . '/../src/' . $fn);
     }
 
     function test_parse_one()
diff --git a/tests/Selenium/bootstrap.php b/tests/Selenium/bootstrap.php
index ed9c2eb..124a81e 100644
--- a/tests/Selenium/bootstrap.php
+++ b/tests/Selenium/bootstrap.php
@@ -22,9 +22,9 @@
 if (php_sapi_name() != 'cli')
   die("Not in shell mode (php-cli)");
 
-if (!defined('INSTALL_PATH')) define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../../') . '/' );
+if (!defined('INSTALL_PATH')) define('INSTALL_PATH', realpath(__DIR__ . '/../../') . '/' );
 
-define('TESTS_DIR', dirname(__FILE__) . '/');
+define('TESTS_DIR', __DIR__ . '/');
 
 if (@is_dir(TESTS_DIR . 'config')) {
     define('RCUBE_CONFIG_DIR', TESTS_DIR . 'config');
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 192997d..bf7199c 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -22,9 +22,9 @@
 if (php_sapi_name() != 'cli')
   die("Not in shell mode (php-cli)");
 
-if (!defined('INSTALL_PATH')) define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' );
+if (!defined('INSTALL_PATH')) define('INSTALL_PATH', realpath(__DIR__ . '/..') . '/' );
 
-define('TESTS_DIR', dirname(__FILE__) . '/');
+define('TESTS_DIR', __DIR__ . '/');
 
 if (@is_dir(TESTS_DIR . 'config')) {
     define('RCUBE_CONFIG_DIR', TESTS_DIR . 'config');

--
Gitblit v1.9.1