Skip to content

Probo-Demos/probo-example-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Probo Example: PHP

A single-file PHP demo that displays the environment variables a Probo CI build injects into a container. It renders two tables:

  • Build variables — the documented Probo catalog (PROBO_ENVIRONMENT, BUILD_ID, BRANCH_NAME, …) with live values where present.
  • Secrets & other injected variables — everything else Probo made visible to PHP (organization/project secrets and any custom variables), discovered dynamically.

The page reads the environment the same way the container exposes it — mirroring the filter in probo-ubuntu/<image>/files/envvars-swap.sh, which drops APACHE_* and the shell internals (HOME/LANG/PWD/PATH/OLDPWD/SHLVL/_). It falls back to $_ENV / $_SERVER on older runtimes (PHP 5.6 / 7.0) where getenv() with no arguments is unavailable, so it works across the full range of Probo PHP images.

Project layout

.probo.yaml      Probo build config (lamp type + LAMPApp plugin step)
src/index.php    Env filtering + two-table page render

Run locally

php -S localhost:8000 -t src
# then open http://localhost:8000

Simulate a Probo build environment:

PROBO_ENVIRONMENT=TRUE BUILD_ID=abc123 BRANCH_NAME=main \
  MY_API_TOKEN=example php -S localhost:8000 -t src

How it runs in a Probo LAMP container

.probo.yaml uses type: lamp with php: 8.5 and database: mariadb:11.4 (provisioning Linux, Apache, MariaDB, and PHP) plus the built-in LAMPApp plugin:

type: lamp
php: 8.5
database: mariadb:11.4

steps:
  - name: Testing
    plugin: LAMPApp
    phpIniOptions:
      memory_limit: 512M
      max_execution_time: 300
    subDirectory: src

The LAMPApp plugin serves the app from src (the subDirectory) under Apache and applies the phpIniOptions overrides. Standard Probo build variables are passed automatically and populate the first table; secrets and custom variables appear in the second.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages