Skip to content

Instantly share code, notes, and snippets.

@0RuiAlvel0
0RuiAlvel0 / GetVersionController.php
Created October 25, 2025 09:45
How to get the latest Codeigniter release?
//Place this on your controller
// Get current version
$currentVersion = \CodeIgniter\CodeIgniter::CI_VERSION;
// Get latest version from GitHub API
$latestVersion = null;
$context = stream_context_create(['http' => ['user_agent' => 'CI-Version-Checker']]);
$json = @file_get_contents('https://api.github.com/repos/codeigniter4/CodeIgniter4/releases/latest', false, $context);
if ($json) {
$data = json_decode($json, true);