Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.05 KB

File metadata and controls

46 lines (34 loc) · 1.05 KB

PHPSourceControl

Simple PHP tool for automatic deployment from GitHub. No SSH, no Git commands, just pure PHP.

Installation

  1. Upload PHPSourceControl.php and index.php to your server
  2. Get a GitHub Personal Access Token (with repo scope)
  3. Configure settings in index.php
  4. Access the dashboard

Configuration

$config = [
    'github_token' => 'ghp_your_token_here',
    'github_owner' => 'your_username',
    'github_repo' => 'your_repo',
    'github_branch' => 'main',
    'project_path' => __DIR__,
    'excluded_files' => ['.git', '.env', 'vendor', 'node_modules', 'storage'],
    'auto_backup' => true
];

How It Works

  1. Push code to GitHub
  2. Click "Update Now" on dashboard
  3. System creates backup
  4. Fetches latest commit
  5. Updates changed files
  6. Done

Note: You can do this in cron

Troubleshooting

"GitHub API error: HTTP 401" Token is invalid, generate a new one.

"Cannot create backup file" Check if storage/backups folder is writable.

"Failed to load status" Check your token and repo settings.