Permalink
Browse files

Drop PHP4

  • Loading branch information...
1 parent eeab870 commit 5585529bded572a923ee4ae2ceadd80a11f213af @CloCkWeRX CloCkWeRX committed Mar 6, 2012
Showing with 32 additions and 32 deletions.
  1. +13 −13 Packaging.php
  2. +2 −2 package.xml
  3. +9 −9 tests/phpt_test.php.inc
  4. +8 −8 tests/setup.php.inc
View
@@ -2,7 +2,7 @@
/**
* PEAR_Command_Packaging (make-rpm-spec commands)
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
@@ -264,23 +264,23 @@ class PEAR_Command_Packaging extends PEAR_Command_Common
*
* @access public
*/
- function PEAR_Command_Packaging(&$ui, &$config)
+ function PEAR_Command_Packaging($ui, $config)
{
parent::PEAR_Command_Common($ui, $config);
}
/**
* Get a PEAR_PackageFile object based on the provided config options
*/
- function &getPackageFile($config, $debug = false, $tmpdir = null)
+ function getPackageFile($config, $debug = false, $tmpdir = null)
{
if (!class_exists('PEAR_Common')) {
require_once 'PEAR/Common.php';
}
if (!class_exists('PEAR_PackageFile')) {
require_once 'PEAR/PackageFile.php';
}
- $a = &new PEAR_PackageFile($config, $debug, $tmpdir);
+ $a = new PEAR_PackageFile($config, $debug, $tmpdir);
$common = new PEAR_Common;
$common->ui = $this->ui;
$a->setLogger($common);
@@ -290,12 +290,12 @@ function &getPackageFile($config, $debug = false, $tmpdir = null)
/**
* Abstraction for unit testing purposes
*/
- function &getInstaller(&$ui)
+ function getInstaller($ui)
{
if (!class_exists('PEAR_Installer')) {
require_once 'PEAR/Installer.php';
}
- $a = &new PEAR_Installer($ui);
+ $a = new PEAR_Installer($ui);
return $a;
}
@@ -477,9 +477,9 @@ function _doMakeRPMFromPackage($source_file, $command, $options, $params) {
// Create a PEAR_PackageFile object and fill it with info from the
// source package
- $reg = &$this->config->getRegistry();
- $pkg = &$this->getPackageFile($this->config, $this->_debug);
- $pf = &$pkg->fromAnyFile($source_file, PEAR_VALIDATE_NORMAL);
+ $reg = $this->config->getRegistry();
+ $pkg = $this->getPackageFile($this->config, $this->_debug);
+ $pf = $pkg->fromAnyFile($source_file, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($pf)) {
$u = $pf->getUserinfo();
if (is_array($u)) {
@@ -538,7 +538,7 @@ function _doMakeRPMFromPackage($source_file, $command, $options, $params) {
require_once 'PEAR/Downloader/Package.php';
$pack = new PEAR_Downloader_Package($installer);
$pack->setPackageFile($pf);
- $params[0] = &$pack;
+ $params[0] = $pack;
$installer->setOptions(array('packagingroot' => $instroot,
'nodeps' => true, 'soft' => true));
$installer->setDownloadedPackages($params);
@@ -884,10 +884,10 @@ function _generatePackageDeps($pf)
/*
* Initialise the RPM naming options
*
- * @param array &$options Standard options array
+ * @param array $options Standard options array
* @return void
*/
- function _initialiseNamingOptions(&$options)
+ function _initialiseNamingOptions($options)
{
if (isset($options['rpm-pkgname'])) {
$this->_rpm_pkgname_format['pkg'] = $options['rpm-pkgname'];
@@ -971,7 +971,7 @@ function _getChannelAlias($package_name, $chan_name = null)
$alias = 'PECL';
break;
default:
- $reg = &$this->config->getRegistry();
+ $reg = $this->config->getRegistry();
$alias = $reg->channelAlias($chan_name);
// fallback
View
@@ -31,7 +31,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<name>Greg Beaver</name>
<user>cellog</user>
<email>cellog@php.net</email>
- <active>yes</active>
+ <active>no</active>
</helper>
<date>2009-06-27</date>
<version>
@@ -83,7 +83,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<dependencies>
<required>
<php>
- <min>4.3</min>
+ <min>5</min>
</php>
<pearinstaller>
<min>1.4.3</min>
@@ -12,9 +12,9 @@ class PEAR_PHPTest
{
$this->_diffonly = $diffonly;
$this->_errors = array();
- PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$this, 'pearerrorCallback'));
+ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'pearerrorCallback'));
if (!$noStackCatch) {
- PEAR_ErrorStack::setDefaultCallback(array(&$this, 'pearerrorstackCallback'));
+ PEAR_ErrorStack::setDefaultCallback(array($this, 'pearerrorstackCallback'));
}
}
@@ -251,12 +251,12 @@ class PEAR_PHPTest
$this->_failTest(debug_backtrace(), $message);
if (class_exists('Text_Diff')) {
echo "Diff of expecting/received:\n";
- $diff = &new Text_Diff(
+ $diff = new Text_Diff(
explode("\n", var_export($control, true)),
explode("\n", var_export($test, true)));
// Output the diff in unified format.
- $renderer = &new Text_Diff_Renderer_unified();
+ $renderer = new Text_Diff_Renderer_unified();
echo $renderer->render($diff);
if ($this->_diffonly) {
return false;
@@ -294,7 +294,7 @@ class PEAR_PHPTest
return true;
}
- function assertRegEquals($dump, &$reg, $message)
+ function assertRegEquals($dump, $reg, $message)
{
$actualdump = var_export(trim($this->dumpReg($reg)), true);
$testdump = var_export(trim($dump), true);
@@ -331,12 +331,12 @@ class PEAR_PHPTest
$this->_failTest(debug_backtrace(), $message);
if (class_exists('Text_Diff')) {
echo "Diff of expecting/received:\n";
- $diff = &new Text_Diff(
+ $diff = new Text_Diff(
explode("\n", var_export($control, true)),
explode("\n", var_export($test, true)));
// Output the diff in unified format.
- $renderer = &new Text_Diff_Renderer_unified();
+ $renderer = new Text_Diff_Renderer_unified();
echo $renderer->render($diff);
if ($this->_diffonly) {
return false;
@@ -356,7 +356,7 @@ class PEAR_PHPTest
return strnatcasecmp($a['name'], $b['name']);
}
- function dumpReg(&$reg)
+ function dumpReg($reg)
{
ob_start();
print "dumping registry...\n";
@@ -411,4 +411,4 @@ class PEAR_PHPTest
$this->_diffonly = false;
}
}
-?>
+?>
View
@@ -11,7 +11,7 @@ class fake_log extends PEAR_Frontend
var $_download = array();
function fake_log()
{
- $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$GLOBALS['fakelog'];
+ $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = $GLOBALS['fakelog'];
}
function log($level, $message)
@@ -154,26 +154,26 @@ if (!empty($home)) {
//require_once "PEAR/ChannelFile.php";
//require_once dirname(dirname(__FILE__)) . '/download_test_classes.php.inc';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpt_test.php.inc';
-$phpunit = &new PEAR_PHPTest(true);
+$phpunit = new PEAR_PHPTest(true);
$fakelog = new fake_log;
require_once 'PEAR/Config.php';
-$config = &new PEAR_Config($temp_path . '/pear.ini', $temp_path . '/pear.conf');
+$config = new PEAR_Config($temp_path . '/pear.ini', $temp_path . '/pear.conf');
require_once 'PEAR/Command/Packaging.php';
require_once 'PEAR/PackageFile.php';
require_once 'PEAR/Installer.php';
class test_PEAR_Command_Packaging extends PEAR_Command_Packaging
{
- function &getPackageFile(&$c, $d = false, $t = null)
+ function getPackageFile($c, $d = false, $t = null)
{
- $a = &new PEAR_PackageFile($c, $d, $t);
+ $a = new PEAR_PackageFile($c, $d, $t);
$a->setLogger($GLOBALS['fakelog']);
return $a;
}
- /*function &getInstaller()
+ /*function getInstaller()
{
- $a = &new PEAR_Installer($this->ui);
+ $a = new PEAR_Installer($this->ui);
$a->setConfig($this->config);
return $a;
}*/
@@ -190,4 +190,4 @@ class test_PEAR_Command_Packaging extends PEAR_Command_Packaging
}
}
-$command = &new test_PEAR_Command_Packaging($fakelog, $config);
+$command = new test_PEAR_Command_Packaging($fakelog, $config);

0 comments on commit 5585529

Please sign in to comment.