/** * Class Constructor - will initiate also the LangId.Py Client with the DEFAULT or CUSTOM connection. * * @param ARRAY $cfg :: *OPTIONAL* The Array of Configuration parameters - if not provided will use the DEFAULT config from config.php: $configs['langid']. * */ public function __construct($cfg = array()) { //-- $this->langid_service_cfg = array(); // reset $this->is_service_available = false; // reset //-- if (Smart::array_size($cfg) > 0) { // if config is specified, use it $this->langid_service_cfg = (array) $cfg; } else { // otherwise use the default config $this->langid_service_cfg = (array) Smart::get_from_config('langid'); } //end if else //-- // check for valid configuration array must not be done, if n/a then simply the service is n/a and will return negative value for confidence checks //-- }
/** * Get the value for a Config parameter from the app $configs array. * * @param ENUM $param :: The selected configuration parameter. * Examples: 'app.info-url' will get value from $configs['app']['info-url'] ; 'regional.decimal-separator' will get the value (string) from $configs['regional']['decimal-separator'] ; 'regional' will get the value (array) from $configs['regional'] * * @return MIXED :: The value for the selected parameter. If the Config parameter does not exists, will return an empty string. */ public final function ConfigParamGet($param) { //-- return Smart::get_from_config($param); // mixed //-- }