1. Go to this page and download the library: Download bella-baxter/sdk 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/ */
// Auto-generated by bella secrets generate php — do not edit manually.
class AppSecrets
{
public function getDatabaseUrl(): string
{
$v = getenv('DATABASE_URL');
if ($v === false) throw new \RuntimeException("Secret 'DATABASE_URL' is not set.");
return $v;
}
public function getPort(): int
{
$v = getenv('PORT');
if ($v === false) throw new \RuntimeException("Secret 'PORT' is not set.");
return (int) $v;
}
public function isEnableFeatureX(): bool
{
$v = getenv('ENABLE_FEATURE_X');
if ($v === false) throw new \RuntimeException("Secret 'ENABLE_FEATURE_X' is not set.");
return filter_var($v, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) ?? false;
}
}
// Secrets must be in the environment before accessing.
// Use bella run, the SDK (BaxterClient), or a .env file loaded at bootstrap.
$secrets = new AppSecrets();
$dbUrl = $secrets->getDatabaseUrl(); // string — throws if missing
$port = $secrets->getPort(); // int — parsed automatically