From 5002e79e290a66fa59fea34d67303a86b986f76a Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 6 Sep 2019 10:57:30 +0100 Subject: [PATCH] add edit example --- src/edit.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 src/edit.php diff --git a/src/edit.php b/src/edit.php new file mode 100755 index 0000000..67b802c --- /dev/null +++ b/src/edit.php @@ -0,0 +1,31 @@ +#!/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.='
'; + } + //replace the tag contents with the result from our $text function + $issue->body=preg_replace("#.*?#s",''.$text($issue).'',$issue->body); + $issue->save(); +}; + +//process ALL issues +$repo->forIssues($tmp);