PHPackages                             quellabs/support - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. quellabs/support

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

quellabs/support
================

Support utilities for the Quellabs ecosystem including Composer path resolution and class discovery

1.0.14(2mo ago)04020MITPHPPHP ^8.2

Since Jul 23Pushed 2mo agoCompare

[ Source](https://github.com/quellabs/support)[ Packagist](https://packagist.org/packages/quellabs/support)[ RSS](/packages/quellabs-support/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)DependenciesVersions (17)Used By (20)

Quellabs Support
================

[](#quellabs-support)

A comprehensive PHP support library providing essential utilities for the Quellabs ecosystem, including advanced debugging, Composer integration, namespace resolution, and framework detection.

Features
--------

[](#features)

- **🐛 Advanced Debugging** - Enhanced variable dumping with rich HTML output and colored CLI display
- **📦 Composer Integration** - Intelligent project root detection and PSR-4 namespace resolution
- **🔍 Context Resolution** - Smart call stack analysis to determine execution context
- **🏗️ Framework Detection** - Automatic detection of popular PHP frameworks
- **📝 Namespace Resolution** - PHP-compliant class name resolution with use statement parsing
- **📚 String Inflection** - English pluralization and singularization utilities

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Composer for autoloading

Installation
------------

[](#installation)

```
composer require quellabs/support
```

Quick Start
-----------

[](#quick-start)

The library automatically registers global debugging functions when installed, providing an **enhanced alternative to Laravel's `dd()`** with rich formatting and intelligent context detection:

```
// Simple variable dumping (like Laravel's dump())
d($user, $request->all(), $config);

// Dump and die (enhanced version of Laravel's dd())
dd($user, $request->all(), $config);
```

Core Components
---------------

[](#core-components)

### CanvasDebugger

[](#canvasdebugger)

The core debugging engine that powers the global `d()` and `dd()` functions. While you'll typically use the convenient global functions, the class can be called directly when needed:

```
use Quellabs\Support\CanvasDebugger;

// Equivalent to d($data, $moreData)
CanvasDebugger::dump($data, $moreData);

// Equivalent to dd($criticalData)
CanvasDebugger::dumpAndDie($criticalData);

// Direct usage in classes where global functions might conflict
class MyDebugger {
    public function debug($data) {
        CanvasDebugger::dump($data);
    }
}
```

**Features:**

- Rich HTML output for web contexts with syntax highlighting
- Colored terminal output for CLI environments
- Collapsible sections for large data structures
- Call location tracking
- Graceful fallback handling

### ComposerUtils

[](#composerutils)

Comprehensive Composer project analysis and PSR-4 utilities:

```
use Quellabs\Support\ComposerUtils;

// Find project root directory
$projectRoot = ComposerUtils::getProjectRoot();

// Get composer.json file path
$composerJson = ComposerUtils::getComposerJsonFilePath();

// Resolve namespace from directory path
$namespace = ComposerUtils::resolveNamespaceFromPath('/path/to/src/Models');
// Returns: "App\Models"

// Find all classes in a directory
$classes = ComposerUtils::findClassesInDirectory('/path/to/controllers');
// Returns: ["App\Controllers\UserController", "App\Controllers\PostController"]

// Normalize file paths
$normalizedPath = ComposerUtils::normalizePath('some/../complex/./path');
// Returns: "complex/path"
```

**Capabilities:**

- Intelligent project root detection for various hosting environments
- PSR-4 namespace mapping and resolution
- Recursive class discovery with filtering
- Path normalization and resolution
- Shared hosting environment support (cPanel, Plesk, DirectAdmin, etc.)

### NamespaceResolver

[](#namespaceresolver)

PHP-compliant class name resolution that mimics PHP's native resolution behavior:

```
use Quellabs\Support\NamespaceResolver;

// Resolve class name based on current context
$resolvedClass = NamespaceResolver::resolveClassName('User');
// Returns: "App\Models\User" (based on use statements and current namespace)

// Resolve with specific context
$reflection = new ReflectionClass('App\Services\UserService');
$resolvedClass = NamespaceResolver::resolveClassName('User', $reflection);
```

**Resolution Strategy:**

1. Direct import matches (`use App\Models\User;`)
2. Compound name resolution (`Models\User` with `use App\Models;`)
3. Current namespace resolution
4. Global namespace fallback

### FrameworkResolver

[](#frameworkresolver)

Automatic detection of popular PHP frameworks:

```
use Quellabs\Support\FrameworkResolver;

$framework = FrameworkResolver::detect();
// Returns: 'laravel', 'symfony', 'canvas', 'cakephp', etc.
```

**Supported Frameworks:**

- Canvas
- Laravel
- Symfony
- CakePHP
- CodeIgniter
- Zend/Laminas
- Yii
- Phalcon
- Slim

### ContextResolver

[](#contextresolver)

Intelligent call stack analysis to find non-framework calling context:

```
use Quellabs\Support\ContextResolver;

$context = ContextResolver::getCallingContext();
// Returns: ['file' => '...', 'class' => '...', 'function' => '...', 'line' => ...]
```

### StringInflector

[](#stringinflector)

English word pluralization and singularization:

```
use Quellabs\Support\StringInflector;

// Pluralization
echo StringInflector::pluralize('user');     // "users"
echo StringInflector::pluralize('child');    // "children"
echo StringInflector::pluralize('person');   // "people"

// Singularization
echo StringInflector::singularize('users');     // "user"
echo StringInflector::singularize('children');  // "child"
echo StringInflector::singularize('people');    // "person"

// Form checking
StringInflector::isPlural('users');    // true
StringInflector::isSingular('user');   // true
```

**Features:**

- Comprehensive irregular word handling
- Uncountable noun support
- Case preservation
- Advanced pluralization rules

### UseStatementParser

[](#usestatementparser)

Extracts and parses PHP use statements from class files:

```
use Quellabs\Support\UseStatementParser;

$reflection = new ReflectionClass('App\Services\UserService');
$imports = UseStatementParser::getImportsForClass($reflection);
// Returns: ['User' => 'App\Models\User', 'Request' => 'Illuminate\Http\Request']
```

**Capabilities:**

- Single and grouped use statement parsing
- Alias resolution
- Efficient caching
- PSR-4 compatibility

### Tools

[](#tools)

General utility functions for common operations:

```
use Quellabs\Support\Tools;

// Get client IP address with proxy support
$ip = Tools::getIPAddress();
// Returns: "192.168.1.100" or null if no valid IP found

// Generate a new GUID/UUID
$guid = Tools::createGUID();
// Returns: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"

// Validate GUID format
$isValid = Tools::validateGUID('a1b2c3d4-e5f6-7890-abcd-ef1234567890');
// Returns: true

$isValid = Tools::validateGUID('invalid-guid');
// Returns: false
```

**IP Address Detection:**

- Handles proxy headers (X-Forwarded-For, X-Real-IP, etc.)
- Validates IPv4 addresses
- Filters private and reserved IP ranges
- Returns only public-facing IP addresses

**GUID Generation:**

- Cross-platform support (uses COM on Windows, OpenSSL elsewhere)
- RFC 4122 compliant UUID v4 format
- Cryptographically secure when OpenSSL available
- Fallback to pseudo-random generation

**GUID Validation:**

- Validates format: 8-4-4-4-12 hexadecimal pattern
- Accepts GUIDs with or without curly braces
- Checks hexadecimal character validity
- Returns boolean result

Performance Considerations
--------------------------

[](#performance-considerations)

The library includes several performance optimizations:

- **Caching**: All expensive operations (file parsing, reflection, etc.) are cached
- **Lazy Loading**: Components are loaded only when needed
- **Memory Management**: Automatic cache size limits prevent memory issues
- **Optimized Algorithms**: Efficient path resolution and namespace matching

Error Handling
--------------

[](#error-handling)

The library provides graceful error handling:

- File system errors fall back to alternative detection methods
- Invalid composer.json files are handled gracefully
- Missing classes don't break namespace resolution
- Debug output includes fallback mechanisms

Contributing
------------

[](#contributing)

This library is part of the Quellabs ecosystem. Contributions should follow PSR-12 coding standards and include comprehensive tests.

License
-------

[](#license)

MIT License. See LICENSE file for details.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance88

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

15

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57e4ab872b3e37536367f2d26b192df3d3bb6a6a1cebec9a104d14a6d2ffe157?d=identicon)[noescom](/maintainers/noescom)

---

Tags

composerPSR-4utilities

### Embed Badge

![Health badge](/badges/quellabs-support/health.svg)

```
[![Health](https://phpackages.com/badges/quellabs-support/health.svg)](https://phpackages.com/packages/quellabs-support)
```

###  Alternatives

[evilfreelancer/routeros-api-php

Modern Mikrotik RouterOS API PHP client for your applications (with Laravel support)

491206.1k4](/packages/evilfreelancer-routeros-api-php)[icamys/php-sitemap-generator

Simple PHP sitemap generator.

175342.8k6](/packages/icamys-php-sitemap-generator)[aura/autoload

Provides a PSR-4 compliant autoloader implementation.

94476.8k12](/packages/aura-autoload)[genert/bbcode

BBCode parser from or to HTML.

81324.0k1](/packages/genert-bbcode)[suin/phpcs-psr4-sniff

PHP\_CodeSniffer sniff that checks class name matches PSR-4 project structure.

271.7M16](/packages/suin-phpcs-psr4-sniff)[yidas/codeigniter-psr4-autoload

CodeIgniter 3 PSR-4 Autoloader for Application

5419.5k3](/packages/yidas-codeigniter-psr4-autoload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
