diff --git a/phab-comment.php b/phab-comment.php index bf0075e..02f55cc 100755 --- a/phab-comment.php +++ b/phab-comment.php @@ -1,56 +1,57 @@ #!/usr/bin/php <?php /** * Script that publish a comment with a builded resource. */ require 'config.php'; // document ID provided as first argument $phid = $argv[1]; // URL provided as second argument $url = $argv[2]; // sha256 provided $sha256 = $argv[3]; // filename extracted from URL $filename = basename( $url ); // load Phabricator's framework -require_once '/home/www-data/gitpull.it/libphutil/src/__phutil_library_init__.php'; +//require_once '/home/www-data/gitpull.it/libphutil/src/__phutil_library_init__.php'; +require_once '/home/www-data/gitpull.it/arcanist/src/__phutil_library_init__.php'; $message = sprintf( "{icon cog spin} Be bop be bop. I'm a bot. Builded:". "\n\n". "→ [[%1\$s|%2\$s]]". "\n\n". " sha256 %3\$s\n", $argv[2], $filename, $sha256 ); // create API request $api_parameters = [ 'objectIdentifier' => $argv[1], 'transactions' => [ [ 'type' => 'comment', 'value' => $message, ] ], ]; $client = new ConduitClient('https://gitpull.it/'); $client->setConduitToken(PHABRICATOR_API_TOKEN); try { $result = $client->callMethodSynchronous('differential.revision.edit', $api_parameters); //print_r($result); } catch( Exception $e ) { print_r( $api_parameters ); echo "ERROR COMMENTING: " . $e->getMessage() . "\n"; }