-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Before you can start using DBease in your PHP project, ensure that you have the following prerequisites installed:
-
PHP: DBease requires PHP 7.0 or later to function correctly. You can download and install PHP from the official PHP website: php.net.
-
MySQL Database: Make sure you have access to a MySQL database where you intend to use DBease for your database interactions.
The recommended way to install DBease is by using Composer, a popular PHP package manager. Follow these steps to install DBease in your project:
-
Create a new PHP project or navigate to an existing one.
-
Open your terminal/command prompt and navigate to your project's root directory.
-
Run the following command to add DBease to your project's dependencies:
composer require erikthiart/dbease
-
Composer will download and install DBease along with its dependencies.
-
Once the installation is complete, you can start using DBease in your PHP code.
If you prefer not to use Composer, you can manually install DBease by following these steps:
-
Download the latest release of DBease from the GitHub releases page.
-
Extract the downloaded archive to your project's directory.
-
Include the
Database.php
file in your PHP code by adding the following line at the beginning of your script:
require_once 'path/to/Database.php';
Replace 'path/to/Database.php'
with the actual path to the Database.php
file.
- You can now start using DBease in your PHP code.
To verify that DBease is correctly installed in your project, you can create a simple PHP script that initializes the Database
class and connects to your database. If no errors occur during this process, the installation is successful.
Here's a minimal example:
<?php
require_once 'path/to/Database.php';
// Create a new Database instance
$db = new \Core\src\Database();
// Replace the above line with the actual path to 'Database.php'
// Perform a simple database query (e.g., retrieve a record)
$data = $db->find('your_table_name', ['id' => 1]);
// Display the result
var_dump($data);
?>
Replace 'your_table_name'
with the name of a table in your database.
That's it! DBease should now be successfully installed and ready to use in your PHP project.