Download the PHP package jyoungblood/dw-utilities without Composer
On this page you can find all versions of the php package jyoungblood/dw-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jyoungblood/dw-utilities
More information about jyoungblood/dw-utilities
Files in jyoungblood/dw-utilities
Package dw-utilities
Short Description A collection of utility functions to facilitate an efficient workflow with the Darkwave web application toolkit.
License MIT
Homepage https://github.com/hxgf/dw-utilities-php
Informations about the package dw-utilities
DW Utilities (PHP)
A collection of utility functions to facilitate an efficient workflow with the Darkwave web application toolkit.
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:
Then add it to your application:
Available Methods
dw::client_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::authenticate()
Parses the JWT 'token' cookie and sets global authentication variables to be used by the rest of the application.
dw::generate_jwt($user)
Uses 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::convert_image($args)
Uses php-image-resize and GD to convert a given image based on various configuration parameters.