Hypervel Documentation

website·Indexed 31 days ago

https://hypervel.org

A PHP framework featuring a service container, Eloquent ORM for database management, and a suite of tools including Sanctum for authentication, Horizon for queue services, and Socialite for OAuth. The documentation covers core components like middleware, facades, and the HTTP client, as well as testing utilities and guides for porting Laravel packages to a coroutine-safe environment.

Tokens
173K
Snippets
1.2K
Records
1.2K
Agent score
59%

What's inside Hypervel

  1. Overview of Hypervel Queues

    Hypervel provides a unified API for background job processing across multiple backends. Configuration is managed in config/queue.php. Supported drivers include database, redis, amazon-sqs, beanstalkd, sync (immediate execution for local development), and null (discards jobs). For asynchronous execution without persistence, coroutine or defer drivers can be used, though defer operates as FILO (First-In-Last-Out).
  2. Introduction to Blade Templating

    Blade is a powerful templating engine included with Hypervel that compiles templates into plain PHP code and caches them for performance. Blade templates use the .blade.php file extension and are typically stored in the resources/views directory. They can be returned from routes or controllers using the global view helper.
    Route::get('/', function () {
        return view('greeting', ['name' => 'Finn']);
    });
  3. Overview of Hypervel Service Providers

    Service providers are the central mechanism for bootstrapping Hypervel applications. They are used to register service container bindings, event listeners, middleware, and routes. All service providers must extend the Hypervel\Support\ServiceProvider class.
  4. Overview of Hypervel Framework

    Hypervel is a Laravel-style PHP framework designed for ultra-high performance. It ports core components and usage patterns from Laravel to provide a familiar development experience while integrating native coroutine support. It is specifically designed for building microservices, API gateways, and high-concurrency applications where traditional blocking I/O frameworks encounter performance bottlenecks.
  5. Overview of Hypervel Middleware Support

    Hypervel provides a mechanism for inspecting and filtering HTTP requests. It supports two types of middleware: PSR-15 compliant middleware for interoperability with other PHP libraries, and Laravel-style middleware for developers migrating from Laravel or preferring its syntax. Both types can be mixed and matched within the same application. Middleware should be placed in the app/Http/Middleware directory.
  6. Overview of available Telescope Watchers

    Hypervel Telescope provides several watchers to monitor application behavior:

    • Event Watcher: Records payloads and listeners for dispatched events (ignores internal framework events).
    • Exception Watcher: Records reportable exceptions and stack traces.
    • HTTP Client Watcher: Records outgoing HTTP requests.
    • Job Watcher: Records status and data of dispatched jobs.
    • Mail Watcher: Provides in-browser previews and .eml downloads of sent emails.
    • Notification Watcher: Records sent notifications.
    • Redis Watcher: Records Redis commands, including cache commands.
    • Schedule Watcher: Records output of scheduled tasks.
    • View Watcher: Records view names, paths, and composers.
  7. Understand why Laravel packages require porting for Hypervel

    Laravel packages cannot be installed directly on Hypervel because they are designed for a single-request lifecycle and often store state in singleton objects (e.g., AuthManager caching guards). In a coroutine environment, this leads to state leakage between concurrent requests. To be compatible, packages must be ported to isolate state within a Coroutine-Level Container (Context) and ensure singleton objects can serve multiple requests concurrently.
  8. Evaluate Laravel package compatibility and migration to Hypervel

    Hypervel is NOT compatible with Laravel packages due to fundamental architectural differences. Developers must manually migrate Laravel packages to Hypervel.

    Migration guidance:

    • If current projects have no performance issues, staying with Laravel is recommended due to its mature ecosystem.
    • For performance-critical needs, consider a hybrid approach: migrate only specific APIs or modules to Hypervel and use an API Gateway to allow both Laravel and Hypervel projects to coexist.
  9. Understand the Hypervel application directory structure

    Hypervel follows a directory structure similar to Laravel. While developers can organize the application as needed, the bootstrap, config, database, and runtime directories are essential to the core design and should be maintained.
    ├── app
    │   ├── Console
    │   │   └── Commands
    │   ├── Events
    │   ├── Exceptions
    │   ├── Http
    │   │   ├── Controllers
    │   │   ├── Middleware
    │   │   └── Requests
    │   ├── Jobs
    │   ├── Listeners
    │   ├── Models
    │   └── Providers
    ├── bootstrap
    ├── config
    ├── database
    │   ├── factories
    │   ├── migrations
    │   └── seeders
    ├── lang
    │   ├── en
    │   ├── zh_CN
    │   └── zh_TW
    ├── public
    ├── resources
    ├── routes
    ├── runtime
    │   └── container
    ├── storage
    │   ├── app
    │   ├── framework
    │   └── logs
    └── tests
        ├── Feature
        └── Unit
  10. Inspect application configuration and environment

    Hypervel provides Artisan commands to view the application's current configuration, drivers, and environment status. Use about for a general overview or config:show to inspect a specific configuration file.
    # Display general application overview
    php artisan about
    
    # Filter overview for environment details only
    php artisan about --only=environment
    
    # Explore a specific configuration file (e.g., database)
    php artisan config:show database
  11. Understand Hypervel Contracts

    Hypervel contracts are a set of interfaces that define the core services provided by the framework (e.g., Hypervel\Auth\Contracts\Gate for authorization or Hypervel\Hashing\Contracts\Hasher for secure hashing). They are located in the Contracts directory of their respective packages, providing a decoupled way to interact with Hypervel services without relying on concrete implementations.
  12. Retrieve file metadata and paths

    Use the following methods to get information about a file. The path method returns the absolute path for local drivers and the relative path for s3 drivers.
    use Hypervel\Support\Facades\Storage;
    
    $size = Storage::size('file.jpg');           // Size in bytes
    $time = Storage::lastModified('file.jpg');    // UNIX timestamp
    $mime = Storage::mimeType('file.jpg');         // MIME type
    $path = Storage::path('file.jpg');            // Absolute (local) or Relative (S3) path