Download the PHP package viragrajput/http-foundation without Composer
On this page you can find all versions of the php package viragrajput/http-foundation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download viragrajput/http-foundation
More information about viragrajput/http-foundation
Files in viragrajput/http-foundation
Package http-foundation
Short Description A lightweight HTTP foundation package for PHP.
License MIT
Informations about the package http-foundation
Virag HTTPFoundation
HTTPFoundation is a PHP package designed to provide a set of classes for handling HTTP-related tasks, including handling cookies, sessions, file uploads, generating HTTP responses, and processing HTTP requests. This package aims to simplify common HTTP-related operations in PHP web development.
Features
- Cookie Handling: Easily manage HTTP cookies with the
Cookie
class, including setting, getting, deleting, and encrypting/decrypting cookie values. - Session Management: Handle PHP sessions effortlessly with the
Session
class, allowing setting, getting, checking existence, and removing session data. - File Upload Handling: Manage file uploads with the
UploadedFile
class, including retrieving file information, moving uploaded files, and determining file types. - HTTP Response Generation: Generate HTTP responses dynamically with the
Response
class, allowing setting status codes, headers, and response content easily. - HTTP Request Processing: Process incoming HTTP requests with the
Request
class, enabling access to request headers, parameters, and files.
Installation
You can install the HTTPFoundation package via Composer:
Usage
Cookie Handling
Session Management
File Upload Handling
For more details example of this class, please check docs folder.
HTTP Response Generation
HTTP Request Processing
The createFromGlobals
method creates a Request
object based on the global variables available in PHP, such as $_SERVER
, $_REQUEST
, and php://input
. This method is convenient for creating request objects in a standardized way, especially in web applications where requests are typically handled through the global scope.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request for any improvements or bug fixes.
License
This package is open-source software licensed under the MIT License.