Download the PHP package neuron-php/data without Composer
On this page you can find all versions of the php package neuron-php/data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package data
Neuron-PHP Data
A comprehensive data handling and utility component for PHP 8.4+ that provides essential data manipulation, filtering, parsing, and configuration management tools for the Neuron framework.
Table of Contents
- Installation
- Core Features
- Input Filtering
- Settings Management
- Environment Variables
- Database Connections
- Data Objects
- Parsers
- Unit Conversion
- Testing
- More Information
Installation
Requirements
- PHP 8.4 or higher
- Extensions: curl, json, calendar
- Composer
Install via Composer
Core Features
The Data component provides:
- Input Filtering: Secure wrappers for PHP's filter_input functions
- Settings Management: Unified configuration from multiple sources (YAML, INI, ENV)
- Environment Variables: .env file loading and management
- Data Objects: Specialized objects for common data structures
- Parsers: CSV, positional, and name parsing utilities
- Array Utilities: Advanced array manipulation functions
- Unit Conversion: Common unit conversions
- Date Utilities: Date range and manipulation tools
Input Filtering
Secure, type-safe wrappers for PHP's filter_input functions with a consistent interface.
Available Filters
Cookie- Access $_COOKIE valuesGet- Access $_GET valuesPost- Access $_POST valuesServer- Access $_SERVER valuesSession- Access $_SESSION values
Filter Interface
All filters implement the IFilter interface:
Usage Examples
Settings Management
The SettingManager provides a unified interface for configuration from multiple sources with fallback support.
Supported Sources
- YAML - YAML configuration files
- INI - Traditional INI files
- ENV - Environment variables
- Memory - In-memory configuration
Basic Usage
YAML Configuration Example
INI Configuration Example
Memory Source
Environment Variables
The Env class provides secure .env file loading and environment variable management using a singleton pattern.
Basic Usage
.env File Format
Database Connections
Neuron\Data\Database\ConnectionFactory is the one place the framework turns
a database: settings section into a PDO connection, so web requests, queue
workers, the scheduler and db:migrate all apply the same rules:
Configuration may use individual keys (adapter, host, port, name,
user/pass or username/password, charset), a url
(mysql://, postgresql://, sqlite:///path, sqlite::memory:), or both;
explicit keys win over the file's url.
A DATABASE_URL environment variable, as injected by Railway, Heroku or
docker-compose, is applied last and overrides the file for the components it
carries. Keys it does not mention (for example charset) fall through to the
file, so one image can run against different databases with no config edit.
Pass false as the second argument to normalize() to ignore it.
SQLite connections get WAL mode, a busy timeout and foreign keys; MySQL and PostgreSQL sessions are set to UTC.
Data Objects
Specialized objects for common data structures with built-in validation and manipulation.
Version
Works with semantic versioning and integrates with the Bump utility.
DateRange
Manage date ranges with validation and comparison.
NumericRange
Handle numeric ranges with validation.
GpsPoint
Geographic coordinate handling with distance calculations.
Parsers
Data parsing utilities for various formats and structures.
CSV Parser
Parse CSV data with custom delimiters and headers.
Positional Parser
Parse fixed-width positional data.
Name Parsers
Parse names in various formats.
Unit Conversion
Common unit conversion utilities for measurements.
Testing
Run the test suite:
Test Structure
Best Practices
Configuration Management
Input Validation
Environment Configuration
More Information
- Neuron Framework: neuronphp.com
- GitHub: github.com/neuron-php/data
- Packagist: packagist.org/packages/neuron-php/data
License
MIT License - see LICENSE file for details
All versions of data with dependencies
ext-json Version *
ext-calendar Version *
neuron-php/formatting Version 0.7.*
symfony/yaml Version ^6.4 || ^7.0 || ^8.0