add bootstrap / autoloader

This commit is contained in:
James 2019-07-06 16:25:47 +01:00
parent 647feac50a
commit c4f527a31e
3 changed files with 8 additions and 17 deletions

4
bootstrap.php Normal file
View File

@ -0,0 +1,4 @@
<?php
spl_autoload_register(function ($class_name) {
include 'src/'.$class_name . '.php';
});

View File

@ -4,13 +4,9 @@
//2a. Adds a no-label label to any issues with no labels (excluding the no-label and no-milestone)
//2b. Also removes the label if present on an issue with a label (excluding the no-label and no-milestone)
require("src/Client.php");
require("src/GiteaData.php");
require("src/GiteaRepoData.php");
require("src/Issue.php");
require("src/Label.php");
require("src/Repo.php");
$config=require("config.php");
require('bootstrap.php');
$config=require('config.php');
//pass cmd line args
if($argc<3){

View File

@ -1,15 +1,6 @@
<?php
//1a. Adds a no-milestone label to any issues with no milestone
//1b. Also removes the label if present on an issue with a milestone
//2a. Adds a no-label label to any issues with no labels (excluding the no-label and no-milestone)
//2b. Also removes the label if present on an issue with a label (excluding the no-label and no-milestone)
require('bootstrap.php');
require("src/Client.php");
require("src/GiteaData.php");
require("src/GiteaRepoData.php");
require("src/Issue.php");
require("src/Label.php");
require("src/Repo.php");
$config=require("config.php");
//pass cmd line args