PHPackages                             peledies/rhonda - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. peledies/rhonda

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

peledies/rhonda
===============

A composer package that provides solutions for common PHP tasks

1.1.17(9y ago)11.4k3[1 PRs](https://github.com/peledies/rhonda/pulls)3MITPHPPHP &gt;=5.3.0

Since Nov 5Pushed 9y ago3 watchersCompare

[ Source](https://github.com/peledies/rhonda)[ Packagist](https://packagist.org/packages/peledies/rhonda)[ RSS](/packages/peledies-rhonda/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (48)Used By (3)

\#Help me \\Rhonda Rhonda is a composer installable package that provides solutions to common PHP tasks.

\##Install

```
  composer require peledies/rhonda:~1
  composer install
```

\##Require in your project Add the folowing to your composer.json file

```
  "require": {
    "peledies/rhonda": "~1"
  }
```

\#Classes and Methods

\##\\Rhonda\\Autoload

Recursivly load all .php files in the provided path, excludes any index.php files.

MethodDescriptionpath(string)Path to load all php files recursively```
  \Rhonda\Autoload::path(__DIR__."/path/to/load/");
```

OR

```
  $load = new \Rhonda\Autoload();
  $load->path(__DIR__."/path/to/load/");
```

\##\\Rhonda\\UUID

MethodDescriptioncreate()Create a new UUID```
  \Rhonda\UUID::create();
```

OR

```
  $uuid = new \Rhonda\UUID();
  $uuid->create();
```

\##\\Rhonda\\Request

Package all incomming request data into a singleton that can be accessed by your application. ALL data that goes through `packager` is automatically mysql\_real\_eacaped even array's and objects recursively.

MethodDescriptionget('param')Get the provided query string parameter, mysql escapedpost()Get the provided request body, mysql escapedIn order to use this class you need to first run the packager right after Rhonda is included in your project

```
  \Rhonda\Request::packager();
```

```
  # GET parameters
  $thing = \Rhonda\Request::get();
```

```
  # GET specific query string value
  $thing = \Rhonda\Request::get('string');
```

```
  # POST body
  $thing = \Rhonda\Request::post();
```

\##\\Rhonda\\RequestBody

use \\Rhonda\\Request for a mysql escaped request body

MethodDescriptionget(boolean)Get the provided request body, exception can be bypassed by putting TRUE as an argument```
  \Rhonda\RequestBody::get();
```

OR

```
  $request_body = new \Rhonda\RequestBody();
  $request_body->get();
```

OR Bypass exception

```
  $request_body = new \Rhonda\RequestBody();
  $request_body->get(TRUE);
```

\##\\Rhonda\\Response

MethodDescriptionpackage(object/array/string)Package the data in an object with possible errors```
  \Rhonda\Response::package($data);
```

OR

```
  $response_package = new \Rhonda\Response($data);
  $response_package->package();
```

\##\\Rhonda\\Success

MethodDescriptioncreate()create a uniform success message```
  echo \Rhonda\Success:: create();
```

OR

```
  $msg = new \Rhonda\Success();
  echo $msg->create();
```

\##\\Rhonda\\Error

MethodDescriptionhandle()Fromat an exception for return. Also writes a pretty stack trace to the error logdeprecation\_warning(**message, alternate route**)Adds a `Warning` header and changes the status code to `299`add\_summary\_item(**Object**)Adds any object to the error summary singletonsummary()Retrieves the error summary data **Array**```
  try{
    throw new Exception("Demo Error Exception");
  }catch(\Exception $e){
    echo \Rhonda\Error::handle($e);
  }
```

OR

```
  try{
    throw new Exception("Demo Error Exception");
  }catch(\Exception $e){
    $error = new \Rhonda\Error();
    echo $error->handle($e);
  }
```

\##\\Rhonda\\Config

MethodDescriptionload\_file()Load a JSON file into memory as an object for later retrievalload\_object()Load an object into memory for later retrievalget()Retrieve a configuration object from memoryLoad Object to memory```
  $object = new stdClass();
  $object->thing_1 = 'something one';
  $object->thing_2 = 'something two';
  \Rhonda\Config::load_object('test_one', $object);
```

Load JSON file to memory

```
  // File path is relative to your project root
  $config->load_file('test_two', 'path/to/file.json');
```

Retrieve a configuration object from memory

```
\Rhonda\Config::get('test_one');
```

\##\\Rhonda\\APIGateway

MethodDescriptionrun(\*\* *optional* \*\*)Run a request to an external URL. optional boolean parameter for exception bypassMake a request to an external address with custom headers and a request body

```
try{
  $headers = array("Domain"=>"domain_1", "Authorization"=>"sometoken");
  $data = (object) array("handle"=>"demo_1", "password"=>"asdf");
  $api = new \Rhonda\APIGateway('POST','http://elguapo.eventlink.local/authenticateasdf/',$data, $headers);
  $data = $api->run();
}catch(\Exception $e){
  $error = new \Rhonda\Error();
  echo $error->handle($e);
}
```

\##\\Rhonda\\Strings

MethodDescription**validate(** *type\_string, test\_string* **)**Return True/False**validate\_or\_error(** *type\_string, test\_string* **)**Return True/False or throws exception**normalize(** *string* **)**Returns normalized string#### String Normalization

[](#string-normalization)

- Removes non word characters
- Converts the string to lowercse
- Converts spaces and dashes to underscores
- Trims trailing invalid characters

#### Validation Types

[](#validation-types)

TypeDescription'email'Verifies proper email structure'username'Tests that string only includes a-z 0-9 . - or \_**Test that a string is a valid email (without exception)**

```
try{
  // PASS
  $string = 'test@test.com';
  \Rhonda\Strings:: validate('email',$string);

  // FAIL
  $string = 'test@test';
  \Rhonda\Strings:: validate('email',$string);

  // Catch will not be invoked
}catch(\Exception $e){
  echo \Rhonda\Error:: handle($e);
}
```

**Test that a string is a valid email (with exception)**

```
try{
  // PASS
  $string = 'test@test.com';
  \Rhonda\Strings:: validate_or_error('email',$string);

  // FAIL
  $string = 'test@test';
  \Rhonda\Strings:: validate_or_error('email',$string);

  // Catch will be invoked
}catch(\Exception $e){
  echo \Rhonda\Error:: handle($e);
}
```

**Normalize a string**

```
  $input = 'Some TEST-@#string-#$-!@';
  \Rhonda\Strings:: normalize($input);

  // Returns
  some_test_string
```

\##\\Rhonda\\Headers

MethodDescriptiongetallheaders()Return an Array of all request headers, works for Apache, PHP, and Nginx serversset\_response\_code(integer)Set the response code and text to a specific value (accepts: 200, 209, 400, 404)Retrieve All request headers as an Array

```
  $headers = \Rhonda\Headers:: getallheaders();
```

OR

```
  $headers = new \Rhonda\Headers();
  $headers->getallheaders();
```

\##\\Rhonda\\Mysql

MethodDescriptionreal\_escape(**String, Array, Object**)Escape the thing being passed in by utilizing mysqli and real\_escape\_string. These methods require a mysql connection so you will need to load a config file into the variable **DB**. real\_escape uses **utf-8** as the charset. When escaping an Array or Object, recursion is used and it will drill through the object/array and escape everything.bool\_to\_string(STRING)Convert ANY truthy or falsy thing into a '1' or a '0' for mysql query building**Escape a String**

```
$string = "that's all folks";
$string = \Rhonda\Mysql::real_escape($string);
```

**Escape an Object**

```
$object = new \stdClass();
$object->thing = "it's for real";
$object = \Rhonda\Mysql::real_escape($object);
```

**Escape an Array**

```
$array = array(
   "ray"=>"it's escaping arrays"
 , "ray2"=>"escape's this one too"
);
$array = \Rhonda\Mysql::real_escape($ray);
```

**Convert to Mysql boolean**

```
  $value = \Rhonda\Mysql:: bool_to_string('true');
  OR
  $mysql = new \Rhonda\Mysql();
  $value = $mysql->bool_to_string('true');
```

\##\\Rhonda\\ServiceChain

MethodDescriptionregister(`optional`)Register this application or micro service to the service chain.report(`Boolean`)Return a string (default) or an Array of the service chain if parameter is set to TRUEIf you are using ServiceChain, `register()` should be one of the first things you do in your application, preferably immediately after the composer autoload.

The default behavior of register is to use your config object named `system` for a property named `host`. `\Rhonda\ServiceChain:: register()` will automatically use that value for the service name.

(Prefered) Register this micro service to the service chain using a config file

```
  require_once __DIR__ . '/../vendor/autoload.php';

  // Load your configuration file to memory
  \Rhonda\Config:: load_file('system', 'path/to/file.json');

  // Register your service name
  \Rhonda\ServiceChain:: register();
```

Register this micro service to the service chain using a parameter

```
  require_once __DIR__ . '/../vendor/autoload.php';

  // Register your service name
  \Rhonda\ServiceChain:: register('Service-Name');
```

Get the current service chain state

```
  // "Returns: service1 => service2 => etc"
  \Rhonda\ServiceChain:: report();

  // "Returns: array("service1", "service2", "etc")
  \Rhonda\ServiceChain:: report(TRUE);
```

\##\\Rhonda\\CORS

MethodDescriptionallow\_headers()Set headers to allow CORS request```
  \Rhonda\CORS::allow_headers();
```

OR

```
  $cors = new \Rhonda\CORS();
  $cors->allow_headers();
```

\##\\Rhonda\\Boolean

MethodDescriptionevaluate(STRING)Read a string to change to a boolean TRUE/FALSE```
  \Rhonda\Boolean::evaluate('yes');
```

OR

```
  $boolean = new \Rhonda\Boolean();
  $boolean->evaluate('false');
```

\##\\Rhonda\\Google

MethodDescriptiongeo\_code(STRING, ARRAY)Load and address with Google api key and Array of address parameters```
  \Rhonda\Google::geo_code('google_api_key', array('1600 Amphitheatre Parkway', 'Mountain View', 'CA 94043', 'USA'));
```

OR

```
  $googleApi = new \Rhonda\Google();
  $googleApi->geo_code('google_api_key', 'array_of_address_parameters');
```

MethodDescriptionprepare\_query\_string(ARRAY)Prepare a Google Array of address parameters```
  \Rhonda\Google::prepare_query_string(array('1600 Amphitheatre Parkway', 'Mountain View', 'CA 94043', 'USA'));
```

OR

```
  $googleApi = new \Rhonda\Google();
  $googleApi->prepare_query_string(array('1600 Amphitheatre Parkway', 'Mountain View', 'CA 94043', 'USA'));
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

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 ~7 days

Total

45

Last Release

3573d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1185267?v=4)[Deac Karns](/maintainers/peledies)[@peledies](https://github.com/peledies)

---

Top Contributors

[![wdekkers](https://avatars.githubusercontent.com/u/11724672?v=4)](https://github.com/wdekkers "wdekkers (24 commits)")[![sloane-shark](https://avatars.githubusercontent.com/u/8558044?v=4)](https://github.com/sloane-shark "sloane-shark (4 commits)")[![peledies](https://avatars.githubusercontent.com/u/1185267?v=4)](https://github.com/peledies "peledies (1 commits)")[![whtevn](https://avatars.githubusercontent.com/u/9390?v=4)](https://github.com/whtevn "whtevn (1 commits)")

### Embed Badge

![Health badge](/badges/peledies-rhonda/health.svg)

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

PHPackages © 2026

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