18 files changed +35
-20
lines changed Original file line number Diff line number Diff line change 33
33
// NOTE: This is dangerous in general, but we know we're in a script context and
34
34
// are not vulnerable to CSRF.
35
35
AphrontWriteGuard::allowDangerousUnguardedWrites (true );
36
+
37
+ $ include_path = ini_get ('include_path ' );
38
+ ini_set ('include_path ' , $ include_path .': ' .dirname (__FILE__ ).'/../../ ' );
39
+
40
+ require_once dirname (dirname (__FILE__ )).'/conf/__init_conf__.php ' ;
41
+
42
+ $ env = isset ($ _SERVER ['PHABRICATOR_ENV ' ])
43
+ ? $ _SERVER ['PHABRICATOR_ENV ' ]
44
+ : getenv ('PHABRICATOR_ENV ' );
45
+ if (!$ env ) {
46
+ echo "Define PHABRICATOR_ENV before running this script. \n" ;
47
+ exit (1 );
48
+ }
49
+
50
+ $ conf = phabricator_read_config_file ($ env );
51
+ $ conf ['phabricator.env ' ] = $ env ;
52
+
53
+ phutil_require_module ('phabricator ' , 'infrastructure/env ' );
54
+ PhabricatorEnv::setEnvConfig ($ conf );
55
+
56
+ phutil_load_library ('arcanist/src ' );
57
+
58
+ foreach (PhabricatorEnv::getEnvConfig ('load-libraries ' ) as $ library ) {
59
+ phutil_load_library ($ library );
60
+ }
61
+
62
+ PhutilErrorHandler::initialize ();
63
+ PhabricatorEventEngine::initialize ();
64
+
65
+ $ tz = PhabricatorEnv::getEnvConfig ('phabricator.timezone ' );
66
+ if ($ tz ) {
67
+ date_default_timezone_set ($ tz );
68
+ }
Original file line number Diff line number Diff line change 75
75
76
76
77
77
require_once dirname (__FILE__ ).'/__init_script__.php ' ;
78
- require_once dirname (__FILE__ ).'/__init_env__.php ' ;
79
78
80
79
if ($ argc != 2 ) {
81
80
$ self = basename ($ argv [0 ]);
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'console ' );
25
24
phutil_require_module ('phutil ' , 'parser/xhpast/bin ' );
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
if ($ argc !== 2 ) {
25
24
echo phutil_console_format (
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phabricator ' , 'infrastructure/daemon/control ' );
25
24
$ control = new PhabricatorDaemonControl ();
Original file line number Diff line number Diff line change 23
23
24
24
$ root = dirname (dirname (dirname (__FILE__ )));
25
25
require_once $ root .'/scripts/__init_script__.php ' ;
26
- require_once $ root .'/scripts/__init_env__.php ' ;
27
26
require_once $ root .'/externals/mimemailparser/MimeMailParser.class.php ' ;
28
27
29
28
phutil_require_module (
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'symbols ' );
25
24
PhutilSymbolLoader::loadClass ('PhabricatorRepository ' );
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'console ' );
25
24
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'console ' );
25
24
phutil_require_module ('phutil ' , 'future/exec ' );
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
if (empty ($ argv [1 ])) {
25
24
echo "usage: index_one_commit.php <commit_name> \n" ;
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
$ users = id (new PhabricatorUser ())->loadAll ();
25
24
echo "Indexing " .count ($ users )." users " ;
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
// TODO: Get rid of this script eventually, once this stuff is better-formalized
25
24
// in Timeline consumers.
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
ini_set ('memory_limit ' , -1 );
25
24
$ tasks = id (new ManiphestTask ())->loadAll ();
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'console ' );
25
24
phutil_require_module ('phabricator ' , 'infrastructure/setup/sql ' );
Original file line number Diff line number Diff line change 19
19
20
20
$ root = dirname (dirname (dirname (__FILE__ )));
21
21
require_once $ root .'/scripts/__init_script__.php ' ;
22
- require_once $ root .'/scripts/__init_env__.php ' ;
23
22
24
23
phutil_require_module ('phutil ' , 'console ' );
25
24
phutil_require_module ('phutil ' , 'future/exec ' );
Original file line number Diff line number Diff line change @@ -30,9 +30,6 @@ protected function willRun() {
30
30
31
31
$ phabricator = phutil_get_library_root ('phabricator ' );
32
32
$ root = dirname ($ phabricator );
33
- require_once $ root .'/scripts/__init_env__.php ' ;
34
-
35
- // Daemons may perform writes.
36
- AphrontWriteGuard::allowDangerousUnguardedWrites (true );
33
+ require_once $ root .'/scripts/__init_script__.php ' ;
37
34
}
38
35
}
Original file line number Diff line number Diff line change 8
8
9
9
phutil_require_module ('phabricator ' , 'aphront/console/plugin/errorlog/api ' );
10
10
phutil_require_module ('phabricator ' , 'aphront/console/plugin/event/api ' );
11
- phutil_require_module ('phabricator ' , 'aphront/writeguard ' );
12
11
13
12
phutil_require_module ('phutil ' , 'daemon/base ' );
14
13
phutil_require_module ('phutil ' , 'moduleutils ' );
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ private function getComputedConfiguration() {
44
44
45
45
protected function willRunTests () {
46
46
$ root = dirname (phutil_get_library_root ('phabricator ' ));
47
- require_once $ root .'/scripts/__init_env__ .php ' ;
47
+ require_once $ root .'/scripts/__init_script__ .php ' ;
48
48
49
49
$ config = $ this ->getComputedConfiguration ();
50
50
0 commit comments