Skip to content

release: v0.0.35-0.0.39 — .env support, short-name resolution, PHP 8.4, docs & CI overhaul#69

Merged
ksandell merged 62 commits intomasterfrom
develop
Mar 25, 2026
Merged

release: v0.0.35-0.0.39 — .env support, short-name resolution, PHP 8.4, docs & CI overhaul#69
ksandell merged 62 commits intomasterfrom
develop

Conversation

@ksandell
Copy link
Copy Markdown
Contributor

Summary

Merges develop into master, covering versions 0.0.35 through 0.0.39.

0.0.39

  • Feature: .env file auto-loading — new DotEnv class reads .env from project root at startup; process env vars always take precedence
  • Fix: dollar{env:VAR:default} inline default syntax now resolves correctly in config macros

0.0.38

  • Feature: Controller short-name resolution — bare class names in route handler fields fall back to App\Controllers{Name}
  • Feature: Middleware short-name resolution — bare class names in before/after arrays fall back to App\Middlewares{Name}
  • Corrected middleware-scope documentation (middleware is group-scoped, never route-scoped)

0.0.37

  • Comprehensive developer documentation: Getting Started, Best Practices, Recipes, Contributor Guide, API Reference
  • AI assistant instruction files for Claude Code, GitHub Copilot, and generic LLMs
  • Reorganized doc/ directory with navigation hub

0.0.36

  • Security: Upgraded firebase/php-jwt v6 to v7 (resolves PKSA-y2cr-5h3j-g3ys)
  • Fix: APCu cache adapter handles DateInterval in set()
  • CI/CD: GitHub Actions pipeline with Redis, MySQL, PostgreSQL sidecar services

0.0.35

  • PHP 8.4 compatibility fixes throughout
  • dollar{env:VAR} macro expansion applied automatically on config load
  • Removed hook subsystem (Hook, HookManager, related interfaces)
  • Removed AbstractBaseDao / AbstractBaseDaoInterface
  • New tests: ApplicationTest, ConfigTest, DotEnvTest, GlobalHelpersTest, MySqlTest

Test plan

  • CI unit-tests pass on PHP 8.1 - 8.4
  • Redis, MySQL, PostgreSQL sidecar tests pass in CI
  • dollar{env:VAR} and dollar{env:VAR:default} macro expansion verified
  • .env auto-loading populates env vars before config load
  • Controller and middleware short-name resolution smoke-tested

ksandell and others added 30 commits August 19, 2025 11:37
…separators, typed returns, route methods fix, helpers env unquote)
small readme change
- Added proper type declarations to all class properties across the codebase
- Updated property docblocks with proper @var annotations
- Fixed property types in Core, Cache, Database, Helpers, Factories, and Classes
- Improved code quality and IDE support with strict typing
- All properties now have explicit types: string, int, bool, array, etc.
- Enhanced type safety and code documentation
- Completely rewrote Configuration.md with JSON-based config structure
- Completely rewrote Routing.md with SPIN-specific routing patterns
- Completely rewrote Middleware.md with actual SPIN middleware structure
- Completely rewrote Security.md with SPIN security patterns
- All docs now based on spin-skeleton examples instead of generic patterns
- Replace outdated PHP array examples with correct JSON configuration
- Update project structure to match spin-skeleton layout (src/app, src/public)
- Fix routing examples to show actual SPIN JSON route configuration
- Update controller examples to use SPIN's handleGET() pattern
- Fix middleware examples to use SPIN's initialize() and handle() methods
- Update web server configuration paths to use src/public
- Add missing security features (JWT, Rate Limiting)
- Reorganize documentation links to match actual available docs
- Fix PSR-7 compatibility issues in helper functions
- Replace Laravel-style methods with proper PSR-7 Request methods
- Fix queryParam, postParam, and cookieParam functions
- Fix MIME content type function return types
- Add comprehensive test suite for all global helper functions
- Test coverage for env, app, config, container, logger functions
- Test coverage for request parameter functions (query, post, cookie)
- Test coverage for response functions (redirect, response, responseJson, etc.)
- Test coverage for utility functions (getClientIp, generateRefId, etc.)
- Resolve conflicts with built-in PHP mime_content_type function
- Add missing test configuration files (config-unittest.json, config-dev.json)
- Set test environment to 'unittest' in bootstrap.php
- Fix cache configuration to prevent 'Cache class does not exist' errors
- Fix generateRefId test timing issue
- Ensure proper test environment setup for GitHub Actions
- Fix withHeader() method calls to handle both array and string values
- Ensure proper type casting for header values to prevent PSR-7 v2 compatibility issues
- Fix applies to redirect(), response(), and other response helper functions
- Resolves type mismatch errors with GuzzleHttp 7.x and PSR-7 v2
PHP 8.4 autofixes (nullsafe logger, container share API, path …
ksandell added 28 commits March 15, 2026 10:50
- .claude/settings.json: allowed/denied tool permissions
- .claude/commands/test.md: /test slash command
- .claude/commands/release.md: /release slash command
- .gitignore: exclude .claude/settings.local.json
…s for cache and database testing

- Add Redis, MySQL, PostgreSQL sidecars with health checks
- Add pdo_pgsql, pdo_sqlite, redis PHP extensions
- Add explicit wait loops for service readiness (30s timeout)
- Set environment variables for test database connections
- Enables previously skipped cache adapter tests (Redis, APCu)
- Enables database driver tests (MySQL, PostgreSQL, SQLite)
- Add 'sudo sysctl -w vm.overcommit_memory=1' as first step
- Increase Redis wait timeout from 30s to 60s
- Improve Redis readiness detection (grep PONG response)
**Redis:**
- Remove strict health check (was failing in slow CI environments)
- Rely on manual wait step (lines 79-90) for reliable startup detection
- Add container name for easier debugging

**PostgreSQL:**
- Add POSTGRES_INITDB_ARGS for UTF8 encoding
- Improve health check: include database name (-d spin_test)
- Increase health check retries from 5 to 10 for slower CI runners

**Wait Steps:**
- Hardcode connection details for robustness
- Change error redirection from 2>&1 to 2>/dev/null for cleaner output
- Add Redis cache adapter with env var support
- Add MySQL connection with CI pipeline env vars
- Add PostgreSQL connection with CI pipeline env vars
- Add SQLite in-memory connection for testing
- Use env macro with fallbacks (e.g. ${env:DB_HOST|127.0.0.1})
- Enables database and cache tests in CI pipeline
- Switch from redis:7-alpine to redis:latest (more stable)
- Change Redis wait step to continue-on-error
- Add verbose output with progress indicators every 10s
- Tests gracefully skip Redis if container fails to start
- Pipeline no longer fails entirely if Redis unavailable
Resolves security advisory PKSA-y2cr-5h3j-g3ys affecting firebase/php-jwt v6.0.0-v6.11.1.
- Upgrade requirement from ^6 to ^7
- No API changes required - Key wrapper and encode/decode methods unchanged
- Allows composer install without security blockers in CI/CD
Convert DateInterval to seconds before passing to apcu_store().
- Calculate time delta by adding DateInterval to current DateTime
- Matches behavior in Redis adapter (lines 124-127)
- Resolves 'Object of class DateInterval could not be converted to int' error
firebase/php-jwt v7 enforces stricter key length validation:
- HS256 requires minimum 32 bytes (256 bits / 8)
- Changed test key from 'xyz987' (6 bytes) to proper 32+ byte key
- Resolves 'Provided key is too short' DomainException
Document all improvements and fixes:
- Security upgrade to firebase/php-jwt v7
- APCu cache adapter DateInterval fix
- JWT test key length validation fix
- CI/CD pipeline enhancements with sidecar services
- Test suite configuration for database and cache testing
- Allow Agent operations for subagent execution
- Allow all git commands via Bash(git *)
- Allow file operations: Glob, Grep, Read, Write, Edit
- Allow TodoWrite for task tracking
- Allow find and ls for system utilities
- Enables smoother Claude Code workflows without permission prompts
- Clarify commit message conventions
- Add guidelines for concise, professional output
- Optimize for token efficiency
Add 4 comprehensive Getting Started guides for new SPIN developers:

- Quick-Start.md: 5-minute setup guide covering installation, first
  route creation, and endpoint testing
- Project-Structure.md: Framework and application directory layout,
  configuration files, and code organization conventions
- Core-Concepts.md: JSON routing, middleware pipeline, request-response
  cycle, and global helpers with examples
- Your-First-App.md: Complete step-by-step tutorial building a Task
  Management API with CRUD operations, controllers, services, and
  testing instructions

All guides include code examples, JSON configuration samples, and cross-
references to related User Guide documentation. Updated doc/README.md
to prominently feature the new guides in Getting Started section.
- Application-Design.md: separation of concerns, layered architecture, DI patterns
- Error-Handling.md: exception hierarchy, JSON responses, logging strategies
- Performance-Optimization.md: caching, query optimization, middleware efficiency
- Database-Patterns.md: connections, transactions, data validation, migrations
- Caching-Strategies.md: when/what to cache, invalidation, adapter selection
- Testing-Patterns.md: unit/integration tests, mocking, fixtures, coverage

Each guide (~450 words) covers practical patterns with real examples and
trade-offs. Cross-referenced with User-Guide and other Best-Practices.
Create comprehensive recipe documentation covering:
- Task 16: Authentication.md (JWT, sessions, middleware, testing)
- Task 17: File-Uploads.md (validation, security, storage, error handling)
- Task 18: Rate-Limiting.md (middleware, Redis, per-user limits)
- Task 19: CORS-Handling.md (headers, preflight, configuration)
- Task 20: API-Versioning.md (URL/header-based, adapters, deprecation)
- Task 21: Deployment.md (config, migrations, health checks, blue-green)

Each guide includes:
- Problem statement
- Complete, runnable code examples
- Configuration examples
- Testing approaches
- Best practices and related docs

Addresses Tasks 16-21 from AI Instructions and Developer Docs plan.
Add 6 detailed contributor guides covering framework development:

- Getting-Started.md: Dev environment setup, git workflow, testing
- Architecture-Overview.md: Core design, components, request lifecycle
- Extension-Points.md: Custom adapters, drivers, middleware, helpers
- Testing-Guide.md: Test structure, coverage, CI/CD integration
- Code-Standards.md: PSR compliance, naming, docblocks, review checklist
- Submitting-Changes.md: PR process, changelog, breaking changes, releases
- README.md: Navigation and quick reference

Includes code examples, checklists, test patterns, and detailed
migration guides for breaking changes. Ready for framework contributors.
Task 28: Create API Reference Guide
- doc/Reference/API-Reference.md with comprehensive coverage (~1500 words)
- Core classes: Application, Controller, Middleware, Config, Logger, CacheManager, ConnectionManager
- Helper functions: env, app, config, container, logger, db, cache, request/response, param accessors
- Exception types: SpinException, ConfigException, DatabaseException, CacheException, MiddlewareException
- Manager classes with configuration examples
- Method signatures with type hints and usage examples

Task 29: Update CLAUDE.md
- Add "AI Instructions" section after Key Architectural Decisions
- Reference three instruction files with brief descriptions
- Maintain existing content

Task 30: Update README.md
- Replace documentation section with improved structure
- Add quick navigation table with topic links
- Reference doc/README.md as navigation hub
- Maintain all other content

Task 31: Final Verification
- Verified all files exist:
  * .claude/claude-instructions.md
  * .github/copilot-instructions.md
  * .claude/llm-instructions.md
  * doc/README.md
  * doc/Getting-Started/* (4 files)
  * doc/User-Guide/* (10 files)
  * doc/Best-Practices/* (6 files)
  * doc/Recipes/* (6 files)
  * doc/Contributor-Guide/* (6+ files)
  * doc/Reference/API-Reference.md (NEW)
- Total markdown files in doc/: 35
- Commits verified and documentation complete

All Tasks 28-31 complete. Framework documentation suite ready for handoff.
…er-docs

Docs/ai instructions and developer docs
- New DotEnv class loads .env from project root at startup before any
  env() or config macro calls; real process env vars always take precedence
- Fixed \${env:VAR:default} inline default syntax in Config::replaceEnvMacros()
  which was documented but silently ignored
- Updated Application::__construct() to call DotEnv::load() as first action
- Added DotEnvTest and extended ConfigTest with inline-default cases
- Updated Configuration.md, Project-Structure.md, Deployment.md, Helpers.md
  to document .env auto-loading and inline macro defaults
- AI instruction files updated: version numbers replaced with VERSION file
  reference; changelog and version-bump rules added to all three files
- Bumped to 0.0.39
@ksandell ksandell requested a review from supercid March 16, 2026 07:47
@ksandell ksandell merged commit f332de7 into master Mar 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants