refactor for the new lib structure
This commit is contained in:
@@ -1,17 +1,7 @@
|
||||
<?php
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$config=require(__DIR__.'/config.php');
|
||||
|
||||
//pass cmd line args
|
||||
if($argc<3){
|
||||
die(basename(__FILE__)." <USER> <REPO> [debug]\n");
|
||||
}
|
||||
$debug = ($argc==4 && $argv[3]=='debug');
|
||||
|
||||
//open connection and repo
|
||||
$client=new Client($config['url'],$config['user'],$config['pass'],$debug);
|
||||
$repo=$client->getRepo($argv[1],$argv[2]);
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
|
||||
//close all issues
|
||||
$repo->forIssues(function($issue){
|
||||
|
@@ -1,22 +1,14 @@
|
||||
<?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)
|
||||
/*****
|
||||
** 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(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$config=require(__DIR__.'/config.php');
|
||||
|
||||
//pass cmd line args
|
||||
if($argc<3){
|
||||
die(basename(__FILE__)." <USER> <REPO> [debug]\n");
|
||||
}
|
||||
$debug = ($argc==4 && $argv[3]=='debug');
|
||||
|
||||
//open connection and repo
|
||||
$client=new Client($config['url'],$config['user'],$config['pass'],$debug);
|
||||
$repo=$client->getRepo($argv[1],$argv[2]);
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
|
||||
//get the labels of interest
|
||||
$nolabelLabel=$repo->getLabelByName('no-label');
|
||||
|
@@ -1,18 +1,9 @@
|
||||
<?php
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$config=require(__DIR__.'/config.php');
|
||||
|
||||
//pass cmd line args
|
||||
if($argc<3){
|
||||
die(basename(__FILE__)." <USER> <REPO> [debug]\n");
|
||||
}
|
||||
$debug = ($argc==4 && $argv[3]=='debug');
|
||||
|
||||
//open connection and repo
|
||||
$client=new Client($config['url'],$config['user'],$config['pass'],$debug);
|
||||
$repo=$client->getRepo($argv[1],$argv[2]);
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
|
||||
//define the repeat terms
|
||||
$terms=[
|
||||
'months'=>['janurary','feburary','march','april','may','june','july','august','september','october','november','december'],
|
||||
'days'=>['monday','tuesday','wednesday','thursday','friday','saturday','sunday'],
|
||||
|
17
src/setup.php
Normal file
17
src/setup.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
use JHodges\GiteaBot\Client;
|
||||
|
||||
$config=require(__DIR__.'/config.php');
|
||||
|
||||
//pass cmd line args
|
||||
if($argc<3){
|
||||
die(basename(__FILE__)." <USER> <REPO> [debug]\n");
|
||||
}
|
||||
$debug = ($argc==4 && $argv[3]=='debug');
|
||||
|
||||
//open connection and repo
|
||||
$client=new Client($config['url'],$config['user'],$config['pass'],$debug);
|
||||
$repo=$client->getRepo($argv[1],$argv[2]);
|
||||
|
@@ -1 +0,0 @@
|
||||
"example title","example body","test"
|
|
16
src/test.php
16
src/test.php
@@ -1,17 +1,7 @@
|
||||
<?php
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$config=require(__DIR__.'/config.php');
|
||||
|
||||
//pass cmd line args
|
||||
if($argc<3){
|
||||
die(basename(__FILE__)." <USER> <REPO> [debug]\n");
|
||||
}
|
||||
$debug = ($argc==4 && $argv[3]=='debug');
|
||||
|
||||
//open connection and repo
|
||||
$client=new Client($config['url'],$config['user'],$config['pass'],$debug);
|
||||
$repo=$client->getRepo($argv[1],$argv[2]);
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
|
||||
//get the test label or create if not exist
|
||||
if(!$label=$repo->getLabelByName('Test')){
|
||||
|
Reference in New Issue
Block a user