PHPackages                             keyqcloud/kyte-php - 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. [Framework](/categories/framework)
4. /
5. keyqcloud/kyte-php

ActiveLibrary[Framework](/categories/framework)

keyqcloud/kyte-php
==================

Light-weight framework for developing versatile PHP applications.

v4.3.2(3w ago)01102MITPHPPHP &gt;=7.2CI passing

Since Jan 19Pushed 3w ago2 watchersCompare

[ Source](https://github.com/keyqcloud/kyte-php)[ Packagist](https://packagist.org/packages/keyqcloud/kyte-php)[ RSS](/packages/keyqcloud-kyte-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (8)Versions (162)Used By (0)

Kyte-PHP Framework
==================

[](#kyte-php-framework)

[![PHP Composer](https://github.com/keyqcloud/kyte-php/actions/workflows/php.yml/badge.svg)](https://github.com/keyqcloud/kyte-php/actions/workflows/php.yml)[![Total Downloads](https://camo.githubusercontent.com/62b20761d188a1f7ca635fc32ee77d36a9c065303bf81e88a77d96d73a9eefee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b657971636c6f75642f6b7974652d7068702e7376673f7374796c653d666c6174)](https://packagist.org/packages/keyqcloud/kyte-php)

(c) 2020-2026 [KeyQ, Inc.](https://www.keyq.cloud)

About Kyte-PHP
--------------

[](#about-kyte-php)

Kyte-PHP is a modern, database-driven web application framework designed to make development more enjoyable and streamline the development workflow. The framework works as a backend API and can be integrated into different application architectures and front-end languages/frameworks.

**Key Features:**

- **Dynamic MVC Architecture**: Models, views, and controllers are managed through Kyte Shipyard and stored in the database
- **Multi-tenant SaaS Support**: Built-in support for multi-tenant applications with account-level scoping
- **API-First Design**: RESTful API with HMAC signature authentication
- **Database-Driven Configuration**: Application models and controllers are dynamically loaded from the database
- **AWS Integration**: Native support for S3, SES, SNS, and other AWS services
- **Session Management**: Robust session handling with configurable timeouts and multi-login support

Architecture Overview
---------------------

[](#architecture-overview)

Kyte-PHP has evolved from a traditional file-based MVC framework to a dynamic, database-driven architecture. All application models, controllers, and configurations are now managed through **[Kyte Shipyard](https://github.com/keyqcloud/kyte-shipyard/)** and stored in the database, allowing for:

- Runtime model and controller loading
- Dynamic application configuration
- Multi-application support from a single framework instance
- Version-controlled deployments through the database

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

[](#getting-started)

### Prerequisites

[](#prerequisites)

- PHP 7.4 or higher
- MySQL 5.7+ or MariaDB 10.2+
- Composer
- [Kyte Shipyard](https://github.com/keyqcloud/kyte-shipyard/)
- AWS account

### Installation

[](#installation)

```
composer require keyqcloud/kyte-php
```

### Basic Setup

[](#basic-setup)

1. **Configure your web server** with the following `.htaccess`:

```
FallbackResource /index.php
```

2. **Database Configuration** - Set your database credentials in your configuration:

```
define('KYTE_DB_HOST', 'your-db-host');
define('KYTE_DB_DATABASE', 'your-db-name');
define('KYTE_DB_USERNAME', 'your-db-user');
define('KYTE_DB_PASSWORD', 'your-db-password');
define('KYTE_DB_CHARSET', 'utf8mb4');
```

3. **Initialize the API** in your `index.php`:

```

```

Authentication &amp; API Access
-------------------------------

[](#authentication--api-access)

### API Signature Generation

[](#api-signature-generation)

Kyte-PHP uses HMAC-SHA256 signatures for secure API access. Signature are automatically generate or can be requested using platform specific libraries. Kyte currently supports vanilla JS, Dart/Flutter, C/C++, Java, and Python. Below is a list of platform specific libraries:

- [JavaScript](https://github.com/keyqcloud/kyte-api-js)
- [Python](https://github.com/keyqcloud/kyte-api-python)
- [Swift](https://github.com/keyqcloud/KyteSwift)
- [Dart/Flutter](https://github.com/keyqcloud/kyte_dart)
- [Java](https://github.com/keyqcloud/kyte-api-java)
- [C++](https://github.com/keyqcloud/kyte-cpp)
- C (Pending QA)
- Node.js (Pending QA)
- Go (Pending QA)
- [PHP](https://github.com/keyqcloud/kyte-api-php)

### Making API Calls

[](#making-api-calls)

Once you have a signature, use the following URL format:

- **POST** `/{model}` + data (Create)
- **PUT** `/{model}/{field}/{value}` + data (Update)
- **GET** `/{model}/{field}/{value}` (Read)
- **DELETE** `/{model}/{field}/{value}` (Delete)

Required headers:

- `X-Kyte-Identity`: Base64 encoded identity string
- `X-Kyte-Signature`: HMAC signature
- `X-Kyte-AppId`: Application identifier (for multi-tenant apps)

Dynamic Model System
--------------------

[](#dynamic-model-system)

### Database-Driven Models

[](#database-driven-models)

Models are now stored in the `DataModel` table and dynamically loaded:

```
// Models are automatically loaded from the database
// No need to define them in files anymore
$user = new \Kyte\Core\ModelObject(constant('User'));
$user->create([
    'name' => 'John Doe',
    'email' => 'john@example.com'
]);
```

### Model Structure

[](#model-structure)

Models follow this structure in the database:

```
[
    'name' => 'ModelName',
    'struct' => [
        'field_name' => [
            'type' => 's|i|d|t|b',  // string, integer, decimal, text, blob
            'required' => true|false,
            'size' => 255,
            'date' => true|false,
            'protected' => true|false,
            'fk' => [
                'model' => 'RelatedModel',
                'field' => 'id'
            ]
        ]
    ]
]
```

### Supported Field Types

[](#supported-field-types)

TypeDescriptionMySQL Type`s`StringVARCHAR`i`IntegerINT`bi`Big IntegerBIGINT`d`DecimalDECIMAL`t`TextTEXT`tt`Tiny TextTINYTEXT`mt`Medium TextMEDIUMTEXT`lt`Long TextLONGTEXT`b`BlobBLOBControllers
-----------

[](#controllers)

### Dynamic Controller Loading

[](#dynamic-controller-loading)

Controllers are stored in the `Controller` table and loaded dynamically:

```
class CustomController extends \Kyte\Mvc\Controller\ModelController
{
    protected function init() {
        // Custom initialization
        $this->requireAuth = true;
        $this->allowableActions = ['get', 'new', 'update'];
    }

    public function hook_preprocess($method, &$data, &$obj = null) {
        // Custom preprocessing logic
        if ($method === 'new') {
            $data['created_by'] = $this->api->user->id;
        }
    }
}
```

### Controller Hooks

[](#controller-hooks)

Available hooks for customizing behavior:

- `hook_init()` - Initialize controller settings
- `hook_auth()` - Custom authentication logic
- `hook_prequery()` - Modify query parameters
- `hook_preprocess()` - Process data before operations
- `hook_response_data()` - Modify response data
- `hook_process_get_response()` - Process GET responses

Multi-Tenant Applications
-------------------------

[](#multi-tenant-applications)

Kyte-PHP supports multi-tenant architectures:

```
// Application-level models with org scoping
$this->api->app->org_model; // Organization model
$this->api->app->userorg_colname; // User-organization relationship

// Automatic scoping in controllers
if ($this->api->app->org_model !== null) {
    $conditions = [
        ['field' => $this->api->app->userorg_colname, 'value' => $this->user->organization_id]
    ];
}
```

Database Features
-----------------

[](#database-features)

### SSL/TLS Support

[](#ssltls-support)

Configure SSL connections with:

```
define('KYTE_DB_CA_BUNDLE', '/path/to/rds-ca-2019-root.pem');
```

### Connection Management

[](#connection-management)

- Automatic connection switching between main and application databases
- Connection pooling and management
- Fallback support for non-SSL connections

Advanced Features
-----------------

[](#advanced-features)

### Environment Variables

[](#environment-variables)

Application-level environment variables stored in `KyteEnvironmentVariable` and managed through Kyte Shipyard:

```
// Access app-specific environment variables
$envVars = KYTE_APP_ENV;
echo $envVars['CUSTOM_SETTING'];
```

### AWS Integration

[](#aws-integration)

Built-in support for:

- **S3**: File storage and static website hosting
- **SES**: Email sending capabilities
- **SNS**: Notification services
- **CloudFront**: CDN distribution

Configuration Options
---------------------

[](#configuration-options)

### Framework Constants

[](#framework-constants)

```
define('DEBUG', false);
define('ALLOW_MULTILOGON', false);
define('SESSION_TIMEOUT', 3600);
define('SIGNATURE_TIMEOUT', 300);
define('PAGE_SIZE', 50);
define('STRICT_TYPING', true);
```

### Date Formatting

[](#date-formatting)

```
define('APP_DATE_FORMAT', 'Y-m-d H:i:s');
```

Error Handling
--------------

[](#error-handling)

Comprehensive error handling with:

- Session exceptions for authentication errors
- Database connection error recovery
- Application-level error logging
- S3-based error logging for production

Migration from Earlier Versions
-------------------------------

[](#migration-from-earlier-versions)

If migrating from file-based models:

1. Use Kyte Shipyard to import existing models
2. Convert file-based controllers to database entries
3. Update application configuration for multi-tenant support
4. Test dynamic loading functionality

API Response Format
-------------------

[](#api-response-format)

Standard API responses:

```
{
    "response_code": 200,
    "session": "session_token",
    "token": "transaction_token",
    "uid": "user_id",
    "model": "ModelName",
    "transaction": "GET|POST|PUT|DELETE",
    "txTimestamp": "1640995200",
    "data": [],
    "page_size": 50,
    "page_num": 1,
    "total_count": 100,
    "total_filtered": 75
}
```

Development Tools
-----------------

[](#development-tools)

### Kyte Shipyard Integration

[](#kyte-shipyard-integration)

All model and controller management is now done through Kyte Shipyard:

- Visual model designer
- Controller code editor
- Application deployment management
- Environment variable configuration

### CLI Support

[](#cli-support)

The framework includes CLI support for:

- Database migrations
- Model synchronization
- Application deployment

Security
--------

[](#security)

- HMAC-SHA256 signature authentication
- SQL injection prevention with prepared statements
- Cross-origin resource sharing (CORS) support
- Session token validation
- Protected field support for sensitive data

Performance
-----------

[](#performance)

- Connection pooling
- Prepared statement caching
- Efficient foreign key loading
- Pagination support for large datasets
- Optional external table loading

License
-------

[](#license)

Copyright (c) 2020-2026 KeyQ, Inc. All rights reserved.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance95

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

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

Recently: every ~17 days

Total

158

Last Release

23d ago

Major Versions

v1.0.0 → 2.1.x-dev2023-06-07

v2.0.0 → v3.0.02023-06-14

v3.8.2 → v4.0.02026-01-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/59730092414d1c68ddaf657c1b7958ce5c46e4ffcc123663051b5b4584cb5a6c?d=identicon)[kennethphough](/maintainers/kennethphough)

---

Top Contributors

[![kennethphough](https://avatars.githubusercontent.com/u/7582355?v=4)](https://github.com/kennethphough "kennethphough (1965 commits)")[![kaizendeveloper](https://avatars.githubusercontent.com/u/6207572?v=4)](https://github.com/kaizendeveloper "kaizendeveloper (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/keyqcloud-kyte-php/health.svg)

```
[![Health](https://phpackages.com/badges/keyqcloud-kyte-php/health.svg)](https://phpackages.com/packages/keyqcloud-kyte-php)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)[bytefury/crater

Free &amp; Open Source Invoice App for Individuals &amp; Small Businesses. https://craterapp.com

8.3k4.2k](/packages/bytefury-crater)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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