Download the PHP package responsive-sk/slim4-paths without Composer
On this page you can find all versions of the php package responsive-sk/slim4-paths. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download responsive-sk/slim4-paths
More information about responsive-sk/slim4-paths
Files in responsive-sk/slim4-paths
Package slim4-paths
Short Description Complete path management solution for PHP applications with zero dependencies, built-in filesystem operations, enhanced security, framework presets (Laravel, Slim4, Mezzio), and comprehensive validation
License MIT
Informations about the package slim4-paths
Slim4 Paths - Enhanced Path Management
A comprehensive, secure path management package for PHP applications with advanced features for modern web development.
Features
- Framework Presets - Laravel, Slim 4, Mezzio/Laminas presets
- Secure Path Joining - Prevents path traversal attacks
- 50+ Predefined Paths - Framework-specific directory structures
- Cross-Platform Compatibility - Works on Windows, Linux, macOS
- Auto-Directory Creation - Automatic directory structure setup
- Security Validation - Input validation and path sanitization
- Framework Agnostic - Works with any PHP framework
- Orbit CMS Support - Built-in support for content management
- Module System Integration - Advanced module path resolution
Installation
Framework Presets
NEW in v3.0 Use framework-specific directory presets for instant setup:
Laravel Preset
Slim 4 Preset
Mezzio/Laminas Preset
Available Presets
Basic Usage
Convenience Methods
Paths::fromHere(__DIR__, $levelsUp = 3)
Convenience method to create a Paths instance from the current file location. Useful in modular systems.
Benefits:
- ✅ More expressive than manual path construction
- ✅ Less error-prone than counting
../manually - ✅ Works in tests, CLI, without DI containers
- ✅ Automatic path validation with clear error messages
Paths::fromEnv($envVar = 'APP_BASE_PATH')
Create a Paths instance from an environment variable. Useful for applications that need environment-based configuration.
Environment-based Usage
Combine environment-based initialization with existing path methods:
Core Path Methods
Basic Directories
Template System
Content Management (Orbit CMS)
Module System
Asset Management
Development Tools
Security & Storage
Localization
Secure Path Joining
The getPath() method provides secure path joining with built-in protection against path traversal attacks:
Security Features
- Path Traversal Protection - Detects and blocks
..sequences - Home Directory Protection - Blocks
~access - Input Validation - Validates all path components
- Cross-Platform Safety - Handles different directory separators
Configuration
Basic Configuration
Framework Integration
Slim Framework
Orbit CMS Integration
This package includes built-in support for Orbit-style content management:
Module System Support
Advanced module path resolution for modular applications:
Security Best Practices
Always Use Secure Path Joining
Validate User Input
Directory Traversal Protection
The package automatically protects against common attacks:
Testing
Requirements
- PHP 8.1 or higher
- No additional dependencies
License
MIT License
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Changelog
Version 2.0.0
- Added 30+ predefined path methods
- Enhanced security with path traversal protection
- Added Orbit CMS support
- Added module system integration
- Added comprehensive test coverage
- Breaking changes from 1.x (see migration guide)
Version 1.0.0
- Initial release
- Basic path management functionality