diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-12-10 05:22:37 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-12-10 05:22:37 +0000 |
| commit | 0ef2dd7175248e1116a867e0a86579d9f6ca16eb (patch) | |
| tree | 452fc6e3391544b209ea075d587935e7ab42e714 /vendor/thecodingmachine/safe/generated/dir.php | |
| parent | f15db7b9610467aa29f6441361fdc4e6c90deaa1 (diff) | |
| parent | 3860435cba19cf2cd9c86dcc5d8938198c6b6736 (diff) | |
Merge branch 'feature/alpine_3.21-and-php_8.4' into 'master'
Bump to Alpine 3.21 and PHP 8.4, raise the minimum to PHP 8.2
See merge request tt-rss/tt-rss!85
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/dir.php')
| -rw-r--r-- | vendor/thecodingmachine/safe/generated/dir.php | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/vendor/thecodingmachine/safe/generated/dir.php b/vendor/thecodingmachine/safe/generated/dir.php deleted file mode 100644 index fe4ea5af5..000000000 --- a/vendor/thecodingmachine/safe/generated/dir.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Safe; - -use Safe\Exceptions\DirException; - -/** - * Changes PHP's current directory to - * directory. - * - * @param string $directory The new current directory - * @throws DirException - * - */ -function chdir(string $directory): void -{ - error_clear_last(); - $result = \chdir($directory); - if ($result === false) { - throw DirException::createFromPhpError(); - } -} - - -/** - * Changes the root directory of the current process to - * directory, and changes the current - * working directory to "/". - * - * This function is only available to GNU and BSD systems, and - * only when using the CLI, CGI or Embed SAPI. Also, this function - * requires root privileges. - * - * Calling this function does not change the values of the __DIR__ - * and __FILE__ magic constants. - * - * @param string $directory The path to change the root directory to. - * @throws DirException - * - */ -function chroot(string $directory): void -{ - error_clear_last(); - $result = \chroot($directory); - if ($result === false) { - throw DirException::createFromPhpError(); - } -} - - -/** - * Gets the current working directory. - * - * @return string Returns the current working directory on success. - * - * On some Unix variants, getcwd will return - * FALSE if any one of the parent directories does not have the - * readable or search mode set, even if the current directory - * does. See chmod for more information on - * modes and permissions. - * @throws DirException - * - */ -function getcwd(): string -{ - error_clear_last(); - $result = \getcwd(); - if ($result === false) { - throw DirException::createFromPhpError(); - } - return $result; -} - - -/** - * Opens up a directory handle to be used in subsequent - * closedir, readdir, and - * rewinddir calls. - * - * @param string $directory The directory path that is to be opened - * @param resource $context For a description of the context parameter, - * refer to the streams section of - * the manual. - * @return resource Returns a directory handle resource on success - * @throws DirException - * - */ -function opendir(string $directory, $context = null) -{ - error_clear_last(); - if ($context !== null) { - $result = \opendir($directory, $context); - } else { - $result = \opendir($directory); - } - if ($result === false) { - throw DirException::createFromPhpError(); - } - return $result; -} - - -/** - * Returns an array of files and directories from the - * directory. - * - * @param string $directory The directory that will be scanned. - * @param int $sorting_order By default, the sorted order is alphabetical in ascending order. If - * the optional sorting_order is set to - * SCANDIR_SORT_DESCENDING, then the sort order is - * alphabetical in descending order. If it is set to - * SCANDIR_SORT_NONE then the result is unsorted. - * @param resource $context For a description of the context parameter, - * refer to the streams section of - * the manual. - * @return array Returns an array of filenames on success. If directory is not a directory, then - * boolean FALSE is returned, and an error of level - * E_WARNING is generated. - * @throws DirException - * - */ -function scandir(string $directory, int $sorting_order = SCANDIR_SORT_ASCENDING, $context = null): array -{ - error_clear_last(); - if ($context !== null) { - $result = \scandir($directory, $sorting_order, $context); - } else { - $result = \scandir($directory, $sorting_order); - } - if ($result === false) { - throw DirException::createFromPhpError(); - } - return $result; -} |