PHPackages                             hxgf/dw-utilities - 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. hxgf/dw-utilities

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

hxgf/dw-utilities
=================

A collection of utility functions to facilitate an efficient workflow with the Darkwave web application toolkit.

0.1(2y ago)012MITPHP

Since Jul 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jyoungblood/dw-utilities-php)[ Packagist](https://packagist.org/packages/hxgf/dw-utilities)[ Docs](https://github.com/hxgf/dw-utilities-php)[ RSS](/packages/hxgf-dw-utilities/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

DW Utilities (PHP)
==================

[](#dw-utilities-php)

### A collection of utility functions to facilitate an efficient workflow with the [Darkwave](https://github.com/jyoungblood/darkwave) web application toolkit.

[](#a-collection-of-utility-functions-to-facilitate-an-efficient-workflow-with-the-darkwave-web-application-toolkit)

Installation
============

[](#installation)

These functions are included with Darkwave, but they can be installed and used as standalone functions in any project.

Install the package with Composer:

```
composer require jyoungblood/dw-utilities

```

Then add it to your application:

```
use Darkwave\dw;
require __DIR__ . '/vendor/autoload.php';

```

Available Methods
=================

[](#available-methods)

dw::client\_ip()
----------------

[](#dwclient_ip)

Returns the (best guess for the) current visitor's IP address, using a combination of `$_SERVER['HTTP_CLIENT_IP']`, `$_SERVER['HTTP_X_FORWARDED_FOR']`, and `$_SERVER['REMOTE_ADDR']`

```
dw::client_ip();
```

dw::authenticate()
------------------

[](#dwauthenticate)

Parses the JWT 'token' cookie and sets global authentication variables to be used by the rest of the application.

```
dw::authenticate();
```

dw::generate\_jwt($user)
------------------------

[](#dwgenerate_jwtuser)

Uses [psr-jwt](https://github.com/RobDWaller/psr-jwt) to generate a JWT based on data from a given user's profile. Sets payload claims for `_id`, `name`, `avatar_url`, `screenname`, `admin_token`, and `staff_token`

```
dw::generate_jwt($user);
```

dw::convert\_image($args)
-------------------------

[](#dwconvert_imageargs)

Uses [php-image-resize](https://github.com/gumlet/php-image-resize) and [GD](https://www.php.net/manual/en/book.image.php) to convert a given image based on various configuration parameters.

```
dw::convert_image([
  'source' => $_SERVER['DOCUMENT_ROOT'] . '/uploads/source-filename.jpg',
  'target' => $_SERVER['DOCUMENT_ROOT'] .  '/uploads/converted-filename.jpg',
  'resize' => [300, 300],
  // 'threshold' => 800
  'crop' => 'center',
  'quality' => 80
]);
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1042d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4130bfc70d308f890899a0c223f9888271f0fd3f91879b09558ba696862d8d4?d=identicon)[jyoungblood](/maintainers/jyoungblood)

---

Top Contributors

[![jyoungblood](https://avatars.githubusercontent.com/u/56104?v=4)](https://github.com/jyoungblood "jyoungblood (5 commits)")

---

Tags

utilities

### Embed Badge

![Health badge](/badges/hxgf-dw-utilities/health.svg)

```
[![Health](https://phpackages.com/badges/hxgf-dw-utilities/health.svg)](https://phpackages.com/packages/hxgf-dw-utilities)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M15](/packages/vaimo-composer-patches)[lodash-php/lodash-php

A port of Lodash to PHP

527719.0k5](/packages/lodash-php-lodash-php)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)[longman/ip-tools

PHP IP Tools for manipulation with IPv4 and IPv6

147245.6k6](/packages/longman-ip-tools)[mathiasverraes/classfunctions

Functions to manipulate class names

34472.6k10](/packages/mathiasverraes-classfunctions)[kunstmaan/utilities-bundle

The KunstmaanUtilitiesBundle makes your life easier by providing a couple of small but usefull helper services you can use and re-use in your applications. We already implemented an easy to use cipher service and a shell helper service for you but feel free to send in a pull request with your additions. The shell helper allows you to run apps in the background, see if a process is running and has a method to kill a running process. The cipher service allow you to encode and decode strings using the Rijndael 256 cipher

13150.5k6](/packages/kunstmaan-utilities-bundle)

PHPackages © 2026

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