diff options
author | Andreas Fischer <bantu@owncloud.com> | 2013-08-21 10:59:31 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-08-21 11:01:24 +0200 |
commit | 83afb46205ef9b2235a4b978beed44267d3e6c81 (patch) | |
tree | 13f1aa5b088267fe914df633248551cc5f3c7d3d /apps/files_encryption | |
parent | 85ac9572ce4f43d1a87dfdfd898b17493f9f8539 (diff) | |
download | nextcloud-server-83afb46205ef9b2235a4b978beed44267d3e6c81.tar.gz nextcloud-server-83afb46205ef9b2235a4b978beed44267d3e6c81.zip |
Use __DIR__ instead of dirname(__FILE__).
This is possible because we require PHP 5.3 or higher.
Diffstat (limited to 'apps/files_encryption')
-rwxr-xr-x | apps/files_encryption/lib/crypt.php | 2 | ||||
-rwxr-xr-x | apps/files_encryption/tests/crypt.php | 30 | ||||
-rw-r--r-- | apps/files_encryption/tests/keymanager.php | 26 | ||||
-rwxr-xr-x | apps/files_encryption/tests/share.php | 20 | ||||
-rw-r--r-- | apps/files_encryption/tests/stream.php | 16 | ||||
-rwxr-xr-x | apps/files_encryption/tests/trashbin.php | 18 | ||||
-rwxr-xr-x | apps/files_encryption/tests/util.php | 24 | ||||
-rwxr-xr-x | apps/files_encryption/tests/webdav.php | 16 |
8 files changed, 76 insertions, 76 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index 47801252bbd..e129bc9313e 100755 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -25,7 +25,7 @@ namespace OCA\Encryption;
-require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
+require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php';
/**
* Class for common cryptography functionality
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 188606ee1c5..f73647d8af5 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -7,16 +7,16 @@ * See the COPYING-README file. */ -require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php'; -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../lib/helper.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../lib/helper.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; @@ -67,12 +67,12 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1; // set content for encrypting / decrypting in tests - $this->dataLong = file_get_contents(dirname(__FILE__) . '/../lib/crypt.php'); + $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php'); $this->dataShort = 'hats'; - $this->dataUrl = dirname(__FILE__) . '/../lib/crypt.php'; - $this->legacyData = dirname(__FILE__) . '/legacy-text.txt'; - $this->legacyEncryptedData = dirname(__FILE__) . '/legacy-encrypted-text.txt'; - $this->legacyEncryptedDataKey = dirname(__FILE__) . '/encryption.key'; + $this->dataUrl = __DIR__ . '/../lib/crypt.php'; + $this->legacyData = __DIR__ . '/legacy-text.txt'; + $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt'; + $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key'; $this->randomKey = Encryption\Crypt::generateKey(); $keypair = Encryption\Crypt::createKeypair(); diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php index 308cdd40327..0fe9ce9ed59 100644 --- a/apps/files_encryption/tests/keymanager.php +++ b/apps/files_encryption/tests/keymanager.php @@ -6,15 +6,15 @@ * See the COPYING-README file. */ -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../lib/helper.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../lib/helper.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; @@ -57,11 +57,11 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase { function setUp() { // set content for encrypting / decrypting in tests - $this->dataLong = file_get_contents(dirname(__FILE__) . '/../lib/crypt.php'); + $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php'); $this->dataShort = 'hats'; - $this->dataUrl = dirname(__FILE__) . '/../lib/crypt.php'; - $this->legacyData = dirname(__FILE__) . '/legacy-text.txt'; - $this->legacyEncryptedData = dirname(__FILE__) . '/legacy-encrypted-text.txt'; + $this->dataUrl = __DIR__ . '/../lib/crypt.php'; + $this->legacyData = __DIR__ . '/legacy-text.txt'; + $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt'; $this->randomKey = Encryption\Crypt::generateKey(); $keypair = Encryption\Crypt::createKeypair(); diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php index 7f68ecd388a..bc3f93ff701 100755 --- a/apps/files_encryption/tests/share.php +++ b/apps/files_encryption/tests/share.php @@ -20,16 +20,16 @@ * */ -require_once dirname(__FILE__) . '/../3rdparty/Crypt_Blowfish/Blowfish.php'; -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../lib/helper.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../3rdparty/Crypt_Blowfish/Blowfish.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../lib/helper.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php index adc0d1959a0..3095d50613c 100644 --- a/apps/files_encryption/tests/stream.php +++ b/apps/files_encryption/tests/stream.php @@ -20,14 +20,14 @@ * */ -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php index 55ec94782eb..e33add74829 100755 --- a/apps/files_encryption/tests/trashbin.php +++ b/apps/files_encryption/tests/trashbin.php @@ -20,15 +20,15 @@ * */ -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/../../files_trashbin/appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/../../files_trashbin/appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php index 8a00c51d5b6..eddc4c6b3ff 100755 --- a/apps/files_encryption/tests/util.php +++ b/apps/files_encryption/tests/util.php @@ -6,13 +6,13 @@ * See the COPYING-README file. */ -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../appinfo/app.php'; use OCA\Encryption; @@ -69,12 +69,12 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase { $this->pass = \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1; // set content for encrypting / decrypting in tests - $this->dataUrl = dirname(__FILE__) . '/../lib/crypt.php'; + $this->dataUrl = __DIR__ . '/../lib/crypt.php'; $this->dataShort = 'hats'; - $this->dataLong = file_get_contents(dirname(__FILE__) . '/../lib/crypt.php'); - $this->legacyData = dirname(__FILE__) . '/legacy-text.txt'; - $this->legacyEncryptedData = dirname(__FILE__) . '/legacy-encrypted-text.txt'; - $this->legacyEncryptedDataKey = dirname(__FILE__) . '/encryption.key'; + $this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php'); + $this->legacyData = __DIR__ . '/legacy-text.txt'; + $this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt'; + $this->legacyEncryptedDataKey = __DIR__ . '/encryption.key'; $this->legacyKey = "30943623843030686906\0\0\0\0"; $keypair = Encryption\Crypt::createKeypair(); diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php index b72f6816951..5c2f87b145d 100755 --- a/apps/files_encryption/tests/webdav.php +++ b/apps/files_encryption/tests/webdav.php @@ -20,14 +20,14 @@ * */ -require_once dirname(__FILE__) . '/../../../lib/base.php'; -require_once dirname(__FILE__) . '/../lib/crypt.php'; -require_once dirname(__FILE__) . '/../lib/keymanager.php'; -require_once dirname(__FILE__) . '/../lib/proxy.php'; -require_once dirname(__FILE__) . '/../lib/stream.php'; -require_once dirname(__FILE__) . '/../lib/util.php'; -require_once dirname(__FILE__) . '/../appinfo/app.php'; -require_once dirname(__FILE__) . '/util.php'; +require_once __DIR__ . '/../../../lib/base.php'; +require_once __DIR__ . '/../lib/crypt.php'; +require_once __DIR__ . '/../lib/keymanager.php'; +require_once __DIR__ . '/../lib/proxy.php'; +require_once __DIR__ . '/../lib/stream.php'; +require_once __DIR__ . '/../lib/util.php'; +require_once __DIR__ . '/../appinfo/app.php'; +require_once __DIR__ . '/util.php'; use OCA\Encryption; |