PHPackages                             thipages/pca-helper - 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. thipages/pca-helper

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

thipages/pca-helper
===================

Helper for PHP-CRUD-API configuration

v0.5.0(4y ago)217MITPHP

Since Mar 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/thipages/pca-helper)[ Packagist](https://packagist.org/packages/thipages/pca-helper)[ RSS](/packages/thipages-pca-helper/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

PCA-HELPER
==========

[](#pca-helper)

PCA-HELPER tries to help to setup the configuration file used in [PHP-CRUD-API](https://github.com/mevdschee/php-crud-api)

- simplifying the database configuration
- simplifying the dbAuth configuration
- providing some middlewares tools (`upload`, `autoFK`),
- writing automatically `middlewares` configuration property

> **Drawback** : it adds some workload on the server compared to the native/original single file `api.php`. May be a cli tool may be a good comprise one day...

Installation
------------

[](#installation)

*composer require thipages/pca-helper*

add an `api.php` file referencing

- either `require('./api.include.php');`for a single file usage from [PHP-CRUD-API](https://github.com/mevdschee/php-crud-api)
- or the library with `autoload.php` and `composer require mevdschee/php-crud-api`

Usage
-----

[](#usage)

**Simple static call**`Helper::echo(...$config);`

`$config` being a list of

- either regular associative arrays (as defined in PHP-CRUD-API)

```
[
    'debug'=>true,
    'authorization.tableHandler' => function ($operation, $tableName) {
            return $tableName != 'user';
     }
]
```

- or static methods of predefined class (returning an associative array...)

```
    Base::setup_connection(
        $database, $username, $password,
        $driver = 'mysql',$address='localhost',
        $port = null
    )
```

```
    Base::setup_SQLite($filePath)
```

```
    Base::setup_cache($cacheType = 'NoCache', $cacheTime = 10, $cachePath = null)
```

```
    BdAuth::setup(
        $sessionName,
        $passwordLength=12, $mode='required',
        $usersTable='user',$usernameColumn='username',$passwordColumn='password',
        $registerUser='1')
    // Note that dbAuth has a strong default setup
```

- or static handlers whose name method match the configuration key (by convention)

```
[
    'multiTenancy.handler'=>AutoFK::multiTenancy_handler(
        $relations,
        $user=['user','id','user_id']
     )
]
```

```
[
    'customzation.beforeHandler'=>Upload::customzation_beforeHandler (
        $table, $field, $filesPath
    )
]
```

Example
-------

[](#example)

```
Helper::echo(
[
    Base::setup_SQLite($dbPath),
    Base::setup_cache(),
    DbAuth::setup('pca_helper',8),
    [
        'authorization.tableHandler' => function ($operation, $tableName) {
            return $tableName != 'user';
        },
        'multiTenancy.handler' => AutoFK::multiTenancy_handler(['note'=>'user_id']),
        'customzation.beforeHandler'=>function($operation, $tableName, $request, $environment) {
            $request= Upload::customzation_beforeHandler ($table, $field, $filesPath)(func_get_args());
            // ...
            return $request;
        },
        Base::debug=>true
    ]
]);
```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~81 days

Total

2

Last Release

1784d ago

### Community

Maintainers

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

---

Top Contributors

[![thipages](https://avatars.githubusercontent.com/u/130309?v=4)](https://github.com/thipages "thipages (20 commits)")

---

Tags

configurationdatabasehelpermiddlewarephp-crud-apimiddlewarehelperconfigurationdatabasephp-crud-api

### Embed Badge

![Health badge](/badges/thipages-pca-helper/health.svg)

```
[![Health](https://phpackages.com/badges/thipages-pca-helper/health.svg)](https://phpackages.com/packages/thipages-pca-helper)
```

###  Alternatives

[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[mg-code/yii2-helpers

A collection of useful helper classes for Yii framework 2.0

2022.5k5](/packages/mg-code-yii2-helpers)

PHPackages © 2026

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