Copy file attachment edges to new storage
[phabricator.git] / scripts / util / emit_test_event.php
blobc8502d0fe6955ec603c39f02a83202207ff29040
1 #!/usr/bin/env php
2 <?php
4 $root = dirname(dirname(dirname(__FILE__)));
5 require_once $root.'/scripts/__init_script__.php';
7 $args = new PhutilArgumentParser($argv);
8 $args->setTagline(pht('emit a test event'));
9 $args->setSynopsis(<<<EOHELP
10 **emit_test_event.php** [--listen listener] ...
11 Emit a test event after installing any specified __listener__s.
12 EOHELP
14 $args->parseStandardArguments();
15 $args->parse(
16 array(
17 array(
18 'name' => 'listen',
19 'param' => 'listener',
20 'repeat' => true,
22 ));
24 $console = PhutilConsole::getConsole();
25 foreach ($args->getArg('listen') as $listener) {
26 $console->writeOut("%s\n", pht("Installing '%s'...", $listener));
27 newv($listener, array())->register();
31 $console->writeOut("%s\n", pht('Emitting event...'));
33 PhutilEventEngine::dispatchEvent(
34 new PhabricatorEvent(
35 PhabricatorEventType::TYPE_TEST_DIDRUNTEST,
36 array(
37 'time' => time(),
38 )));
40 $console->writeOut("%s\n", pht('Done.'));
41 exit(0);