diff --git a/.env.example b/.env.example index 50efe2f..89fc49f 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,12 @@ DARK_MODE=false + +SORT_ORDER=type +REVERSE_SORT=false + +HIDDEN_FILES="" +HIDE_APP_FILES=true +HIDE_VCS_FILES=true + +DATE_FORMAT="Y-m-d H:i:s" + +MAX_HASH_SIZE=1000000000 diff --git a/app/Bootstrap/FinderComposer.php b/app/Bootstrap/FinderComposer.php index 0500b21..9eacb80 100644 --- a/app/Bootstrap/FinderComposer.php +++ b/app/Bootstrap/FinderComposer.php @@ -41,7 +41,7 @@ class FinderComposer public function __invoke(): void { $finder = Finder::create()->depth(0)->followLinks(); - $finder->ignoreVCS($this->config->get('app.ignore_vcs_files', false)); + $finder->ignoreVCS($this->config->get('app.hide_vcs_files', false)); $finder->filter(function (SplFileInfo $file) { return ! $this->hiddenFiles()->contains($file->getRealPath()); }); diff --git a/app/config/app.php b/app/config/app.php index 57c9111..4b7c1bd 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -1,51 +1,52 @@ + * Possible values: type, natural, name, accessed, changed, modified * Default value: type */ - 'sort_order' => 'type', + 'sort_order' => Helpers::env('SORT_ORDER', 'type'), /** * Reverse the sort order. * - * Possible values: true, false * Default value: false */ - 'reverse_sort' => false, + 'reverse_sort' => Helpers::env('REVERSE_SORT', false), /** * Default date format. * * Default value: 'Y-m-d H:i:s' */ - 'date_format' => 'Y-m-d H:i:s', - - /** - * Whether or not to hide application files/directories form the listing. - * - * Default value: true - */ - 'hide_app_files' => true, + 'date_format' => Helpers::env('DATE_FORMAT', 'Y-m-d H:i:s'), /** * Description here... * * Default value: [] */ - 'hidden_files' => [ - // ... - ], + 'hidden_files' => array_map(function (string $file) { + return trim($file); + }, explode(',', Helpers::env('HIDDEN_FILES'))), + + /** + * Whether or not to hide application files/directories form the listing. + * + * Default value: true + */ + 'hide_app_files' => Helpers::env('HIDE_APP_FILES', true), /** * Hide version control system files (e.g. .git directories) from listing. * * Default value: true */ - 'ignore_vcs_files' => true, + 'hide_vcs_files' => Helpers::env('HIDE_VSC_FILES', true), /** * The maximum file size (in bytes) that can be hashed. This helps to @@ -53,5 +54,5 @@ return [ * * Defualt value: 1000000000 */ - 'max_hash_size' => 1000000000 + 'max_hash_size' => Helpers::env('MAX_HASH_SIZE', 1000000000) ]; diff --git a/app/config/view.php b/app/config/view.php index 44653d6..52839f0 100644 --- a/app/config/view.php +++ b/app/config/view.php @@ -12,6 +12,7 @@ return [ /** * Path to the view cache directory. + * Set to 'false' to disable view caching entirely. * * Default value: 'app/cache/views' */