https://github.com/utopia-php/platform
https://github.com/utopia-php/platform
hacktoberfest php utopia
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/utopia-php/platform
- Owner: utopia-php
- License: mit
- Created: 2022-07-10T05:41:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T12:20:56.000Z (8 months ago)
- Last Synced: 2025-04-18T00:24:01.398Z (8 months ago)
- Topics: hacktoberfest, php, utopia
- Language: PHP
- Homepage:
- Size: 217 KB
- Stars: 11
- Watchers: 6
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Utopia Platform
[](https://travis-ci.com/utopia-php/platform)

[](https://appwrite.io/discord)
An object oriented way of writing Applications using Utopia libraries
## Getting Started
This library contains abstract classes that assist in implementing services and actions for Utopia http framework and CLI. You must implement `Platform`, `Service` and `Action` classes to build your application.
## Example
Install using composer
```
composer require utopia-php/platform
```
Implementing a HTTP services using platform.
```php
// Action
httpPath = '/hello';
$this->httpMethod = 'GET';
$this->inject('response');
$this->callback(fn ($response) => $this->action($response));
}
public function action($response)
{
$response->send('Hello World!');
}
}
// service
use Utopia\Platform\Service;
class HelloWorldService extends Service
{
public function __construct()
{
$this->type = Service::TYPE_HTTP;
$this->addAction('hello', new HelloWorldAction());
}
}
// Platform
use Utopia\Platform\Platform;
class HelloWorldPlatform extends Platform
{
public function __construct()
{
$this->addService('helloService', new HelloWorldService());
}
}
// Using platform to initialize http service
$platform = new HelloWorldPlatform();
$platform->init('http');
```
## System Requirements
Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
## Contributing
All code contributions - including those of people having commit access - must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md).
## Copyright and license
The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)