1. Go to this page and download the library: Download ody/foundation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ody / foundation example snippets
// Start an HTTP server with Swoole
HttpServer::start(ServerManager::init(ServerType::HTTP_SERVER)
->createServer($config)
->setServerConfig($config['additional'])
->registerCallbacks($config['callbacks'])
->getServerInstance()
);
class MyServiceProvider extends ServiceProvider
{
public function register(): void
{
$this->container->singleton(MyService::class, function () {
return new MyService();
});
}
public function boot(): void
{
// Bootstrap the service
}
}
use Ody\Foundation\Bootstrap;
// Initialize the application
$app = Bootstrap::init();
// Bootstrap and run
$app->bootstrap();
$app->run();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.