seedproject-web/api/core/Session.php
Carlos Arias 1559ce017d chore: scaffold SeedProject base (Phase 1)
Clean-room copy of the reusable engines from comiida, with all
instance data, secrets, dependencies, and build output excluded:
- app/         Astro theme skeleton (no comiida blog posts; hero image -> placeholder)
- api/         SeedProject PHP framework (no vendor/.env/config.php)
- content-pipeline/  engine only (scripts/admin/prompts; empty runtime state)
- astroagent.config.json + app/.astroagent/skills

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SYHWLHihq3v9nxNwoPCKSn
2026-07-04 22:53:10 +00:00

65 lines
No EOL
1.1 KiB
PHP

<?php
class Session
{
public static function init()
{
@session_start();
}
public static function set($key, $value)
{
$_SESSION[$key] = $value;
}
public static function get($key)
{
if (isset($_SESSION[$key]))
return $_SESSION[$key];
}
public static function destroy()
{
//unset($_SESSION);
session_destroy();
}
/*
* Set a value or create a child under parent session.
*/
public static function pSet($parent, $key, $value)
{
$_SESSION[$parent][$key] = $value;
}
/*
* Unset Just Child
*/
public static function cUnset($parent, $key)
{
unset($_SESSION[$parent][$key]);
}
/*
* Unset Parent and everything under it
*/
public static function pUnset($key)
{
unset($_SESSION[$key]);
}
/**
*
* @param parameter $key
* @return Session
*/
public static function pGet($parent, $key)
{
if (isset($_SESSION[$parent][$key]))
return $_SESSION[$parent][$key];
}
}