Permalink
Browse files

Moved throttler and mailctl to classes/ folder

  • Loading branch information...
1 parent 3d5f905 commit 1676e84b01cba49cbb1e7c34400f184c0a6e7f64 Adrian Ancona Novelo committed Aug 18, 2010
View
6 ajax/ajax.mailingtest.php
@@ -55,7 +55,7 @@
if (SmartyValidate :: is_valid($_POST) && !$current) {
// __ FORM IS VALID
- require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+ require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
require_once(Pommo::$_baseDir.'classes/Pommo_Subscribers.php');
require_once(Pommo::$_baseDir.'classes/Pommo_Validate.php');
@@ -94,11 +94,11 @@
// populate queue
$queue = array($key);
- if(!PommoMailCtl::queueMake($queue))
+ if(!Pommo_Mail_Ctl::queueMake($queue))
$logger->addErr('Unable to Populate Queue');
// spawn mailer
- else if (!PommoMailCtl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?test=TRUE&code='.$code))
+ else if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?test=TRUE&code='.$code))
$logger->addErr('Unable to spawn background mailer');
else
$smarty->assign('sent',$_POST['email']);
View
2 ajax/mailings_send4.php
@@ -149,7 +149,7 @@
)
);
-$throttler =& new PommoThrottler(
+$throttler =& new Pommo_Throttler(
Pommo::$_session['throttler'][$tid]['base'],
Pommo::$_session['throttler'][$tid]['domainHistory'],
Pommo::$_session['throttler'][$tid]['sent'],
View
6 ajax/preview.php
@@ -23,7 +23,7 @@
*********************************/
require ('../bootstrap.php');
require_once(Pommo::$_baseDir.'classes/Pommo_Groups.php');
-require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
require_once(Pommo::$_baseDir.'classes/Pommo_Mailing.php');
Pommo::init();
@@ -126,10 +126,10 @@
$code = Pommo_Mailing::add($mailing);
- if(!PommoMailCtl::queueMake($memberIDs))
+ if(!Pommo_Mail_Ctl::queueMake($memberIDs))
$json->fail('Unable to populate queue');
- if (!PommoMailCtl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?code='.$code))
+ if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?code='.$code))
$json->fail('Unable to spawn background mailer');
// clear mailing composistion data from session
View
4 ajax/status_cmd.php
@@ -22,7 +22,7 @@
INITIALIZATION METHODS
*********************************/
require ('../bootstrap.php');
-require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
require_once(Pommo::$_baseDir.'classes/Pommo_Mailing.php');
Pommo::init();
@@ -51,7 +51,7 @@
$json->fail();
if($_GET['cmd'] == 'restart' || $_GET['cmd'] == 'cancel')
- PommoMailCtl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?id='.$mailing['id'].'&code='.$mailing['code']);
+ Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?id='.$mailing['id'].'&code='.$mailing['code']);
break;
}
$json->success();
View
10 inc/classes/mailctl.php → classes/Pommo_Mail_Ctl.php
@@ -18,7 +18,7 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-class PommoMailCtl {
+class Pommo_Mail_Ctl {
// populates the queue with subscribers
// accepts an array of subscriber IDs
@@ -151,7 +151,7 @@ function finish($id = 0, $cancel = false, $test = false) {
if ($test) { // remove if this was a test mailing
// remove all notices
- PommoMailCtl::delNotices($id,0);
+ Pommo_Mail_Ctl::delNotices($id,0);
// remove mailing from DB
$query = "
@@ -163,7 +163,7 @@ function finish($id = 0, $cancel = false, $test = false) {
else {
// shorten notices to last 50
- PommoMailCtl::delNotices($id);
+ Pommo_Mail_Ctl::delNotices($id);
// update mailing in DB
$query = "
@@ -205,7 +205,7 @@ function addNotices($id) {
}
// trim notices
- PommoMailCtl::delNotices($id);
+ Pommo_Mail_Ctl::delNotices($id);
}
// removes notices from a mailing
@@ -245,4 +245,4 @@ function delNotices($id, $keep = 50) {
return;
}
}
-?>
+?>
View
16 classes/Pommo_Mta.php
@@ -21,9 +21,9 @@
// poMMo MTA - poMMo's background mailer
// includes
-require_once(Pommo::$_baseDir. 'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir. 'classes/Pommo_Mail_Ctl.php');
require_once(Pommo::$_baseDir. 'inc/classes/mailer.php');
-require_once(Pommo::$_baseDir. 'inc/classes/throttler.php');
+require_once(Pommo::$_baseDir. 'classes/Pommo_Throttler.php');
require_once(Pommo::$_baseDir. 'classes/Pommo_Mailing.php');
require_once(Pommo::$_baseDir. 'classes/Pommo_Subscribers.php');
@@ -121,7 +121,7 @@ function Pommo_Mta($args = array()) {
$this->shutdown(Pommo::_T('Mailing Complete.'));
if(empty($this->_mailing['serial']))
- if (!PommoMailCtl::mark($this->_serial,$this->_id))
+ if (!Pommo_Mail_Ctl::mark($this->_serial,$this->_id))
$this->shutdown('Unable to serialize mailing (ID: '.$this->_id.' SERIAL: '.$this->_serial.')');
if($this->_maxRunTime < 15)
@@ -188,7 +188,7 @@ function poll() {
break;
case 'cancel':
- PommoMailCtl::finish($this->_id, true);
+ Pommo_Mail_Ctl::finish($this->_id, true);
$this->shutdown(Pommo::_T('Mailing Cancelled.'), true);
break;
@@ -381,7 +381,7 @@ function update() {
}
// add notices
- PommoMailCtl::addNotices($this->_id);
+ Pommo_Mail_Ctl::addNotices($this->_id);
// reset sent/failed
$this->_sent = $this->_failed = array();
@@ -398,19 +398,19 @@ function stop($finish = false) {
$this->_mailer->SmtpClose();
if ($this->_test) { // don't respawn if this is a test mailing
- PommoMailCtl::finish($this->_id,TRUE,TRUE);
+ Pommo_Mail_Ctl::finish($this->_id,TRUE,TRUE);
Pommo_Subscribers::delete(current($this->_hash));
session_destroy();
exit();
}
if($finish) {
- PommoMailCtl::finish($this->_id);
+ Pommo_Mail_Ctl::finish($this->_id);
$this->shutdown(Pommo::_T('Mailing Complete.'));
}
// respwn
- if (!PommoMailCtl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?'.
+ if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'ajax/mailings_send4.php?'.
'code='.$this->_code.
'&serial='.$this->_serial.
'&id='.$this->_id))
View
4 inc/classes/throttler.php → classes/Pommo_Throttler.php
@@ -22,7 +22,7 @@
// TODO -> This class needs rewritting -- better/clearer methods!
// NOTE: Due to lack of support for usleep in PHP < 5.0 on IIS/Windows, Throttling is limited to *seconds*
-class PommoThrottler {
+class Pommo_Throttler {
// THROTTLE VARIABLES, EXPLANATION
// -----------------------------------------------
@@ -162,7 +162,7 @@ class PommoThrottler {
// ------------------------------
// bThrottler() - simple initialization of class variables.
- function PommoThrottler($p = array(), & $history, &$sent, &$sentBytes) {
+ function Pommo_Throttler($p = array(), & $history, &$sent, &$sentBytes) {
global $pommo;
$this->logger =& Pommo::$_logger;
View
4 mailing.runtime.php
@@ -25,13 +25,13 @@
require ('bootstrap.php');
Pommo::init();
-require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
set_time_limit(0);
$code = Pommo_Helper::makeCode();
-if(!PommoMailCtl::spawn(Pommo::$_baseUrl.'mailing.runtime2.php?code='.$code))
+if(!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'mailing.runtime2.php?code='.$code))
Pommo::kill('Initial Spawn Failed! You must correct this before poMMo can send mailings.');
echo 'Initial Run Time: '.ini_get('max_execution_time').' seconds <br>';
View
4 mailing.test.php
@@ -25,15 +25,15 @@
require ('bootstrap.php');
Pommo::init();
-require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
echo 'Please Wait...';
ob_flush();
flush();
$code = Pommo_Helper::makeCode();
-if(!PommoMailCtl::spawn(Pommo::$_baseUrl.'mailing.test2.php?code='.$code,true))
+if(!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'mailing.test2.php?code='.$code,true))
Pommo::kill('Initial Spawn Failed! You must correct this before poMMo can send mailings.');
sleep(6);
View
4 mailing.test2.php
@@ -31,7 +31,7 @@
// ignore user abort
ignore_user_abort(true);
-require_once(Pommo::$_baseDir.'inc/classes/mailctl.php');
+require_once(Pommo::$_baseDir.'classes/Pommo_Mail_Ctl.php');
$code = (empty($_GET['code'])) ? null : $_GET['code'];
$spawn = (!isset($_GET['spawn'])) ? 0 : ($_GET['spawn'] + 1);
@@ -55,7 +55,7 @@
sleep(1);
// respawn test
-if (!PommoMailCtl::spawn(Pommo::$_baseUrl.'mailing.test2.php?'.
+if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl.'mailing.test2.php?'.
'code='.$code.
'&spawn='.$spawn,true)) {

0 comments on commit 1676e84

Please sign in to comment.