mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Depend on class autoloading
Test Plan: Run setup. /differential/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Maniphest Tasks: T1103 Differential Revision: https://secure.phabricator.com/D2612
This commit is contained in:
parent
09c8af4de0
commit
1ebf9186b4
32 changed files with 46 additions and 138 deletions
|
@ -42,7 +42,6 @@ $env = isset($_SERVER['PHABRICATOR_ENV'])
|
||||||
? $_SERVER['PHABRICATOR_ENV']
|
? $_SERVER['PHABRICATOR_ENV']
|
||||||
: getenv('PHABRICATOR_ENV');
|
: getenv('PHABRICATOR_ENV');
|
||||||
if (!$env) {
|
if (!$env) {
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
echo phutil_console_wrap(
|
echo phutil_console_wrap(
|
||||||
phutil_console_format(
|
phutil_console_format(
|
||||||
"**ERROR**: PHABRICATOR_ENV Not Set\n\n".
|
"**ERROR**: PHABRICATOR_ENV Not Set\n\n".
|
||||||
|
@ -59,7 +58,6 @@ if (!$env) {
|
||||||
$conf = phabricator_read_config_file($env);
|
$conf = phabricator_read_config_file($env);
|
||||||
$conf['phabricator.env'] = $env;
|
$conf['phabricator.env'] = $env;
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'infrastructure/env');
|
|
||||||
PhabricatorEnv::setEnvConfig($conf);
|
PhabricatorEnv::setEnvConfig($conf);
|
||||||
|
|
||||||
phutil_load_library('arcanist/src');
|
phutil_load_library('arcanist/src');
|
||||||
|
|
|
@ -155,11 +155,6 @@ if ($argc != 2) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
phutil_require_module('phutil', 'filesystem');
|
|
||||||
phutil_require_module('phutil', 'filesystem/filefinder');
|
|
||||||
phutil_require_module('phutil', 'future/exec');
|
|
||||||
phutil_require_module('phutil', 'parser/docblock');
|
|
||||||
|
|
||||||
$root = Filesystem::resolvePath($argv[1]);
|
$root = Filesystem::resolvePath($argv[1]);
|
||||||
|
|
||||||
$resource_hash = PhabricatorEnv::getEnvConfig('celerity.resource-hash');
|
$resource_hash = PhabricatorEnv::getEnvConfig('celerity.resource-hash');
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
|
|
||||||
$time_start = microtime(true);
|
$time_start = microtime(true);
|
||||||
|
|
||||||
if ($argc !== 3) {
|
if ($argc !== 3) {
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'infrastructure/daemon/control');
|
|
||||||
$control = new PhabricatorDaemonControl();
|
$control = new PhabricatorDaemonControl();
|
||||||
|
|
||||||
must_have_extension('pcntl');
|
must_have_extension('pcntl');
|
||||||
|
@ -208,10 +207,6 @@ switch ($command) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function phd_load_tracked_repositories() {
|
function phd_load_tracked_repositories() {
|
||||||
phutil_require_module(
|
|
||||||
'phabricator',
|
|
||||||
'applications/repository/storage/repository');
|
|
||||||
|
|
||||||
$repositories = id(new PhabricatorRepository())->loadAll();
|
$repositories = id(new PhabricatorRepository())->loadAll();
|
||||||
foreach ($repositories as $key => $repository) {
|
foreach ($repositories as $key => $repository) {
|
||||||
if (!$repository->isTracked()) {
|
if (!$repository->isTracked()) {
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
|
|
||||||
$revision = new DifferentialRevision();
|
$revision = new DifferentialRevision();
|
||||||
|
|
||||||
$empty_revisions = queryfx_all(
|
$empty_revisions = queryfx_all(
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phutil', 'future/exec');
|
|
||||||
|
|
||||||
PhutilServiceProfiler::installEchoListener();
|
PhutilServiceProfiler::installEchoListener();
|
||||||
|
|
||||||
$allocator = new DrydockAllocator();
|
$allocator = new DrydockAllocator();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -25,13 +25,6 @@ $root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
require_once $root.'/externals/mimemailparser/MimeMailParser.class.php';
|
require_once $root.'/externals/mimemailparser/MimeMailParser.class.php';
|
||||||
|
|
||||||
phutil_require_module(
|
|
||||||
'phabricator',
|
|
||||||
'applications/metamta/storage/receivedmail');
|
|
||||||
phutil_require_module(
|
|
||||||
'phabricator',
|
|
||||||
'applications/files/storage/file');
|
|
||||||
|
|
||||||
$parser = new MimeMailParser();
|
$parser = new MimeMailParser();
|
||||||
$parser->setText(file_get_contents('php://stdin'));
|
$parser->setText(file_get_contents('php://stdin'));
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,10 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'symbols');
|
|
||||||
PhutilSymbolLoader::loadClass('PhabricatorRepository');
|
|
||||||
PhutilSymbolLoader::loadClass('PhabricatorRepositoryCommit');
|
|
||||||
|
|
||||||
$commit = new PhabricatorRepositoryCommit();
|
$commit = new PhabricatorRepositoryCommit();
|
||||||
|
|
||||||
$conn_w = id(new PhabricatorRepository())->establishConnection('w');
|
$conn_w = id(new PhabricatorRepository())->establishConnection('w');
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
|
|
||||||
$is_all = false;
|
$is_all = false;
|
||||||
$reparse_message = false;
|
$reparse_message = false;
|
||||||
$reparse_change = false;
|
$reparse_change = false;
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phutil', 'future/exec');
|
|
||||||
|
|
||||||
if (empty($argv[1])) {
|
if (empty($argv[1])) {
|
||||||
echo "usage: test_connection.php <repository_callsign>\n";
|
echo "usage: test_connection.php <repository_callsign>\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
|
|
||||||
if (ctags_check_executable() == false) {
|
if (ctags_check_executable() == false) {
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
"Could not find Exuberant ctags. Make sure it is installed and\n".
|
"Could not find Exuberant ctags. Make sure it is installed and\n".
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phutil', 'parser/xhpast/bin');
|
|
||||||
|
|
||||||
if ($argc !== 1 || posix_isatty(STDIN)) {
|
if ($argc !== 1 || posix_isatty(STDIN)) {
|
||||||
echo phutil_console_format(
|
echo phutil_console_format(
|
||||||
"usage: find . -type f -name '*.php' | ./generate_php_symbols.php\n");
|
"usage: find . -type f -name '*.php' | ./generate_php_symbols.php\n");
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phutil', 'future/exec');
|
|
||||||
|
|
||||||
echo "Enter a username to create a new account or edit an existing account.";
|
echo "Enter a username to create a new account or edit an existing account.";
|
||||||
|
|
||||||
$username = phutil_console_prompt("Enter a username:");
|
$username = phutil_console_prompt("Enter a username:");
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phutil', 'future/exec');
|
|
||||||
|
|
||||||
if ($argc !== 5) {
|
if ($argc !== 5) {
|
||||||
echo "usage: add_user.php <username> <email> <realname> <admin_user>\n";
|
echo "usage: add_user.php <username> <email> <realname> <admin_user>\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -20,9 +20,6 @@
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
|
|
||||||
phutil_require_module('phutil', 'console');
|
|
||||||
phutil_require_module('phabricator', 'storage/queryfx');
|
|
||||||
|
|
||||||
$purge_changesets = false;
|
$purge_changesets = false;
|
||||||
$purge_differential = false;
|
$purge_differential = false;
|
||||||
$purge_maniphest = false;
|
$purge_maniphest = false;
|
||||||
|
|
|
@ -74,7 +74,6 @@ abstract class AphrontApplicationConfiguration {
|
||||||
return $this->build404Controller();
|
return $this->build404Controller();
|
||||||
}
|
}
|
||||||
|
|
||||||
PhutilSymbolLoader::loadClass($controller_class);
|
|
||||||
$controller = newv($controller_class, array($request));
|
$controller = newv($controller_class, array($request));
|
||||||
|
|
||||||
return array($controller, $uri_data);
|
return array($controller, $uri_data);
|
||||||
|
|
|
@ -70,7 +70,6 @@ final class DarkConsoleXHProfPluginAPI {
|
||||||
$data = xhprof_disable();
|
$data = xhprof_disable();
|
||||||
$data = serialize($data);
|
$data = serialize($data);
|
||||||
$file_class = 'PhabricatorFile';
|
$file_class = 'PhabricatorFile';
|
||||||
PhutilSymbolLoader::loadClass($file_class);
|
|
||||||
|
|
||||||
// Since these happen on GET we can't do guarded writes.
|
// Since these happen on GET we can't do guarded writes.
|
||||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||||
|
|
|
@ -155,7 +155,6 @@ abstract class PhabricatorOAuthProvider {
|
||||||
default:
|
default:
|
||||||
throw new Exception('Unknown OAuth provider.');
|
throw new Exception('Unknown OAuth provider.');
|
||||||
}
|
}
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
return newv($class, array());
|
return newv($class, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,8 @@ abstract class PhabricatorController extends AphrontController {
|
||||||
$request->setUser($user);
|
$request->setUser($user);
|
||||||
|
|
||||||
if ($user->getIsDisabled() && $this->shouldRequireEnabledUser()) {
|
if ($user->getIsDisabled() && $this->shouldRequireEnabledUser()) {
|
||||||
$disabled_user_controller = newv(
|
$disabled_user_controller = new PhabricatorDisabledUserController(
|
||||||
'PhabricatorDisabledUserController',
|
$request);
|
||||||
array($request));
|
|
||||||
return $this->delegateToController($disabled_user_controller);
|
return $this->delegateToController($disabled_user_controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +77,7 @@ abstract class PhabricatorController extends AphrontController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->shouldRequireLogin() && !$user->getPHID()) {
|
if ($this->shouldRequireLogin() && !$user->getPHID()) {
|
||||||
$login_controller = newv('PhabricatorLoginController', array($request));
|
$login_controller = new PhabricatorLoginController($request);
|
||||||
return $this->delegateToController($login_controller);
|
return $this->delegateToController($login_controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,9 +88,7 @@ abstract class PhabricatorController extends AphrontController {
|
||||||
"No primary email address associated with this account!");
|
"No primary email address associated with this account!");
|
||||||
}
|
}
|
||||||
if (!$email->getIsVerified()) {
|
if (!$email->getIsVerified()) {
|
||||||
$verify_controller = newv(
|
$verify_controller = new PhabricatorMustVerifyEmailController($request);
|
||||||
'PhabricatorMustVerifyEmailController',
|
|
||||||
array($request));
|
|
||||||
return $this->delegateToController($verify_controller);
|
return $this->delegateToController($verify_controller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,7 +227,6 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
|
|
||||||
// TODO: build a better version of the action links and deprecate the
|
// TODO: build a better version of the action links and deprecate the
|
||||||
// whole DifferentialRevisionDetailRenderer class.
|
// whole DifferentialRevisionDetailRenderer class.
|
||||||
PhutilSymbolLoader::loadClass($custom_renderer_class);
|
|
||||||
$custom_renderer =
|
$custom_renderer =
|
||||||
newv($custom_renderer_class, array());
|
newv($custom_renderer_class, array());
|
||||||
$actions = array_merge(
|
$actions = array_merge(
|
||||||
|
|
|
@ -51,18 +51,15 @@ abstract class DiffusionBranchQuery {
|
||||||
|
|
||||||
switch ($repository->getVersionControlSystem()) {
|
switch ($repository->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
$class = 'DiffusionGitBranchQuery';
|
$query = new DiffusionGitBranchQuery();
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
$class = 'DiffusionMercurialBranchQuery';
|
$query = new DiffusionMercurialBranchQuery();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unsupported VCS!");
|
throw new Exception("Unsupported VCS!");
|
||||||
}
|
}
|
||||||
|
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$query = new $class();
|
|
||||||
|
|
||||||
$query->request = $request;
|
$query->request = $request;
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
|
|
|
@ -44,21 +44,18 @@ abstract class DiffusionBrowseQuery {
|
||||||
switch ($repository->getVersionControlSystem()) {
|
switch ($repository->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
// TODO: Verify local-path?
|
// TODO: Verify local-path?
|
||||||
$class = 'DiffusionGitBrowseQuery';
|
$query = new DiffusionGitBrowseQuery();
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
$class = 'DiffusionMercurialBrowseQuery';
|
$query = new DiffusionMercurialBrowseQuery();
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
$class = 'DiffusionSvnBrowseQuery';
|
$query = new DiffusionSvnBrowseQuery();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Unsupported VCS!");
|
throw new Exception("Unsupported VCS!");
|
||||||
}
|
}
|
||||||
|
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$query = new $class();
|
|
||||||
|
|
||||||
$query->request = $request;
|
$query->request = $request;
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
|
|
|
@ -106,6 +106,7 @@ final class PhabricatorS3FileStorageEngine
|
||||||
* Create a new S3 API object.
|
* Create a new S3 API object.
|
||||||
*
|
*
|
||||||
* @task internal
|
* @task internal
|
||||||
|
* @phutil-external-symbol class S3
|
||||||
*/
|
*/
|
||||||
private function newS3API() {
|
private function newS3API() {
|
||||||
$libroot = dirname(phutil_get_library_root('phabricator'));
|
$libroot = dirname(phutil_get_library_root('phabricator'));
|
||||||
|
@ -119,13 +120,7 @@ final class PhabricatorS3FileStorageEngine
|
||||||
"Specify 'amazon-s3.access-key' and 'amazon-s3.secret-key'!");
|
"Specify 'amazon-s3.access-key' and 'amazon-s3.secret-key'!");
|
||||||
}
|
}
|
||||||
|
|
||||||
$s3 = newv(
|
$s3 = new S3($access_key, $secret_key, $use_ssl = true);
|
||||||
'S3',
|
|
||||||
array(
|
|
||||||
$access_key,
|
|
||||||
$secret_key,
|
|
||||||
$use_ssl = true,
|
|
||||||
));
|
|
||||||
|
|
||||||
$s3->setExceptions(true);
|
$s3->setExceptions(true);
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,6 @@ class PhabricatorMarkupEngine {
|
||||||
$custom_rule_classes = $options['custom-inline'];
|
$custom_rule_classes = $options['custom-inline'];
|
||||||
if ($custom_rule_classes) {
|
if ($custom_rule_classes) {
|
||||||
foreach ($custom_rule_classes as $custom_rule_class) {
|
foreach ($custom_rule_classes as $custom_rule_class) {
|
||||||
PhutilSymbolLoader::loadClass($custom_rule_class);
|
|
||||||
$rules[] = newv($custom_rule_class, array());
|
$rules[] = newv($custom_rule_class, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,7 +166,6 @@ class PhabricatorMarkupEngine {
|
||||||
$custom_block_rule_classes = $options['custom-block'];
|
$custom_block_rule_classes = $options['custom-block'];
|
||||||
if ($custom_block_rule_classes) {
|
if ($custom_block_rule_classes) {
|
||||||
foreach ($custom_block_rule_classes as $custom_block_rule_class) {
|
foreach ($custom_block_rule_classes as $custom_block_rule_class) {
|
||||||
PhutilSymbolLoader::loadClass($custom_block_rule_class);
|
|
||||||
$blocks[] = newv($custom_block_rule_class, array());
|
$blocks[] = newv($custom_block_rule_class, array());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,9 @@ final class PhabricatorMailImplementationAmazonSESAdapter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phutil-external-symbol class SimpleEmailService
|
||||||
|
*/
|
||||||
public function executeSend($body) {
|
public function executeSend($body) {
|
||||||
$key = PhabricatorEnv::getEnvConfig('amazon-ses.access-key');
|
$key = PhabricatorEnv::getEnvConfig('amazon-ses.access-key');
|
||||||
$secret = PhabricatorEnv::getEnvConfig('amazon-ses.secret-key');
|
$secret = PhabricatorEnv::getEnvConfig('amazon-ses.secret-key');
|
||||||
|
@ -41,7 +44,7 @@ final class PhabricatorMailImplementationAmazonSESAdapter
|
||||||
$root = dirname($root);
|
$root = dirname($root);
|
||||||
require_once $root.'/externals/amazon-ses/ses.php';
|
require_once $root.'/externals/amazon-ses/ses.php';
|
||||||
|
|
||||||
$service = newv('SimpleEmailService', array($key, $secret));
|
$service = new SimpleEmailService($key, $secret);
|
||||||
$service->enableUseExceptions(true);
|
$service->enableUseExceptions(true);
|
||||||
return $service->sendRawEmail($body);
|
return $service->sendRawEmail($body);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,14 @@
|
||||||
class PhabricatorMailImplementationPHPMailerLiteAdapter
|
class PhabricatorMailImplementationPHPMailerLiteAdapter
|
||||||
extends PhabricatorMailImplementationAdapter {
|
extends PhabricatorMailImplementationAdapter {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @phutil-external-symbol class PHPMailerLite
|
||||||
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$root = phutil_get_library_root('phabricator');
|
$root = phutil_get_library_root('phabricator');
|
||||||
$root = dirname($root);
|
$root = dirname($root);
|
||||||
require_once $root.'/externals/phpmailer/class.phpmailer-lite.php';
|
require_once $root.'/externals/phpmailer/class.phpmailer-lite.php';
|
||||||
$this->mailer = newv('PHPMailerLite', array($use_exceptions = true));
|
$this->mailer = new PHPMailerLite($use_exceptions = true);
|
||||||
$this->mailer->CharSet = 'utf-8';
|
$this->mailer->CharSet = 'utf-8';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -233,13 +233,13 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO {
|
||||||
$class_obj = null;
|
$class_obj = null;
|
||||||
switch ($receiver_type) {
|
switch ($receiver_type) {
|
||||||
case 'T':
|
case 'T':
|
||||||
$class_obj = newv('ManiphestTask', array());
|
$class_obj = new ManiphestTask();
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
$class_obj = newv('DifferentialRevision', array());
|
$class_obj = new DifferentialRevision();
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
$class_obj = newv('PhabricatorRepositoryCommit', array());
|
$class_obj = new PhabricatorRepositoryCommit();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -40,7 +40,7 @@ final class PhabricatorObjectHandleData {
|
||||||
foreach ($types as $type => $phids) {
|
foreach ($types as $type => $phids) {
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
||||||
$user_dao = newv('PhabricatorUser', array());
|
$user_dao = new PhabricatorUser();
|
||||||
$users = $user_dao->loadAllWhere(
|
$users = $user_dao->loadAllWhere(
|
||||||
'phid in (%Ls)',
|
'phid in (%Ls)',
|
||||||
$phids);
|
$phids);
|
||||||
|
@ -49,13 +49,13 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_CMIT:
|
case PhabricatorPHIDConstants::PHID_TYPE_CMIT:
|
||||||
$commit_dao = newv('PhabricatorRepositoryCommit', array());
|
$commit_dao = new PhabricatorRepositoryCommit();
|
||||||
$commits = $commit_dao->loadAllWhere(
|
$commits = $commit_dao->loadAllWhere(
|
||||||
'phid IN (%Ls)',
|
'phid IN (%Ls)',
|
||||||
$phids);
|
$phids);
|
||||||
$commit_data = array();
|
$commit_data = array();
|
||||||
if ($commits) {
|
if ($commits) {
|
||||||
$data_dao = newv('PhabricatorRepositoryCommitData', array());
|
$data_dao = new PhabricatorRepositoryCommitData();
|
||||||
$commit_data = $data_dao->loadAllWhere(
|
$commit_data = $data_dao->loadAllWhere(
|
||||||
'commitID IN (%Ld)',
|
'commitID IN (%Ld)',
|
||||||
mpull($commits, 'getID'));
|
mpull($commits, 'getID'));
|
||||||
|
@ -73,7 +73,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_TASK:
|
case PhabricatorPHIDConstants::PHID_TYPE_TASK:
|
||||||
$task_dao = newv('ManiphestTask', array());
|
$task_dao = new ManiphestTask();
|
||||||
$tasks = $task_dao->loadAllWhere(
|
$tasks = $task_dao->loadAllWhere(
|
||||||
'phid IN (%Ls)',
|
'phid IN (%Ls)',
|
||||||
$phids);
|
$phids);
|
||||||
|
@ -82,7 +82,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_DREV:
|
case PhabricatorPHIDConstants::PHID_TYPE_DREV:
|
||||||
$revision_dao = newv('DifferentialRevision', array());
|
$revision_dao = new DifferentialRevision();
|
||||||
$revisions = $revision_dao->loadAllWhere(
|
$revisions = $revision_dao->loadAllWhere(
|
||||||
'phid IN (%Ls)',
|
'phid IN (%Ls)',
|
||||||
$phids);
|
$phids);
|
||||||
|
@ -131,9 +131,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
case PhabricatorPHIDConstants::PHID_TYPE_USER:
|
||||||
$class = 'PhabricatorUser';
|
$object = new PhabricatorUser();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$users = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
$users = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
||||||
$users = mpull($users, null, 'getPHID');
|
$users = mpull($users, null, 'getPHID');
|
||||||
|
@ -183,10 +181,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
case PhabricatorPHIDConstants::PHID_TYPE_MLST:
|
||||||
$class = 'PhabricatorMetaMTAMailingList';
|
$object = new PhabricatorMetaMTAMailingList();
|
||||||
|
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$lists = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
$lists = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
||||||
$lists = mpull($lists, null, 'getPHID');
|
$lists = mpull($lists, null, 'getPHID');
|
||||||
|
@ -208,9 +203,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_DREV:
|
case PhabricatorPHIDConstants::PHID_TYPE_DREV:
|
||||||
$class = 'DifferentialRevision';
|
$object = new DifferentialRevision();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$revs = $object->loadAllWhere('phid in (%Ls)', $phids);
|
$revs = $object->loadAllWhere('phid in (%Ls)', $phids);
|
||||||
$revs = mpull($revs, null, 'getPHID');
|
$revs = mpull($revs, null, 'getPHID');
|
||||||
|
@ -240,9 +233,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_CMIT:
|
case PhabricatorPHIDConstants::PHID_TYPE_CMIT:
|
||||||
$class = 'PhabricatorRepositoryCommit';
|
$object = new PhabricatorRepositoryCommit();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$commits = $object->loadAllWhere('phid in (%Ls)', $phids);
|
$commits = $object->loadAllWhere('phid in (%Ls)', $phids);
|
||||||
$commits = mpull($commits, null, 'getPHID');
|
$commits = mpull($commits, null, 'getPHID');
|
||||||
|
@ -287,9 +278,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_TASK:
|
case PhabricatorPHIDConstants::PHID_TYPE_TASK:
|
||||||
$class = 'ManiphestTask';
|
$object = new ManiphestTask();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$tasks = $object->loadAllWhere('phid in (%Ls)', $phids);
|
$tasks = $object->loadAllWhere('phid in (%Ls)', $phids);
|
||||||
$tasks = mpull($tasks, null, 'getPHID');
|
$tasks = mpull($tasks, null, 'getPHID');
|
||||||
|
@ -316,9 +305,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_FILE:
|
case PhabricatorPHIDConstants::PHID_TYPE_FILE:
|
||||||
$class = 'PhabricatorFile';
|
$object = new PhabricatorFile();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$files = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
$files = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
||||||
$files = mpull($files, null, 'getPHID');
|
$files = mpull($files, null, 'getPHID');
|
||||||
|
@ -339,9 +326,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_PROJ:
|
case PhabricatorPHIDConstants::PHID_TYPE_PROJ:
|
||||||
$class = 'PhabricatorProject';
|
$object = new PhabricatorProject();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$projects = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
$projects = $object->loadAllWhere('phid IN (%Ls)', $phids);
|
||||||
$projects = mpull($projects, null, 'getPHID');
|
$projects = mpull($projects, null, 'getPHID');
|
||||||
|
@ -362,9 +347,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_REPO:
|
case PhabricatorPHIDConstants::PHID_TYPE_REPO:
|
||||||
$class = 'PhabricatorRepository';
|
$object = new PhabricatorRepository();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$repositories = $object->loadAllWhere('phid in (%Ls)', $phids);
|
$repositories = $object->loadAllWhere('phid in (%Ls)', $phids);
|
||||||
$repositories = mpull($repositories, null, 'getPHID');
|
$repositories = mpull($repositories, null, 'getPHID');
|
||||||
|
@ -385,9 +368,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_OPKG:
|
case PhabricatorPHIDConstants::PHID_TYPE_OPKG:
|
||||||
$class = 'PhabricatorOwnersPackage';
|
$object = new PhabricatorOwnersPackage();
|
||||||
PhutilSymbolLoader::loadClass($class);
|
|
||||||
$object = newv($class, array());
|
|
||||||
|
|
||||||
$packages = $object->loadAllWhere('phid in (%Ls)', $phids);
|
$packages = $object->loadAllWhere('phid in (%Ls)', $phids);
|
||||||
$packages = mpull($packages, null, 'getPHID');
|
$packages = mpull($packages, null, 'getPHID');
|
||||||
|
@ -408,7 +389,7 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_APRJ:
|
case PhabricatorPHIDConstants::PHID_TYPE_APRJ:
|
||||||
$project_dao = newv('PhabricatorRepositoryArcanistProject', array());
|
$project_dao = new PhabricatorRepositoryArcanistProject();
|
||||||
|
|
||||||
$projects = $project_dao->loadAllWhere(
|
$projects = $project_dao->loadAllWhere(
|
||||||
'phid IN (%Ls)',
|
'phid IN (%Ls)',
|
||||||
|
@ -429,8 +410,8 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PhabricatorPHIDConstants::PHID_TYPE_WIKI:
|
case PhabricatorPHIDConstants::PHID_TYPE_WIKI:
|
||||||
$document_dao = newv('PhrictionDocument', array());
|
$document_dao = new PhrictionDocument();
|
||||||
$content_dao = newv('PhrictionContent', array());
|
$content_dao = new PhrictionContent();
|
||||||
|
|
||||||
$conn = $document_dao->establishConnection('r');
|
$conn = $document_dao->establishConnection('r');
|
||||||
$documents = queryfx_all(
|
$documents = queryfx_all(
|
||||||
|
@ -467,7 +448,6 @@ final class PhabricatorObjectHandleData {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($loader) {
|
if ($loader) {
|
||||||
PhutilSymbolLoader::loadClass($loader);
|
|
||||||
$object = newv($loader, array());
|
$object = newv($loader, array());
|
||||||
$handles += $object->loadHandles($phids);
|
$handles += $object->loadHandles($phids);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,7 +48,6 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
'PhabricatorRepositoryDefaultCommitMessageDetailParser');
|
'PhabricatorRepositoryDefaultCommitMessageDetailParser');
|
||||||
|
|
||||||
if ($detail_parser) {
|
if ($detail_parser) {
|
||||||
PhutilSymbolLoader::loadClass($detail_parser);
|
|
||||||
$parser_obj = newv($detail_parser, array($commit, $data));
|
$parser_obj = newv($detail_parser, array($commit, $data));
|
||||||
$parser_obj->parseCommitDetails();
|
$parser_obj->parseCommitDetails();
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
|
||||||
$data = idx($task_data, $task->getID());
|
$data = idx($task_data, $task->getID());
|
||||||
$class = $task->getTaskClass();
|
$class = $task->getTaskClass();
|
||||||
try {
|
try {
|
||||||
PhutilSymbolLoader::loadClass($class);
|
if (!class_exists($class) ||
|
||||||
if (!is_subclass_of($class, 'PhabricatorWorker')) {
|
!is_subclass_of($class, 'PhabricatorWorker')) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"Task class '{$class}' does not extend PhabricatorWorker.");
|
"Task class '{$class}' does not extend PhabricatorWorker.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,7 @@ final class PhabricatorSetup {
|
||||||
// of security so warn even if things look OK.
|
// of security so warn even if things look OK.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
phutil_require_module('phutil', 'utils');
|
$open_libphutil = class_exists('Future');
|
||||||
$open_libphutil = true;
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$message = $ex->getMessage();
|
$message = $ex->getMessage();
|
||||||
self::write("Unable to load modules from libphutil: {$message}\n");
|
self::write("Unable to load modules from libphutil: {$message}\n");
|
||||||
|
@ -67,8 +66,7 @@ final class PhabricatorSetup {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
phutil_require_module('arcanist', 'workflow/base');
|
$open_arcanist = class_exists('ArcanistDiffParser');
|
||||||
$open_arcanist = true;
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$message = $ex->getMessage();
|
$message = $ex->getMessage();
|
||||||
self::write("Unable to load modules from Arcanist: {$message}\n");
|
self::write("Unable to load modules from Arcanist: {$message}\n");
|
||||||
|
|
|
@ -76,7 +76,6 @@ try {
|
||||||
$conf = phabricator_read_config_file($env);
|
$conf = phabricator_read_config_file($env);
|
||||||
$conf['phabricator.env'] = $env;
|
$conf['phabricator.env'] = $env;
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'infrastructure/env');
|
|
||||||
PhabricatorEnv::setEnvConfig($conf);
|
PhabricatorEnv::setEnvConfig($conf);
|
||||||
|
|
||||||
// This is the earliest we can get away with this, we need env config first.
|
// This is the earliest we can get away with this, we need env config first.
|
||||||
|
@ -91,11 +90,8 @@ try {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/console/plugin/xhprof/api');
|
|
||||||
DarkConsoleXHProfPluginAPI::hookProfiler();
|
DarkConsoleXHProfPluginAPI::hookProfiler();
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/console/plugin/errorlog/api');
|
|
||||||
|
|
||||||
PhutilErrorHandler::initialize();
|
PhutilErrorHandler::initialize();
|
||||||
|
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
|
@ -106,8 +102,6 @@ $tz = PhabricatorEnv::getEnvConfig('phabricator.timezone');
|
||||||
if ($tz) {
|
if ($tz) {
|
||||||
date_default_timezone_set($tz);
|
date_default_timezone_set($tz);
|
||||||
}
|
}
|
||||||
phutil_require_module('phabricator', 'aphront/console/plugin/errorlog/api');
|
|
||||||
phutil_require_module('phutil', 'error');
|
|
||||||
|
|
||||||
PhutilErrorHandler::setErrorListener(
|
PhutilErrorHandler::setErrorListener(
|
||||||
array('DarkConsoleErrorLogPluginAPI', 'handleErrors'));
|
array('DarkConsoleErrorLogPluginAPI', 'handleErrors'));
|
||||||
|
|
Loading…
Reference in a new issue