\OphanimFlow
OphanimFlow integration implementation
Synopsis
class OphanimFlow
{
- // constants
- const TABLE_TRAFFDATA = 'ophtraff';
- const API_ENDPOINT = '/?module=gettraff';
- const OPTION_ENABLED = 'OPHANIMFLOW_ENABLED';
- const OPTION_URLS = 'OPHANIMFLOW_URLS';
- const OPTION_DIMENSIONS = 'OPHANIM_DIMENSIONS';
- const PID_SYNC = 'OPHANIMTRAFF';
- // members
- protected array $altCfg = ;
- protected integer $currentYear = 0;
- protected integer $currentMonth = 0;
- protected $traffDb = '';
- protected array $traffStats = ;
- protected array $currentTraff = ;
- protected array $allUserIps = ;
- protected array $ophanimUrls = ;
- // methods
- public void __construct()
- protected void setDates()
- protected void initDb()
- protected void loadConfigs()
- protected void loadUserData()
- protected void loadTraffStats()
- protected void processOphanimTraff()
- public void traffDataProcessing()
- public array getUserCurMonthTraff()
- public array getUserAllTraff()
- public array getAllUsersAggrTraff()
Constants
Name | Value |
---|---|
TABLE_TRAFFDATA | 'ophtraff' |
API_ENDPOINT | '/?module=gettraff' |
OPTION_ENABLED | 'OPHANIMFLOW_ENABLED' |
OPTION_URLS | 'OPHANIMFLOW_URLS' |
OPTION_DIMENSIONS | 'OPHANIM_DIMENSIONS' |
PID_SYNC | 'OPHANIMTRAFF' |
Members
protected
- $allUserIps
—
array
Contains array of all existing users IPs as IP=>login - $altCfg
—
array
Contains alter config as key=>value - $currentMonth
—
int
Contains current month number without leading zero - $currentTraff
—
array
Contains current run traff - $currentYear
—
int
Contains current year - $ophanimUrls
—
array
Contains OphanimFlow URLs to pull traffic data as idx=>url - $traffDb
—
Traff stats database abstraction layer - $traffStats
—
array
Contains previously saved traffic stats as login=>id/login/month/year/d0/u0
Methods
protected
- initDb() — Inits database abstraction layer
- loadConfigs() — Load requred configs, sets some properties
- loadTraffStats() — Loads saved traff stats
- loadUserData() — Loads all reqired user data
- processOphanimTraff() — Preprocess fetched data and update local database records
- setDates() — Sets current instance dates info
public
- __construct()
- getAllUsersAggrTraff() — Returns all users current month aggregated traffic summ as login=>bytesCount
- getUserAllTraff() — Returns all of previous user traff data
- getUserCurMonthTraff() — Returns array of current month traffic for some user as D0/U0 array
- traffDataProcessing() — Fetches data from ophanimUrls and updates local db