1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +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:
jungejason 2011-03-16 17:46:29 -07:00
parent 6aa006b903
commit e4fa1523bd
4 changed files with 4 additions and 30 deletions

View file

@ -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();

View file

@ -565,6 +565,7 @@ phutil_register_library_map(array(
'PhabricatorMailImplementationPHPMailerLiteAdapter' => 'PhabricatorMailImplementationAdapter', 'PhabricatorMailImplementationPHPMailerLiteAdapter' => 'PhabricatorMailImplementationAdapter',
'PhabricatorMetaMTAController' => 'PhabricatorController', 'PhabricatorMetaMTAController' => 'PhabricatorController',
'PhabricatorMetaMTADAO' => 'PhabricatorLiskDAO', 'PhabricatorMetaMTADAO' => 'PhabricatorLiskDAO',
'PhabricatorMetaMTADaemon' => 'PhabricatorDaemon',
'PhabricatorMetaMTAListController' => 'PhabricatorMetaMTAController', 'PhabricatorMetaMTAListController' => 'PhabricatorMetaMTAController',
'PhabricatorMetaMTAMail' => 'PhabricatorMetaMTADAO', 'PhabricatorMetaMTAMail' => 'PhabricatorMetaMTADAO',
'PhabricatorMetaMTAMailingList' => 'PhabricatorMetaMTADAO', 'PhabricatorMetaMTAMailingList' => 'PhabricatorMetaMTADAO',

View file

@ -16,7 +16,7 @@
* limitations under the License. * limitations under the License.
*/ */
class PhabricatorMetaMTADaemon { class PhabricatorMetaMTADaemon extends PhabricatorDaemon {
public function run() { public function run() {
echo "OK. Sending mail"; echo "OK. Sending mail";
@ -29,7 +29,7 @@ class PhabricatorMetaMTADaemon {
$message->sendNow(); $message->sendNow();
echo "."; echo ".";
} }
sleep(1); $this->sleep(1);
} while (true); } while (true);
} }

View file

@ -7,6 +7,7 @@
phutil_require_module('phabricator', 'applications/metamta/storage/mail'); phutil_require_module('phabricator', 'applications/metamta/storage/mail');
phutil_require_module('phabricator', 'infrastructure/daemon/base');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');