for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Laravoole\Workerman;
class Worker extends \Workerman\Worker
{
public static function runAll()
self::checkSapiEnv();
self::init();
self::parseCommand();
self::daemonize();
self::initWorkers();
self::installSignal();
self::saveMasterPid();
self::forkWorkers();
// @codeCoverageIgnoreStart
self::resetStd();
self::monitorWorkers();
// @codeCoverageIgnoreEnd
} // @codeCoverageIgnore
protected static function parseCommand()
global $argv;
global
Instead of relying on global state, we recommend one of these alternatives:
function myFunction($a, $b) { // Do something }
class MyClass { private $a; private $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function myFunction() { // Do something } }
$argv = [
__FILE__,
'start',
];
parent::parseCommand();
}
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state