PHPackages                             akrabat/akrabat\_db\_schema\_manager - 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. akrabat/akrabat\_db\_schema\_manager

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

akrabat/akrabat\_db\_schema\_manager
====================================

Akrabat's Zend Tool Provider for Zend Framework 1 Database Migrations

1.0.0(13y ago)9528.6k22[3 issues](https://github.com/akrabat/AkrabatZF/issues)BSD-3-ClausePHPPHP &gt;=5.2.7

Since Feb 26Pushed 12y ago1 watchersCompare

[ Source](https://github.com/akrabat/AkrabatZF)[ Packagist](https://packagist.org/packages/akrabat/akrabat_db_schema_manager)[ Docs](https://github.com/akrabat/Akrabat)[ RSS](/packages/akrabat-akrabat-db-schema-manager/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Akrabat ZF library
==================

[](#akrabat-zf-library)

See [Akrabat\_Db\_Schema\_Manager: Zend Framework database migrations](http://akrabat.com/zend-framework/akrabat_db_schema_manager-zend-framework-database-migrations/) for full details. This code is licensed under the [New-BSD license](http://akrabat.com/license/new_bsd/).

Akrabat\_Db\_Schema\_Manager is a tool for use with ZF1. If you need a standalone tool, then have a look at [South for the Winter](https://github.com/startupdevs/sftw).

ZF1:
----

[](#zf1)

To get the Zend\_Tool provider working:

1. Place a copy of ZF1 in `/usr/local/include/zf1/`, so that the Zend folder is in `zf1/library/Zend`
2. Update your `~/.bash_profile` to set up an alias to the zf.sh script

    ```
     alias zf='export ZF_CONFIG_FILE=~/.zf.ini; /usr/local/include/zf1/bin/zf.sh'

    ```

    Restart your terminal or `source ~/.bash_profile`
3. If you haven't already done so, setup the storage directory and config file:

    ```
     zf --setup storage-directory
     zf --setup config-file

    ```
4. Place a copy of the Akrabat Tools in `/usr/local/include/Akrabat`:

    ```
     cd /usr/local/include
     git clone http://github.com/akrabat/Akrabat.git

    ```
5. Edit the created `~/.zf.ini`. Change path so that it includes ZF1 and Akrabat/library, allow for auotoloading Akrabat and set up the provider:

    ```
     php.include_path = "/usr/local/include/zf1/library:/usr/local/include/Akrabat/library/"
     autoloadernamespaces.0 = "Akrabat_"
     basicloader.classes.0 = "Akrabat_Tool_DatabaseSchemaProvider"

    ```
6. `zf` should provide a help screen with the `DatabaseSchema` provider at the bottom.

### Akrabat\_Db\_Schema\_Manager

[](#akrabat_db_schema_manager)

1. Create scripts/migrations folder in your ZF application
2. Create migration files within migrations with the file name format of nnn-Xxxx.php. e.g. 001-Users.php where:
    nnn =&gt; any number. The lower numbered files are executed first
    Xxx =&gt; any name. This is the class name within the file.

    In up(), database changes are applied, in down(), changes are reverted. If changes cannot be reverted, then down() should throw a Akrabat\_Db\_Schema\_Exception.
3. Create a class in your migrations file. Example for 001-Users.php:

    ```
     class Users extends Akrabat_Db_Schema_AbstractChange
     {
         function up()
         {
             $tableName = $this->_tablePrefix . 'users';
             $sql = "
                 CREATE TABLE IF NOT EXISTS $tableName (
                   id int(11) NOT NULL AUTO_INCREMENT,
                   username varchar(50) NOT NULL,
                   password varchar(75) NOT NULL,
                   roles varchar(200) NOT NULL DEFAULT 'user',
                   PRIMARY KEY (id)
                 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
             $this->_db->query($sql);

             $data = array();
             $data['username'] = 'admin';
             $data['password'] = sha1('password');
             $data['roles'] = 'user,admin';
             $this->_db->insert($tableName, $data);
         }

         function down()
         {
             $tableName = $this->_tablePrefix . 'users';
             $sql= "DROP TABLE IF EXISTS $tableName";
             $this->_db->query($sql);
         }

     }

    ```
4. If you want a table prefix, add this to your `application.ini`:

    ```
     resources.db.table_prefix = "prefix"

    ```

Phing Task
----------

[](#phing-task)

1. Define the phing task in the `build.xml`

    ```

    ```
2. Setup a phing target with the database options in the `build.xml`

    ```

    ```
3. Run phing using the command line, by `phing database-migration`

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% 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

Unknown

Total

1

Last Release

4872d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33135?v=4)[Rob Allen](/maintainers/akrabat)[@akrabat](https://github.com/akrabat)

---

Top Contributors

[![akrabat](https://avatars.githubusercontent.com/u/33135?v=4)](https://github.com/akrabat "akrabat (42 commits)")[![dstockto](https://avatars.githubusercontent.com/u/775393?v=4)](https://github.com/dstockto "dstockto (5 commits)")[![meonkeys](https://avatars.githubusercontent.com/u/50639?v=4)](https://github.com/meonkeys "meonkeys (2 commits)")[![SamHennessy](https://avatars.githubusercontent.com/u/119867?v=4)](https://github.com/SamHennessy "SamHennessy (2 commits)")[![Justmatt](https://avatars.githubusercontent.com/u/168540585?v=4)](https://github.com/Justmatt "Justmatt (1 commits)")[![zircote](https://avatars.githubusercontent.com/u/307960?v=4)](https://github.com/zircote "zircote (1 commits)")

---

Tags

db migrationZF1tooling

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/akrabat-akrabat-db-schema-manager/health.svg)

```
[![Health](https://phpackages.com/badges/akrabat-akrabat-db-schema-manager/health.svg)](https://phpackages.com/packages/akrabat-akrabat-db-schema-manager)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M114](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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