\SendDog
SMS/Telegram/Email messages sending implementation
Synopsis
class SendDog
{
- // constants
- const URL_ME = '?module=senddog';
- const PID_PATH = 'exports/senddogrunning.pid';
- const SERVICES_LIB_PATH = 'api/vendor/senddog_classic_services/';
- // members
- protected array $altCfg = ;
- protected array $settings = ;
- protected $messages = '';
- protected $smsQueue = '';
- protected $ubConfig = NULL;
- protected array $servicesEnabled = ;
- protected array $activeServices = ;
- // methods
- public void __construct()
- protected void loadAltCfg()
- protected void setOptions()
- protected void preloadSmsServicesLibs()
- protected void loadServicesConfigs()
- protected void initSmsQueue()
- protected void initMessages()
- protected void loadBaseConfig()
- public string getBaseUrl()
- protected string safeEscapeString()
- protected void loadTelegramConfig()
- public string renderTelegramContacts()
- protected string newContact()
- protected string renderTelegramConfigInputs()
- public string renderConfigForm()
- public void saveConfig()
- public int emailProcessing()
- public int smsProcessing()
- public void smsHistoryProcessing()
- public int telegramProcessing()
- public static bool|mixed|string cutInternationalsFromPhoneNum()
- public void renderBalanceInfo()
Constants
Name | Value |
---|---|
URL_ME | '?module=senddog' |
PID_PATH | 'exports/senddogrunning.pid' |
SERVICES_LIB_PATH | 'api/vendor/senddog_classic_services/' |
Members
protected
- $activeServices
—
array
Active services objects array - $altCfg
—
array
Contains system alter config as key=>value - $messages
—
System message helper object placeholder - $servicesEnabled
—
array
Contains array of SMS services that will be loaded as serviceId=>serviceParams - $settings
—
array
Contains senddog config - $smsQueue
—
System SMS queue object placeholder - $ubConfig
—
null
Placeholder for UbillingConfig object
Methods
protected
- initMessages() — Inits message helper object for further usage
- initSmsQueue() — Inits system SMS queue object
- loadAltCfg() — Loads system alter config into protected property for further usage
- loadBaseConfig() — Loads basic send dog settings
- loadServicesConfigs() — Loads enabled SMS services data
- loadTelegramConfig() — Loads telegram config
- newContact() — Returns new contact marker
- preloadSmsServicesLibs() — Preloads all enabled SMS services libs and creates separate instances of each
- renderTelegramConfigInputs() — Returns set of inputs, required for SMS-Fly service configuration
- safeEscapeString() — Dirty input data filtering
- setOptions() — Loads required options and
public
- __construct()
- cutInternationalsFromPhoneNum() — Cuts international codes like "+38", "+7" from phone number This function might be supplemented with new country codes and refactored
- emailProcessing() — Loads and sends all email messages from system queue
- getBaseUrl() — Returns base module URL
- renderBalanceInfo() — Renders service balance or another misc info by its serviceId
- renderConfigForm() — Renders SendDog config interface
- renderTelegramContacts() — Renders current telegram bot contacts
- saveConfig() — Saves config in database
- smsHistoryProcessing() — Goes through sms_history table and checks statuses for messages
- smsProcessing() — Loads and sends all stored SMS from system queue
- telegramProcessing() — Loads and sends all stored Telegram messages from system queue