@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert more scripts to use `PhutilConsoleTable`.

Summary: Convert `./bin/mail` and a`./bin/sms` to use `PhutilConsoleTable` for formatting output.

Test Plan: I don't actually have mail and SMS setup on my dev box, but this is a pretty straightforward change.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9621

+46 -28
+20 -14
src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
··· 41 41 ->withPHIDs($phids) 42 42 ->execute(); 43 43 44 + $table = id(new PhutilConsoleTable()) 45 + ->setShowHeader(false) 46 + ->addColumn('id', array('title' => 'ID')) 47 + ->addColumn('author', array('title' => 'Author')) 48 + ->addColumn('phid', array('title' => 'Related PHID')) 49 + ->addColumn('subject', array('title' => 'Subject')); 50 + 44 51 foreach (array_reverse($mails) as $mail) { 45 - $console->writeOut( 46 - "%s\n", 47 - sprintf( 48 - '% 8d %-16s %-20s %s', 49 - $mail->getID(), 50 - $mail->getAuthorPHID() 51 - ? $handles[$mail->getAuthorPHID()]->getName() 52 - : '-', 53 - $mail->getRelatedPHID() 54 - ? $handles[$mail->getRelatedPHID()]->getName() 55 - : '-', 56 - $mail->getSubject() 57 - ? $mail->getSubject() 58 - : pht('(No subject.)'))); 52 + $table->addRow(array( 53 + 'id' => $mail->getID(), 54 + 'author' => $mail->getAuthorPHID() 55 + ? $handles[$mail->getAuthorPHID()]->getName() 56 + : '-', 57 + 'phid' => $mail->getRelatedPHID() 58 + ? $handles[$mail->getRelatedPHID()]->getName() 59 + : '-', 60 + 'subject' => $mail->getSubject() 61 + ? $mail->getSubject() 62 + : pht('(No subject.)'), 63 + )); 59 64 } 60 65 66 + $table->draw(); 61 67 return 0; 62 68 } 63 69
+14 -7
src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
··· 33 33 return 0; 34 34 } 35 35 36 + $table = id(new PhutilConsoleTable()) 37 + ->setShowHeader(false) 38 + ->addColumn('id', array('title' => 'ID')) 39 + ->addColumn('status', array('title' => 'Status')) 40 + ->addColumn('subject', array('title' => 'Subject')); 41 + 36 42 foreach (array_reverse($mails) as $mail) { 37 - $console->writeOut( 38 - "%s\n", 39 - sprintf( 40 - '% 8d %-8s %s', 41 - $mail->getID(), 42 - PhabricatorMetaMTAMail::getReadableStatus($mail->getStatus()), 43 - $mail->getSubject())); 43 + $status = $mail->getStatus(); 44 + 45 + $table->addRow(array( 46 + 'id' => $mail->getID(), 47 + 'status' => PhabricatorMetaMTAMail::getReadableStatus($status), 48 + 'subject' => $mail->getSubject(), 49 + )); 44 50 } 45 51 52 + $table->draw(); 46 53 return 0; 47 54 } 48 55
+12 -7
src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
··· 34 34 return 0; 35 35 } 36 36 37 + $table = id(new PhutilConsoleTable()) 38 + ->setShowHeader(false) 39 + ->addColumn('id', array('title' => 'ID')) 40 + ->addColumn('status', array('title' => 'Status')) 41 + ->addColumn('recv', array('title' => 'Recipient')); 42 + 37 43 foreach (array_reverse($sms_messages) as $sms) { 38 - $console->writeOut( 39 - "%s\n", 40 - sprintf( 41 - '% 8d %-8s To: %s', 42 - $sms->getID(), 43 - $sms->getSendStatus(), 44 - $sms->getToNumber())); 44 + $table->addRow(array( 45 + 'id' => $sms->getID(), 46 + 'status' => $sms->getSendStatus(), 47 + 'recv' => $sms->getToNumber(), 48 + )); 45 49 } 46 50 51 + $table->draw(); 47 52 return 0; 48 53 } 49 54