{"id":14972171,"url":"https://github.com/aaronmk44/ci4-db-backup","last_synced_at":"2025-08-07T18:45:06.225Z","repository":{"id":243063850,"uuid":"811389124","full_name":"AaronMk44/ci4-db-backup","owner":"AaronMk44","description":"Ci4 Database Backup is a PHP library designed to facilitate database backups for applications built with CodeIgniter 4 and other PHP Frameworks. It's able to operate in native PHP project too. This library provides an easy way to create SQL dumps of your MySQL databases.","archived":false,"fork":false,"pushed_at":"2024-06-13T12:47:16.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T22:11:40.221Z","etag":null,"topics":["codeigniter","mysql-database","php-framework","php-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AaronMk44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-06T13:58:22.000Z","updated_at":"2024-06-13T12:46:09.000Z","dependencies_parsed_at":"2024-06-06T14:40:24.476Z","dependency_job_id":"f792c13f-e757-4c6b-bbbd-9732c82c23ec","html_url":"https://github.com/AaronMk44/ci4-db-backup","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"d00b7871591b78b999bf51790ceb7b9a130d1bc9"},"previous_names":["aaronmk44/ci4-db-backup"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronMk44%2Fci4-db-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronMk44%2Fci4-db-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronMk44%2Fci4-db-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaronMk44%2Fci4-db-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AaronMk44","download_url":"https://codeload.github.com/AaronMk44/ci4-db-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238386083,"owners_count":19463292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeigniter","mysql-database","php-framework","php-library"],"created_at":"2024-09-24T13:46:29.675Z","updated_at":"2025-02-11T23:32:20.276Z","avatar_url":"https://github.com/AaronMk44.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ci4 Database Backup\n\n![Packagist Version](https://img.shields.io/packagist/v/aaronmk44/ci4-db-backup)\n![Packagist License](https://img.shields.io/packagist/l/aaronmk44/ci4-db-backup)\n\n## Overview\n\nCi4 Database Backup is a PHP library designed to facilitate database backups for applications built with CodeIgniter 4 and other PHP Frameworks. It's able to operate in native PHP project too. This library provides an easy way to create SQL dumps of your MySQL databases.\n\n## Features\n\n- Simple and easy to use\n- Generates SQL dumps of your database\n- Supports CodeIgniter 4\n\n## Installation\n\nYou can install this library via Composer. Run the following command:\n\n```sh\ncomposer require aaronmk44/ci4-db-backup\n```\n\n## Usage\n\nHere is an example of how to use the `Ci4 Database Backup` library:\n\n### Basic Usage\n\n1. **Include Autoload File**: Ensure you include the Composer autoload file in your script.\n\n2. **Create a Backup Script**:\n\n```php\n\u003c?php\n\nrequire './vendor/autoload.php'; // Autoload classes\n\nuse Ci4DbBackup\\Ci4DbBackup;\n\n(new Ci4DbBackup([\n  'host' =\u003e 'localhost',\n  'username' =\u003e 'root',\n  'password' =\u003e ''\n]))-\u003ebackup('test_db', 'path/to/backups');\n```\n\nIn this example:\n- The `Ci4DbBackup` class is instantiated with database connection details (host, username, and password).\n- The `backup` method is called with the database name (`test_db`) and the path where the backup file should be saved.\n\n### Advanced Usage\n\nFor more advanced usage and options, refer to the documentation.\n\n## Methods\n\n### `__construct`\n\nInitializes the `Ci4DbBackup` class with database connection details.\n\n```php\npublic function __construct(array $dbConfig)\n```\n\n- **$dbConfig**: An associative array with the following keys:\n  - `host`: Database host (e.g., `localhost`)\n  - `username`: Database username\n  - `password`: Database password\n\n### `backup`\n\nCreates a backup of the specified database.\n\n```php\npublic function backup(string $database, string $backupPath)\n```\n\n- **$database**: The name of the database to back up\n- **$backupPath**: The path where the backup file will be saved\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your improvements.\n\n## Author\n\n- **Aaron Mkandawire** - [AaronMk44](https://github.com/AaronMk44)\n\n## Acknowledgements\n\nhttps://dev.to/joemoses33/create-a-composer-package-how-to-29kn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronmk44%2Fci4-db-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronmk44%2Fci4-db-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronmk44%2Fci4-db-backup/lists"}