21 lines
820 B
PHP
21 lines
820 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
$source = file_get_contents(__DIR__ . '/../app/service/SwooleService.php');
|
|
if (!is_string($source)) {
|
|
throw new RuntimeException('Unable to read upload transport');
|
|
}
|
|
if (!str_contains($source, "private string \$host = 'ossup.jzvisa.cn';")) {
|
|
throw new RuntimeException('Upload transport must use ossup.jzvisa.cn');
|
|
}
|
|
if (!str_contains($source, 'private int $port = 19501;')) {
|
|
throw new RuntimeException('Upload transport must keep port 19501');
|
|
}
|
|
|
|
$controller = file_get_contents(__DIR__ . '/../app/miniapi/controller/Upload.php');
|
|
if (!is_string($controller) || !str_contains($controller, "'json_encode_param' => 0")) {
|
|
throw new RuntimeException('Upload responses must escape Unicode for wx.uploadFile compatibility');
|
|
}
|
|
|
|
echo "Upload transport self-check passed\n";
|