class PuSHEnvironment in Feeds 8.2
Provide environmental functions to the PuSHSubscriber library.
Hierarchy
- class \Drupal\feeds\PuSHEnvironment implements PuSHSubscriberEnvironmentInterface
Expanded class hierarchy of PuSHEnvironment
1 file declares its use of PuSHEnvironment
- FeedsHTTPFetcher.php in lib/
Drupal/ feeds/ Plugin/ feeds/ fetcher/ FeedsHTTPFetcher.php - Contains \Drupal\feeds\Plugin\feeds\fetcher\FeedsHTTPFetcher.
File
- lib/
Drupal/ feeds/ PuSHEnvironment.php, line 8
Namespace
Drupal\feedsView source
class PuSHEnvironment implements PuSHSubscriberEnvironmentInterface {
/**
* Singleton.
*/
public static function instance() {
static $env;
if (empty($env)) {
$env = new PuSHEnvironment();
}
return $env;
}
/**
* Implements PuSHSubscriberEnvironmentInterface::msg().
*/
public function msg($msg, $level = 'status') {
drupal_set_message(check_plain($msg), $level);
}
/**
* Implements PuSHSubscriberEnvironmentInterface::log().
*/
public function log($msg, $level = 'status') {
switch ($level) {
case 'error':
$severity = WATCHDOG_ERROR;
break;
case 'warning':
$severity = WATCHDOG_WARNING;
break;
default:
$severity = WATCHDOG_NOTICE;
break;
}
feeds_dbg($msg);
watchdog('FeedsHTTPFetcher', $msg, array(), $severity);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PuSHEnvironment:: |
public static | function | Singleton. | |
PuSHEnvironment:: |
public | function |
Implements PuSHSubscriberEnvironmentInterface::log(). Overrides PuSHSubscriberEnvironmentInterface:: |
|
PuSHEnvironment:: |
public | function |
Implements PuSHSubscriberEnvironmentInterface::msg(). Overrides PuSHSubscriberEnvironmentInterface:: |