* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: ChannelFile.php 313023 2011-07-06 19:17:11Z dufuz $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.4
+ * @version Release: 1.10.1
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.4.0a1
*/
*/
var $_isValid = false;
- function PEAR_ChannelFile()
+ function __construct()
{
- $this->_stack = &new PEAR_ErrorStack('PEAR_ChannelFile');
+ $this->_stack = new PEAR_ErrorStack('PEAR_ChannelFile');
$this->_stack->setErrorMessageTemplate($this->_getErrorMessage());
$this->_isValid = false;
}
/**
* @param array
- * @static
+ *
* @return PEAR_ChannelFile|false false if invalid
*/
- function &fromArray($data, $compatibility = false, $stackClass = 'PEAR_ErrorStack')
- {
+ public static function &fromArray(
+ $data, $compatibility = false, $stackClass = 'PEAR_ErrorStack'
+ ) {
$a = new PEAR_ChannelFile($compatibility, $stackClass);
$a->_fromArray($data);
if (!$a->validate()) {
/**
* Unlike {@link fromArray()} this does not do any validation
+ *
* @param array
- * @static
+ *
* @return PEAR_ChannelFile
*/
- function &fromArrayWithErrors($data, $compatibility = false,
- $stackClass = 'PEAR_ErrorStack')
- {
+ public static function &fromArrayWithErrors(
+ $data, $compatibility = false, $stackClass = 'PEAR_ErrorStack'
+ ) {
$a = new PEAR_ChannelFile($compatibility, $stackClass);
$a->_fromArray($data);
return $a;
if (isset($this->_channelInfo['validatepackage'])) {
if ($package == $this->_channelInfo['validatepackage']) {
// channel validation packages are always validated by PEAR_Validate
- $val = &new PEAR_Validate;
+ $val = new PEAR_Validate;
return $val;
}
$this->_channelInfo['validatepackage']['_content']) . '.php';
$vclass = str_replace('.', '_',
$this->_channelInfo['validatepackage']['_content']);
- $val = &new $vclass;
+ $val = new $vclass;
} else {
$a = false;
return $a;
} else {
$vclass = str_replace('.', '_',
$this->_channelInfo['validatepackage']['_content']);
- $val = &new $vclass;
+ $val = new $vclass;
}
} else {
- $val = &new PEAR_Validate;
+ $val = new PEAR_Validate;
}
return $val;
return time();
}
-}
\ No newline at end of file
+}