src/Initially/Rpc/Core/Engine/ComposerScriptHandler.php
public static function rebuildClientServiceProxy(Event $event)
    {
        $io = $event->getIO();
        $extra = $event->getComposer()->getPackage()->getExtra();
        if (isset($extra["initially-rpc-config-file"])) {
            $rootDir = getcwd();
            $configFile = $rootDir . "/" . $extra["initially-rpc-config-file"];
            if (is_file($configFile)) {
                $client = new Client($configFile);
                $builder = $client->getBuilder();
                $config = $client->getConfig();
                $services = $config->getServices();
                $io->write("Initially Rpc: build proxy start");
                foreach ($services as $service) {
                    $io->write("Initially Rpc: build {$service->getInterface()}");
                    $builder->create($service->getInterface());
                }
                $io->write("Initially Rpc: build proxy end");
            } else {
                $io->write("Initially Rpc: client config file error [\"{$configFile}\"]");
            }
        } else {
            $io->write("Initially Rpc: not configured composer extra [\"initially-rpc-config-file\"]");
        }
    }
public static function rebuildClientServiceProxy(Event $event)
    {
        $io = $event->getIO();
        $extra = $event->getComposer()->getPackage()->getExtra();
        if (isset($extra["initially-rpc-config-file"])) {
            $rootDir = getcwd();
            $configFile = $rootDir . "/" . $extra["initially-rpc-config-file"];
            if (is_file($configFile)) {
                $client = new Client($configFile);
                $builder = $client->getBuilder();
                $config = $client->getConfig();
                $services = $config->getServices();
                $io->write("Initially Rpc: build proxy start");
                foreach ($services as $service) {
                    $io->write("Initially Rpc: build {$service->getInterface()}");
                    $builder->create($service->getInterface());
                }
                $io->write("Initially Rpc: build proxy end");
            } else {
                $io->write("Initially Rpc: client config file error [\"{$configFile}\"]");
            }
        } else {
            $io->write("Initially Rpc: not configured composer extra [\"initially-rpc-config-file\"]");
        }
    }
public static function rebuildClientServiceProxy ( Event $ event ) { $ io = $ event -> getIO ( ) ; $ extra = $ event -> getComposer ( ) -> getPackage ( ) -> getExtra ( ) ; if ( isset ( $ extra [ "initially-rpc-config-file" ] ) ) { $ rootDir = getcwd ( ) ; $ configFile = $ rootDir . "/" . $ extra [ "initially-rpc-config-file" ] ; if ( is_file ( $ configFile ) ) { $ client = new Client ( $ configFile ) ; $ builder = $ client -> getBuilder ( ) ; $ config = $ client -> getConfig ( ) ; $ services = $ config -> getServices ( ) ; $ io -> write ( "Initially Rpc: build proxy start" ) ; foreach ( $ services as $ service ) { $ io -> write ( "Initially Rpc: build {$service->getInterface()}" ) ; $ builder -> create ( $ service -> getInterface ( ) ) ; } $ io -> write ( "Initially Rpc: build proxy end" ) ; } else { $ io -> write ( "Initially Rpc: client config file error [\"{$configFile}\"]" ) ; } } else { $ io -> write ( "Initially Rpc: not configured composer extra [\"initially-rpc-config-file\"]" ) ; } }
Rebuild client service proxy
Rebuild client service proxy