add some delete examples
This commit is contained in:
27
src/delete_labels.php
Executable file
27
src/delete_labels.php
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/php
|
||||
<?php
|
||||
/****************************************************
|
||||
* This will loop through a list of label names
|
||||
* If the label exists on the repo, delete the label
|
||||
****************************************************/
|
||||
|
||||
// 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
|
||||
$names=[
|
||||
'janurary','feburary','march','april','may','june','july','august','september','october','november','december',
|
||||
'monday','tuesday','wednesday','thursday','friday','saturday','sunday',
|
||||
'daily','weekly','fortnightly','monthly','yearly'
|
||||
];
|
||||
|
||||
//loop through the names
|
||||
foreach($names as $name){
|
||||
//see if label exists?
|
||||
$label=$repo->getLabelByName($name);
|
||||
if($label){ //it exists
|
||||
//delete it
|
||||
$repo->deleteLabel($label);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user