Installation

How to install the Loopwork library in your project.

Installing Loopwork Installer

If you have installed PHP at least version 8 and Composer, you can install the Loopwork installer now.

Install via Composer:

composer global require loopwork/installer:dev-main

Creating an Application

Once you have installed the Loopwork installer, you can run this command:

loopwork

When the command is executed we ask you to fill in the Project Name.
Fill in the project name according to the name of the application you want to create, Example:

Project Name: MyProject

Installation Complete

We provide you with a template in index.php. Contents:

require "vendor/autoload.php";
require_once "utility/UtilityLoader.php";
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
use Utility\Utility AS utl;

How to use the code

We make a provision that every use of function must call utl:: first.
Here's an example of its use:

Using MYSQL funtion create a query:

You no longer need to connect to the database because we have made it one with the mqr() function.

$qry = utl::mqr("SELECT * FROM table")
while($rows = utl::fa($utl)){
echo $rows['name'];
}
// asep saepudin

Using RANDOM funtion create a random string or int:

utl::random("abcABC123", 0, 5)
// Ba3A1