Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/attitude/index-php
Walks tree and generates index.php [devtool]
https://github.com/attitude/index-php
Last synced: about 6 hours ago
JSON representation
Walks tree and generates index.php [devtool]
- Host: GitHub
- URL: https://github.com/attitude/index-php
- Owner: attitude
- License: mit
- Created: 2020-10-08T07:41:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-03-29T18:43:10.000Z (8 months ago)
- Last Synced: 2024-03-29T19:43:25.711Z (8 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# index.php [devtool]
Walks the directory tree and generates `index.php` files for deeply nested file structures:
```
(root)
├- dir-1
| ├- dir-1-1
| | ├- file-1.php
| | ├- file-2.php
| | ├- ...
| | ├- file-n.php
| | └> index.php
| ├- dir-1-2
| | └> index.php
| ├- ...
| ├- dir-1-n
| | └> index.php
| ├- file-1.php
| ├- file-2.php
| ├- ...
| ├- file-n.php
| └> index.php
├- dir-2
| └> index.php
├- ...
├- dir-n
| └> index.php
└> index.php
```All the `*.php` files of the directory are required within its `index.php` as well as the `index.php`s of the subdirectories directories of the directory and so on up to the root.
## Using via command line
Only `-path` parameter is required. Use `-dry on` to test results. Turn `-backup off` as soon as you don't need backups and nothing gets lost/overwritten.
```
$ /path/to/index-php/run.sh -path "/to/walk"
```Shorthand | Argument | Description | Default
----------|------------|-----------------------------------|--------
-h | -help | Shows help. | –
-p | -path | Path to directory to process. | -
-b | -backup | Create backups of index files. | `true`
-d | -dry | Dry run without applying changes. | `false`
-r | -recursive | Walk directories recursively. | `true`
-e | -exclude | Regex pattern to exclude files. | –
-i | -include | Regex pattern to include files. | –