Skip to content

Commit

Permalink
deploy: 38bb986
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq committed Feb 27, 2024
1 parent 8563407 commit bc43b8c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
20 changes: 10 additions & 10 deletions classes/rex-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ <h4 class="phpdocumentor-element__name" id="method_delete">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="redaxo-main/redaxo/src/core/lib/util/file.php"><a href="files/redaxo-main-redaxo-src-core-lib-util-file.html"><abbr title="redaxo-main/redaxo/src/core/lib/util/file.php">file.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">230</span>
<span class="phpdocumentor-element-found-in__line">236</span>

<a href="classes/rex-file.html#source-view.230" class="phpdocumentor-element-found-in__source" data-line="230" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
<a href="classes/rex-file.html#source-view.236" class="phpdocumentor-element-found-in__source" data-line="236" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Deletes a file.</p>
Expand Down Expand Up @@ -550,9 +550,9 @@ <h4 class="phpdocumentor-element__name" id="method_extension">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="redaxo-main/redaxo/src/core/lib/util/file.php"><a href="files/redaxo-main-redaxo-src-core-lib-util-file.html"><abbr title="redaxo-main/redaxo/src/core/lib/util/file.php">file.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">256</span>
<span class="phpdocumentor-element-found-in__line">262</span>

<a href="classes/rex-file.html#source-view.256" class="phpdocumentor-element-found-in__source" data-line="256" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
<a href="classes/rex-file.html#source-view.262" class="phpdocumentor-element-found-in__source" data-line="262" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Extracts the extension of the given filename.</p>
Expand Down Expand Up @@ -619,9 +619,9 @@ <h4 class="phpdocumentor-element__name" id="method_formattedSize">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="redaxo-main/redaxo/src/core/lib/util/file.php"><a href="files/redaxo-main-redaxo-src-core-lib-util-file.html"><abbr title="redaxo-main/redaxo/src/core/lib/util/file.php">file.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">301</span>
<span class="phpdocumentor-element-found-in__line">307</span>

<a href="classes/rex-file.html#source-view.301" class="phpdocumentor-element-found-in__source" data-line="301" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
<a href="classes/rex-file.html#source-view.307" class="phpdocumentor-element-found-in__source" data-line="307" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Formates the filesize of the given file into a userfriendly form.</p>
Expand Down Expand Up @@ -913,9 +913,9 @@ <h4 class="phpdocumentor-element__name" id="method_getOutput">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="redaxo-main/redaxo/src/core/lib/util/file.php"><a href="files/redaxo-main-redaxo-src-core-lib-util-file.html"><abbr title="redaxo-main/redaxo/src/core/lib/util/file.php">file.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">313</span>
<span class="phpdocumentor-element-found-in__line">319</span>

<a href="classes/rex-file.html#source-view.313" class="phpdocumentor-element-found-in__source" data-line="313" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
<a href="classes/rex-file.html#source-view.319" class="phpdocumentor-element-found-in__source" data-line="319" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Gets executed content of given file.</p>
Expand Down Expand Up @@ -966,9 +966,9 @@ <h4 class="phpdocumentor-element__name" id="method_mimeType">
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="redaxo-main/redaxo/src/core/lib/util/file.php"><a href="files/redaxo-main-redaxo-src-core-lib-util-file.html"><abbr title="redaxo-main/redaxo/src/core/lib/util/file.php">file.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">268</span>
<span class="phpdocumentor-element-found-in__line">274</span>

<a href="classes/rex-file.html#source-view.268" class="phpdocumentor-element-found-in__source" data-line="268" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
<a href="classes/rex-file.html#source-view.274" class="phpdocumentor-element-found-in__source" data-line="274" data-modal="source-view" data-src="files/redaxo-main/redaxo/src/core/lib/util/file.php.txt"></a>
</aside>

<p class="phpdocumentor-summary">Detects the mime type of the given file.</p>
Expand Down
10 changes: 8 additions & 2 deletions files/redaxo-main/redaxo/src/core/lib/util/file.php.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class rex_file

// mimic a atomic write
$tmpFile = @tempnam(dirname($file), rex_path::basename($file));
if (false !== file_put_contents($tmpFile, $content) && rename($tmpFile, $file)) {
if (false !== file_put_contents($tmpFile, $content) && self::move($tmpFile, $file)) {
@chmod($file, rex::getFilePerm());
return true;
}
Expand Down Expand Up @@ -217,7 +217,13 @@ class rex_file
*/
public static function move(string $srcfile, string $dstfile): bool
{
return rename($srcfile, $dstfile);
if (@rename($srcfile, $dstfile)) {
return true;
}
if (copy($srcfile, $dstfile)) {
return unlink($srcfile);
}
return false;
}

/**
Expand Down

0 comments on commit bc43b8c

Please sign in to comment.