https://github.com/orkan/utils
Bunch of scripts collected from all around the HDD
https://github.com/orkan/utils
apache-ant app application batch-script cli console php
Last synced: 6 months ago
JSON representation
Bunch of scripts collected from all around the HDD
- Host: GitHub
- URL: https://github.com/orkan/utils
- Owner: orkan
- License: mit
- Created: 2022-12-02T04:19:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T23:22:51.000Z (about 2 years ago)
- Last Synced: 2024-04-13T09:01:38.568Z (about 2 years ago)
- Topics: apache-ant, app, application, batch-script, cli, console, php
- Language: PHP
- Homepage:
- Size: 724 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE
Awesome Lists containing this project
README
# Utils `v13.1.0`
Bunch of scripts collected from all around the HDD
# Console app
`src/Application.php`
Simple, configurable, extendable, easy to use CLI app implementation.
## Usage
```php
// Define app config and modules
$Factory = new Factory([
'app_title' => 'My CLI app',
]);
// Initialize PHP env, load cmd line switches, set error handlers, etc...
$App = new Application( $Factory );
$App->run();
// Do something!
$Factory->Logger()->notice( 'Hello from ' . $Factory->get( 'app_title' ) );
```
See included tools in /bin dir for more examples.
# FORM Input generator
`src/Input.php`
HTML/PHP `` input parser.
Allows automatic import of values form POST like data arrays with value filtering.
Allows rendering html input elements straight from php array.
## Usage
Define:
```php
$fields = [
'text' => [
'type' => 'text',
'filter' => 'strtoupper',
],
'radios' => [
'type' => 'radio',
'defval' => 'radC',
'items' => [
'radA' => 'Tag A',
'radB' => 'Tag B',
'radC' => 'Tag C',
],
],
];
```
Parse:
```php
foreach ( $fields as $name => $field ) {
$Input = new Input( $field, $_POST ); // Create Input with value extracted from POST array
saveDB( $name, $Input->val() ); // Save filtered value to DB
echo $Input->getContents(); // Render element on HTML page
}
```
# Thumbnail generator
`src/Thumbnail.php`
@todo Add description...
# PHP cli apps
- `bin/app_env_switch.php` - Switch between multiple configuration files.
- `bin/app_files_quantity.php` - Copy files from one dir to another with quantity limit and sorting features.
## About
### Third Party Packages
- none
### Installation
`$ composer require orkan/utils`
### Author
[Orkan](https://github.com/orkan)
### License
MIT
### Updated
Fri, 19 Sep 2025 06:15:21 +02:00