Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ pipeline:
image: plugins/git
depth: 1
jsunit:
image: nextcloudci/jsunit:1.0.6
image: nextcloudci/jsunit:jsunit-5
commands:
- ./autotest-js.sh
when:
matrix:
TESTS: jsunit
nodb-php5.4:
image: nextcloudci/php5.4:1.0.7
image: nextcloudci/php5.4:php5.4-5
commands:
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
when:
matrix:
DB: NODB
PHP: 5.4
nodb-php5.5:
image: nextcloudci/php5.5:1.0.7
image: nextcloudci/php5.5:php5.5-5
commands:
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
when:
matrix:
DB: NODB
PHP: 5.5
app-check-code:
image: nextcloudci/php7.0:php7.0-2
image: nextcloudci/php7.0:php7.0-6
commands:
- ./occ app:check-code admin_audit
- ./occ app:check-code comments
Expand All @@ -36,55 +36,55 @@ pipeline:
matrix:
TESTS: app-check-code
syntax-php5.4:
image: nextcloudci/php5.4:1.0.14
image: nextcloudci/php5.4:php5.4-5
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php .
when:
matrix:
TESTS: syntax-php5.4
syntax-php5.5:
image: nextcloudci/php5.5:1.0.14
image: nextcloudci/php5.5:php5.5-5
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php .
when:
matrix:
TESTS: syntax-php5.5
syntax-php5.6:
image: nextcloudci/php5.6:php5.6-2
image: nextcloudci/php5.6:php5.6-7
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php .
when:
matrix:
TESTS: syntax-php5.6
syntax-php7.0:
image: nextcloudci/php7.0:php7.0-2
image: nextcloudci/php7.0:php7.0-6
commands:
- composer install
- ./lib/composer/bin/parallel-lint --exclude lib/composer/jakub-onderka/ --exclude 3rdparty/symfony/polyfill-php70/Resources/stubs/ --exclude 3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/ --exclude 3rdparty/paragonie/random_compat/lib/ --exclude lib/composer/composer/autoload_static.php --exclude 3rdparty/composer/autoload_static.php .
when:
matrix:
TESTS: syntax-php7.0
litmus-v1:
image: nextcloudci/litmus-php7.0:litmus-php7.0-2
image: nextcloudci/litmus-php7.0:litmus-php7.0-4
commands:
- bash tests/travis/install.sh sqlite
- bash apps/dav/tests/travis/litmus-v1/script.sh
when:
matrix:
TESTS: litmus-v1
litmus-v2:
image: nextcloudci/litmus-php7.0:litmus-php7.0-2
image: nextcloudci/litmus-php7.0:litmus-php7.0-4
commands:
- bash tests/travis/install.sh sqlite
- bash apps/dav/tests/travis/litmus-v2/script.sh
when:
matrix:
TESTS: litmus-v2
caldavtester:
image: nextcloudci/litmus-php7.0:litmus-php7.0-2
image: nextcloudci/litmus-php7.0:litmus-php7.0-4
commands:
- bash tests/travis/install.sh sqlite
- bash apps/dav/tests/travis/caldav/install.sh
Expand All @@ -93,7 +93,7 @@ pipeline:
matrix:
TESTS: caldavtester
carddavtester:
image: nextcloudci/litmus-php7.0:litmus-php7.0-2
image: nextcloudci/litmus-php7.0:litmus-php7.0-4
commands:
- bash tests/travis/install.sh sqlite
- bash apps/dav/tests/travis/carddav/install.sh
Expand All @@ -102,55 +102,55 @@ pipeline:
matrix:
TESTS: carddavtester
nodb-php5.6:
image: nextcloudci/php5.6:1.0.6
image: nextcloudci/php5.6:php5.6-7
commands:
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
when:
matrix:
DB: NODB
PHP: 5.6
nodb-php7.0:
image: nextcloudci/php7.0:1.0.9
image: nextcloudci/php7.0:php7.0-6
commands:
- NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
when:
matrix:
DB: NODB
PHP: "7.0"
sqlite-php5.4:
image: nextcloudci/php5.4:1.0.7
image: nextcloudci/php5.4:php5.4-5
commands:
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
when:
matrix:
DB: sqlite
PHP: 5.4
sqlite-php5.5:
image: nextcloudci/php5.5:1.0.7
image: nextcloudci/php5.5:php5.5-5
commands:
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
when:
matrix:
DB: sqlite
PHP: 5.5
sqlite-php5.6:
image: nextcloudci/php5.6:1.0.6
image: nextcloudci/php5.6:php5.6-7
commands:
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
when:
matrix:
DB: sqlite
PHP: 5.6
sqlite-php7.0:
image: nextcloudci/php7.0:1.0.9
image: nextcloudci/php7.0:php7.0-6
commands:
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
when:
matrix:
DB: sqlite
PHP: "7.0"
mysql-php5.6:
image: nextcloudci/php5.6:1.0.6
image: nextcloudci/php5.6:php5.6-7
commands:
- sleep 15 # gives the database enough time to initialize
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql
Expand All @@ -159,7 +159,7 @@ pipeline:
DB: mysql
PHP: 5.6
postgres-php5.6:
image: nextcloudci/php5.6:1.0.6
image: nextcloudci/php5.6:php5.6-7
commands:
- sleep 10 # gives the database enough time to initialize
- NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql
Expand All @@ -168,7 +168,7 @@ pipeline:
DB: postgres
PHP: 5.6
integration:
image: nextcloudci/php7.0:1.0.9
image: nextcloudci/php7.0:php7.0-6
commands:
- ./occ maintenance:install --admin-pass=admin
- cd build/integration
Expand Down
17 changes: 0 additions & 17 deletions lib/private/LargeFileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,6 @@ public function getFileSizeViaCurl($fileName) {
return null;
}

/**
* @brief Tries to get the size of a file via the Windows DOM extension.
*
* @param string $filename Path to the file.
*
* @return null|int|float Number of bytes as number (float or int) or
* null on failure.
*/
public function getFileSizeViaCOM($filename) {
if (class_exists('COM')) {
$fsObj = new \COM("Scripting.FileSystemObject");
$file = $fsObj->GetFile($filename);
return 0 + $file->Size;
}
return null;
}

/**
* @brief Tries to get the size of a file via an exec() call.
*
Expand Down
32 changes: 30 additions & 2 deletions lib/private/Memcache/APCu.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,21 @@ public function add($key, $value, $ttl = 0) {
*/
public function inc($key, $step = 1) {
$this->add($key, 0);
return apcu_inc($this->getPrefix() . $key, $step);
/**
* TODO - hack around a PHP 7 specific issue in APCu
*
* on PHP 7 the apcu_inc method on a non-existing object will increment
* "0" and result in "1" as value - therefore we check for existence
* first
*
* on PHP 5.6 this is not the case
*
* see https://github.com/krakjoe/apcu/issues/183#issuecomment-244038221
* for details
*/
return apcu_exists($this->getPrefix() . $key)
? apcu_inc($this->getPrefix() . $key, $step)
: false;
}

/**
Expand All @@ -99,7 +113,21 @@ public function inc($key, $step = 1) {
* @return int | bool
*/
public function dec($key, $step = 1) {
return apcu_dec($this->getPrefix() . $key, $step);
/**
* TODO - hack around a PHP 7 specific issue in APCu
*
* on PHP 7 the apcu_dec method on a non-existing object will decrement
* "0" and result in "-1" as value - therefore we check for existence
* first
*
* on PHP 5.6 this is not the case
*
* see https://github.com/krakjoe/apcu/issues/183#issuecomment-244038221
* for details
*/
return apcu_exists($this->getPrefix() . $key)
? apcu_dec($this->getPrefix() . $key, $step)
: false;
}

/**
Expand Down
15 changes: 0 additions & 15 deletions tests/lib/LargeFileHelperGetFileSizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@ public function testGetFileSizeViaCurl($filename, $fileSize) {
);
}

/**
* @dataProvider dataFileNameProvider
*/
public function testGetFileSizeViaCOM($filename, $fileSize) {
if (!extension_loaded('COM')) {
$this->markTestSkipped(
'The PHP Windows COM extension is required for this test.'
);
}
$this->assertSame(
$fileSize,
$this->helper->getFileSizeViaCOM($filename)
);
}

/**
* @dataProvider dataFileNameProvider
*/
Expand Down