1. Go to this page and download the library: Download italix/console library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
italix / console example snippets
namespace App\Console;
use Italix\Console\{BaseCommand, Input, Output};
use Italix\Orm\DataManager;
final class PurgeTokensCommand extends BaseCommand
{
/** Injected by the runner — protected, because BaseCommand assigns it */
protected DataManager $dm;
public static function name_code(): string { return 'tokens:purge'; }
public static function summary(): string { return 'Delete expired verification tokens.'; }
public static function depends_on(): array
{
return ['dm' => DataManager::class];
}
public function run(Input $in, Output $out): int
{
$days_n = $in->int_option('older-than', 30);
if ($in->flag('dry-run')) {
$out->comment("Would purge tokens older than {$days_n} days.");
return 0;
}
$done_n = $this->dm->execute('DELETE FROM …')->rowCount();
$out->success("{$done_n} tokens purged.");
return 0;
}
}
bash
php bin/ix # every command, grouped
php bin/ix migrate --dry-run # what would run, without running it
php bin/ix encode:lint # template output that is not encoded
php bin/ix version # every Italix library and its version
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.