Download the PHP package ongom/hot-lib without Composer

On this page you can find all versions of the php package ongom/hot-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hot-lib

Hot-lib

This is a php library that provides most of the common methods used in controller. It has on it static methods like;

session()

It saves and retrieve session variable. You don't need to start session.

deleteSession()

Will delete the session key from the the session variable. If no parameter is passed, it unset the entire session.

flash()

It sets and retrieve flash messege. This messege will appear only once. It also uses sessinon under in the background.

randomString()

Generate random string of default length 8. Takes in the length of the string as one parameter.

randomLetters()

Generate random letters of default length 8. Takes in the length of the string as one parameter.

randomNumber()

Generate random number of default length 8. Takes in the length of the string as one parameter. Returns a string of numbers

env()

It reads a particular evironment variable from the .env file. It returns the value of the key passed. If no key is passed it returns the whole env array results.

URL

redirect()

Redirect to any URL. It takes in the new redirect route, array or string query params and status.

redirectBack()

Redirects the request back to the url it is comming from. It takes in array or string query params and status and a status code.

serverBase()

Returns the base URL of the the server you are currently running the website on. Server base URL (domain only)

incoming()

Returns the full URL where the request is comming from. Full incoming URL (path + query)

incomingBase

Base URL of incoming request (includes app subfolder)

incomingPath()

Returns the incoming path only (no scheme, no host)

Request

body()

Gets request body from an api call. It can return Object or array or null

params()

Gets request query params from an api call. It can return Object or array or null

post()

Gets posted data from a form in post request. It can return Object or array or null

get()

Gets posted data from a form in a get request. It can return Object or array or null

files()

Gets file(s) submited from form or api call. It can return the file or null

Response

json()

Converts array or object to json object. Has no effect on numbers and strings.

send()

Converts array or object to json object and send back. Has no effect on numbers and strings.

Files

upload()

It uploads single or multiple files locally on the server. It also renames the files before saving it. Takes in array parameter,and it retuns a string for single file, array for multiple files and false for failure to upload.

delete()

It deletes any file from the server. It takes in a string or array of filenames and the directory where it is stored.

getFiles()

It gets all the files from the provided directory. It take in an array or string of filename, and the derectory where the files is stored and an optional fallback image which can either be a link or the file on the server.

exist()

checks if a file exist in the directory. Takes in the file path and returns a boolean.

Number

numberToWords()

Converts number to word upto the range of trillion.

currency

Converts money to words

sequence()

Generate and returns sequence of number from down to up or from up to down. Takes in the three number parameter; from, to and steps.

format()

It formats the number with commas by default. It takes in the number and an optional formatter, if formatter is not passed, it default to comma.

matrix()

Converts large numbers to shorthands like 10M for 10000000, 1.3k for 1300, etc. It takes in the number and the optional precision.

chop()

It cuts some part of the array or string off from some position to a particular position.

trancate()

Instead of rounding off, it trancates the number to some required precision.

ago()

Takes in the date or time and returns how much time has passed. Returns false if less than 1 seconds.

left()

Takes in the date or time ahead and returns how much time is left. Returns false if less than 1 seconds.

Password

hash()

Takes in plain text and reterns the hash. There more methods with different algorithms like bcrypt(123456), algon2i(123456), algon21i(123456)

verify()

Takes in plain text and hashed text then, reterns a boolean, true for match and false for not matching.


SecureId

A PRO ID encryption system built specifically for; numeric DB IDs, UUIDs / strings, public URLs, constant length output, URL-safe, reversible, collision-safe and faster than normal OpenSSL usage.

It has methods encode/encrypt for encrypting the content and decode/decrypt for decrypting the content to original.

Encode

Decode

Encrypt

It encrypts numerical values to random string that is reversible

Decrypt

It brings back the original number thar was decrypted. What this protects against are /user/abc@@ → null, /user/zzzzz → null, /user/ → null, tampered token → null, non-integer results → null. Only valid encoded IDs return a number.

Id

Secure method (AES encryption — recommended). Use OpenSSL so the ID cannot be guessed or reversed.

View Engine

This is a lightweight, class-based PHP View Engine that allows you to:

FEATURES


Setting Paths


Rendering Templates

render()

Example:


fetch()


Template Syntax

Variables

Basic Variables and Nested Variables
Global Variables

This are variables that can automatically be access every where within the page/view. Current component, current layout, current view/page and current pathname are accessed anywhere within the app by default as below

Setting global Variables

There are two ways of passing youn own global variables to view/page too.


Components / Partials

Set up path to component directory

Create an html file in that directory eg. profile.html, Add content to you html. You can have sub-folders in components folder too

Display the component within your templete using its name as before

Example: in the templete

Component Summary table for paaing vairiables to components

Data type Supported Access in component
String ✓ $title
Integer ✓ $count
Boolean ✓ $isAdmin
Array ✓ $users[]
Object ✓ $user->name
Closure ✓ $callback()
Slot content ✓ $$slot

Available variables in components

Layouts and Slots


Example Project Structure


View Caching

How it works

Security Notes

Best Practices

THANK YOU


All versions of hot-lib with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ongom/hot-lib contains the following files

Loading the files please wait ...