orkan / utils
Helper functions
9.0.0
2024-05-17 13:45 UTC
Requires
- composer-runtime-api: ^2.2
Requires (Dev)
- monolog/monolog: ^2.9
- phpunit/phpunit: ^9.6
- dev-master / 9.0.x-dev
- 9.0.0
- 8.1.0
- 8.0.0
- 7.1.0
- 7.0.0
- 7.0.0-RC4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.1.0
- 5.0.0
- 4.0.0
- 3.10.3
- 3.10.2
- 3.10.1
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.13
- 1.5.12
- 1.5.11
- 1.5.10
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-11-17 14:45:59 UTC
README
Bunch of scripts collected from all around the HDD
Console app
src/Application.php
Simple, configurable, extendable, easy to use CLI app implementation.
Usage
// 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 <form>
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:
$fields = [ 'text' => [ 'type' => 'text', 'filter' => 'strtoupper', ], 'radios' => [ 'type' => 'radio', 'defval' => 'radC', 'items' => [ 'radA' => 'Tag A', 'radB' => 'Tag B', 'radC' => 'Tag C', ], ], ];
Parse:
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
Requirements
- Main:
- PHP ^7
- Tools:
- ANT ^1.9.4
- DOS
- Eclipse
- MySQL
Third Party Packages
- none
Installation
$ composer require orkan/utils
Author
License
MIT
Updated
Fri, 17 May 2024 15:45:33 +02:00