1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-02 12:37:47 +01:00

Separately require entry module

This commit is contained in:
Daniil Gentili 2021-09-06 16:22:07 +02:00
parent 5d9009dc27
commit 657e974264
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
6 changed files with 20 additions and 6 deletions

5
.gitignore vendored
View File

@ -124,3 +124,8 @@ extracted.json
ponyScripts ponyScripts
*.madeline.* *.madeline.*
uwu
madeline*phar
madeline*phar.version
e.php

View File

@ -89,7 +89,6 @@
"files": [ "files": [
"src/BigIntegor.php", "src/BigIntegor.php",
"src/YieldReturnValue.php", "src/YieldReturnValue.php",
"src/danog/MadelineProto/Ipc/Runner/entry.php",
"src/polyfill.php" "src/polyfill.php"
] ]
}, },

View File

@ -306,7 +306,7 @@ class API extends InternalDoc
if ($unserialized === 0) { if ($unserialized === 0) {
// Timeout // Timeout
Logger::log("!!! Could not connect to MadelineProto, please check and report the logs for more details. !!!", Logger::FATAL_ERROR); Logger::log("!!! Could not connect to MadelineProto, please check and report the logs for more details. !!!", Logger::FATAL_ERROR);
if (!$tryReconnect) { if (!$tryReconnect || (\defined('MADELINEPROTO_TEST') && \constant("MADELINEPROTO_TEST") === 'pony')) {
throw new Exception('Could not connect to MadelineProto, please check the MadelineProto.log file to debug!'); throw new Exception('Could not connect to MadelineProto, please check the MadelineProto.log file to debug!');
} }
Logger::log("!!! Reconnecting using slower method. !!!", Logger::FATAL_ERROR); Logger::log("!!! Reconnecting using slower method. !!!", Logger::FATAL_ERROR);

View File

@ -28,6 +28,7 @@ if ($phar = \getenv('ACTIONS_PHAR')) {
} else { } else {
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
} }
define('MADELINEPROTO_TEST', 'pony');
if ($loader) { if ($loader) {
foreach ($loader->getClassMap() as $class => $file) { foreach ($loader->getClassMap() as $class => $file) {
if (\in_array($class, [ if (\in_array($class, [

View File

@ -109,7 +109,11 @@ function ___install_madeline()
} }
$packages = []; $packages = [];
foreach ($composer['packages'] as $dep) { foreach ($composer['packages'] as $dep) {
$packages[$dep['name']] = $dep['version_normalized']; $name = $dep['name'];
if (strpos($name, 'phabel/transpiler') === 0) {
$name = explode('/', $name, 3)[2];
}
$packages[$name] = $dep['version_normalized'];
} }
return $packages; return $packages;
}; };
@ -123,6 +127,7 @@ function ___install_madeline()
\file_put_contents($madeline_phar, $phar, LOCK_EX); \file_put_contents($madeline_phar, $phar, LOCK_EX);
\file_put_contents("$madeline_phar.version", $release, LOCK_EX); \file_put_contents("$madeline_phar.version", $release, LOCK_EX);
unset($phar);
$current = $extractVersions(); $current = $extractVersions();
$postData = ['downloads' => []]; $postData = ['downloads' => []];
@ -164,7 +169,11 @@ function ___install_madeline()
} }
} }
return $madeline_phar; $result = require_once $madeline_phar;
if (defined('MADELINE_WORKER_TYPE') && constant('MADELINE_WORKER_TYPE') === 'madeline-ipc') {
require_once "phar://$madeline_phar/vendor/danog/madelineproto/src/danog/MadelineProto/Ipc/Runner/entry.php";
}
return $result;
} }
return require_once ___install_madeline(); return ___install_madeline();