#!/usr/bin/env php . */ if (!isset($argv[3])) { echo 'Usage: '.$argv[0].' inputDir output.phar ref'.PHP_EOL; die(1); } @unlink($argv[2]); $p = new Phar(__DIR__.'/../'.$argv[2], 0, $argv[2]); $p->buildFromDirectory(realpath($argv[1]), '/^((?!tests).)*(\.php|\.py|\.exe|\.tl|\.json|\.dat|\.h|\.wav)$/i'); $p->setStub('= 2) { \define(\MADELINE_WORKER_TYPE::class, \array_shift($arguments)); \define(\MADELINE_WORKER_ARGS::class, $arguments); } else { die("MadelineProto loader: you must include this file in another PHP script, see https://docs.madelineproto.xyz for more info.".PHP_EOL); } \define("MADELINE_REAL_ROOT", __DIR__); @chdir(\MADELINE_REAL_ROOT); } } Phar::interceptFileFuncs(); Phar::mapPhar("'.$argv[2].'"); $result = require_once "phar://'.$argv[2].'/vendor/autoload.php"; if (\defined("MADELINE_WORKER_TYPE") && \constant("MADELINE_WORKER_TYPE") === "madeline-ipc") { require_once "phar://'.$argv[2].'/vendor/danog/madelineproto/src/Ipc/Runner/entry.php"; } return $result; __HALT_COMPILER(); ?>');