~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to scripts/__init_script__.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-11-01 23:20:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20141101232006-mvlnp0cil67tsboe
Tags: upstream-0~git20141101/arcanist
Import upstream version 0~git20141101, component arcanist

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
 * Adjust 'include_path' to add locations where we'll search for libphutil.
 
5
 * We look in these places:
 
6
 *
 
7
 *  - Next to 'arcanist/'.
 
8
 *  - Anywhere in the normal PHP 'include_path'.
 
9
 *  - Inside 'arcanist/externals/includes/'.
 
10
 *
 
11
 * When looking in these places, we expect to find a 'libphutil/' directory.
 
12
 */
 
13
function arcanist_adjust_php_include_path() {
 
14
  // The 'arcanist/' directory.
 
15
  $arcanist_dir = dirname(dirname(__FILE__));
 
16
 
 
17
  // The parent directory of 'arcanist/'.
 
18
  $parent_dir = dirname($arcanist_dir);
 
19
 
 
20
  // The 'arcanist/externals/includes/' directory.
 
21
  $include_dir = implode(
 
22
    DIRECTORY_SEPARATOR,
 
23
    array(
 
24
      $arcanist_dir,
 
25
      'externals',
 
26
      'includes',
 
27
    ));
 
28
 
 
29
  $php_include_path = ini_get('include_path');
 
30
  $php_include_path = implode(
 
31
    PATH_SEPARATOR,
 
32
    array(
 
33
      $parent_dir,
 
34
      $php_include_path,
 
35
      $include_dir,
 
36
    ));
 
37
 
 
38
  ini_set('include_path', $php_include_path);
 
39
}
 
40
arcanist_adjust_php_include_path();
 
41
 
 
42
if (getenv('ARC_PHUTIL_PATH')) {
 
43
  @include_once getenv('ARC_PHUTIL_PATH').'/scripts/__init_script__.php';
 
44
} else {
 
45
  @include_once 'libphutil/scripts/__init_script__.php';
 
46
}
 
47
if (!@constant('__LIBPHUTIL__')) {
 
48
  echo "ERROR: Unable to load libphutil. Put libphutil/ next to arcanist/, or ".
 
49
       "update your PHP 'include_path' to include the parent directory of ".
 
50
       "libphutil/, or symlink libphutil/ into arcanist/externals/includes/.\n";
 
51
  exit(1);
 
52
}
 
53
 
 
54
PhutilTranslator::getInstance()
 
55
  ->addTranslations(array(
 
56
    'Locally modified path(s) are not included in this revision:' => array(
 
57
      'A locally modified path is not included in this revision:',
 
58
      'Locally modified paths are not included in this revision:',
 
59
    ),
 
60
    'They will NOT be committed. Commit this revision anyway?' => array(
 
61
      'It will NOT be committed. Commit this revision anyway?',
 
62
      'They will NOT be committed. Commit this revision anyway?',
 
63
    ),
 
64
    'Revision includes changes to path(s) that do not exist:' => array(
 
65
      'Revision includes changes to a path that does not exist:',
 
66
      'Revision includes changes to paths that do not exist:',
 
67
    ),
 
68
 
 
69
    'This diff includes file(s) which are not valid UTF-8 (they contain '.
 
70
      'invalid byte sequences). You can either stop this workflow and fix '.
 
71
      'these files, or continue. If you continue, these files will be '.
 
72
      'marked as binary.' => array(
 
73
      'This diff includes a file which is not valid UTF-8 (it has invalid '.
 
74
        'byte sequences). You can either stop this workflow and fix it, or '.
 
75
        'continue. If you continue, this file will be marked as binary.',
 
76
      'This diff includes files which are not valid UTF-8 (they contain '.
 
77
        'invalid byte sequences). You can either stop this workflow and fix '.
 
78
        'these files, or continue. If you continue, these files will be '.
 
79
        'marked as binary.',
 
80
    ),
 
81
    'AFFECTED FILE(S)' => array('AFFECTED FILE', 'AFFECTED FILES'),
 
82
    'Do you want to mark these files as binary and continue?' => array(
 
83
      'Do you want to mark this file as binary and continue?',
 
84
      'Do you want to mark these files as binary and continue?',
 
85
    ),
 
86
 
 
87
    'Do you want to amend these files to the commit?' => array(
 
88
      'Do you want to amend this file to the commit?',
 
89
      'Do you want to amend these files to the commit?',
 
90
    ),
 
91
 
 
92
    'Do you want to add these files to the commit?' => array(
 
93
      'Do you want to add this file to the commit?',
 
94
      'Do you want to add these files to the commit?',
 
95
    ),
 
96
 
 
97
    'line(s)' => array('line', 'lines'),
 
98
 
 
99
    '%d test(s)' => array('%d test', '%d tests'),
 
100
 
 
101
    '%d assertion(s) passed.' => array(
 
102
      '%d assertion passed.',
 
103
      '%d assertions passed.',
 
104
    ),
 
105
  ));
 
106
 
 
107
phutil_load_library(dirname(dirname(__FILE__)).'/src/');