protected function execute(InputInterface $input, OutputInterface $output) { $this->downloadConfiguration(); $library = new GLibc(); try { $this->download()->extract(); $library->setEnv($this->env)->setProjectDir($this->baseDir)->initialize()->boot($input, $output); $configure = $this->projectDir . '/' . $library->configure(); $this->projectDir = dirname($this->projectDir) . '/glibc-build'; $this->fs->mkdir($this->projectDir); $this->output->write(' Building : '); $process = new Process($configure, $this->projectDir, $this->env->toArray()); $process->setTimeout(0); $process->run(); if ($process->isSuccessful()) { $process->setCommandLine('make -j4 && make -j4 install'); $process->run(); } if ($process->isSuccessful()) { $message = '<info>✔</info>'; } else { $message = '<error>✕</error>'; } $this->output->writeln($message); } catch (\Exception $e) { $this->cleanUp(); throw $e; } $this->createConfiguration(); $this->output->writeln(sprintf(" <info>%s</info> Droidphp Installer <info>successfully configured</info> Now you can:\n" . " * Run :\n" . " 1. Execute the <comment>%s build:components</comment> command.\n" . " To Build the project\n\n", defined('PHP_WINDOWS_VERSION_BUILD') ? 'OK' : '✔', basename($_SERVER['PHP_SELF']))); }
private function optimizeBinaries() { $this->output->write(" Preparing to Optimize...\n"); $binaries = [$this->baseDir . '/rootfs/php/bin/php-cgi', $this->baseDir . '/rootfs/msmtp/bin/msmtp', $this->baseDir . '/rootfs/lighttpd/sbin/lighttpd', $this->baseDir . '/rootfs/nginx/sbin/nginx']; foreach ($binaries as $bin) { $this->output->write(sprintf(' Optimizing %s : ', basename($bin))); $command = $this->env->get('TOOLCHAIN') . '-strip ' . $bin; $process = new Process($command, null, $this->env->toArray()); $process->setTimeout(0); $process->run(); echo $process->getErrorOutput(); $this->showResponse($process->isSuccessful()); } $this->output->write("\n"); }