@@ -337,7 +337,7 @@
// on changing the room status as disabled for some date range.....
$(document).on("change", ".room_status", function(){
var status_val = $(this).val();
- if (status_val == 3) {
+ if (status_val == rm_status.STATUS_TEMPORARY_INACTIVE.id) {
$(this).closest('.room_data_values').find('.room_comment, .deactiveDatesModal').toggle();
} else {
$(this).closest('.room_data_values').find('.room_comment').show();
diff --git a/classes/ConfigurationTest.php b/classes/ConfigurationTest.php
index fa5ff10e3..1723b902d 100644
--- a/classes/ConfigurationTest.php
+++ b/classes/ConfigurationTest.php
@@ -87,6 +87,7 @@ class ConfigurationTestCore
'config_dir' => 'config',
'files' => false,
'mails_dir' => 'mails',
+ 'openssl' => false,
'curl' => false,
'soap' => false,
'simplexml' => false,
@@ -113,7 +114,6 @@ class ConfigurationTestCore
'new_phpversion' => false,
'register_globals' => false,
'gz' => false,
- 'mcrypt' => false,
'mbstring' => false,
'magicquotes' => false,
'dom' => false,
@@ -145,12 +145,12 @@ class ConfigurationTestCore
public static function test_phpversion()
{
- return version_compare(substr(phpversion(), 0, 5), '5.4.0', '>=');
+ return version_compare(substr(phpversion(), 0, 5), '5.6.0', '>=');
}
public static function test_new_phpversion()
{
- return version_compare(substr(phpversion(), 0, 5), '5.4.0', '>=');
+ return version_compare(substr(phpversion(), 0, 5), '5.6.0', '>=');
}
public static function test_mysql_support()
@@ -400,9 +400,9 @@ class ConfigurationTestCore
return function_exists('mb_strtolower');
}
- public static function test_mcrypt()
+ public static function test_openssl()
{
- return function_exists('mcrypt_encrypt');
+ return function_exists('openssl_encrypt');
}
public static function test_sessions()
diff --git a/classes/Cookie.php b/classes/Cookie.php
index 89ee0ef6e..77115986a 100644
--- a/classes/Cookie.php
+++ b/classes/Cookie.php
@@ -76,7 +76,7 @@ class CookieCore
$this->_name = 'PrestaShop-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
$this->_allow_writing = true;
$this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
- $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
+ $this->_cipherTool = new PhpEncryption(_NEW_COOKIE_KEY_);
$this->_secure = (bool)$secure;
$this->update();
@@ -324,6 +324,11 @@ class CookieCore
*/
protected function _setcookie($cookie = null)
{
+ $length = (ini_get('mbstring.func_overload') & 2) ? mb_strlen($cookie, ini_get('default_charset')) : strlen($cookie);
+ if ($length >= 1048576) {
+ return false;
+ }
+
if ($cookie) {
$content = $this->_cipherTool->encrypt($cookie);
$time = $this->_expire;
diff --git a/classes/PhpEncryption.php b/classes/PhpEncryption.php
new file mode 100644
index 000000000..13d4fa7a1
--- /dev/null
+++ b/classes/PhpEncryption.php
@@ -0,0 +1,122 @@
+
+ * @copyright 2007-2018 PrestaShop SA
+ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+use Defuse\Crypto\Exception\EnvironmentIsBrokenException;
+
+/**
+ * Class PhpEncryptionCore for openSSL 1.0.1+.
+ */
+class PhpEncryptionCore
+{
+ const ENGINE = 'PhpEncryptionEngine';
+ const LEGACY_ENGINE = 'PhpEncryptionLegacyEngine';
+
+ private static $engine;
+
+ /**
+ * PhpEncryptionCore constructor.
+ *
+ * @param string $hexString A string that only contains hexadecimal characters
+ * Bother upper and lower case are allowed
+ */
+ public function __construct($hexString)
+ {
+ $engineClass = self::resolveEngineToUse();
+ self::$engine = new $engineClass($hexString);
+ }
+
+ /**
+ * Encrypt the plaintext.
+ *
+ * @param string $plaintext Plaintext
+ *
+ * @return string Cipher text
+ */
+ public function encrypt($plaintext)
+ {
+ return self::$engine->encrypt($plaintext);
+ }
+
+ /**
+ * Decrypt the cipher text.
+ *
+ * @param string $cipherText Cipher text
+ *
+ * @return bool|string Plaintext
+ * `false` if unable to decrypt
+ *
+ * @throws Exception
+ */
+ public function decrypt($cipherText)
+ {
+ return self::$engine->decrypt($cipherText);
+ }
+
+ /**
+ * @param $header
+ * @param $bytes
+ *
+ * @return string
+ *
+ * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException
+ */
+ public static function saveBytesToChecksummedAsciiSafeString($header, $bytes)
+ {
+ $engine = self::resolveEngineToUse();
+
+ return $engine::saveBytesToChecksummedAsciiSafeString($header, $bytes);
+ }
+
+ /**
+ * @return string
+ *
+ * @throws Exception
+ */
+ public static function createNewRandomKey()
+ {
+ $engine = self::resolveEngineToUse();
+
+ try {
+ $randomKey = $engine::createNewRandomKey();
+ } catch (EnvironmentIsBrokenException $exception) {
+ $buf = $engine::randomCompat();
+ $randomKey = $engine::saveToAsciiSafeString($buf);
+ }
+
+ return $randomKey;
+ }
+
+ /**
+ * Choose which engine use regarding the OpenSSL cipher methods available.
+ */
+ public static function resolveEngineToUse()
+ {
+ if (false === in_array(\Defuse\Crypto\Core::CIPHER_METHOD, openssl_get_cipher_methods())) {
+ return self::LEGACY_ENGINE;
+ }
+
+ return self::ENGINE;
+ }
+}
diff --git a/classes/PhpEncryptionEngine.php b/classes/PhpEncryptionEngine.php
new file mode 100644
index 000000000..3f496f4a2
--- /dev/null
+++ b/classes/PhpEncryptionEngine.php
@@ -0,0 +1,168 @@
+
+ * @copyright 2007-2018 PrestaShop SA
+ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+use Defuse\Crypto\Crypto;
+use Defuse\Crypto\Encoding;
+use Defuse\Crypto\Key;
+
+/**
+ * Class PhpEncryption engine for openSSL 1.0.1+.
+ */
+class PhpEncryptionEngineCore
+{
+ protected $key;
+
+ /**
+ * PhpEncryptionCore constructor.
+ *
+ * @param string $hexString A string that only contains hexadecimal characters
+ * Bother upper and lower case are allowed
+ */
+ public function __construct($hexString)
+ {
+ $this->key = self::loadFromAsciiSafeString($hexString);
+ }
+
+ /**
+ * Encrypt the plaintext.
+ *
+ * @param string $plaintext Plaintext
+ *
+ * @return string Cipher text
+ */
+ public function encrypt($plaintext)
+ {
+ return Crypto::encrypt($plaintext, $this->key);
+ }
+
+ /**
+ * Decrypt the cipher text.
+ *
+ * @param string $cipherText Cipher text
+ *
+ * @return bool|string Plaintext
+ * `false` if unable to decrypt
+ *
+ * @throws Exception
+ */
+ public function decrypt($cipherText)
+ {
+ try {
+ $plaintext = Crypto::decrypt($cipherText, $this->key);
+ } catch (Exception $e) {
+ if ($e instanceof \Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException) {
+ return false;
+ }
+
+ throw $e;
+ }
+
+ return $plaintext;
+ }
+
+ /**
+ * @param $header
+ * @param $bytes
+ *
+ * @return string
+ *
+ * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException
+ */
+ public static function saveBytesToChecksummedAsciiSafeString($header, $bytes)
+ {
+ return Encoding::saveBytesToChecksummedAsciiSafeString($header, $bytes);
+ }
+
+ /**
+ * @return string
+ */
+ public static function createNewRandomKey()
+ {
+ $key = Key::createNewRandomKey();
+
+ return $key->saveToAsciiSafeString();
+ }
+
+ /**
+ * @param $hexString
+ *
+ * @return Key
+ */
+ public static function loadFromAsciiSafeString($hexString)
+ {
+ return Key::loadFromAsciiSafeString($hexString);
+ }
+
+ /**
+ * @return string
+ *
+ * @throws Exception
+ *
+ * @see https://github.com/paragonie/random_compat/blob/v1.4.1/lib/random_bytes_openssl.php
+ * @see https://github.com/paragonie/random_compat/blob/v1.4.1/lib/random_bytes_mcrypt.php
+ */
+ public static function randomCompat()
+ {
+ $bytes = Key::KEY_BYTE_SIZE;
+
+ $secure = true;
+ $buf = openssl_random_pseudo_bytes($bytes, $secure);
+ if (
+ $buf !== false
+ &&
+ $secure
+ &&
+ RandomCompat_strlen($buf) === $bytes
+ ) {
+ return $buf;
+ }
+
+ $buf = @mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM);
+ if (
+ $buf !== false
+ &&
+ RandomCompat_strlen($buf) === $bytes
+ ) {
+ return $buf;
+ }
+
+ throw new Exception(
+ 'Could not gather sufficient random data'
+ );
+ }
+
+ /**
+ * @param $buf
+ *
+ * @return string
+ */
+ public static function saveToAsciiSafeString($buf)
+ {
+ return Encoding::saveBytesToChecksummedAsciiSafeString(
+ Key::KEY_CURRENT_VERSION,
+ $buf
+ );
+ }
+}
diff --git a/classes/PhpEncryptionLegacyEngine.php b/classes/PhpEncryptionLegacyEngine.php
new file mode 100644
index 000000000..3033024ca
--- /dev/null
+++ b/classes/PhpEncryptionLegacyEngine.php
@@ -0,0 +1,168 @@
+
+ * @copyright 2007-2018 PrestaShop SA
+ * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
+ * International Registered Trademark & Property of PrestaShop SA
+ */
+
+/**
+ * Class PhpEncryption engine for openSSL < 0.9.8.
+ *
+ * @doc http://php.net/manual/fr/function.mcrypt-encrypt.php#refsect1-function.mcrypt-encrypt-examples
+ *
+ * This class will be deprecated when web hosting providers will update their version of OpenSSL.
+ */
+class PhpEncryptionLegacyEngineCore extends PhpEncryptionEngine
+{
+ protected $key;
+ protected $hmacIv;
+ protected $iv;
+ protected $ivSize;
+
+ protected $mode = MCRYPT_MODE_CBC;
+ protected $cipher = MCRYPT_RIJNDAEL_128;
+
+ /**
+ * PhpEncryptionCore constructor.
+ *
+ * @param string $hexString A string that only contains hexadecimal characters
+ * Bother upper and lower case are allowed
+ */
+ public function __construct($hexString)
+ {
+ $this->key = substr($hexString, 0, 32);
+ $this->ivSize = mcrypt_get_iv_size($this->cipher, $this->mode);
+ $this->iv = mcrypt_create_iv($this->ivSize, MCRYPT_RAND);
+ $this->hmacIv = substr(sha1(_COOKIE_KEY_), 0, $this->ivSize);
+ }
+
+ /**
+ * Encrypt the plaintext.
+ *
+ * @param string $plaintext Plaintext
+ *
+ * @return string Cipher text
+ */
+ public function encrypt($plaintext)
+ {
+ $blockSize = mcrypt_get_block_size($this->cipher, $this->mode);
+ $pad = $blockSize - (strlen($plaintext) % $blockSize);
+
+ $cipherText = mcrypt_encrypt(
+ $this->cipher,
+ $this->key,
+ $plaintext . str_repeat(chr($pad), $pad),
+ $this->mode,
+ $this->iv
+ );
+ $cipherText = $this->iv . $cipherText;
+
+ return $this->generateHmac($cipherText) . ':' . base64_encode($cipherText);
+ }
+
+ /**
+ * Decrypt the cipher text.
+ *
+ * @param string $cipherText Cipher text
+ *
+ * @return bool|string Plaintext
+ * `false` if unable to decrypt
+ *
+ * @throws Exception
+ */
+ public function decrypt($cipherText)
+ {
+ $data = explode(':', $cipherText);
+ if (count($data) != 2) {
+ return false;
+ }
+
+ list($hmac, $encrypted) = $data;
+ $encrypted = base64_decode($encrypted);
+ $newHmac = $this->generateHmac($encrypted);
+ if ($hmac !== $newHmac) {
+ return false;
+ }
+
+ $ivDec = substr($encrypted, 0, $this->ivSize);
+ $cipherText = substr($encrypted, $this->ivSize);
+
+ $data = mcrypt_decrypt(
+ $this->cipher,
+ $this->key,
+ $cipherText,
+ $this->mode,
+ $ivDec
+ );
+
+ $pad = ord($data[strlen($data) - 1]);
+
+ return substr($data, 0, -$pad);
+ }
+
+ /**
+ * Generate Hmac.
+ *
+ * @param string $encrypted
+ *
+ * @return string
+ */
+ protected function generateHmac($encrypted)
+ {
+ $macKey = $this->generateKeygenS2k('sha256', $this->key, $this->hmacIv, 32);
+
+ return hash_hmac(
+ 'sha256',
+ $this->hmacIv . $this->cipher . $encrypted,
+ $macKey
+ );
+ }
+
+ /**
+ * Alternative to mhash_keygen_s2k for security reason
+ * and php compatibilities.
+ *
+ * @param string $hash
+ * @param string $password
+ * @param string $salt
+ * @param int $bytes
+ *
+ * @return string
+ */
+ protected function generateKeygenS2k($hash, $password, $salt, $bytes)
+ {
+ $result = '';
+ foreach (range(0, ceil($bytes / strlen(hash($hash, null, true))) - 1) as $i) {
+ $result .= hash(
+ $hash,
+ str_repeat("\0", $i) . str_pad(substr($salt, 0, 8), 8, "\0", STR_PAD_RIGHT) . $password,
+ true
+ );
+ }
+
+ return substr(
+ $result,
+ 0,
+ intval($bytes)
+ );
+ }
+}
diff --git a/classes/Rijndael.php b/classes/Rijndael.php
deleted file mode 100644
index 16edb83bb..000000000
--- a/classes/Rijndael.php
+++ /dev/null
@@ -1,157 +0,0 @@
-
-* @copyright 2007-2018 PrestaShop SA
-* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-class RijndaelCore
-{
- protected $_key;
- protected $_iv;
-
- public function __construct($key, $iv)
- {
- $this->_key = $key;
- $this->_iv = base64_decode($iv);
- }
-
- /**
- * Base64 is not required, but it is be more compact than urlencode
- *
- * @param string $plaintext
- * @return bool|string
- */
- public function encrypt($plaintext)
- {
- if (strlen($plaintext) >= 1048576) {
- return false;
- }
-
- $cipherText = null;
- if (function_exists('openssl_encrypt') && version_compare(phpversion(), '5.3.3', '>=')) {
- $cipherText = openssl_encrypt($plaintext, 'AES-128-CBC', $this->_key, OPENSSL_RAW_DATA, $this->_iv);
- } elseif (function_exists('mcrypt_encrypt')) {
- $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
- $blockSize = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $pad = $blockSize - (strlen($plaintext) % $blockSize);
-
- $cipherText = mcrypt_encrypt(
- MCRYPT_RIJNDAEL_128,
- $this->_key,
- $plaintext . str_repeat(chr($pad), $pad),
- MCRYPT_MODE_CBC,
- $iv
- );
- $cipherText = $iv.$cipherText;
- } else {
- throw new RuntimeException('Either Mcrypt or OpenSSL extension is required to run Prestashop');
- }
-
- return $this->generateHmac($cipherText) . ':' . base64_encode($cipherText);
- }
-
- public function decrypt($cipherText)
- {
- $data = explode(':', $cipherText);
- if (count($data) != 2) {
- return false;
- }
-
- list($hmac, $encrypted) = $data;
-
- $encrypted = base64_decode($encrypted);
- $newHmac = $this->generateHmac($encrypted);
- if ($hmac !== $newHmac) {
- return false;
- }
-
- $output = null;
- if (function_exists('openssl_decrypt') && version_compare(phpversion(), '5.3.3', '>=')) {
- $output = openssl_decrypt($encrypted, 'AES-128-CBC', $this->_key, OPENSSL_RAW_DATA, $this->_iv);
- } elseif (function_exists('mcrypt_decrypt')) {
- $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $ivDec = substr($encrypted, 0, $ivSize);
- $encrypted = substr($encrypted, $ivSize);
- $output = mcrypt_decrypt(
- MCRYPT_RIJNDAEL_128,
- $this->_key,
- $encrypted,
- MCRYPT_MODE_CBC,
- $ivDec
- );
- $pad = ord($output[strlen($output) - 1]);
- $output = substr($output, 0, -$pad);
- } else {
- throw new RuntimeException('Either Mcrypt or OpenSSL extension is required to run Prestashop');
- }
-
- return $output;
- }
-
- /**
- * Generate Hmac
- *
- * @param string $encrypted
- *
- * @return string
- */
- protected function generateHmac($encrypted)
- {
- $macKey = $this->generateKeygenS2k('sha256', $this->_key, $this->_iv, 32);
- return hash_hmac(
- 'sha256',
- $this->_iv . MCRYPT_RIJNDAEL_128 . $encrypted,
- $macKey
- );
- }
-
- /**
- * Alternative to mhash_keygen_s2k for security reason
- * and php compatibilities.
- *
- * @param string $hash
- * @param string $password
- * @param string $salt
- * @param integer $bytes
- *
- * @return string
- */
- protected function generateKeygenS2k($hash, $password, $salt, $bytes)
- {
- $result = '';
- foreach (range(0, ceil($bytes / strlen(hash($hash, null, true))) - 1) as $i) {
- $result .= hash(
- $hash,
- str_repeat("\0", $i) . str_pad(substr($salt, 0, 8), 8, "\0", STR_PAD_RIGHT) . $password,
- true
- );
- }
-
- return substr(
- $result,
- 0,
- intval($bytes)
- );
- }
-}
diff --git a/config/autoload.php b/config/autoload.php
index 20a6c05fa..0cfc7a14c 100644
--- a/config/autoload.php
+++ b/config/autoload.php
@@ -23,6 +23,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
+require_once (_PS_TOOL_DIR_.'defuse/php-encryption/defuse-crypto.phar');
// Include some alias functions
require_once(_PS_CONFIG_DIR_.'alias.php');
diff --git a/config/defines.inc.php b/config/defines.inc.php
index 899b1a0a8..9e7679fb1 100644
--- a/config/defines.inc.php
+++ b/config/defines.inc.php
@@ -107,7 +107,6 @@ if (!defined('_PS_GEOIP_DIR_')) {
if (!defined('_PS_GEOIP_CITY_FILE_')) {
define('_PS_GEOIP_CITY_FILE_', 'GeoLiteCity.dat');
}
-define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/');
define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/');
define('_PS_TAASC_PATH_', _PS_TOOL_DIR_.'taasc/');
define('_PS_TCPDF_PATH_', _PS_TOOL_DIR_.'tcpdf/');
diff --git a/controllers/admin/AdminInformationController.php b/controllers/admin/AdminInformationController.php
index 4c820f5e6..4f05a418f 100644
--- a/controllers/admin/AdminInformationController.php
+++ b/controllers/admin/AdminInformationController.php
@@ -127,9 +127,10 @@ class AdminInformationControllerCore extends AdminController
'fopen' => $this->l('Allow the PHP fopen() function on your server.'),
'register_globals' => $this->l('Set PHP "register_globals" option to "Off".'),
'gz' => $this->l('Enable GZIP compression on your server.'),
- 'files' => $this->l('Some PrestaShop files are missing from your server.'),
- 'new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by PrestaShop will be PHP 5.4. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.4 now!'), phpversion()),
+ 'files' => $this->l('Some QloApps files are missing from your server.'),
+ 'new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by QloApps will be PHP 5.4. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.4 now!'), phpversion()),
'pdo_mysql' => $this->l('PDO MySQL extension is not loaded')
+ 'openssl' => $this->l('PHP OpenSSL extension is not loaded'),
);
// Functions list to test with 'test_system'
diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php
index 3e5976b34..415196036 100644
--- a/controllers/admin/AdminPerformanceController.php
+++ b/controllers/admin/AdminPerformanceController.php
@@ -460,49 +460,6 @@ class AdminPerformanceControllerCore extends AdminController
$this->fields_value['_MEDIA_SERVER_3_'] = Configuration::get('PS_MEDIA_SERVER_3');
}
- public function initFieldsetCiphering()
- {
- $phpdoc_langs = array('en', 'zh', 'fr', 'de', 'ja', 'pl', 'ro', 'ru', 'fa', 'es', 'tr');
- $php_lang = in_array($this->context->language->iso_code, $phpdoc_langs) ? $this->context->language->iso_code : 'en';
-
- $warning_mcrypt = ' '.$this->l('(you must install the [a]Mcrypt extension[/a])');
- $warning_mcrypt = str_replace('[a]', '', $warning_mcrypt);
- $warning_mcrypt = str_replace('[/a]', '', $warning_mcrypt);
-
- if (defined('_RIJNDAEL_KEY_') && defined('_RIJNDAEL_IV_')) {
- $this->fields_form[5]['form'] = array(
-
- 'legend' => array(
- 'title' => $this->l('Ciphering'),
- 'icon' => 'icon-desktop'
- ),
- 'input' => array(
- array(
- 'type' => 'hidden',
- 'name' => 'ciphering_up'
- ),
- array(
- 'type' => 'radio',
- 'label' => $this->l('Algorithm'),
- 'name' => 'PS_CIPHER_ALGORITHM',
- 'values' => array(
- array(
- 'id' => 'PS_CIPHER_ALGORITHM_1',
- 'value' => 1,
- 'label' => $this->l('Use Rijndael with mcrypt lib.').(function_exists('mcrypt_encrypt') ? '' : $warning_mcrypt)
- ),
- )
- )
- ),
- 'submit' => array(
- 'title' => $this->l('Save')
- )
- );
- }
-
- $this->fields_value['PS_CIPHER_ALGORITHM'] = Configuration::get('PS_CIPHER_ALGORITHM');
- }
-
public function initFieldsetCaching()
{
$phpdoc_langs = array('en', 'zh', 'fr', 'de', 'ja', 'pl', 'ro', 'ru', 'fa', 'es', 'tr');
@@ -618,7 +575,6 @@ class AdminPerformanceControllerCore extends AdminController
if (!defined('_PS_HOST_MODE_')) {
$this->initFieldsetMediaServer();
- $this->initFieldsetCiphering();
$this->initFieldsetCaching();
}
@@ -840,51 +796,6 @@ class AdminPerformanceControllerCore extends AdminController
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
}
- if ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM')) {
- if ($this->tabAccess['edit'] === '1') {
- $algo = (int)Tools::getValue('PS_CIPHER_ALGORITHM');
- $prev_settings = file_get_contents(_PS_ROOT_DIR_.'/config/settings.inc.php');
- $new_settings = $prev_settings;
- if ($algo) {
- if (!function_exists('mcrypt_encrypt')) {
- $this->errors[] = Tools::displayError('The "Mcrypt" PHP extension is not activated on this server.');
- } else {
- if (!strstr($new_settings, '_RIJNDAEL_KEY_')) {
- $key_size = mcrypt_get_key_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $key = Tools::passwdGen($key_size);
- $new_settings = preg_replace(
- '/define\(\'_COOKIE_KEY_\', \'([a-z0-9=\/+-_]+)\'\);/i',
- 'define(\'_COOKIE_KEY_\', \'\1\');'."\n".'define(\'_RIJNDAEL_KEY_\', \''.$key.'\');',
- $new_settings
- );
- }
- if (!strstr($new_settings, '_RIJNDAEL_IV_')) {
- $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $iv = base64_encode(mcrypt_create_iv($iv_size, MCRYPT_RAND));
- $new_settings = preg_replace(
- '/define\(\'_COOKIE_IV_\', \'([a-z0-9=\/+-_]+)\'\);/i',
- 'define(\'_COOKIE_IV_\', \'\1\');'."\n".'define(\'_RIJNDAEL_IV_\', \''.$iv.'\');',
- $new_settings
- );
- }
- }
- }
- if (!count($this->errors)) {
- // If there is not settings file modification or if the backup and replacement of the settings file worked
- if ($new_settings == $prev_settings || (
- copy(_PS_ROOT_DIR_.'/config/settings.inc.php', _PS_ROOT_DIR_.'/config/settings.old.php')
- && (bool)file_put_contents(_PS_ROOT_DIR_.'/config/settings.inc.php', $new_settings)
- )) {
- Configuration::updateValue('PS_CIPHER_ALGORITHM', $algo);
- $redirectAdmin = true;
- } else {
- $this->errors[] = Tools::displayError('The settings file cannot be overwritten.');
- }
- }
- } else {
- $this->errors[] = Tools::displayError('You do not have permission to edit this.');
- }
- }
if ((bool)Tools::getValue('cache_up')) {
if ($this->tabAccess['edit'] === '1') {
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index de358ef20..f53d8e948 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -3324,8 +3324,8 @@ class AdminProductsControllerCore extends AdminController
$objHotelInfo = new HotelBranchInformation();
$hotelInfo = $objHotelInfo->hotelsNameAndId();
if ($hotelInfo) {
- $objRoomStatus = new HotelRoomStatus();
- $roomStatus = $objRoomStatus->getAllRoomStatus();
+ $objRoomInfo = new HotelRoomInformation();
+ $roomStatus = $objRoomInfo->getAllRoomStatus();
$objRoomType = new HotelRoomType();
if ($hotelRoomType = $objRoomType->getRoomTypeInfoByIdProduct($obj->id)) {
@@ -3334,12 +3334,11 @@ class AdminProductsControllerCore extends AdminController
$hotelFullInfo = $objHotelInfo->hotelBranchInfoById($hotelRoomType['id_hotel']);
$data->assign('htl_full_info', $hotelFullInfo);
- $objRoomInfo = new HotelRoomInformation();
$objRoomDisableDates = new HotelRoomDisableDates();
$hotelRoomInfo = $objRoomInfo->getHotelRoomInfo($obj->id, $hotelRoomType['id_hotel']);
if ($hotelRoomInfo) {
foreach ($hotelRoomInfo as &$room) {
- if ($room['id_status'] == 3) {
+ if ($room['id_status'] == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE) {
$disabledDates = $objRoomDisableDates->getRoomDisableDates($room['id']);
$room['disabled_dates_json'] = json_encode($disabledDates);
}
@@ -3493,7 +3492,7 @@ class AdminProductsControllerCore extends AdminController
//validate room status
$disableDtsArr = array();
foreach ($room_status as $key => $status) {
- if ($status == 3) {
+ if ($status == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE) {
$disableDtsArr[$key] = json_decode($disable_dates[$key], true);
$this->validateDisableDateRanges($disableDtsArr[$key]);
}
@@ -3529,7 +3528,7 @@ class AdminProductsControllerCore extends AdminController
$objRoomInfo->floor = $room_floor[$key];
$objRoomInfo->comment = $room_comment[$key];
if ($objRoomInfo->save()) {
- if ($room_status[$key] == 3) {
+ if ($room_status[$key] == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE) {
$objDisDts = new HotelRoomDisableDates();
$objDisDts->deleteRoomDisableDates($objRoomInfo->id);
if (isset($disableDtsArr[$key]) && $disableDtsArr[$key]) {
diff --git a/install/models/install.php b/install/models/install.php
index 5648853e9..96cafd57d 100644
--- a/install/models/install.php
+++ b/install/models/install.php
@@ -24,6 +24,8 @@
* International Registered Trademark & Property of PrestaShop SA
*/
+require_once (_PS_TOOL_DIR_.'defuse/php-encryption/defuse-crypto.phar');
+
class InstallModelInstall extends InstallAbstractModel
{
const SETTINGS_FILE = 'config/settings.inc.php';
@@ -69,6 +71,7 @@ class InstallModelInstall extends InstallAbstractModel
$this->setError($this->language->l('%s folder is not writable (check permissions)', dirname(self::SETTINGS_FILE)));
return false;
}
+ $key = \Defuse\Crypto\Key::createNewRandomKey();
// Generate settings content and write file
$settings_constants = array(
@@ -82,17 +85,12 @@ class InstallModelInstall extends InstallAbstractModel
'_PS_CACHE_ENABLED_' => '0',
'_COOKIE_KEY_' => Tools::passwdGen(56),
'_COOKIE_IV_' => Tools::passwdGen(8),
+ '_NEW_COOKIE_KEY_' => $key->saveToAsciiSafeString(),
'_PS_CREATION_DATE_' => date('Y-m-d'),
'_PS_VERSION_' => _PS_INSTALL_VERSION_,
'_QLOAPPS_VERSION_' => _QLO_INSTALL_VERSION_,
);
- // If mcrypt is activated, add Rijndael 128 configuration
- if (function_exists('mcrypt_encrypt')) {
- $settings_constants['_RIJNDAEL_KEY_'] = Tools::passwdGen(mcrypt_get_key_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC));
- $settings_constants['_RIJNDAEL_IV_'] = base64_encode(mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND));
- }
-
$settings_content = " $value) {
diff --git a/modules/blockrss/blockrss.php b/modules/blockrss/blockrss.php
index b302f4019..9e47d174d 100644
--- a/modules/blockrss/blockrss.php
+++ b/modules/blockrss/blockrss.php
@@ -27,8 +27,9 @@
if (!defined('_PS_VERSION_'))
exit;
-include_once(_PS_CLASS_DIR_.'../tools/pear/PEAR.php');
-include_once(_PS_PEAR_XML_PARSER_PATH_.'Parser.php');
+include_once _PS_CLASS_DIR_.'../tools/pear/PEAR.php';
+require_once dirname(__FILE__).'/vendor/autoload.php';
+
class Blockrss extends Module
{
diff --git a/modules/blockrss/vendor/autoload.php b/modules/blockrss/vendor/autoload.php
new file mode 100644
index 000000000..f3772b7aa
--- /dev/null
+++ b/modules/blockrss/vendor/autoload.php
@@ -0,0 +1,7 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see http://www.php-fig.org/psr/psr-0/
+ * @see http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ // PSR-4
+ private $prefixLengthsPsr4 = array();
+ private $prefixDirsPsr4 = array();
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ private $prefixesPsr0 = array();
+ private $fallbackDirsPsr0 = array();
+
+ private $useIncludePath = false;
+ private $classMap = array();
+ private $classMapAuthoritative = false;
+ private $missingClasses = array();
+ private $apcuPrefix;
+
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
+ }
+
+ return array();
+ }
+
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ (array) $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ (array) $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 base directories
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return bool|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ includeFile($file);
+
+ return true;
+ }
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+ include $file;
+}
diff --git a/modules/blockrss/vendor/composer/LICENSE b/modules/blockrss/vendor/composer/LICENSE
new file mode 100644
index 000000000..f27399a04
--- /dev/null
+++ b/modules/blockrss/vendor/composer/LICENSE
@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/modules/blockrss/vendor/composer/autoload_classmap.php b/modules/blockrss/vendor/composer/autoload_classmap.php
new file mode 100644
index 000000000..8b46d5171
--- /dev/null
+++ b/modules/blockrss/vendor/composer/autoload_classmap.php
@@ -0,0 +1,10 @@
+ $vendorDir . '/pear/pear_exception/PEAR/Exception.php',
+);
diff --git a/modules/blockrss/vendor/composer/autoload_namespaces.php b/modules/blockrss/vendor/composer/autoload_namespaces.php
new file mode 100644
index 000000000..f3dc5248f
--- /dev/null
+++ b/modules/blockrss/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,11 @@
+ array($vendorDir . '/pear/xml_feed_parser'),
+ 'Log' => array($vendorDir . '/pear/log'),
+);
diff --git a/modules/blockrss/vendor/composer/autoload_psr4.php b/modules/blockrss/vendor/composer/autoload_psr4.php
new file mode 100644
index 000000000..b265c64a2
--- /dev/null
+++ b/modules/blockrss/vendor/composer/autoload_psr4.php
@@ -0,0 +1,9 @@
+= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+ if ($useStaticLoader) {
+ require_once __DIR__ . '/autoload_static.php';
+
+ call_user_func(\Composer\Autoload\ComposerStaticInit573edf418ff486f71fdaa7e03e5841ca::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
+
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
+ }
+
+ $loader->register(true);
+
+ return $loader;
+ }
+}
diff --git a/modules/blockrss/vendor/composer/autoload_static.php b/modules/blockrss/vendor/composer/autoload_static.php
new file mode 100644
index 000000000..d4f3a4a4d
--- /dev/null
+++ b/modules/blockrss/vendor/composer/autoload_static.php
@@ -0,0 +1,38 @@
+
+ array (
+ 'XML' =>
+ array (
+ 0 => __DIR__ . '/..' . '/pear/xml_feed_parser',
+ ),
+ ),
+ 'L' =>
+ array (
+ 'Log' =>
+ array (
+ 0 => __DIR__ . '/..' . '/pear/log',
+ ),
+ ),
+ );
+
+ public static $classMap = array (
+ 'PEAR_Exception' => __DIR__ . '/..' . '/pear/pear_exception/PEAR/Exception.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixesPsr0 = ComposerStaticInit573edf418ff486f71fdaa7e03e5841ca::$prefixesPsr0;
+ $loader->classMap = ComposerStaticInit573edf418ff486f71fdaa7e03e5841ca::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/modules/blockrss/vendor/composer/include_paths.php b/modules/blockrss/vendor/composer/include_paths.php
new file mode 100644
index 000000000..abbc02ccf
--- /dev/null
+++ b/modules/blockrss/vendor/composer/include_paths.php
@@ -0,0 +1,12 @@
+
+* @copyright 2010-2021 Webkul IN
+* @license https://store.webkul.com/license.html
+*/
+
+header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Cache-Control: post-check=0, pre-check=0', false);
+header('Pragma: no-cache');
+
+header('Location: ../../../');
+exit;
diff --git a/modules/blockrss/vendor/composer/installed.json b/modules/blockrss/vendor/composer/installed.json
new file mode 100644
index 000000000..a01ae047d
--- /dev/null
+++ b/modules/blockrss/vendor/composer/installed.json
@@ -0,0 +1,166 @@
+[
+ {
+ "name": "pear/log",
+ "version": "1.13.3",
+ "version_normalized": "1.13.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pear/Log.git",
+ "reference": "21af0be11669194d72d88b5ee9d5f176dc75d9a3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pear/Log/zipball/21af0be11669194d72d88b5ee9d5f176dc75d9a3",
+ "reference": "21af0be11669194d72d88b5ee9d5f176dc75d9a3",
+ "shasum": ""
+ },
+ "require": {
+ "pear/pear_exception": "1.0.1 || 1.0.2",
+ "php": ">5.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "*"
+ },
+ "suggest": {
+ "pear/db": "Install optionally via your project's composer.json"
+ },
+ "time": "2021-05-04T23:51:30+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Log": "./"
+ },
+ "exclude-from-classmap": [
+ "/examples/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ ""
+ ],
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jon Parise",
+ "email": "jon@php.net",
+ "homepage": "http://www.indelible.org",
+ "role": "Developer"
+ }
+ ],
+ "description": "PEAR Logging Framework",
+ "homepage": "http://pear.github.io/Log/",
+ "keywords": [
+ "log",
+ "logging"
+ ]
+ },
+ {
+ "name": "pear/pear_exception",
+ "version": "v1.0.2",
+ "version_normalized": "1.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pear/PEAR_Exception.git",
+ "reference": "b14fbe2ddb0b9f94f5b24cf08783d599f776fff0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/b14fbe2ddb0b9f94f5b24cf08783d599f776fff0",
+ "reference": "b14fbe2ddb0b9f94f5b24cf08783d599f776fff0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "<9"
+ },
+ "time": "2021-03-21T15:43:46+00:00",
+ "type": "class",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "classmap": [
+ "PEAR/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "."
+ ],
+ "license": [
+ "BSD-2-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Helgi Thormar",
+ "email": "dufuz@php.net"
+ },
+ {
+ "name": "Greg Beaver",
+ "email": "cellog@php.net"
+ }
+ ],
+ "description": "The PEAR Exception base class.",
+ "homepage": "https://github.com/pear/PEAR_Exception",
+ "keywords": [
+ "exception"
+ ]
+ },
+ {
+ "name": "pear/xml_feed_parser",
+ "version": "v1.0.5",
+ "version_normalized": "1.0.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/pear/XML_Feed_Parser.git",
+ "reference": "d8ad454742acba786738b39cbcc7c10f7b57adbe"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/pear/XML_Feed_Parser/zipball/d8ad454742acba786738b39cbcc7c10f7b57adbe",
+ "reference": "d8ad454742acba786738b39cbcc7c10f7b57adbe",
+ "shasum": ""
+ },
+ "require": {
+ "pear/log": "*",
+ "pear/pear_exception": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "*"
+ },
+ "suggest": {
+ "ext-tidy": "May require the tidy PHP extension"
+ },
+ "time": "2019-02-11T14:09:14+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "XML": "./"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "include-path": [
+ "./"
+ ],
+ "license": [
+ "LGPL"
+ ],
+ "authors": [
+ {
+ "name": "James Stewart",
+ "email": "james@jystewart.net",
+ "role": "Lead"
+ }
+ ],
+ "description": "More info available on: http://pear.php.net/package/XML_Feed_Parser"
+ }
+]
diff --git a/modules/blockrss/vendor/index.php b/modules/blockrss/vendor/index.php
new file mode 100644
index 000000000..051e0122d
--- /dev/null
+++ b/modules/blockrss/vendor/index.php
@@ -0,0 +1,29 @@
+
+* @copyright 2010-2021 Webkul IN
+* @license https://store.webkul.com/license.html
+*/
+
+header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Cache-Control: post-check=0, pre-check=0', false);
+header('Pragma: no-cache');
+
+header('Location: ../../../');
+exit;
diff --git a/modules/blockrss/vendor/pear/index.php b/modules/blockrss/vendor/pear/index.php
new file mode 100644
index 000000000..051e0122d
--- /dev/null
+++ b/modules/blockrss/vendor/pear/index.php
@@ -0,0 +1,29 @@
+
+* @copyright 2010-2021 Webkul IN
+* @license https://store.webkul.com/license.html
+*/
+
+header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Cache-Control: post-check=0, pre-check=0', false);
+header('Pragma: no-cache');
+
+header('Location: ../../../');
+exit;
diff --git a/modules/blockrss/vendor/pear/log/.github/workflows/ci.yml b/modules/blockrss/vendor/pear/log/.github/workflows/ci.yml
new file mode 100644
index 000000000..5c17cfef6
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/.github/workflows/ci.yml
@@ -0,0 +1,29 @@
+---
+name: CI
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up PHP ${{ matrix.php-version }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-version }}
+ extensions: sqlite
+ ini-values: include_path=.:/usr/share/php
+ - name: Run tests
+ run: |
+ pear run-tests -d tests/
diff --git a/modules/blockrss/vendor/pear/log/.gitignore b/modules/blockrss/vendor/pear/log/.gitignore
new file mode 100644
index 000000000..1cb564d81
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/.gitignore
@@ -0,0 +1,18 @@
+
+# /
+/*.tgz
+
+# /docs/
+/docs/api
+
+# /tests/
+/tests/*.diff
+/tests/*.exp
+/tests/*.log
+/tests/*.out
+/tests/sqlite-log.db
+
+# composer related
+composer.lock
+composer.phar
+vendor
diff --git a/modules/blockrss/vendor/pear/log/LICENSE b/modules/blockrss/vendor/pear/log/LICENSE
new file mode 100644
index 000000000..18847aa36
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2001-2016 Jon Parise, Chuck Hagenbuch, and Jan Schneider.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/modules/blockrss/vendor/pear/log/Log.php b/modules/blockrss/vendor/pear/log/Log.php
new file mode 100644
index 000000000..b1c67a4da
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log.php
@@ -0,0 +1,872 @@
+
+ * @author Jon Parise
+ * @since Horde 1.3
+ * @package Log
+ */
+class Log
+{
+ /**
+ * Indicates whether or not the log can been opened / connected.
+ *
+ * @var boolean
+ * @access protected
+ */
+ var $_opened = false;
+
+ /**
+ * Instance-specific unique identification number.
+ *
+ * @var integer
+ * @access protected
+ */
+ var $_id = 0;
+
+ /**
+ * The label that uniquely identifies this set of log messages.
+ *
+ * @var string
+ * @access protected
+ */
+ var $_ident = '';
+
+ /**
+ * The default priority to use when logging an event.
+ *
+ * @var integer
+ * @access protected
+ */
+ var $_priority = PEAR_LOG_INFO;
+
+ /**
+ * The bitmask of allowed log levels.
+ *
+ * @var integer
+ * @access protected
+ */
+ var $_mask = PEAR_LOG_ALL;
+
+ /**
+ * Holds all Log_observer objects that wish to be notified of new messages.
+ *
+ * @var array
+ * @access protected
+ */
+ var $_listeners = array();
+
+ /**
+ * Starting depth to use when walking a backtrace in search of the
+ * function that invoked the log system.
+ *
+ * @var integer
+ * @access protected
+ */
+ var $_backtrace_depth = 0;
+
+ /**
+ * Maps canonical format keys to position arguments for use in building
+ * "line format" strings.
+ *
+ * @var array
+ * @access protected
+ */
+ var $_formatMap = array('%{timestamp}' => '%1$s',
+ '%{ident}' => '%2$s',
+ '%{priority}' => '%3$s',
+ '%{message}' => '%4$s',
+ '%{file}' => '%5$s',
+ '%{line}' => '%6$s',
+ '%{function}' => '%7$s',
+ '%{class}' => '%8$s',
+ '%\{' => '%%{');
+
+ public function __construct()
+ {
+ }
+
+ /**
+ * Attempts to return a concrete Log instance of type $handler.
+ *
+ * @param string $handler The type of concrete Log subclass to return.
+ * Attempt to dynamically include the code for
+ * this subclass. Currently, valid values are
+ * 'console', 'syslog', 'sql', 'file', and 'mcal'.
+ *
+ * @param string $name The name of the actually log file, table, or
+ * other specific store to use. Defaults to an
+ * empty string, with which the subclass will
+ * attempt to do something intelligent.
+ *
+ * @param string $ident The identity reported to the log system.
+ *
+ * @param array $conf A hash containing any additional configuration
+ * information that a subclass might need.
+ *
+ * @param int $level Log messages up to and including this level.
+ *
+ * @return object Log The newly created concrete Log instance, or
+ * null on an error.
+ * @access public
+ * @since Log 1.0
+ */
+ public static function factory($handler, $name = '', $ident = '',
+ $conf = array(), $level = PEAR_LOG_DEBUG)
+ {
+ $handler = strtolower($handler);
+ $class = 'Log_' . $handler;
+ $classfile = 'Log/' . $handler . '.php';
+
+ /*
+ * Attempt to include our version of the named class, but don't treat
+ * a failure as fatal. The caller may have already included their own
+ * version of the named class.
+ */
+ if (!class_exists($class, false)) {
+ include_once $classfile;
+ }
+
+ /* If the class exists, return a new instance of it. */
+ if (class_exists($class, false)) {
+ $obj = new $class($name, $ident, $conf, $level);
+ return $obj;
+ }
+
+ $null = null;
+ return $null;
+ }
+
+ /**
+ * Attempts to return a reference to a concrete Log instance of type
+ * $handler, only creating a new instance if no log instance with the same
+ * parameters currently exists.
+ *
+ * You should use this if there are multiple places you might create a
+ * logger, you don't want to create multiple loggers, and you don't want to
+ * check for the existance of one each time. The singleton pattern does all
+ * the checking work for you.
+ *
+ * You MUST call this method with the $var = &Log::singleton() syntax.
+ * Without the ampersand (&) in front of the method name, you will not get
+ * a reference, you will get a copy.
+ *
+ * @param string $handler The type of concrete Log subclass to return.
+ * Attempt to dynamically include the code for
+ * this subclass. Currently, valid values are
+ * 'console', 'syslog', 'sql', 'file', and 'mcal'.
+ *
+ * @param string $name The name of the actually log file, table, or
+ * other specific store to use. Defaults to an
+ * empty string, with which the subclass will
+ * attempt to do something intelligent.
+ *
+ * @param string $ident The identity reported to the log system.
+ *
+ * @param array $conf A hash containing any additional configuration
+ * information that a subclass might need.
+ *
+ * @param int $level Log messages up to and including this level.
+ *
+ * @return object Log The newly created concrete Log instance, or
+ * null on an error.
+ * @access public
+ * @since Log 1.0
+ */
+ public static function singleton($handler, $name = '', $ident = '',
+ $conf = array(), $level = PEAR_LOG_DEBUG)
+ {
+ static $instances;
+ if (!isset($instances)) $instances = array();
+
+ $signature = serialize(array($handler, $name, $ident, $conf, $level));
+ if (!isset($instances[$signature])) {
+ $instances[$signature] = Log::factory($handler, $name, $ident,
+ $conf, $level);
+ }
+
+ return $instances[$signature];
+ }
+
+ /**
+ * Abstract implementation of the open() method.
+ * @since Log 1.0
+ */
+ function open()
+ {
+ return false;
+ }
+
+ /**
+ * Abstract implementation of the close() method.
+ * @since Log 1.0
+ */
+ function close()
+ {
+ return false;
+ }
+
+ /**
+ * Abstract implementation of the flush() method.
+ * @since Log 1.8.2
+ */
+ function flush()
+ {
+ return false;
+ }
+
+ /**
+ * Abstract implementation of the log() method.
+ * @since Log 1.0
+ */
+ function log($message, $priority = null)
+ {
+ return false;
+ }
+
+ /**
+ * A convenience function for logging a emergency event. It will log a
+ * message at the PEAR_LOG_EMERG log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function emerg($message)
+ {
+ return $this->log($message, PEAR_LOG_EMERG);
+ }
+
+ /**
+ * A convenience function for logging an alert event. It will log a
+ * message at the PEAR_LOG_ALERT log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function alert($message)
+ {
+ return $this->log($message, PEAR_LOG_ALERT);
+ }
+
+ /**
+ * A convenience function for logging a critical event. It will log a
+ * message at the PEAR_LOG_CRIT log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function crit($message)
+ {
+ return $this->log($message, PEAR_LOG_CRIT);
+ }
+
+ /**
+ * A convenience function for logging a error event. It will log a
+ * message at the PEAR_LOG_ERR log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function err($message)
+ {
+ return $this->log($message, PEAR_LOG_ERR);
+ }
+
+ /**
+ * A convenience function for logging a warning event. It will log a
+ * message at the PEAR_LOG_WARNING log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function warning($message)
+ {
+ return $this->log($message, PEAR_LOG_WARNING);
+ }
+
+ /**
+ * A convenience function for logging a notice event. It will log a
+ * message at the PEAR_LOG_NOTICE log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function notice($message)
+ {
+ return $this->log($message, PEAR_LOG_NOTICE);
+ }
+
+ /**
+ * A convenience function for logging a information event. It will log a
+ * message at the PEAR_LOG_INFO log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function info($message)
+ {
+ return $this->log($message, PEAR_LOG_INFO);
+ }
+
+ /**
+ * A convenience function for logging a debug event. It will log a
+ * message at the PEAR_LOG_DEBUG log level.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ *
+ * @return boolean True if the message was successfully logged.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function debug($message)
+ {
+ return $this->log($message, PEAR_LOG_DEBUG);
+ }
+
+ /**
+ * Returns the string representation of the message data.
+ *
+ * If $message is an object, _extractMessage() will attempt to extract
+ * the message text using a known method (such as a PEAR_Error object's
+ * getMessage() method). If a known method, cannot be found, the
+ * serialized representation of the object will be returned.
+ *
+ * If the message data is already a string, it will be returned unchanged.
+ *
+ * @param mixed $message The original message data. This may be a
+ * string or any object.
+ *
+ * @return string The string representation of the message.
+ *
+ * @access protected
+ */
+ function _extractMessage($message)
+ {
+ /*
+ * If we've been given an object, attempt to extract the message using
+ * a known method. If we can't find such a method, default to the
+ * "human-readable" version of the object.
+ *
+ * We also use the human-readable format for arrays.
+ */
+ if (is_object($message)) {
+ if (method_exists($message, 'getmessage')) {
+ $message = $message->getMessage();
+ } else if (method_exists($message, 'tostring')) {
+ $message = $message->toString();
+ } else if (method_exists($message, '__tostring')) {
+ $message = (string)$message;
+ } else {
+ $message = var_export($message, true);
+ }
+ } else if (is_array($message)) {
+ if (isset($message['message'])) {
+ if (is_scalar($message['message'])) {
+ $message = $message['message'];
+ } else {
+ $message = var_export($message['message'], true);
+ }
+ } else {
+ $message = var_export($message, true);
+ }
+ } else if (is_bool($message) || $message === NULL) {
+ $message = var_export($message, true);
+ }
+
+ /* Otherwise, we assume the message is a string. */
+ return $message;
+ }
+
+ /**
+ * Using debug_backtrace(), returns the file, line, and enclosing function
+ * name of the source code context from which log() was invoked.
+ *
+ * @param int $depth The initial number of frames we should step
+ * back into the trace.
+ *
+ * @return array Array containing four strings: the filename, the line,
+ * the function name, and the class name from which log()
+ * was called.
+ *
+ * @access private
+ * @since Log 1.9.4
+ */
+ function _getBacktraceVars($depth)
+ {
+ /* Start by generating a backtrace from the current call (here). */
+ $bt = debug_backtrace();
+
+ /* Store some handy shortcuts to our previous frames. */
+ $bt0 = isset($bt[$depth]) ? $bt[$depth] : null;
+ $bt1 = isset($bt[$depth + 1]) ? $bt[$depth + 1] : null;
+
+ /*
+ * If we were ultimately invoked by the composite handler, we need to
+ * increase our depth one additional level to compensate.
+ */
+ $class = isset($bt1['class']) ? $bt1['class'] : null;
+ if ($class !== null && strcasecmp($class, 'Log_composite') == 0) {
+ $depth++;
+ $bt0 = isset($bt[$depth]) ? $bt[$depth] : null;
+ $bt1 = isset($bt[$depth + 1]) ? $bt[$depth + 1] : null;
+ $class = isset($bt1['class']) ? $bt1['class'] : null;
+ }
+
+ /*
+ * We're interested in the frame which invoked the log() function, so
+ * we need to walk back some number of frames into the backtrace. The
+ * $depth parameter tells us where to start looking. We go one step
+ * further back to find the name of the encapsulating function from
+ * which log() was called.
+ */
+ $file = isset($bt0) ? $bt0['file'] : null;
+ $line = isset($bt0) ? $bt0['line'] : 0;
+ $func = isset($bt1) ? $bt1['function'] : null;
+
+ /*
+ * However, if log() was called from one of our "shortcut" functions,
+ * we're going to need to go back an additional step.
+ */
+ if (in_array($func, array('emerg', 'alert', 'crit', 'err', 'warning',
+ 'notice', 'info', 'debug'))) {
+ $bt2 = isset($bt[$depth + 2]) ? $bt[$depth + 2] : null;
+
+ $file = is_array($bt1) ? $bt1['file'] : null;
+ $line = is_array($bt1) ? $bt1['line'] : 0;
+ $func = is_array($bt2) ? $bt2['function'] : null;
+ $class = isset($bt2['class']) ? $bt2['class'] : null;
+ }
+
+ /*
+ * If we couldn't extract a function name (perhaps because we were
+ * executed from the "main" context), provide a default value.
+ */
+ if ($func === null) {
+ $func = '(none)';
+ }
+
+ /* Return a 4-tuple containing (file, line, function, class). */
+ return array($file, $line, $func, $class);
+ }
+
+ /**
+ * Sets the starting depth to use when walking a backtrace in search of
+ * the function that invoked the log system. This is used on conjunction
+ * with the 'file', 'line', 'function', and 'class' formatters.
+ *
+ * @param int $depth The new backtrace depth.
+ *
+ * @access public
+ * @since Log 1.12.7
+ */
+ public function setBacktraceDepth($depth)
+ {
+ $this->_backtrace_depth = $depth;
+ }
+
+ /**
+ * Produces a formatted log line based on a format string and a set of
+ * variables representing the current log record and state.
+ *
+ * @return string Formatted log string.
+ *
+ * @access protected
+ * @since Log 1.9.4
+ */
+ function _format($format, $timestamp, $priority, $message)
+ {
+ /*
+ * If the format string references any of the backtrace-driven
+ * variables (%5 %6,%7,%8), generate the backtrace and fetch them.
+ */
+ if (preg_match('/%[5678]/', $format)) {
+ /* Plus 2 to account for our internal function calls. */
+ $d = $this->_backtrace_depth + 2;
+ list($file, $line, $func, $class) = $this->_getBacktraceVars($d);
+ }
+
+ /*
+ * Build the formatted string. We use the sprintf() function's
+ * "argument swapping" capability to dynamically select and position
+ * the variables which will ultimately appear in the log string.
+ */
+ return sprintf($format,
+ $timestamp,
+ $this->_ident,
+ $this->priorityToString($priority),
+ $message,
+ isset($file) ? $file : '',
+ isset($line) ? $line : '',
+ isset($func) ? $func : '',
+ isset($class) ? $class : '');
+ }
+
+ /**
+ * Returns the string representation of a PEAR_LOG_* integer constant.
+ *
+ * @param int $priority A PEAR_LOG_* integer constant.
+ *
+ * @return string The string representation of $level.
+ *
+ * @access public
+ * @since Log 1.0
+ */
+ function priorityToString($priority)
+ {
+ $levels = array(
+ PEAR_LOG_EMERG => 'emergency',
+ PEAR_LOG_ALERT => 'alert',
+ PEAR_LOG_CRIT => 'critical',
+ PEAR_LOG_ERR => 'error',
+ PEAR_LOG_WARNING => 'warning',
+ PEAR_LOG_NOTICE => 'notice',
+ PEAR_LOG_INFO => 'info',
+ PEAR_LOG_DEBUG => 'debug'
+ );
+
+ return $levels[$priority];
+ }
+
+ /**
+ * Returns the the PEAR_LOG_* integer constant for the given string
+ * representation of a priority name. This function performs a
+ * case-insensitive search.
+ *
+ * @param string $name String containing a priority name.
+ *
+ * @return string The PEAR_LOG_* integer contstant corresponding
+ * the the specified priority name.
+ *
+ * @access public
+ * @since Log 1.9.0
+ */
+ function stringToPriority($name)
+ {
+ $levels = array(
+ 'emergency' => PEAR_LOG_EMERG,
+ 'alert' => PEAR_LOG_ALERT,
+ 'critical' => PEAR_LOG_CRIT,
+ 'error' => PEAR_LOG_ERR,
+ 'warning' => PEAR_LOG_WARNING,
+ 'notice' => PEAR_LOG_NOTICE,
+ 'info' => PEAR_LOG_INFO,
+ 'debug' => PEAR_LOG_DEBUG
+ );
+
+ return $levels[strtolower($name)];
+ }
+
+ /**
+ * Calculate the log mask for the given priority.
+ *
+ * This method may be called statically.
+ *
+ * @param integer $priority The priority whose mask will be calculated.
+ *
+ * @return integer The calculated log mask.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ public static function MASK($priority)
+ {
+ return (1 << $priority);
+ }
+
+ /**
+ * Calculate the log mask for all priorities up to the given priority.
+ *
+ * This method may be called statically.
+ *
+ * @param integer $priority The maximum priority covered by this mask.
+ *
+ * @return integer The resulting log mask.
+ *
+ * @access public
+ * @since Log 1.7.0
+ *
+ * @deprecated deprecated since Log 1.9.4; use Log::MAX() instead
+ */
+ public static function UPTO($priority)
+ {
+ return Log::MAX($priority);
+ }
+
+ /**
+ * Calculate the log mask for all priorities greater than or equal to the
+ * given priority. In other words, $priority will be the lowest priority
+ * matched by the resulting mask.
+ *
+ * This method may be called statically.
+ *
+ * @param integer $priority The minimum priority covered by this mask.
+ *
+ * @return integer The resulting log mask.
+ *
+ * @access public
+ * @since Log 1.9.4
+ */
+ public static function MIN($priority)
+ {
+ return PEAR_LOG_ALL ^ ((1 << $priority) - 1);
+ }
+
+ /**
+ * Calculate the log mask for all priorities less than or equal to the
+ * given priority. In other words, $priority will be the highests priority
+ * matched by the resulting mask.
+ *
+ * This method may be called statically.
+ *
+ * @param integer $priority The maximum priority covered by this mask.
+ *
+ * @return integer The resulting log mask.
+ *
+ * @access public
+ * @since Log 1.9.4
+ */
+ public static function MAX($priority)
+ {
+ return ((1 << ($priority + 1)) - 1);
+ }
+
+ /**
+ * Set and return the level mask for the current Log instance.
+ *
+ * @param integer $mask A bitwise mask of log levels.
+ *
+ * @return integer The current level mask.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function setMask($mask)
+ {
+ $this->_mask = $mask;
+
+ return $this->_mask;
+ }
+
+ /**
+ * Returns the current level mask.
+ *
+ * @return integer The current level mask.
+ *
+ * @access public
+ * @since Log 1.7.0
+ */
+ function getMask()
+ {
+ return $this->_mask;
+ }
+
+ /**
+ * Check if the given priority is included in the current level mask.
+ *
+ * @param integer $priority The priority to check.
+ *
+ * @return boolean True if the given priority is included in the current
+ * log mask.
+ *
+ * @access protected
+ * @since Log 1.7.0
+ */
+ function _isMasked($priority)
+ {
+ return (Log::MASK($priority) & $this->_mask);
+ }
+
+ /**
+ * Returns the current default priority.
+ *
+ * @return integer The current default priority.
+ *
+ * @access public
+ * @since Log 1.8.4
+ */
+ function getPriority()
+ {
+ return $this->_priority;
+ }
+
+ /**
+ * Sets the default priority to the specified value.
+ *
+ * @param integer $priority The new default priority.
+ *
+ * @access public
+ * @since Log 1.8.4
+ */
+ function setPriority($priority)
+ {
+ $this->_priority = $priority;
+ }
+
+ /**
+ * Adds a Log_observer instance to the list of observers that are listening
+ * for messages emitted by this Log instance.
+ *
+ * @param object $observer The Log_observer instance to attach as a
+ * listener.
+ *
+ * @return boolean True if the observer is successfully attached.
+ *
+ * @access public
+ * @since Log 1.0
+ */
+ function attach(&$observer)
+ {
+ if (!is_a($observer, 'Log_observer')) {
+ return false;
+ }
+
+ $this->_listeners[$observer->_id] = &$observer;
+
+ return true;
+ }
+
+ /**
+ * Removes a Log_observer instance from the list of observers.
+ *
+ * @param object $observer The Log_observer instance to detach from
+ * the list of listeners.
+ *
+ * @return boolean True if the observer is successfully detached.
+ *
+ * @access public
+ * @since Log 1.0
+ */
+ function detach($observer)
+ {
+ if (!is_a($observer, 'Log_observer') ||
+ !isset($this->_listeners[$observer->_id])) {
+ return false;
+ }
+
+ unset($this->_listeners[$observer->_id]);
+
+ return true;
+ }
+
+ /**
+ * Informs each registered observer instance that a new message has been
+ * logged.
+ *
+ * @param array $event A hash describing the log event.
+ *
+ * @access protected
+ */
+ function _announce($event)
+ {
+ foreach ($this->_listeners as $id => $listener) {
+ if ($event['priority'] <= $this->_listeners[$id]->_priority) {
+ $this->_listeners[$id]->notify($event);
+ }
+ }
+ }
+
+ /**
+ * Indicates whether this is a composite class.
+ *
+ * @return boolean True if this is a composite class.
+ *
+ * @access public
+ * @since Log 1.0
+ */
+ function isComposite()
+ {
+ return false;
+ }
+
+ /**
+ * Sets this Log instance's identification string.
+ *
+ * @param string $ident The new identification string.
+ *
+ * @access public
+ * @since Log 1.6.3
+ */
+ function setIdent($ident)
+ {
+ $this->_ident = $ident;
+ }
+
+ /**
+ * Returns the current identification string.
+ *
+ * @return string The current Log instance's identification string.
+ *
+ * @access public
+ * @since Log 1.6.3
+ */
+ function getIdent()
+ {
+ return $this->_ident;
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/composite.php b/modules/blockrss/vendor/pear/log/Log/composite.php
new file mode 100644
index 000000000..41fcd943a
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/composite.php
@@ -0,0 +1,274 @@
+
+ * @author Jon Parise
+ *
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example composite.php Using the composite handler.
+ */
+class Log_composite extends Log
+{
+ /**
+ * Array holding all of the Log instances to which log events should be
+ * sent.
+ *
+ * @var array
+ * @access private
+ */
+ var $_children = array();
+
+
+ /**
+ * Constructs a new composite Log object.
+ *
+ * @param string $name This parameter is ignored.
+ * @param string $ident This parameter is ignored.
+ * @param array $conf This parameter is ignored.
+ * @param int $level This parameter is ignored.
+ *
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_ident = $ident;
+ }
+
+ /**
+ * Opens all of the child instances.
+ *
+ * @return True if all of the child instances were successfully opened.
+ *
+ * @access public
+ */
+ function open()
+ {
+ /* Attempt to open each of our children. */
+ $this->_opened = true;
+ foreach ($this->_children as $child) {
+ $this->_opened &= $child->open();
+ }
+
+ /* If all children were opened, return success. */
+ return $this->_opened;
+ }
+
+ /**
+ * Closes all open child instances.
+ *
+ * @return True if all of the opened child instances were successfully
+ * closed.
+ *
+ * @access public
+ */
+ function close()
+ {
+ /* If we haven't been opened, there's nothing more to do. */
+ if (!$this->_opened) {
+ return true;
+ }
+
+ /* Attempt to close each of our children. */
+ $closed = true;
+ foreach ($this->_children as $child) {
+ if ($child->_opened) {
+ $closed &= $child->close();
+ }
+ }
+
+ /* Clear the opened state for consistency. */
+ $this->_opened = false;
+
+ /* If all children were closed, return success. */
+ return $closed;
+ }
+
+ /**
+ * Flushes all child instances. It is assumed that all of the children
+ * have been successfully opened.
+ *
+ * @return True if all of the child instances were successfully flushed.
+ *
+ * @access public
+ * @since Log 1.8.2
+ */
+ function flush()
+ {
+ /* Attempt to flush each of our children. */
+ $flushed = true;
+ foreach ($this->_children as $child) {
+ $flushed &= $child->flush();
+ }
+
+ /* If all children were flushed, return success. */
+ return $flushed;
+ }
+
+ /**
+ * Sends $message and $priority to each child of this composite. If the
+ * appropriate children aren't already open, they will be opened here.
+ *
+ * @param mixed $message String or object containing the message
+ * to log.
+ * @param string $priority (optional) The priority of the message.
+ * Valid values are: PEAR_LOG_EMERG,
+ * PEAR_LOG_ALERT, PEAR_LOG_CRIT,
+ * PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and
+ * PEAR_LOG_DEBUG.
+ *
+ * @return boolean True if the entry is successfully logged.
+ *
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /*
+ * Abort early if the priority is above the composite handler's
+ * maximum logging level.
+ *
+ * XXX: Consider whether or not introducing this change would break
+ * backwards compatibility. Some users may be expecting composite
+ * handlers to pass on all events to their children regardless of
+ * their own priority.
+ */
+ #if (!$this->_isMasked($priority)) {
+ # return false;
+ #}
+
+ /*
+ * Iterate over all of our children. If a unopened child will respond
+ * to this log event, we attempt to open it immediately. The composite
+ * handler's opened state will be enabled as soon as the first child
+ * handler is successfully opened.
+ *
+ * We track an overall success state that indicates whether or not all
+ * of the relevant child handlers were opened and successfully logged
+ * the event. If one handler fails, we still attempt any remaining
+ * children, but we consider the overall result a failure.
+ */
+ $success = true;
+ foreach ($this->_children as $child) {
+ /* If this child won't respond to this event, skip it. */
+ if (!$child->_isMasked($priority)) {
+ continue;
+ }
+
+ /* If this child has yet to be opened, attempt to do so now. */
+ if (!$child->_opened) {
+ $success &= $child->open();
+
+ /*
+ * If we've successfully opened our first handler, the
+ * composite handler itself is considered to be opened.
+ */
+ if (!$this->_opened && $success) {
+ $this->_opened = true;
+ }
+ }
+
+ /* Finally, attempt to log the message to the child handler. */
+ if ($child->_opened) {
+ $success &= $child->log($message, $priority);
+ }
+ }
+
+ /* Notify the observers. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ /* Return success if all of the open children logged the event. */
+ return $success;
+ }
+
+ /**
+ * Returns true if this is a composite.
+ *
+ * @return boolean True if this is a composite class.
+ *
+ * @access public
+ */
+ function isComposite()
+ {
+ return true;
+ }
+
+ /**
+ * Sets this identification string for all of this composite's children.
+ *
+ * @param string $ident The new identification string.
+ *
+ * @access public
+ * @since Log 1.6.7
+ */
+ function setIdent($ident)
+ {
+ /* Call our base class's setIdent() method. */
+ parent::setIdent($ident);
+
+ /* ... and then call setIdent() on all of our children. */
+ foreach ($this->_children as $child) {
+ $child->setIdent($ident);
+ }
+ }
+
+ /**
+ * Adds a Log instance to the list of children.
+ *
+ * @param object $child The Log instance to add.
+ *
+ * @return boolean True if the Log instance was successfully added.
+ *
+ * @access public
+ */
+ function addChild(&$child)
+ {
+ /* Make sure this is a Log instance. */
+ if (!is_a($child, 'Log')) {
+ return false;
+ }
+
+ $this->_children[$child->_id] = $child;
+
+ return true;
+ }
+
+ /**
+ * Removes a Log instance from the list of children.
+ *
+ * @param object $child The Log instance to remove.
+ *
+ * @return boolean True if the Log instance was successfully removed.
+ *
+ * @access public
+ */
+ function removeChild($child)
+ {
+ if (!is_a($child, 'Log') || !isset($this->_children[$child->_id])) {
+ return false;
+ }
+
+ unset($this->_children[$child->_id]);
+
+ return true;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/console.php b/modules/blockrss/vendor/pear/log/Log/console.php
new file mode 100644
index 000000000..4b5ec85b4
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/console.php
@@ -0,0 +1,222 @@
+
+ * @since Log 1.1
+ * @package Log
+ *
+ * @example console.php Using the console handler.
+ */
+class Log_console extends Log
+{
+ /**
+ * Handle to the current output stream.
+ * @var resource
+ * @access private
+ */
+ var $_stream = null;
+
+ /**
+ * Is this object responsible for closing the stream resource?
+ * @var bool
+ * @access private
+ */
+ var $_closeResource = false;
+
+ /**
+ * Should the output be buffered or displayed immediately?
+ * @var string
+ * @access private
+ */
+ var $_buffering = false;
+
+ /**
+ * String holding the buffered output.
+ * @var string
+ * @access private
+ */
+ var $_buffer = '';
+
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * Constructs a new Log_console object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (!empty($conf['stream'])) {
+ $this->_stream = $conf['stream'];
+ } elseif (defined('STDOUT')) {
+ $this->_stream = STDOUT;
+ } else {
+ $this->_stream = fopen('php://output', 'a');
+ $this->_closeResource = true;
+ }
+
+ if (isset($conf['buffering'])) {
+ $this->_buffering = $conf['buffering'];
+ }
+
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+
+ /*
+ * If output buffering has been requested, we need to register a
+ * shutdown function that will dump the buffer upon termination.
+ */
+ if ($this->_buffering) {
+ register_shutdown_function(array(&$this, '_Log_console'));
+ }
+ }
+
+ /**
+ * Destructor
+ */
+ function _Log_console()
+ {
+ $this->close();
+ }
+
+ /**
+ * Open the output stream.
+ *
+ * @access public
+ * @since Log 1.9.7
+ */
+ function open()
+ {
+ $this->_opened = true;
+ return true;
+ }
+
+ /**
+ * Closes the output stream.
+ *
+ * This results in a call to flush().
+ *
+ * @access public
+ * @since Log 1.9.0
+ */
+ function close()
+ {
+ $this->flush();
+ $this->_opened = false;
+ if ($this->_closeResource === true && is_resource($this->_stream)) {
+ fclose($this->_stream);
+ }
+ return true;
+ }
+
+ /**
+ * Flushes all pending ("buffered") data to the output stream.
+ *
+ * @access public
+ * @since Log 1.8.2
+ */
+ function flush()
+ {
+ /*
+ * If output buffering is enabled, dump the contents of the buffer to
+ * the output stream.
+ */
+ if ($this->_buffering && (strlen($this->_buffer) > 0)) {
+ fwrite($this->_stream, $this->_buffer);
+ $this->_buffer = '';
+ }
+
+ if (is_resource($this->_stream)) {
+ return fflush($this->_stream);
+ }
+
+ return false;
+ }
+
+ /**
+ * Writes $message to the text console. Also, passes the message
+ * along to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build the string containing the complete log line. */
+ $line = $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority, $message) . "\n";
+
+ /*
+ * If buffering is enabled, append this line to the output buffer.
+ * Otherwise, print the line to the output stream immediately.
+ */
+ if ($this->_buffering) {
+ $this->_buffer .= $line;
+ } else {
+ fwrite($this->_stream, $line);
+ }
+
+ /* Notify observers about this log message. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/daemon.php b/modules/blockrss/vendor/pear/log/Log/daemon.php
new file mode 100644
index 000000000..6a24d2bf8
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/daemon.php
@@ -0,0 +1,234 @@
+
+ * @version $Revision$
+ * @package Log
+ */
+class Log_daemon extends Log
+{
+ /**
+ * Integer holding the log facility to use.
+ * @var string
+ */
+ var $_name = LOG_DAEMON;
+
+ /**
+ * Var holding the resource pointer to the socket
+ * @var resource
+ */
+ var $_socket;
+
+ /**
+ * The ip address or servername
+ * @see http://www.php.net/manual/en/transports.php
+ * @var string
+ */
+ var $_ip = '127.0.0.1';
+
+ /**
+ * Protocol to use (tcp, udp, etc.)
+ * @see http://www.php.net/manual/en/transports.php
+ * @var string
+ */
+ var $_proto = 'udp';
+
+ /**
+ * Port to connect to
+ * @var int
+ */
+ var $_port = 514;
+
+ /**
+ * Maximum message length in bytes
+ * @var int
+ */
+ var $_maxsize = 4096;
+
+ /**
+ * Socket timeout in seconds
+ * @var int
+ */
+ var $_timeout = 1;
+
+ /**
+ * Constructs a new syslog object.
+ *
+ * @param string $name The syslog facility.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Maximum level at which to log.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ /* Ensure we have a valid integer value for $name. */
+ if (empty($name) || !is_int($name)) {
+ $name = LOG_SYSLOG;
+ }
+
+ $this->_id = md5(microtime().rand());
+ $this->_name = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (isset($conf['ip'])) {
+ $this->_ip = $conf['ip'];
+ }
+ if (isset($conf['proto'])) {
+ $this->_proto = $conf['proto'];
+ }
+ if (isset($conf['port'])) {
+ $this->_port = $conf['port'];
+ }
+ if (isset($conf['maxsize'])) {
+ $this->_maxsize = $conf['maxsize'];
+ }
+ if (isset($conf['timeout'])) {
+ $this->_timeout = $conf['timeout'];
+ }
+ $this->_proto = $this->_proto . '://';
+
+ register_shutdown_function(array(&$this, '_Log_daemon'));
+ }
+
+ /**
+ * Destructor.
+ *
+ * @access private
+ */
+ function _Log_daemon()
+ {
+ $this->close();
+ }
+
+ /**
+ * Opens a connection to the system logger, if it has not already
+ * been opened. This is implicitly called by log(), if necessary.
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ $this->_opened = (bool)($this->_socket = @fsockopen(
+ $this->_proto . $this->_ip,
+ $this->_port,
+ $errno,
+ $errstr,
+ $this->_timeout));
+ }
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the connection to the system logger, if it is open.
+ * @access public
+ */
+ function close()
+ {
+ if ($this->_opened) {
+ $this->_opened = false;
+ return fclose($this->_socket);
+ }
+ return true;
+ }
+
+ /**
+ * Sends $message to the currently open syslog connection. Calls
+ * open() if necessary. Also passes the message along to any Log_observer
+ * instances that are observing this Log.
+ *
+ * @param string $message The textual message to be logged.
+ * @param int $priority (optional) The priority of the message. Valid
+ * values are: LOG_EMERG, LOG_ALERT, LOG_CRIT,
+ * LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO,
+ * and LOG_DEBUG. The default is LOG_INFO.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the connection isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Set the facility level. */
+ $facility_level = intval($this->_name) +
+ intval($this->_toSyslog($priority));
+
+ /* Prepend ident info. */
+ if (!empty($this->_ident)) {
+ $message = $this->_ident . ' ' . $message;
+ }
+
+ /* Check for message length. */
+ if (strlen($message) > $this->_maxsize) {
+ $message = substr($message, 0, ($this->_maxsize) - 10) . ' [...]';
+ }
+
+ /* Write to socket. */
+ fwrite($this->_socket, '<' . $facility_level . '>' . $message . "\n");
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+ }
+
+ /**
+ * Converts a PEAR_LOG_* constant into a syslog LOG_* constant.
+ *
+ * This function exists because, under Windows, not all of the LOG_*
+ * constants have unique values. Instead, the PEAR_LOG_* were introduced
+ * for global use, with the conversion to the LOG_* constants kept local to
+ * to the syslog driver.
+ *
+ * @param int $priority PEAR_LOG_* value to convert to LOG_* value.
+ *
+ * @return The LOG_* representation of $priority.
+ *
+ * @access private
+ */
+ function _toSyslog($priority)
+ {
+ static $priorities = array(
+ PEAR_LOG_EMERG => LOG_EMERG,
+ PEAR_LOG_ALERT => LOG_ALERT,
+ PEAR_LOG_CRIT => LOG_CRIT,
+ PEAR_LOG_ERR => LOG_ERR,
+ PEAR_LOG_WARNING => LOG_WARNING,
+ PEAR_LOG_NOTICE => LOG_NOTICE,
+ PEAR_LOG_INFO => LOG_INFO,
+ PEAR_LOG_DEBUG => LOG_DEBUG
+ );
+
+ /* If we're passed an unknown priority, default to LOG_INFO. */
+ if (!is_int($priority) || !in_array($priority, $priorities)) {
+ return LOG_INFO;
+ }
+
+ return $priorities[$priority];
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/display.php b/modules/blockrss/vendor/pear/log/Log/display.php
new file mode 100644
index 000000000..9711221ec
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/display.php
@@ -0,0 +1,181 @@
+
+ * @since Log 1.8.0
+ * @package Log
+ *
+ * @example display.php Using the display handler.
+ */
+class Log_display extends Log
+{
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%3$s: %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * Flag indicating whether raw message text should be passed directly to
+ * the log system. Otherwise, the text will be converted to an HTML-safe
+ * representation.
+ * @var boolean
+ * @access private
+ */
+ var $_rawText = false;
+
+ /**
+ * Constructs a new Log_display object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name = '', $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ /* Start by configuring the line format. */
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ /* We may need to prepend a string to our line format. */
+ $prepend = null;
+ if (isset($conf['error_prepend'])) {
+ $prepend = $conf['error_prepend'];
+ } else {
+ $prepend = ini_get('error_prepend_string');
+ }
+ if (!empty($prepend)) {
+ $this->_lineFormat = $prepend . $this->_lineFormat;
+ }
+
+ /* We may also need to append a string to our line format. */
+ $append = null;
+ if (isset($conf['error_append'])) {
+ $append = $conf['error_append'];
+ } else {
+ $append = ini_get('error_append_string');
+ }
+ if (!empty($append)) {
+ $this->_lineFormat .= $append;
+ }
+
+ /* Lastly, the line ending sequence is also configurable. */
+ if (isset($conf['linebreak'])) {
+ $this->_lineFormat .= $conf['linebreak'];
+ } else {
+ $this->_lineFormat .= " \n";
+ }
+
+ /* The user can also change the time format. */
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+
+ /* Message text conversion can be disabled. */
+ if (isset($conf['rawText'])) {
+ $this->_rawText = $conf['rawText'];
+ }
+ }
+
+ /**
+ * Opens the display handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function open()
+ {
+ $this->_opened = true;
+ return true;
+ }
+
+ /**
+ * Closes the display handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function close()
+ {
+ $this->_opened = false;
+ return true;
+ }
+
+ /**
+ * Writes $message to the text browser. Also, passes the message
+ * along to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Convert the message to an HTML-friendly represention unless raw
+ * text has been requested. */
+ if ($this->_rawText === false) {
+ $message = nl2br(htmlspecialchars($message));
+ }
+
+ /* Build and output the complete log line. */
+ echo $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority,
+ $message);
+
+ /* Notify observers about this log message. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/error_log.php b/modules/blockrss/vendor/pear/log/Log/error_log.php
new file mode 100644
index 000000000..602d7cd3c
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/error_log.php
@@ -0,0 +1,160 @@
+
+ * @since Log 1.7.0
+ * @package Log
+ *
+ * @example error_log.php Using the error_log handler.
+ */
+class Log_error_log extends Log
+{
+ /**
+ * The error_log() log type.
+ * @var integer
+ * @access private
+ */
+ var $_type = PEAR_LOG_TYPE_SYSTEM;
+
+ /**
+ * The type-specific destination value.
+ * @var string
+ * @access private
+ */
+ var $_destination = '';
+
+ /**
+ * Additional headers to pass to the mail() function when the
+ * PEAR_LOG_TYPE_MAIL type is used.
+ * @var string
+ * @access private
+ */
+ var $_extra_headers = '';
+
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%2$s: %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * Constructs a new Log_error_log object.
+ *
+ * @param string $name One of the PEAR_LOG_TYPE_* constants.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_type = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (!empty($conf['destination'])) {
+ $this->_destination = $conf['destination'];
+ }
+
+ if (!empty($conf['extra_headers'])) {
+ $this->_extra_headers = $conf['extra_headers'];
+ }
+
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+ }
+
+ /**
+ * Opens the handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function open()
+ {
+ $this->_opened = true;
+ return true;
+ }
+
+ /**
+ * Closes the handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function close()
+ {
+ $this->_opened = false;
+ return true;
+ }
+
+ /**
+ * Logs $message using PHP's error_log() function. The message is also
+ * passed along to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build the string containing the complete log line. */
+ $line = $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority, $message);
+
+ /* Pass the log line and parameters to the error_log() function. */
+ $success = error_log($line, $this->_type, $this->_destination,
+ $this->_extra_headers);
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return $success;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/file.php b/modules/blockrss/vendor/pear/log/Log/file.php
new file mode 100644
index 000000000..3cd5fec45
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/file.php
@@ -0,0 +1,316 @@
+
+ * @author Roman Neuhauser
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example file.php Using the file handler.
+ */
+class Log_file extends Log
+{
+ /**
+ * String containing the name of the log file.
+ * @var string
+ * @access private
+ */
+ var $_filename = 'php.log';
+
+ /**
+ * Handle to the log file.
+ * @var resource
+ * @access private
+ */
+ var $_fp = false;
+
+ /**
+ * Should new log entries be append to an existing log file, or should the
+ * a new log file overwrite an existing one?
+ * @var boolean
+ * @access private
+ */
+ var $_append = true;
+
+ /**
+ * Should advisory file locking (i.e., flock()) be used?
+ * @var boolean
+ * @access private
+ */
+ var $_locking = false;
+
+ /**
+ * Integer (in octal) containing the log file's permissions mode.
+ * @var integer
+ * @access private
+ */
+ var $_mode = 0644;
+
+ /**
+ * Integer (in octal) specifying the file permission mode that will be
+ * used when creating directories that do not already exist.
+ * @var integer
+ * @access private
+ */
+ var $_dirmode = 0755;
+
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * String containing the end-on-line character sequence.
+ * @var string
+ * @access private
+ */
+ var $_eol = "\n";
+
+ /**
+ * Constructs a new Log_file object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_filename = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (isset($conf['append'])) {
+ $this->_append = $conf['append'];
+ }
+
+ if (isset($conf['locking'])) {
+ $this->_locking = $conf['locking'];
+ }
+
+ if (!empty($conf['mode'])) {
+ if (is_string($conf['mode'])) {
+ $this->_mode = octdec($conf['mode']);
+ } else {
+ $this->_mode = $conf['mode'];
+ }
+ }
+
+ if (!empty($conf['dirmode'])) {
+ if (is_string($conf['dirmode'])) {
+ $this->_dirmode = octdec($conf['dirmode']);
+ } else {
+ $this->_dirmode = $conf['dirmode'];
+ }
+ }
+
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+
+ if (!empty($conf['eol'])) {
+ $this->_eol = $conf['eol'];
+ } else {
+ $this->_eol = (strstr(PHP_OS, 'WIN')) ? "\r\n" : "\n";
+ }
+
+ register_shutdown_function(array(&$this, '_Log_file'));
+ }
+
+ /**
+ * Destructor
+ */
+ function _Log_file()
+ {
+ if ($this->_opened) {
+ $this->close();
+ }
+ }
+
+ /**
+ * Creates the given directory path. If the parent directories don't
+ * already exist, they will be created, too.
+ *
+ * This implementation is inspired by Python's os.makedirs function.
+ *
+ * @param string $path The full directory path to create.
+ * @param integer $mode The permissions mode with which the
+ * directories will be created.
+ *
+ * @return True if the full path is successfully created or already
+ * exists.
+ *
+ * @access private
+ */
+ function _mkpath($path, $mode = 0700)
+ {
+ /* Separate the last pathname component from the rest of the path. */
+ $head = dirname($path);
+ $tail = basename($path);
+
+ /* Make sure we've split the path into two complete components. */
+ if (empty($tail)) {
+ $head = dirname($path);
+ $tail = basename($path);
+ }
+
+ /* Recurse up the path if our current segment does not exist. */
+ if (!empty($head) && !empty($tail) && !is_dir($head)) {
+ $this->_mkpath($head, $mode);
+ }
+
+ /* Create this segment of the path. */
+ return @mkdir($head, $mode);
+ }
+
+ /**
+ * Opens the log file for output. If the specified log file does not
+ * already exist, it will be created. By default, new log entries are
+ * appended to the end of the log file.
+ *
+ * This is implicitly called by log(), if necessary.
+ *
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ /* If the log file's directory doesn't exist, create it. */
+ if (!is_dir(dirname($this->_filename))) {
+ $this->_mkpath($this->_filename, $this->_dirmode);
+ }
+
+ /* Determine whether the log file needs to be created. */
+ $creating = !file_exists($this->_filename);
+
+ /* Obtain a handle to the log file. */
+ $this->_fp = fopen($this->_filename, ($this->_append) ? 'a' : 'w');
+
+ /* We consider the file "opened" if we have a valid file pointer. */
+ $this->_opened = ($this->_fp !== false);
+
+ /* Attempt to set the file's permissions if we just created it. */
+ if ($creating && $this->_opened) {
+ chmod($this->_filename, $this->_mode);
+ }
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the log file if it is open.
+ *
+ * @access public
+ */
+ function close()
+ {
+ /* If the log file is open, close it. */
+ if ($this->_opened && fclose($this->_fp)) {
+ $this->_opened = false;
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Flushes all pending data to the file handle.
+ *
+ * @access public
+ * @since Log 1.8.2
+ */
+ function flush()
+ {
+ if (is_resource($this->_fp)) {
+ return fflush($this->_fp);
+ }
+
+ return false;
+ }
+
+ /**
+ * Logs $message to the output window. The message is also passed along
+ * to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the log file isn't already open, open it now. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build the string containing the complete log line. */
+ $line = $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority, $message) . $this->_eol;
+
+ /* If locking is enabled, acquire an exclusive lock on the file. */
+ if ($this->_locking) {
+ flock($this->_fp, LOCK_EX);
+ }
+
+ /* Write the log line to the log file. */
+ $success = (fwrite($this->_fp, $line) !== false);
+
+ /* Unlock the file now that we're finished writing to it. */
+ if ($this->_locking) {
+ flock($this->_fp, LOCK_UN);
+ }
+
+ /* Notify observers about this log message. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return $success;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/firebug.php b/modules/blockrss/vendor/pear/log/Log/firebug.php
new file mode 100644
index 000000000..b30cdbd86
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/firebug.php
@@ -0,0 +1,207 @@
+
+ * @since Log 1.9.11
+ * @package Log
+ *
+ * @example firebug.php Using the firebug handler.
+ */
+class Log_firebug extends Log
+{
+ /**
+ * Should the output be buffered or displayed immediately?
+ * @var string
+ * @access private
+ */
+ var $_buffering = false;
+
+ /**
+ * String holding the buffered output.
+ * @var string
+ * @access private
+ */
+ var $_buffer = array();
+
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%2$s [%3$s] %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ *
+ * Note! Default lineFormat of this driver does not display time.
+ *
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * Mapping of log priorities to Firebug methods.
+ * @var array
+ * @access private
+ */
+ var $_methods = array(
+ PEAR_LOG_EMERG => 'error',
+ PEAR_LOG_ALERT => 'error',
+ PEAR_LOG_CRIT => 'error',
+ PEAR_LOG_ERR => 'error',
+ PEAR_LOG_WARNING => 'warn',
+ PEAR_LOG_NOTICE => 'info',
+ PEAR_LOG_INFO => 'info',
+ PEAR_LOG_DEBUG => 'debug'
+ );
+
+ /**
+ * Constructs a new Log_firebug object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name = '', $ident = 'PHP', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+ if (isset($conf['buffering'])) {
+ $this->_buffering = $conf['buffering'];
+ }
+
+ if ($this->_buffering) {
+ register_shutdown_function(array(&$this, '_Log_firebug'));
+ }
+
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+ }
+
+ /**
+ * Opens the firebug handler.
+ *
+ * @access public
+ */
+ function open()
+ {
+ $this->_opened = true;
+ return true;
+ }
+
+ /**
+ * Destructor
+ */
+ function _Log_firebug()
+ {
+ $this->close();
+ }
+
+ /**
+ * Closes the firebug handler.
+ *
+ * @access public
+ */
+ function close()
+ {
+ $this->flush();
+ $this->_opened = false;
+ return true;
+ }
+
+ /**
+ * Flushes all pending ("buffered") data.
+ *
+ * @access public
+ */
+ function flush() {
+ if (count($this->_buffer)) {
+ print '\n";
+ };
+ $this->_buffer = array();
+ }
+
+ /**
+ * Writes $message to Firebug console. Also, passes the message
+ * along to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+ $method = $this->_methods[$priority];
+
+ /* normalize line breaks and escape quotes*/
+ $message = preg_replace("/\r?\n/", "\\n", addslashes($message));
+
+ /* Build the string containing the complete log line. */
+ $line = $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority,
+ $message);
+
+ if ($this->_buffering) {
+ $this->_buffer[] = sprintf('console.%s("%s");', $method, $line);
+ } else {
+ print '\n";
+ }
+ /* Notify observers about this log message. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/index.php b/modules/blockrss/vendor/pear/log/Log/index.php
new file mode 100644
index 000000000..051e0122d
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/index.php
@@ -0,0 +1,29 @@
+
+* @copyright 2010-2021 Webkul IN
+* @license https://store.webkul.com/license.html
+*/
+
+header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
+header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
+
+header('Cache-Control: no-store, no-cache, must-revalidate');
+header('Cache-Control: post-check=0, pre-check=0', false);
+header('Pragma: no-cache');
+
+header('Location: ../../../');
+exit;
diff --git a/modules/blockrss/vendor/pear/log/Log/mail.php b/modules/blockrss/vendor/pear/log/Log/mail.php
new file mode 100644
index 000000000..5c079ee83
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/mail.php
@@ -0,0 +1,294 @@
+
+ * @author Jon Parise
+ * @since Log 1.3
+ * @package Log
+ *
+ * @example mail.php Using the mail handler.
+ */
+class Log_mail extends Log
+{
+ /**
+ * String holding the recipients' email addresses. Multiple addresses
+ * should be separated with commas.
+ * @var string
+ * @access private
+ */
+ var $_recipients = '';
+
+ /**
+ * String holding the sender's email address.
+ * @var string
+ * @access private
+ */
+ var $_from = '';
+
+ /**
+ * String holding the email's subject.
+ * @var string
+ * @access private
+ */
+ var $_subject = '[Log_mail] Log message';
+
+ /**
+ * String holding an optional preamble for the log messages.
+ * @var string
+ * @access private
+ */
+ var $_preamble = '';
+
+ /**
+ * String containing the format of a log line.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%1$s %2$s [%3$s] %4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * String holding the mail message body.
+ * @var string
+ * @access private
+ */
+ var $_message = '';
+
+ /**
+ * Flag used to indicated that log lines have been written to the message
+ * body and the message should be sent on close().
+ * @var boolean
+ * @access private
+ */
+ var $_shouldSend = false;
+
+ /**
+ * String holding the backend name of PEAR::Mail
+ * @var string
+ * @access private
+ */
+ var $_mailBackend = '';
+
+ /**
+ * Array holding the params for PEAR::Mail
+ * @var array
+ * @access private
+ */
+ var $_mailParams = array();
+
+ /**
+ * Constructs a new Log_mail object.
+ *
+ * Here is how you can customize the mail driver with the conf[] hash :
+ * $conf['from']: the mail's "From" header line,
+ * $conf['subject']: the mail's "Subject" line.
+ * $conf['mailBackend']: backend name of PEAR::Mail
+ * $conf['mailParams']: parameters for the PEAR::Mail backend
+ *
+ * @param string $name The message's recipients.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_recipients = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (!empty($conf['from'])) {
+ $this->_from = $conf['from'];
+ } else {
+ $this->_from = ini_get('sendmail_from');
+ }
+
+ if (!empty($conf['subject'])) {
+ $this->_subject = $conf['subject'];
+ }
+
+ if (!empty($conf['preamble'])) {
+ $this->_preamble = $conf['preamble'];
+ }
+
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+
+ if (!empty($conf['mailBackend'])) {
+ $this->_mailBackend = $conf['mailBackend'];
+ }
+
+ if (!empty($conf['mailParams'])) {
+ $this->_mailParams = $conf['mailParams'];
+ }
+
+ /* register the destructor */
+ register_shutdown_function(array(&$this, '_Log_mail'));
+ }
+
+ /**
+ * Destructor. Calls close().
+ *
+ * @access private
+ */
+ function _Log_mail()
+ {
+ $this->close();
+ }
+
+ /**
+ * Starts a new mail message.
+ * This is implicitly called by log(), if necessary.
+ *
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ if (!empty($this->_preamble)) {
+ $this->_message = $this->_preamble . "\r\n\r\n";
+ }
+ $this->_opened = true;
+ $_shouldSend = false;
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the message, if it is open, and sends the mail.
+ * This is implicitly called by the destructor, if necessary.
+ *
+ * @access public
+ */
+ function close()
+ {
+ if ($this->_opened) {
+ if ($this->_shouldSend && !empty($this->_message)) {
+ if ($this->_mailBackend === '') { // use mail()
+ $headers = "From: $this->_from\r\n";
+ $headers .= 'User-Agent: PEAR Log Package';
+ if (mail($this->_recipients, $this->_subject,
+ $this->_message, $headers) == false) {
+ return false;
+ }
+ } else { // use PEAR::Mail
+ include_once 'Mail.php';
+ $headers = array('From' => $this->_from,
+ 'To' => $this->_recipients,
+ 'User-Agent' => 'PEAR Log Package',
+ 'Subject' => $this->_subject);
+ $mailer = &Mail::factory($this->_mailBackend,
+ $this->_mailParams);
+ $res = $mailer->send($this->_recipients, $headers,
+ $this->_message);
+ if (PEAR::isError($res)) {
+ return false;
+ }
+ }
+
+ /* Clear the message string now that the email has been sent. */
+ $this->_message = '';
+ $this->_shouldSend = false;
+ }
+ $this->_opened = false;
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Flushes the log output by forcing the email message to be sent now.
+ * Events that are logged after flush() is called will be appended to a
+ * new email message.
+ *
+ * @access public
+ * @since Log 1.8.2
+ */
+ function flush()
+ {
+ /*
+ * It's sufficient to simply call close() to flush the output.
+ * The next call to log() will cause the handler to be reopened.
+ */
+ return $this->close();
+ }
+
+ /**
+ * Writes $message to the currently open mail message.
+ * Calls open(), if necessary.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the message isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Append the string containing the complete log line. */
+ $this->_message .= $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority, $message) . "\r\n";
+ $this->_shouldSend = true;
+
+ /* Notify observers about this log message. */
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/mcal.php b/modules/blockrss/vendor/pear/log/Log/mcal.php
new file mode 100644
index 000000000..57b9e6e6d
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/mcal.php
@@ -0,0 +1,169 @@
+
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ */
+class Log_mcal extends Log
+{
+ /**
+ * holding the calendar specification to connect to.
+ * @var string
+ * @access private
+ */
+ var $_calendar = '{localhost/mstore}';
+
+ /**
+ * holding the username to use.
+ * @var string
+ * @access private
+ */
+ var $_username = '';
+
+ /**
+ * holding the password to use.
+ * @var string
+ * @access private
+ */
+ var $_password = '';
+
+ /**
+ * holding the options to pass to the calendar stream.
+ * @var integer
+ * @access private
+ */
+ var $_options = 0;
+
+ /**
+ * ResourceID of the MCAL stream.
+ * @var string
+ * @access private
+ */
+ var $_stream = '';
+
+ /**
+ * Integer holding the log facility to use.
+ * @var string
+ * @access private
+ */
+ var $_name = LOG_SYSLOG;
+
+ /**
+ * Constructs a new Log_mcal object.
+ *
+ * @param string $name The category to use for our events.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_name = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+ $this->_calendar = $conf['calendar'];
+ $this->_username = $conf['username'];
+ $this->_password = $conf['password'];
+ $this->_options = $conf['options'];
+ }
+
+ /**
+ * Opens a calendar stream, if it has not already been
+ * opened. This is implicitly called by log(), if necessary.
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ $this->_stream = mcal_open($this->_calendar, $this->_username,
+ $this->_password, $this->_options);
+ $this->_opened = true;
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the calendar stream, if it is open.
+ * @access public
+ */
+ function close()
+ {
+ if ($this->_opened) {
+ mcal_close($this->_stream);
+ $this->_opened = false;
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Logs $message and associated information to the currently open
+ * calendar stream. Calls open() if necessary. Also passes the
+ * message along to any Log_observer instances that are observing
+ * this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the connection isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ $date_str = date('Y:n:j:G:i:s');
+ $dates = explode(':', $date_str);
+
+ mcal_event_init($this->_stream);
+ mcal_event_set_title($this->_stream, $this->_ident);
+ mcal_event_set_category($this->_stream, $this->_name);
+ mcal_event_set_description($this->_stream, $message);
+ mcal_event_add_attribute($this->_stream, 'priority', $priority);
+ mcal_event_set_start($this->_stream, $dates[0], $dates[1], $dates[2],
+ $dates[3], $dates[4], $dates[5]);
+ mcal_event_set_end($this->_stream, $dates[0], $dates[1], $dates[2],
+ $dates[3], $dates[4], $dates[5]);
+ mcal_append_event($this->_stream);
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/mdb2.php b/modules/blockrss/vendor/pear/log/Log/mdb2.php
new file mode 100644
index 000000000..6a0b45c7a
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/mdb2.php
@@ -0,0 +1,358 @@
+
+ * @author Jon Parise
+ * @since Log 1.9.0
+ * @package Log
+ */
+class Log_mdb2 extends Log
+{
+ /**
+ * Variable containing the DSN information.
+ * @var mixed
+ * @access private
+ */
+ var $_dsn = '';
+
+ /**
+ * Array containing our set of DB configuration options.
+ * @var array
+ * @access private
+ */
+ var $_options = array('persistent' => true);
+
+ /**
+ * Object holding the database handle.
+ * @var object
+ * @access private
+ */
+ var $_db = null;
+
+ /**
+ * Resource holding the prepared statement handle.
+ * @var resource
+ * @access private
+ */
+ var $_statement = null;
+
+ /**
+ * Flag indicating that we're using an existing database connection.
+ * @var boolean
+ * @access private
+ */
+ var $_existingConnection = false;
+
+ /**
+ * String holding the database table to use.
+ * @var string
+ * @access private
+ */
+ var $_table = 'log_table';
+
+ /**
+ * String holding the name of the ID sequence.
+ * @var string
+ * @access private
+ */
+ var $_sequence = 'log_id';
+
+ /**
+ * Maximum length of the $ident string. This corresponds to the size of
+ * the 'ident' column in the SQL table.
+ * @var integer
+ * @access private
+ */
+ var $_identLimit = 16;
+
+ /**
+ * Set of field types used in the database table.
+ * @var array
+ * @access private
+ */
+ var $_types = array(
+ 'id' => 'integer',
+ 'logtime' => 'timestamp',
+ 'ident' => 'text',
+ 'priority' => 'text',
+ 'message' => 'clob'
+ );
+
+ /**
+ * Constructs a new sql logging object.
+ *
+ * @param string $name The target SQL table.
+ * @param string $ident The identification field.
+ * @param array $conf The connection configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_table = $name;
+ $this->_mask = Log::UPTO($level);
+
+ /* If an options array was provided, use it. */
+ if (isset($conf['options']) && is_array($conf['options'])) {
+ $this->_options = $conf['options'];
+ }
+
+ /* If a specific sequence name was provided, use it. */
+ if (!empty($conf['sequence'])) {
+ $this->_sequence = $conf['sequence'];
+ }
+
+ /* If a specific sequence name was provided, use it. */
+ if (isset($conf['identLimit'])) {
+ $this->_identLimit = $conf['identLimit'];
+ }
+
+ /* Now that the ident limit is confirmed, set the ident string. */
+ $this->setIdent($ident);
+
+ /* If an existing database connection was provided, use it. */
+ if (isset($conf['db'])) {
+ $this->_db = &$conf['db'];
+ $this->_existingConnection = true;
+ $this->_opened = true;
+ } elseif (isset($conf['singleton'])) {
+ $this->_db = &MDB2::singleton($conf['singleton'], $this->_options);
+ $this->_existingConnection = true;
+ $this->_opened = true;
+ } else {
+ $this->_dsn = $conf['dsn'];
+ }
+ }
+
+ /**
+ * Opens a connection to the database, if it has not already
+ * been opened. This is implicitly called by log(), if necessary.
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ /* Use the DSN and options to create a database connection. */
+ $this->_db = &MDB2::connect($this->_dsn, $this->_options);
+ if (PEAR::isError($this->_db)) {
+ return false;
+ }
+
+ /* Create a prepared statement for repeated use in log(). */
+ if (!$this->_prepareStatement()) {
+ return false;
+ }
+
+ /* We now consider out connection open. */
+ $this->_opened = true;
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the connection to the database if it is still open and we were
+ * the ones that opened it. It is the caller's responsible to close an
+ * existing connection that was passed to us via $conf['db'].
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function close()
+ {
+ /* If we have a statement object, free it. */
+ if (is_object($this->_statement)) {
+ $this->_statement->free();
+ $this->_statement = null;
+ }
+
+ /* If we opened the database connection, disconnect it. */
+ if ($this->_opened && !$this->_existingConnection) {
+ $this->_opened = false;
+ return $this->_db->disconnect();
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Sets this Log instance's identification string. Note that this
+ * SQL-specific implementation will limit the length of the $ident string
+ * to sixteen (16) characters.
+ *
+ * @param string $ident The new identification string.
+ *
+ * @access public
+ * @since Log 1.8.5
+ */
+ function setIdent($ident)
+ {
+ $this->_ident = substr($ident, 0, $this->_identLimit);
+ }
+
+ /**
+ * Inserts $message to the currently open database. Calls open(),
+ * if necessary. Also passes the message along to any Log_observer
+ * instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the connection isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* If we don't already have a statement object, create one. */
+ if (!is_object($this->_statement) && !$this->_prepareStatement()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build our set of values for this log entry. */
+ $values = array(
+ 'id' => $this->_db->nextId($this->_sequence),
+ 'logtime' => MDB2_Date::mdbNow(),
+ 'ident' => $this->_ident,
+ 'priority' => $priority,
+ 'message' => $message
+ );
+
+ /* Execute the SQL query for this log entry insertion. */
+ $this->_db->expectError(MDB2_ERROR_NOSUCHTABLE);
+ $result = &$this->_statement->execute($values);
+ $this->_db->popExpect();
+
+ /* Attempt to handle any errors. */
+ if (PEAR::isError($result)) {
+ /* We can only handle MDB2_ERROR_NOSUCHTABLE errors. */
+ if ($result->getCode() != MDB2_ERROR_NOSUCHTABLE) {
+ return false;
+ }
+
+ /* Attempt to create the target table. */
+ if (!$this->_createTable()) {
+ return false;
+ }
+
+ /* Recreate our prepared statement resource. */
+ $this->_statement->free();
+ if (!$this->_prepareStatement()) {
+ return false;
+ }
+
+ /* Attempt to re-execute the insertion query. */
+ $result = $this->_statement->execute($values);
+ if (PEAR::isError($result)) {
+ return false;
+ }
+ }
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+ /**
+ * Create the log table in the database.
+ *
+ * @return boolean True on success or false on failure.
+ * @access private
+ */
+ function _createTable()
+ {
+ $this->_db->loadModule('Manager', null, true);
+ $result = $this->_db->manager->createTable(
+ $this->_table,
+ array(
+ 'id' => array('type' => $this->_types['id']),
+ 'logtime' => array('type' => $this->_types['logtime']),
+ 'ident' => array('type' => $this->_types['ident']),
+ 'priority' => array('type' => $this->_types['priority']),
+ 'message' => array('type' => $this->_types['message'])
+ )
+ );
+ if (PEAR::isError($result)) {
+ return false;
+ }
+
+ $result = $this->_db->manager->createIndex(
+ $this->_table,
+ 'unique_id',
+ array('fields' => array('id' => true), 'unique' => true)
+ );
+ if (PEAR::isError($result)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Prepare the SQL insertion statement.
+ *
+ * @return boolean True if the statement was successfully created.
+ *
+ * @access private
+ * @since Log 1.9.0
+ */
+ function _prepareStatement()
+ {
+ $this->_statement = &$this->_db->prepare(
+ 'INSERT INTO ' . $this->_table .
+ ' (id, logtime, ident, priority, message)' .
+ ' VALUES(:id, :logtime, :ident, :priority, :message)',
+ $this->_types, MDB2_PREPARE_MANIP);
+
+ /* Return success if we didn't generate an error. */
+ return (PEAR::isError($this->_statement) === false);
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/null.php b/modules/blockrss/vendor/pear/log/Log/null.php
new file mode 100644
index 000000000..6b3a0aaa4
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/null.php
@@ -0,0 +1,91 @@
+
+ * @since Log 1.8.2
+ * @package Log
+ *
+ * @example null.php Using the null handler.
+ */
+class Log_null extends Log
+{
+ /**
+ * Constructs a new Log_null object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+ }
+
+ /**
+ * Opens the handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function open()
+ {
+ $this->_opened = true;
+ return true;
+ }
+
+ /**
+ * Closes the handler.
+ *
+ * @access public
+ * @since Log 1.9.6
+ */
+ function close()
+ {
+ $this->_opened = false;
+ return true;
+ }
+
+ /**
+ * Simply consumes the log event. The message will still be passed
+ * along to any Log_observer instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/observer.php b/modules/blockrss/vendor/pear/log/Log/observer.php
new file mode 100644
index 000000000..09b01454b
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/observer.php
@@ -0,0 +1,129 @@
+
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example observer_mail.php An example Log_observer implementation.
+ */
+class Log_observer
+{
+ /**
+ * Instance-specific unique identification number.
+ *
+ * @var integer
+ * @access private
+ */
+ var $_id = 0;
+
+ /**
+ * The minimum priority level of message that we want to hear about.
+ * PEAR_LOG_EMERG is the highest priority, so we will only hear messages
+ * with an integer priority value less than or equal to ours. It defaults
+ * to PEAR_LOG_INFO, which listens to everything except PEAR_LOG_DEBUG.
+ *
+ * @var string
+ * @access private
+ */
+ var $_priority = PEAR_LOG_INFO;
+
+ /**
+ * Creates a new basic Log_observer instance.
+ *
+ * @param integer $priority The highest priority at which to receive
+ * log event notifications.
+ *
+ * @access public
+ */
+ public function __construct($priority = PEAR_LOG_INFO)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_priority = $priority;
+ }
+
+ /**
+ * Attempts to return a new concrete Log_observer instance of the requested
+ * type.
+ *
+ * @param string $type The type of concreate Log_observer subclass
+ * to return.
+ * @param integer $priority The highest priority at which to receive
+ * log event notifications.
+ * @param array $conf Optional associative array of additional
+ * configuration values.
+ *
+ * @return object The newly created concrete Log_observer
+ * instance, or null on an error.
+ */
+ function &factory($type, $priority = PEAR_LOG_INFO, $conf = array())
+ {
+ $type = strtolower($type);
+ $class = 'Log_observer_' . $type;
+
+ /*
+ * If the desired class already exists (because the caller has supplied
+ * it from some custom location), simply instantiate and return a new
+ * instance.
+ */
+ if (class_exists($class)) {
+ $object = new $class($priority, $conf);
+ return $object;
+ }
+
+ /* Support both the new-style and old-style file naming conventions. */
+ $newstyle = true;
+ $classfile = dirname(__FILE__) . '/observer_' . $type . '.php';
+
+ if (!file_exists($classfile)) {
+ $classfile = 'Log/' . $type . '.php';
+ $newstyle = false;
+ }
+
+ /*
+ * Attempt to include our version of the named class, but don't treat
+ * a failure as fatal. The caller may have already included their own
+ * version of the named class.
+ */
+ @include_once $classfile;
+
+ /* If the class exists, return a new instance of it. */
+ if (class_exists($class)) {
+ /* Support both new-style and old-style construction. */
+ if ($newstyle) {
+ $object = new $class($priority, $conf);
+ } else {
+ $object = new $class($priority);
+ }
+ return $object;
+ }
+
+ $null = null;
+ return $null;
+ }
+
+ /**
+ * This is a stub method to make sure that Log_Observer classes do
+ * something when they are notified of a message. The default behavior
+ * is to just print the message, which is obviously not desireable in
+ * practically any situation - which is why you need to override this
+ * method. :)
+ *
+ * @param array $event A hash describing the log event.
+ */
+ function notify($event)
+ {
+ print_r($event);
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/sql.php b/modules/blockrss/vendor/pear/log/Log/sql.php
new file mode 100644
index 000000000..a235d09f5
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/sql.php
@@ -0,0 +1,293 @@
+
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example sql.php Using the SQL handler.
+ */
+class Log_sql extends Log
+{
+ /**
+ * Variable containing the DSN information.
+ * @var mixed
+ * @access private
+ */
+ var $_dsn = '';
+
+ /**
+ * String containing the SQL insertion statement.
+ *
+ * @var string
+ * @access private
+ */
+ var $_sql = '';
+
+ /**
+ * Array containing our set of DB configuration options.
+ * @var array
+ * @access private
+ */
+ var $_options = array('persistent' => true);
+
+ /**
+ * Object holding the database handle.
+ * @var object
+ * @access private
+ */
+ var $_db = null;
+
+ /**
+ * Resource holding the prepared statement handle.
+ * @var resource
+ * @access private
+ */
+ var $_statement = null;
+
+ /**
+ * Flag indicating that we're using an existing database connection.
+ * @var boolean
+ * @access private
+ */
+ var $_existingConnection = false;
+
+ /**
+ * String holding the database table to use.
+ * @var string
+ * @access private
+ */
+ var $_table = 'log_table';
+
+ /**
+ * String holding the name of the ID sequence.
+ * @var string
+ * @access private
+ */
+ var $_sequence = 'log_id';
+
+ /**
+ * Maximum length of the $ident string. This corresponds to the size of
+ * the 'ident' column in the SQL table.
+ * @var integer
+ * @access private
+ */
+ var $_identLimit = 16;
+
+ /**
+ * Constructs a new sql logging object.
+ *
+ * @param string $name The target SQL table.
+ * @param string $ident The identification field.
+ * @param array $conf The connection configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_table = $name;
+ $this->_mask = Log::UPTO($level);
+
+ /* Now that we have a table name, assign our SQL statement. */
+ if (!empty($conf['sql'])) {
+ $this->_sql = $conf['sql'];
+ } else {
+ $this->_sql = 'INSERT INTO ' . $this->_table .
+ ' (id, logtime, ident, priority, message)' .
+ ' VALUES(?, CURRENT_TIMESTAMP, ?, ?, ?)';
+ }
+
+ /* If an options array was provided, use it. */
+ if (isset($conf['options']) && is_array($conf['options'])) {
+ $this->_options = $conf['options'];
+ }
+
+ /* If a specific sequence name was provided, use it. */
+ if (!empty($conf['sequence'])) {
+ $this->_sequence = $conf['sequence'];
+ }
+
+ /* If a specific sequence name was provided, use it. */
+ if (isset($conf['identLimit'])) {
+ $this->_identLimit = $conf['identLimit'];
+ }
+
+ /* Now that the ident limit is confirmed, set the ident string. */
+ $this->setIdent($ident);
+
+ /* If an existing database connection was provided, use it. */
+ if (isset($conf['db'])) {
+ $this->_db = &$conf['db'];
+ $this->_existingConnection = true;
+ $this->_opened = true;
+ } else {
+ $this->_dsn = $conf['dsn'];
+ }
+ }
+
+ /**
+ * Opens a connection to the database, if it has not already
+ * been opened. This is implicitly called by log(), if necessary.
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ /* Use the DSN and options to create a database connection. */
+ $this->_db = &DB::connect($this->_dsn, $this->_options);
+ if (DB::isError($this->_db)) {
+ return false;
+ }
+
+ /* Create a prepared statement for repeated use in log(). */
+ if (!$this->_prepareStatement()) {
+ return false;
+ }
+
+ /* We now consider out connection open. */
+ $this->_opened = true;
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the connection to the database if it is still open and we were
+ * the ones that opened it. It is the caller's responsible to close an
+ * existing connection that was passed to us via $conf['db'].
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function close()
+ {
+ if ($this->_opened && !$this->_existingConnection) {
+ $this->_opened = false;
+ $this->_db->freePrepared($this->_statement);
+ return $this->_db->disconnect();
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Sets this Log instance's identification string. Note that this
+ * SQL-specific implementation will limit the length of the $ident string
+ * to sixteen (16) characters.
+ *
+ * @param string $ident The new identification string.
+ *
+ * @access public
+ * @since Log 1.8.5
+ */
+ function setIdent($ident)
+ {
+ $this->_ident = substr($ident, 0, $this->_identLimit);
+ }
+
+ /**
+ * Inserts $message to the currently open database. Calls open(),
+ * if necessary. Also passes the message along to any Log_observer
+ * instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the connection isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ /* If we don't already have our statement object yet, create it. */
+ if (!is_object($this->_statement) && !$this->_prepareStatement()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build our set of values for this log entry. */
+ $id = $this->_db->nextId($this->_sequence);
+ $values = array($id, $this->_ident, $priority, $message);
+
+ /* Execute the SQL query for this log entry insertion. */
+ $result =& $this->_db->execute($this->_statement, $values);
+ if (DB::isError($result)) {
+ return false;
+ }
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+ /**
+ * Prepare the SQL insertion statement.
+ *
+ * @return boolean True if the statement was successfully created.
+ *
+ * @access private
+ * @since Log 1.9.1
+ */
+ function _prepareStatement()
+ {
+ $this->_statement = $this->_db->prepare($this->_sql);
+
+ /* Return success if we didn't generate an error. */
+ return (DB::isError($this->_statement) === false);
+ }
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/sqlite.php b/modules/blockrss/vendor/pear/log/Log/sqlite.php
new file mode 100644
index 000000000..ec7ac27e7
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/sqlite.php
@@ -0,0 +1,224 @@
+
+ * @author Jon Parise
+ * @since Log 1.8.3
+ * @package Log
+ *
+ * @example sqlite.php Using the Sqlite handler.
+ */
+class Log_sqlite extends Log
+{
+ /**
+ * Array containing the connection defaults
+ * @var array
+ * @access private
+ */
+ var $_options = array('mode' => 0666,
+ 'persistent' => false);
+
+ /**
+ * Object holding the database handle.
+ * @var object
+ * @access private
+ */
+ var $_db = null;
+
+ /**
+ * Flag indicating that we're using an existing database connection.
+ * @var boolean
+ * @access private
+ */
+ var $_existingConnection = false;
+
+ /**
+ * String holding the database table to use.
+ * @var string
+ * @access private
+ */
+ var $_table = 'log_table';
+
+ /**
+ * Constructs a new sql logging object.
+ *
+ * @param string $name The target SQL table.
+ * @param string $ident The identification field.
+ * @param mixed $conf Can be an array of configuration options used
+ * to open a new database connection
+ * or an already opened sqlite connection.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', &$conf, $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_table = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (is_array($conf)) {
+ foreach ($conf as $k => $opt) {
+ $this->_options[$k] = $opt;
+ }
+ } else {
+ // If an existing database connection was provided, use it.
+ $this->_db =& $conf;
+ $this->_existingConnection = true;
+ }
+ }
+
+ /**
+ * Opens a connection to the database, if it has not already
+ * been opened. This is implicitly called by log(), if necessary.
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function open()
+ {
+ if (is_resource($this->_db)) {
+ $this->_opened = true;
+ return $this->_createTable();
+ } else {
+ /* Set the connection function based on the 'persistent' option. */
+ if (empty($this->_options['persistent'])) {
+ $connectFunction = 'sqlite_open';
+ } else {
+ $connectFunction = 'sqlite_popen';
+ }
+
+ /* Attempt to connect to the database. */
+ if ($this->_db = $connectFunction($this->_options['filename'],
+ (int)$this->_options['mode'],
+ $error)) {
+ $this->_opened = true;
+ return $this->_createTable();
+ }
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the connection to the database if it is still open and we were
+ * the ones that opened it. It is the caller's responsible to close an
+ * existing connection that was passed to us via $conf['db'].
+ *
+ * @return boolean True on success, false on failure.
+ * @access public
+ */
+ function close()
+ {
+ /* We never close existing connections. */
+ if ($this->_existingConnection) {
+ return false;
+ }
+
+ if ($this->_opened) {
+ $this->_opened = false;
+ sqlite_close($this->_db);
+ }
+
+ return ($this->_opened === false);
+ }
+
+ /**
+ * Inserts $message to the currently open database. Calls open(),
+ * if necessary. Also passes the message along to any Log_observer
+ * instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param string $priority The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If the connection isn't open and can't be opened, return failure. */
+ if (!$this->_opened && !$this->open()) {
+ return false;
+ }
+
+ // Extract the string representation of the message.
+ $message = $this->_extractMessage($message);
+
+ // Build the SQL query for this log entry insertion.
+ $q = sprintf('INSERT INTO [%s] (logtime, ident, priority, message) ' .
+ "VALUES ('%s', '%s', %d, '%s')",
+ $this->_table,
+ strftime('%Y-%m-%d %H:%M:%S', time()),
+ sqlite_escape_string($this->_ident),
+ $priority,
+ sqlite_escape_string($message));
+ if (!($res = @sqlite_unbuffered_query($this->_db, $q))) {
+ return false;
+ }
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+ /**
+ * Checks whether the log table exists and creates it if necessary.
+ *
+ * @return boolean True on success or false on failure.
+ * @access private
+ */
+ function _createTable()
+ {
+ $q = "SELECT name FROM sqlite_master WHERE name='" . $this->_table .
+ "' AND type='table'";
+
+ $res = sqlite_query($this->_db, $q);
+
+ if (sqlite_num_rows($res) == 0) {
+ $q = 'CREATE TABLE [' . $this->_table . '] (' .
+ 'id INTEGER PRIMARY KEY NOT NULL, ' .
+ 'logtime NOT NULL, ' .
+ 'ident CHAR(16) NOT NULL, ' .
+ 'priority INT NOT NULL, ' .
+ 'message)';
+
+ if (!($res = sqlite_unbuffered_query($this->_db, $q))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/syslog.php b/modules/blockrss/vendor/pear/log/Log/syslog.php
new file mode 100644
index 000000000..59c27fdd9
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/syslog.php
@@ -0,0 +1,238 @@
+
+ * @author Jon Parise
+ * @since Horde 1.3
+ * @since Log 1.0
+ * @package Log
+ *
+ * @example syslog.php Using the syslog handler.
+ */
+class Log_syslog extends Log
+{
+ /**
+ * Integer holding the log facility to use.
+ * @var integer
+ * @access private
+ */
+ var $_name = LOG_SYSLOG;
+
+ /**
+ * Should we inherit the current syslog connection for this process, or
+ * should we call openlog() to start a new syslog connection?
+ * @var boolean
+ * @access private
+ */
+ var $_inherit = false;
+
+ /**
+ * Should we re-open the syslog connection for each log event?
+ * @var boolean
+ * @access private
+ */
+ var $_reopen = false;
+
+ /**
+ * Maximum message length that will be sent to syslog(). If the handler
+ * receives a message longer than this length limit, it will be split into
+ * multiple syslog() calls.
+ * @var integer
+ * @access private
+ */
+ var $_maxLength = 500;
+
+ /**
+ * String containing the format of a message.
+ * @var string
+ * @access private
+ */
+ var $_lineFormat = '%4$s';
+
+ /**
+ * String containing the timestamp format. It will be passed directly to
+ * strftime(). Note that the timestamp string will generated using the
+ * current locale.
+ * @var string
+ * @access private
+ */
+ var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * Constructs a new syslog object.
+ *
+ * @param string $name The syslog facility.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ /* Ensure we have a valid integer value for $name. */
+ if (empty($name) || !is_int($name)) {
+ $name = LOG_SYSLOG;
+ }
+
+ if (isset($conf['inherit'])) {
+ $this->_inherit = $conf['inherit'];
+ $this->_opened = $this->_inherit;
+ }
+ if (isset($conf['reopen'])) {
+ $this->_reopen = $conf['reopen'];
+ }
+ if (isset($conf['maxLength'])) {
+ $this->_maxLength = $conf['maxLength'];
+ }
+ if (!empty($conf['lineFormat'])) {
+ $this->_lineFormat = str_replace(array_keys($this->_formatMap),
+ array_values($this->_formatMap),
+ $conf['lineFormat']);
+ }
+ if (!empty($conf['timeFormat'])) {
+ $this->_timeFormat = $conf['timeFormat'];
+ }
+
+ $this->_id = md5(microtime().rand());
+ $this->_name = $name;
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+ }
+
+ /**
+ * Opens a connection to the system logger, if it has not already
+ * been opened. This is implicitly called by log(), if necessary.
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened || $this->_reopen) {
+ $this->_opened = openlog($this->_ident, LOG_PID, $this->_name);
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the connection to the system logger, if it is open.
+ * @access public
+ */
+ function close()
+ {
+ if ($this->_opened && !$this->_inherit) {
+ closelog();
+ $this->_opened = false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Sends $message to the currently open syslog connection. Calls
+ * open() if necessary. Also passes the message along to any Log_observer
+ * instances that are observing this Log.
+ *
+ * @param mixed $message String or object containing the message to log.
+ * @param int $priority (optional) The priority of the message. Valid
+ * values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT,
+ * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING,
+ * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.
+ * @return boolean True on success or false on failure.
+ * @access public
+ */
+ function log($message, $priority = null)
+ {
+ /* If a priority hasn't been specified, use the default value. */
+ if ($priority === null) {
+ $priority = $this->_priority;
+ }
+
+ /* Abort early if the priority is above the maximum logging level. */
+ if (!$this->_isMasked($priority)) {
+ return false;
+ }
+
+ /* If we need to (re)open the connection and open() fails, abort. */
+ if ((!$this->_opened || $this->_reopen) && !$this->open()) {
+ return false;
+ }
+
+ /* Extract the string representation of the message. */
+ $message = $this->_extractMessage($message);
+
+ /* Build a syslog priority value based on our current configuration. */
+ $syslogPriority = $this->_toSyslog($priority);
+ if ($this->_inherit) {
+ $syslogPriority |= $this->_name;
+ }
+
+ /* Apply the configured line format to the message string. */
+ $message = $this->_format($this->_lineFormat,
+ strftime($this->_timeFormat),
+ $priority, $message);
+
+ /* Split the string into parts based on our maximum length setting. */
+ $parts = str_split($message, $this->_maxLength);
+ if ($parts === false) {
+ return false;
+ }
+
+ foreach ($parts as $part) {
+ if (!syslog($syslogPriority, $part)) {
+ return false;
+ }
+ }
+
+ $this->_announce(array('priority' => $priority, 'message' => $message));
+
+ return true;
+ }
+
+ /**
+ * Converts a PEAR_LOG_* constant into a syslog LOG_* constant.
+ *
+ * This function exists because, under Windows, not all of the LOG_*
+ * constants have unique values. Instead, the PEAR_LOG_* were introduced
+ * for global use, with the conversion to the LOG_* constants kept local to
+ * to the syslog driver.
+ *
+ * @param int $priority PEAR_LOG_* value to convert to LOG_* value.
+ *
+ * @return The LOG_* representation of $priority.
+ *
+ * @access private
+ */
+ function _toSyslog($priority)
+ {
+ static $priorities = array(
+ PEAR_LOG_EMERG => LOG_EMERG,
+ PEAR_LOG_ALERT => LOG_ALERT,
+ PEAR_LOG_CRIT => LOG_CRIT,
+ PEAR_LOG_ERR => LOG_ERR,
+ PEAR_LOG_WARNING => LOG_WARNING,
+ PEAR_LOG_NOTICE => LOG_NOTICE,
+ PEAR_LOG_INFO => LOG_INFO,
+ PEAR_LOG_DEBUG => LOG_DEBUG
+ );
+
+ /* If we're passed an unknown priority, default to LOG_INFO. */
+ if (!is_int($priority) || !in_array($priority, $priorities)) {
+ return LOG_INFO;
+ }
+
+ return $priorities[$priority];
+ }
+
+}
diff --git a/modules/blockrss/vendor/pear/log/Log/win.php b/modules/blockrss/vendor/pear/log/Log/win.php
new file mode 100644
index 000000000..43d9c4a3d
--- /dev/null
+++ b/modules/blockrss/vendor/pear/log/Log/win.php
@@ -0,0 +1,286 @@
+
+ * @since Log 1.7.0
+ * @package Log
+ *
+ * @example win.php Using the window handler.
+ */
+class Log_win extends Log
+{
+ /**
+ * The name of the output window.
+ * @var string
+ * @access private
+ */
+ var $_name = 'LogWindow';
+
+ /**
+ * The title of the output window.
+ * @var string
+ * @access private
+ */
+ var $_title = 'Log Output Window';
+
+ /**
+ * Mapping of log priorities to styles.
+ * @var array
+ * @access private
+ */
+ var $_styles = array(
+ PEAR_LOG_EMERG => 'color: red;',
+ PEAR_LOG_ALERT => 'color: orange;',
+ PEAR_LOG_CRIT => 'color: yellow;',
+ PEAR_LOG_ERR => 'color: green;',
+ PEAR_LOG_WARNING => 'color: blue;',
+ PEAR_LOG_NOTICE => 'color: indigo;',
+ PEAR_LOG_INFO => 'color: violet;',
+ PEAR_LOG_DEBUG => 'color: black;'
+ );
+
+ /**
+ * String buffer that holds line that are pending output.
+ * @var array
+ * @access private
+ */
+ var $_buffer = array();
+
+ /**
+ * Constructs a new Log_win object.
+ *
+ * @param string $name Ignored.
+ * @param string $ident The identity string.
+ * @param array $conf The configuration array.
+ * @param int $level Log messages up to and including this level.
+ * @access public
+ */
+ public function __construct($name, $ident = '', $conf = array(),
+ $level = PEAR_LOG_DEBUG)
+ {
+ $this->_id = md5(microtime().rand());
+ $this->_name = str_replace(' ', '_', $name);
+ $this->_ident = $ident;
+ $this->_mask = Log::UPTO($level);
+
+ if (isset($conf['title'])) {
+ $this->_title = $conf['title'];
+ }
+ if (isset($conf['styles']) && is_array($conf['styles'])) {
+ $this->_styles = $conf['styles'];
+ }
+ if (isset($conf['colors']) && is_array($conf['colors'])) {
+ foreach ($conf['colors'] as $level => $color) {
+ $this->_styles[$level] .= "color: $color;";
+ }
+ }
+
+ register_shutdown_function(array(&$this, '_Log_win'));
+ }
+
+ /**
+ * Destructor
+ */
+ function _Log_win()
+ {
+ if ($this->_opened || (count($this->_buffer) > 0)) {
+ $this->close();
+ }
+ }
+
+ /**
+ * The first time open() is called, it will open a new browser window and
+ * prepare it for output.
+ *
+ * This is implicitly called by log(), if necessary.
+ *
+ * @access public
+ */
+ function open()
+ {
+ if (!$this->_opened) {
+ $win = $this->_name;
+ $styles = $this->_styles;
+
+ if (!empty($this->_ident)) {
+ $identHeader = "$win.document.writeln('
Ident
')";
+ } else {
+ $identHeader = '';
+ }
+
+ echo <<< EOT
+
+EOT;
+ $this->_opened = true;
+ }
+
+ return $this->_opened;
+ }
+
+ /**
+ * Closes the output stream if it is open. If there are still pending
+ * lines in the output buffer, the output window will be opened so that
+ * the buffer can be drained.
+ *
+ * @access public
+ */
+ function close()
+ {
+ /*
+ * If there are still lines waiting to be written, open the output
+ * window so that we can drain the buffer.
+ */
+ if (!$this->_opened && (count($this->_buffer) > 0)) {
+ $this->open();
+ }
+
+ if ($this->_opened) {
+ $this->_writeln('');
+ $this->_writeln('