Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3885818
Add workflow for 32bits testing
come-nc Jan 12, 2023
e156f83
Revert "remove 32-bit workarounds"
come-nc Jan 12, 2023
b370fdb
Running all tests on 32bits to see what happens
come-nc Jan 16, 2023
2d8e696
Add apcu and ffmpeg to have less skipped tests
come-nc Jan 20, 2023
ff776a9
Strong type filesize related methods to ease 32bits problem findings
come-nc Jan 20, 2023
d9dbed9
Fix psalm errors related to filesizes
come-nc Jan 23, 2023
5cfab22
Improve test failure output for RouterTest.php
come-nc Jan 23, 2023
255f230
Fix bigsize support on 32bits in OC_Helper
come-nc Jan 23, 2023
0f8c34c
Fix filesize return type error in ViewTest
come-nc Jan 23, 2023
94ecae4
Add helper to cast to int|float, fix MemoryInfo on 32bits
come-nc Jan 23, 2023
7a628c0
Fix 32bits bigint support in Util/OC_Helper
come-nc Jan 23, 2023
0753be3
Fix a few tests that were using too big int values for 32bits
come-nc Jan 23, 2023
d00422b
Fix computerFileSize when called with a string without unit
come-nc Jan 23, 2023
5aed587
Fix setQuota on User on 32bits
come-nc Jan 23, 2023
5c1a0e0
Allow float sizes in FileInfo for 32bits
come-nc Jan 23, 2023
cd885b5
Type sizes as int|float throughout the code base
come-nc Jan 23, 2023
77c8c9c
Improve error output on failed Router test
come-nc Jan 23, 2023
110fc79
Silence errors of return type mismatch from Sabre for now
come-nc Jan 23, 2023
d315bce
Improve behavior with dates on 32bits and fix tests or skip them
come-nc Jan 23, 2023
b7d9e43
Put back string in $includeMounts as it actually does something
come-nc Jan 24, 2023
db80ac0
Fix name of skip method for phpunit
come-nc Jan 24, 2023
028c225
Fix psalm errors
come-nc Jan 24, 2023
1994554
Fix Sabre connector test
come-nc Jan 24, 2023
885e54e
Psalm easy fixes in apps/files/appinfo/routes.php
come-nc Jan 24, 2023
892e6c6
Skip buggy tests for 32bits CI
come-nc Jan 24, 2023
476d5dc
Skip tests that cannot succeed on 32bits
come-nc Jan 30, 2023
33b5207
Only run 32bit CI once a day
come-nc Jan 30, 2023
1765908
Document that size may be a float in new class VersionEntity
come-nc Jan 30, 2023
c4d90f3
Removed catch of ValueError as we cannot know if it’s >2038 or <1970
come-nc Feb 2, 2023
09a97ad
Move back typing to phpdoc to keep backward compatibility in OCP
come-nc Feb 6, 2023
308fcf4
Respect OCP interface in private classes
come-nc Feb 6, 2023
6e276ad
Show logs on smb-kerberos CI failure
come-nc Feb 7, 2023
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
Prev Previous commit
Next Next commit
Fix psalm errors related to filesizes
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Feb 7, 2023
commit d9dbed91050e80ab15768c278a1aecdfc3a1efda
4 changes: 2 additions & 2 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,9 @@ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
$result = $this->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, true);
if ($result) {
if ($sourceStorage->is_dir($sourceInternalPath)) {
$result = $result && $sourceStorage->rmdir($sourceInternalPath);
$result = $sourceStorage->rmdir($sourceInternalPath);
} else {
$result = $result && $sourceStorage->unlink($sourceInternalPath);
$result = $sourceStorage->unlink($sourceInternalPath);
}
}
return $result;
Expand Down
3 changes: 3 additions & 0 deletions lib/private/Files/Storage/Wrapper/Availability.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ public function getMetaData($path) {
}

/**
* @template T of StorageNotAvailableException|null
* @param T $e
* @psalm-return (T is null ? void : never)
* @throws StorageNotAvailableException
*/
protected function setUnavailable(?StorageNotAvailableException $e): void {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/Wrapper/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function __construct(
* see https://www.php.net/manual/en/function.filesize.php
* The result for filesize when called on a folder is required to be 0
*/
public function filesize(string $path): int|float {
public function filesize(string $path): false|int|float {
$fullPath = $this->getFullPath($path);

/** @var CacheEntry $info */
Expand Down
6 changes: 3 additions & 3 deletions lib/private/Files/Stream/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public function __construct() {
* @param \OC\Encryption\Util $util
* @param \OC\Encryption\File $file
* @param string $mode
* @param int $size
* @param int $unencryptedSize
* @param int|float $size
* @param int|float $unencryptedSize
* @param int $headerSize
* @param bool $signed
* @param string $wrapper stream wrapper class
Expand All @@ -158,7 +158,7 @@ public static function wrap($source, $internalPath, $fullPath, array $header,
\OC\Files\Storage\Storage $storage,
\OC\Files\Storage\Wrapper\Encryption $encStorage,
\OC\Encryption\Util $util,
\OC\Encryption\File $file,
\OC\Encryption\File $file,
$mode,
$size,
$unencryptedSize,
Expand Down
7 changes: 2 additions & 5 deletions lib/private/LargeFileHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,18 @@ public function getFileSizeNative(string $filename): int|float {

/**
* Returns the current mtime for $fullPath
*
* @param string $fullPath
* @return int
*/
public function getFileMtime(string $fullPath): int {
try {
$result = filemtime($fullPath);
$result = filemtime($fullPath) ?: -1;
} catch (\Exception $e) {
$result = - 1;
}
if ($result < 0) {
if (\OCP\Util::isFunctionEnabled('exec')) {
$os = strtolower(php_uname('s'));
if (strpos($os, 'linux') !== false) {
return $this->exec('stat -c %Y ' . escapeshellarg($fullPath));
return (int)($this->exec('stat -c %Y ' . escapeshellarg($fullPath)) ?? -1);
}
}
}
Expand Down