diff --git a/composer.json b/composer.json index 45f15a6..7cc7132 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "jhodges/giteabot-examples", - "description": "Some examples for the giteabot php api", + "name": "jhodges/giteabot-repeat", + "description": "Support recurring issue on Gitea", "authors": [ { "name": "James", @@ -9,7 +9,7 @@ ], "require": { "jhodges/giteabot": "~1.2.0", - "tplaner/when": "^2.1" + "rlanvin/php-rrule": "^2.1" }, "repositories": { "repo-name": { diff --git a/composer.lock b/composer.lock index 3482e29..e5903f2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,15 +4,16 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f61690b1844d67af5e8aa461d9936b6", - "packages": [ + "content-hash": "4c8a75e0d85a808b7861f77a853742b9", + "packages": [], + "packages-dev": [ { "name": "jhodges/giteabot", - "version": "v1.2.1", + "version": "v1.2.2", "source": { "type": "git", "url": "https://git.jhodges.co.uk/jhodges/GiteaBot", - "reference": "a2c44392b2b4eede6be4b132e55e3479232fda93" + "reference": "aef0c2166ee9c3ac4f82c7c433b296f21d9865c7" }, "type": "library", "autoload": { @@ -30,56 +31,53 @@ } ], "description": "Simple PHP library to interface with Gitea API", - "time": "2019-09-07T08:43:48+00:00" + "time": "2019-09-23T11:14:59+00:00" }, { - "name": "tplaner/when", - "version": "2.1.0", + "name": "rlanvin/php-rrule", + "version": "v2.1.0", "source": { "type": "git", - "url": "https://github.com/tplaner/When.git", - "reference": "91643472f8c8f23cab23bd38c1f43620475b01a0" + "url": "https://github.com/rlanvin/php-rrule.git", + "reference": "c71d0f9251ba967b211ddab820c7012df6962b19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tplaner/When/zipball/91643472f8c8f23cab23bd38c1f43620475b01a0", - "reference": "91643472f8c8f23cab23bd38c1f43620475b01a0", + "url": "https://api.github.com/repos/rlanvin/php-rrule/zipball/c71d0f9251ba967b211ddab820c7012df6962b19", + "reference": "c71d0f9251ba967b211ddab820c7012df6962b19", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.8|^5.5|^6.5" + }, + "suggest": { + "ext-intl": "Intl extension is needed for humanReadable()" }, "type": "library", "autoload": { "psr-4": { - "When\\": "src/" + "RRule\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Tom Planer", - "email": "tplaner@gmail.com" - } - ], - "description": "Date/Calendar recursion library.", - "homepage": "https://github.com/tplaner/When", + "description": "Lightweight and fast recurrence rules for PHP (RFC 5545)", + "homepage": "https://github.com/rlanvin/php-rrule", "keywords": [ "date", - "datetime", + "ical", "recurrence", - "time" + "recurring", + "rrule" ], - "time": "2017-06-02T00:08:33+00:00" + "time": "2019-01-15T05:31:37+00:00" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/src/close_all.php b/src/close_all.php deleted file mode 100755 index 9f22e76..0000000 --- a/src/close_all.php +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/php -getIssues() as $issue){ - $issue->state='closed'; - $issue->save(); -} diff --git a/src/delete_labels.php b/src/delete_labels.php deleted file mode 100755 index 3939b7e..0000000 --- a/src/delete_labels.php +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/php -getLabelByName($name); - if($label){ //it exists - //delete it - $repo->deleteLabel($label); - } -} diff --git a/src/delete_me.php b/src/delete_me.php deleted file mode 100755 index 38d6495..0000000 --- a/src/delete_me.php +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/php -getIssues(['q'=>'delete me']) as $issue){ - // check for exact match - if($issue->title=='delete me'){ - // remove all labels - foreach($issue->labels as $label){ - $issue->removeLabel($label); - } - //change status and title. - $issue->state='closed'; - $issue->title='deleted'; - $issue->save(); - } -}; diff --git a/src/delete_nags.php b/src/delete_nags.php deleted file mode 100755 index 0f15da6..0000000 --- a/src/delete_nags.php +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/php -getIssues(['q'=>'NAG!']) as $issue){ - // loop through the current issues comments - foreach($issue->getComments() as $comment){ - // if the comment body matches - if($comment->body=='NAG!'){ - // delete the commend - $repo->deleteComment($comment); - } - } -} diff --git a/src/edit.php b/src/edit.php deleted file mode 100755 index 67b802c..0000000 --- a/src/edit.php +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/php -number."\n".$issue->title."\ntexting\n".time()."\n```\n"; -}; - -//callback function to add/replace the tag with our text -$tmp=function($issue) use ($text){ - // add a tag to the body if to doesn't exist - if( strpos($issue->body,'')===false ){ - $issue->body.='