PHPackages                             cloudframework-io/backend-core-php8 - 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. cloudframework-io/backend-core-php8

ActiveLibrary[Framework](/categories/framework)

cloudframework-io/backend-core-php8
===================================

CLOUDRAMEWORK PHP8 CORE FRAMEWORK TO DEVELOP BACKEND APIs and SCRIPTs optimized for APPENGINE, FUNCTIONS, KUBERNETS and other server technologies

8.4.43(1mo ago)21.9k↓33.3%[7 PRs](https://github.com/CloudFramework-io/backend-core-php8/pulls)MITPHP

Since Dec 16Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/CloudFramework-io/backend-core-php8)[ Packagist](https://packagist.org/packages/cloudframework-io/backend-core-php8)[ RSS](/packages/cloudframework-io-backend-core-php8/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (28)Versions (144)Used By (0)

CloudFramework Backend Core PHP8
================================

[](#cloudframework-backend-core-php8)

A powerful and flexible PHP8+ framework for building scalable backend APIs and scripts, optimized for Google Cloud Platform (GCP) services including App Engine, Cloud Functions, Compute Engine, and Kubernetes.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![PHP Version](https://camo.githubusercontent.com/3cdf2455b00f7bca9782b13ef40017bedb17095024f6d09252a9cdd847f4febd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e332d626c75652e737667)](https://www.php.net/)

Overview
--------

[](#overview)

CloudFramework Backend Core is a comprehensive framework designed to accelerate backend development with built-in support for:

- **RESTful API Development**: Robust API creation with built-in routing, validation, and response handling
- **Google Cloud Integration**: Native support for Datastore, Cloud Storage, BigQuery, Cloud SQL, and more
- **Script Execution**: CLI script framework for backend tasks and automation
- **Security**: Built-in authentication, authorization, and security features
- **Data Validation**: Comprehensive validation system for API requests
- **Caching**: Flexible caching strategies for performance optimization
- **Logging**: Advanced logging with GCP Cloud Logging integration

Requirements
------------

[](#requirements)

- PHP ^8.3
- Composer
- Python 3.x (for development tools)
- Google Cloud SDK (optional, for GCP deployment)

Quick Links
-----------

[](#quick-links)

- **GitHub Repository**:
- **Packagist**:
- **Documentation**: See `/docs` directory for comprehensive guides

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Your First API](#your-first-api)
- [Running Scripts](#running-scripts)
- [Configuration](#configuration)
- [GCP Setup](#gcp-setup)
- [Deployment](#deployment)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [License](#license)

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

[](#installation)

### Basic Installation

[](#basic-installation)

Install the framework via Composer:

```
composer require cloudframework-io/backend-core-php8
# if you have problem with GRPC extensions you can use:
# composer require cloudframework-io/backend-core-php8 --ignore-platform-req=ext-grpc
```

### Initialize Project Structure

[](#initialize-project-structure)

Run the installation script to create the basic project structure:

```
php vendor/cloudframework-io/backend-core-php8/install.php
```

This command will create:

- `./local_data/cache` - Local cache directory
- `./api/` - API endpoints examples
- `./scripts/` - Script examples
- `composer.json` - Project composer configuration
- `.gitignore` - Git ignore rules
- `app.yaml` - Google App Engine configuration
- `.gcloudignore` - GCP deployment ignore rules
- `README.md` - Project README
- `php.ini` - PHP configuration
- `config.json` - Framework configuration

Quick Start
-----------

[](#quick-start)

### Launch Local Development Server

[](#launch-local-development-server)

Start the built-in development server:

```
composer server
```

The server will start at `http://localhost:8080/`

### Test Your First API

[](#test-your-first-api)

Open your browser and navigate to:

- `http://localhost:8080/` - Main endpoint with API information
- `http://localhost:8080/training/hello` - Simple Hello World API
- `http://localhost:8080/training/hello-advanced` - Advanced Hello World with endpoints

### Example API Response

[](#example-api-response)

The response from `http://localhost:8080/` will be a JSON:

```
{
    "success": true,
    "status": 200,
    "code": "ok",
    "time_zone": "UTC",
    "data": {
        "end-point /index [current]": "This end-point defined in /api/index.php",
        "end-point /training/hello": "Advanced API Structure of Hello World in  /api/training/hello-advanced.php",
        "Current Url Parameters: $this->params": [],
        "Current formParameters: $this->formParams": []
    },
    "logs": [
    "[syslog:info] CoreCache: init(). type: directory",
    "[syslog:info] RESTful: Url: [GET] http://localhost:8080/"
    ]
}
```

Your First API
--------------

[](#your-first-api)

### Simple API Structure

[](#simple-api-structure)

Create a simple API in `api/your-endpoint.php`:

```
