Page MenuHomePhorge

Command-Line Input

Authored By
avivey
Nov 24 2023, 17:09
Size
608 B
Referenced Files
None
Subscribers
None

Command-Line Input

#!/usr/bin/env php
<?php
require_once 'scripts/__init_script__.php';
function handler1($event, $value, array $metadata) {
echo pht('Handler 1 - event is `%s`'."\n", $event);
}
function handler2($event, $value, array $metadata) {
echo pht('Handler 2 - event is `%s`'."\n", $event);
}
echo "First error - no handler registered:\n";
strlen(null);
echo "\n";
PhutilErrorHandler::setErrorListener("handler1");
echo "Registered one handler, error again:\n";
strlen(null);
echo "\n";
PhutilErrorHandler::setErrorListener("handler2");
echo "Registered 2 handlers, error again:\n";
strlen(null);
echo "\n";

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
284550
Default Alt Text
Command-Line Input (608 B)

Event Timeline