Example #1
0
 /**
  * @param $token
  * @param string $ns
  * @return bool
  */
 public static function exists($token, $ns = 'default')
 {
     $result = isset(self::$_buffer[$ns]) && array_key_exists($token, self::$_buffer[$ns]);
     if (self::$debug) {
         ifw_debug(sprintf('%s: $token: %s, $ns: %s, $result: %s', __METHOD__, $token, $ns, $result ? 'true' : 'false'));
     }
     return $result;
 }
Example #2
0
 /**
  * Loads autoloader before other resources for convenience
  */
 protected function _initAutoloader()
 {
     if (!class_exists('IfwPsn_Wp_Autoloader')) {
         require_once $this->_pluginPathinfo->getRootLib() . 'IfwPsn/Wp/Autoloader.php';
     }
     if (!IfwPsn_Wp_Autoloader::init($this->_pluginPathinfo->getRootLib())) {
         ifw_debug('Autoloader error: Could not init ' . $this->_pluginPathinfo->getRootLib());
     }
     if (!IfwPsn_Wp_Autoloader::init($this->_pluginPathinfo->getRootAdminMenu())) {
         ifw_debug('Autoloader error: Could not init ' . $this->_pluginPathinfo->getRootAdminMenu());
     }
 }
Example #3
0
 /**
  * Debugs some essential plugin internal values
  */
 public function debug()
 {
     $output = PHP_EOL;
     $output .= 'Plugin env:' . PHP_EOL;
     $output .= sprintf('Environment: %s', $this->getEnvironmet()) . PHP_EOL;
     $output .= sprintf('display_errors: %s', ini_get('display_errors')) . PHP_EOL;
     $output .= sprintf('error_reporting: %s', error_reporting()) . PHP_EOL;
     $output .= sprintf('WP_DEBUG: %s', WP_DEBUG) . PHP_EOL;
     $output .= sprintf('WP_DEBUG_LOG: %s', WP_DEBUG_LOG) . PHP_EOL;
     $output .= sprintf('WP_DEBUG_DISPLAY: %s', WP_DEBUG_DISPLAY) . PHP_EOL;
     ifw_debug($output);
 }