Skip to content

ICWR-TEAM/Githubcrud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub CRUD Library

A simple PHP library for managing GitHub repository files using the GitHub API.

Installation

Install the library using Composer:

composer require icwr-team/githubcrud

Usage

Here's an example of how to use the library:

require 'vendor/autoload.php';

$config = [
    'token' => 'YOUR_GITHUB_TOKEN',
    'username' => 'YOUR_GITHUB_USERNAME',
    'repository' => 'YOUR_REPOSITORY_NAME',
    'branch' => 'main' // or any branch name
];

$github = new IcwrTeam\Githubcrud\Githubcrud($config);

// Create a file
$github->createFile('example.txt', 'Hello, World!');

// Edit a file
$github->editFile('example.txt', 'Updated content');

// Read a file
$content = $github->readFile('example.txt');

echo $content;

// Delete a file
$github->deleteFile('example.txt');

Requirements

  • PHP 7.4 or higher
  • Composer

License

This library is open-sourced software licensed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages