1. Go to this page and download the library: Download bazarin/bazarin-php-library library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bazarin / bazarin-php-library example snippets
use Bazarin\Database\Connection;
use Bazarin\Database\QueryBuilder;
// Database Configuration
$db = new Connection([
'host' => 'localhost',
'user' => 'bazarin',
'password' => 'bazarin',
'database' => 'xgramm'
]);
// Initialize Query Builder
$query = new QueryBuilder($db->getConnection());
use Bazarin\Helpers\FileHelper;
$fileHelper = new FileHelper();
$filePath = "uploads/sample.txt";
// Check if a file exists
if ($fileHelper->exists($filePath)) {
echo "File exists!";
}
use Bazarin\Helpers\DateHelper;
$dateHelper = new DateHelper();
// Get current date
echo $dateHelper->now();
use Bazarin\APIS\Curl;
$curl = new Curl();
$response = $curl->request('https://jsonplaceholder.typicode.com/todos/1', 'GET');
var_dump($response);
use Bazarin\APIS\FileGetContent;
$fileGetContent = new FileGetContent('*');
$content = $fileGetContent->fetch("https://example.com/sample.txt");
echo $content;
use Bazarin\Security\Cryptions;
$cryptions = new Cryptions('my-secret-key');
$encrypted = $cryptions->encrypt("Hello, World!");
$decrypted = $cryptions->decrypt($encrypted);
echo "Encrypted: $encrypted\n";
echo "Decrypted: $decrypted\n";
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.