add new close all example
This commit is contained in:
parent
a6bb48ef96
commit
9be8133616
20
example/close_all.php
Normal file
20
example/close_all.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
require(__DIR__.'/../bootstrap.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]);
|
||||||
|
|
||||||
|
//close all issues
|
||||||
|
$repo->forIssues(function($issue){
|
||||||
|
$issue->state='closed';
|
||||||
|
$issue->save();
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user