PHPackages                             chez14/f3-ilgar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. chez14/f3-ilgar

ActiveLibrary[Database &amp; ORM](/categories/database)

chez14/f3-ilgar
===============

A simple migration tool for Fat-Free Framework

v1.1.0(6y ago)56472[1 issues](https://github.com/chez14/f3-ilgar/issues)[1 PRs](https://github.com/chez14/f3-ilgar/pulls)1GPL-3.0-onlyPHPPHP &gt;=7.1

Since Sep 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/chez14/f3-ilgar)[ Packagist](https://packagist.org/packages/chez14/f3-ilgar)[ Docs](https://github.com/chez14/f3-ilgar)[ RSS](/packages/chez14-f3-ilgar/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (11)Used By (1)

Ilgar
=====

[](#ilgar)

[![PHP from Packagist](https://camo.githubusercontent.com/c26ea67a400743d7a5a4a938170f3e99d362d8c6660c90fbb23b83751fe7ce3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6368657a31342f66332d696c6761722e7376673f7374796c653d666c61742d737175617265)](https://github.com/chez14/f3-ilgar)[![Travis (.org)](https://camo.githubusercontent.com/077885007cda44cff92d7fb82f4815acf4ca6ab49fabdc720f39a3059c79fd32/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6368657a31342f66332d696c6761722e7376673f7374796c653d666c61742d737175617265)](https://github.com/chez14/f3-ilgar) [![Packagist](https://camo.githubusercontent.com/29f4a6373c2843148f9d64a43507e4634b6f4e134d20409b1b57a95d5c795553/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368657a31342f66332d696c6761722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chez14/f3-ilgar) [![GitHub release](https://camo.githubusercontent.com/079cbebc3175431713c9918818ef047fb104589b86274fba45bc5877d5f852a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6368657a31342f66332d696c6761722e7376673f7374796c653d666c61742d737175617265)](https://github.com/chez14/f3-ilgar)

Quick and simple migration tool for Fat-Free Framework.

Getting Started
---------------

[](#getting-started)

1. Install via Composer

    ```
    composer require chez14/f3-ilgar
    ```
2. Decide your bombarding option

    - **Do it with default configuration?**Default settings:

        - Call `/ilgar/migrate` to do migration
        - Use `Migration` as your migration class namespace prefix
        - Migration packets placed in a `Migration` or `migration` folder in your project root folder.

        Then, just add this to your `index.php` file:

        ```
        \Chez14\Ilgar\Boot::now();
        ```
    - **Do it with your own style and custom security?**

        Just invoke `\Chez14\Ilgar\Boot::trigger_on();` Anywhere at your controller. This will trigger migration process and returns [quick stats](#quick-stats).
3. Create your first ever migration packet
4. Deploy migration by accessing `/ilgar/migrate`

    ```
    curl http://localhost:8087/ilgar/migrate
    ```

    or

    ```
    php index.php /ilgar/migrate
    ```

`MigrationPacket` Class Example
-------------------------------

[](#migrationpacket-class-example)

This file is available on your `migration` folder, located on your project root folder. Alternatively you can set the folder by setting `ILGAR.path`.

```
$this->f3->set('ILGAR.path', "new-folder/");
```

---

**IMPORTANT!** The file name should be formatted as "0-classname.php", where the 0 is any number (you can use just normal number `1-ClassName.php`, or CI-style timestamp `180901012400-ClassName.php`), seperated with single dash, and followed with your class name, either in lowercase, SnakeCase, or camelCase.

**IMPORTANT!** You need to **extends** `\Chez14\Ilgar\MigrationPacket` class. This will ensure required methods is always available and dependable.

---

Here's your file: `1-test01.php`.

```
namespace Migration;

class Test01 extends \Chez14\Ilgar\MigrationPacket {
    public function on_migrate(){
        // Do your things here!
        // All the F3 object were loaded, F3 routines executed,
        // this will just like you doing things in your controller file.

        $f3 = \F3::instance(); //get the $f3 from here.

        echo "Hello from Test01 Migration package";
    }

    public function on_failed(\Exception $e) {

    }
}
```

`MigrationPacket` abstract class
--------------------------------

[](#migrationpacket-abstract-class)

It's just a normal class. With something that you need to implement:

- `on_migrate()`
- `on_failed(\Exception $e)`

Ilgar has 2 ability, *bomb* and *self-destruct*. **Bomb** means do the migration mission (`on_migrate`), **self-destruct** means when it failed do the mission it will use their remaining power to do suicide bombing, in this matter, it means rollback the migration mission (`on_failed`).

More convenient event-based functions (all of this is optional):

- `pre_migrate()`

    Before the migration event. This might be useful if you want to prepare something first.

    Please check `is_migratable` if you want to wanted to do checks.
- `post_migrate()`

    After migration event. This will be executed when the packet were successfully executed.
- `is_migratable()`

    Validates current packet if it is applicable. This must return true in order to make this packet executed.

Quick Api for Ilgar
-------------------

[](#quick-api-for-ilgar)

Ilgar's API is available on `Chez14\Ilgar\Internal` class. It's a `\Prefab` child class, do if you wanted to get it's instance, you can obtain the instance by calling `Chez14\Ilgar\Internal::instance()`. Aaanyway, here's the API list:

### get\_current\_version()

[](#get_current_version)

returns an `int`.

This integer represent current migration version point, declared by the filename.

Will load the version from `migration.json`.

### reset\_version()

[](#reset_version)

returns void.

Will forcefully delete `migration.json` at designated path.

### get\_stats()

[](#get_stats)

returns [quick stats](#quick-stats).

This will return current statistics with the migrations.

Quick Stats
-----------

[](#quick-stats)

Quick stats is a array, consisting:

```
$stats = [
    "success" => $counter, // how many migration executed
    "last_exception" => $failed, // last exception occured, this is an Exception object.
    "version" => $current // current version applied
];
```

License
-------

[](#license)

Yes, [GPLv3](LICENSE).

FAQ and RAQ (Rarely Asked Question)
-----------------------------------

[](#faq-and-raq-rarely-asked-question)

### Why naming it "Ilgar"?

[](#why-naming-it-ilgar)

[Ilgar](http://worldtrigger.wikia.com/wiki/Ilgar) is a bombarding-type Trion Warrior. It's used by [Aftocrator](http://worldtrigger.wikia.com/wiki/Aftokrator) and [Chion](http://worldtrigger.wikia.com/wiki/Chion) for invasion. Yes, it's meant to bombarding the database with migration packets.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~125 days

Recently: every ~217 days

Total

8

Last Release

1935d ago

Major Versions

v0.1.5 → v1.0.02018-09-03

v1.1.0 → v2.x-dev2021-01-23

PHP version history (2 changes)v0.1.4PHP &gt;=5.6

v1.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/daaabb160acffab2c30a9a14ba5c2d3c8da48d395af354a7378ac465751525d2?d=identicon)[chez14](/maintainers/chez14)

---

Top Contributors

[![chez14](https://avatars.githubusercontent.com/u/5555026?v=4)](https://github.com/chez14 "chez14 (40 commits)")[![remocrevo](https://avatars.githubusercontent.com/u/8701105?v=4)](https://github.com/remocrevo "remocrevo (1 commits)")

---

Tags

databasefat-free-frameworkmigrationmigration-toolphpmigrationdatabasemigratefat-free frameworkF3ilgarworld triggerbomber

### Embed Badge

![Health badge](/badges/chez14-f3-ilgar/health.svg)

```
[![Health](https://phpackages.com/badges/chez14-f3-ilgar/health.svg)](https://phpackages.com/packages/chez14-f3-ilgar)
```

###  Alternatives

[odan/phinx-migrations-generator

Migration generator for Phinx

235847.8k23](/packages/odan-phinx-migrations-generator)[bizley/migration

Migration generator for Yii 2.

297374.3k11](/packages/bizley-migration)[lulco/phoenix

Database Migrations for PHP

180329.4k4](/packages/lulco-phoenix)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[erjanmx/laravel-migrate-check

A command to check for pending migrations. Exits with non-zero code if there are any

54273.8k1](/packages/erjanmx-laravel-migrate-check)[sayeed/custom-migrate

Custom migrate in laravel. You can individual file migrate here

2126.0k](/packages/sayeed-custom-migrate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
