\Telepathy
Prophetic guessing login by the address/surname/realname
Synopsis
class Telepathy
{
- // constants
- const PHONE_CACHE_TIME = 86400;
- // members
- protected array $altCfg = ;
- protected array $alladdress = ;
- protected array $allrealnames = ;
- protected array $allsurnames = ;
- protected array $allMobiles = ;
- protected array $allExtMobiles = ;
- protected array $allPhones = ;
- protected array $allMobilesFull = ;
- protected array $allExtMobilesFull = ;
- protected array $allPhonesFull = ;
- protected bool $caseSensitive = false;
- protected bool $cachedAddress = true;
- protected bool $cachedPhones = false;
- protected bool $uniqLogin = false;
- protected boolean $citiesAddress = false;
- protected $cache = '';
- protected array $phoneTelepathyCache = ;
- // methods
- public void __construct()
- protected void loadConfig()
- protected void initCache()
- protected void loadAddress()
- protected void loadRealnames()
- protected string/void normalizePhoneFormat()
- public void usePhones()
- protected void surnamesExtract()
- public void useNames()
- protected void addressToLowerCase()
- public string getLogin()
- public string getBySurname()
- public string getByPhone()
- public string getByPhoneFast()
- public void savePhoneTelepathyCache()
- public void flushPhoneTelepathyCache()
Constants
Name | Value |
---|---|
PHONE_CACHE_TIME | 86400 |
Members
protected
- $allExtMobiles
—
array
Contains all available additional user mobiles - $allExtMobilesFull
—
array
Contains all available additional user mobiles with doubles - $allMobiles
—
array
Contains all available user mobiles - $allMobilesFull
—
array
Contains all available user mobiles with doubles - $allPhones
—
array
Contains all available user phones - $allPhonesFull
—
array
Contains all available user phones with doubles - $alladdress
—
array
Contains all available user address - $allrealnames
—
array
Contains all available users realnames - $allsurnames
—
array
Contains preprocessed users surnames - $altCfg
—
array
Contains system alter config as key=>value - $cache
—
System caching object placeholder - $cachedAddress
—
bool
Cached address usage flag - $cachedPhones
—
bool
Use phones caching or not? - $caseSensitive
—
bool
Case sensitivity flag - $citiesAddress
—
array
City display flag - $phoneTelepathyCache
—
array
Contains users previously detected by phone number as number=>login - $uniqLogin
—
bool
Return only uniq login when telepaty by phones
Methods
protected
- addressToLowerCase() — preprocess available address data into lower case
- initCache() — Inits system cache
- loadAddress() — Loads cached address data to private data property
- loadConfig() — Loads system alter.ini config into protected property for further usage
- loadRealnames() — Loads all user realnames from database into private prop
- normalizePhoneFormat() — Normalizes mobile number to +380 format.
- surnamesExtract() — Preprocess all user surnames into usable data
public
- __construct() — Creates new telepathy instance
- flushPhoneTelepathyCache() — Cleans phone telepathy cache
- getByPhone() — Get user login by some phone number
- getByPhoneFast() — Get user login by some phone number. After all calls you must finalize cache with savePhoneTelepathyCache().
- getBySurname() — returns user login by surname
- getLogin() — detects user login by its address
- savePhoneTelepathyCache() — Saves previously detected by phone logins cache
- useNames() — external passive constructor for name realname login detection
- usePhones() — Loads all existing phone data into protected props for further usage