@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3function init_phabricator_script(array $options) {
4 error_reporting(E_ALL);
5 ini_set('display_errors', 1);
6
7 $root = null;
8 if (!empty($_SERVER['PHUTIL_LIBRARY_ROOT'])) {
9 $root = $_SERVER['PHUTIL_LIBRARY_ROOT'];
10 }
11
12 $include_path = ini_get('include_path');
13 ini_set(
14 'include_path',
15 $include_path.PATH_SEPARATOR.dirname(__FILE__).'/../../../');
16
17 $ok = @include_once $root.'arcanist/support/init/init-script.php';
18 if (!$ok) {
19 echo
20 'FATAL ERROR: Unable to load the "Arcanist" library. '.
21 'Put "arcanist/" next to "phorge/" on disk.';
22 echo "\n";
23
24 exit(1);
25 }
26
27 phutil_load_library('arcanist/src');
28 phutil_load_library(dirname(__FILE__).'/../../src/');
29
30 $config_optional = $options['config.optional'];
31 $no_extensions = $options['no-extensions'] ?? false;
32 PhabricatorEnv::initializeScriptEnvironment(
33 $config_optional,
34 $no_extensions);
35}