mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +01:00
Use PhabricatorDaemon for sending emails.
Summary: Make PhabricatorMetaMTADaemon extend PhabricatorDaemon. Test Plan: send mail with the new daemon. Reviewed By: epriestley Reviewers: epriestley CC: epriestley Differential Revision: 74
This commit is contained in:
parent
6aa006b903
commit
e4fa1523bd
4 changed files with 4 additions and 30 deletions
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
require_once $root.'/scripts/__init_script__.php';
|
||||
require_once $root.'/scripts/__init_env__.php';
|
||||
|
||||
phutil_require_module('phutil', 'symbols');
|
||||
|
||||
PhutilSymbolLoader::loadClass('PhabricatorMetaMTADaemon');
|
||||
$daemon = new PhabricatorMetaMTADaemon();
|
||||
$daemon->run();
|
|
@ -565,6 +565,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorMailImplementationPHPMailerLiteAdapter' => 'PhabricatorMailImplementationAdapter',
|
||||
'PhabricatorMetaMTAController' => 'PhabricatorController',
|
||||
'PhabricatorMetaMTADAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorMetaMTADaemon' => 'PhabricatorDaemon',
|
||||
'PhabricatorMetaMTAListController' => 'PhabricatorMetaMTAController',
|
||||
'PhabricatorMetaMTAMail' => 'PhabricatorMetaMTADAO',
|
||||
'PhabricatorMetaMTAMailingList' => 'PhabricatorMetaMTADAO',
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
class PhabricatorMetaMTADaemon {
|
||||
class PhabricatorMetaMTADaemon extends PhabricatorDaemon {
|
||||
|
||||
public function run() {
|
||||
echo "OK. Sending mail";
|
||||
|
@ -29,7 +29,7 @@ class PhabricatorMetaMTADaemon {
|
|||
$message->sendNow();
|
||||
echo ".";
|
||||
}
|
||||
sleep(1);
|
||||
$this->sleep(1);
|
||||
} while (true);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
|
||||
phutil_require_module('phabricator', 'applications/metamta/storage/mail');
|
||||
phutil_require_module('phabricator', 'infrastructure/daemon/base');
|
||||
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
|
Loading…
Reference in a new issue