Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1050594
D79.id206.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 3, 1:21 AM
Size
7 KB
Mime Type
text/x-diff
Expires
Fri, Jul 4, 1:21 AM (13 h, 25 m)
Engine
blob
Format
Raw Data
Handle
678817
Attached To
D79: INP-1436 - PHP 7 compatibility issues
D79.id206.diff
View Options
Index: core/install/install_toolkit.php
===================================================================
--- core/install/install_toolkit.php
+++ core/install/install_toolkit.php
@@ -74,7 +74,10 @@
*/
var $_installator = null;
- function kInstallToolkit()
+ /**
+ * Creates instance of kInstallToolkit class.
+ */
+ public function __construct()
{
$this->systemConfig = new kSystemConfig(true, false);
Index: core/kernel/db/db_connection.php
===================================================================
--- core/kernel/db/db_connection.php
+++ core/kernel/db/db_connection.php
@@ -390,16 +390,7 @@
*/
protected function callErrorHandler($sql)
{
- if (is_array($this->errorHandler)) {
- $func = $this->errorHandler[1];
- $ret = $this->errorHandler[0]->$func($this->errorCode, $this->errorMessage, $sql);
- }
- else {
- $func = $this->errorHandler;
- $ret = $func($this->errorCode, $this->errorMessage, $sql);
- }
-
- return $ret;
+ return call_user_func($this->errorHandler, $this->errorCode, $this->errorMessage, $sql);
}
/**
Index: core/kernel/db/dblist.php
===================================================================
--- core/kernel/db/dblist.php
+++ core/kernel/db/dblist.php
@@ -261,12 +261,14 @@
parent::__construct();
$this->OrderFields = Array();
-
- $filters = $this->getFilterStructure();
-
- foreach ($filters as $filter_params) {
- $filter =& $this->$filter_params['type'];
- $filter[ $filter_params['class'] ] = $this->Application->makeClass('kMultipleFilter', Array ($filter_params['join_using']));
+ foreach ( $this->getFilterStructure() as $filter_params ) {
+ $property_name = $filter_params['type'];
+ $filter_group =& $this->$property_name;
+
+ $filter_group[$filter_params['class']] = $this->Application->makeClass(
+ 'kMultipleFilter',
+ array($filter_params['join_using'])
+ );
}
$this->PerPage = -1;
@@ -317,19 +319,7 @@
*/
public function addFilter($name, $clause, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM)
{
- $filter_source = Array (
- self::WHERE_FILTER => 'WhereFilter',
- self::HAVING_FILTER => 'HavingFilter',
- self::AGGREGATE_FILTER => 'AggregateFilter'
- );
-
- $filter_name = $filter_source[$filter_type];
-
- $filter =& $this->$filter_name;
- $filter =& $filter[$filter_scope];
- /* @var $filter kMultipleFilter */
-
- $filter->addFilter($name, $clause);
+ $this->getFilterCollection($filter_type, $filter_scope)->addFilter($name, $clause);
}
/**
@@ -343,19 +333,7 @@
*/
public function getFilter($name, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM)
{
- $filter_source = Array (
- self::WHERE_FILTER => 'WhereFilter',
- self::HAVING_FILTER => 'HavingFilter',
- self::AGGREGATE_FILTER => 'AggregateFilter'
- );
-
- $filter_name = $filter_source[$filter_type];
-
- $filter =& $this->$filter_name;
- $filter =& $filter[$filter_scope];
- /* @var $filter kMultipleFilter */
-
- return $filter->getFilter($name);
+ return $this->getFilterCollection($filter_type, $filter_scope)->getFilter($name);
}
/**
@@ -368,19 +346,30 @@
*/
public function removeFilter($name, $filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM)
{
- $filter_source = Array (
+ $this->getFilterCollection($filter_type, $filter_scope)->removeFilter($name);
+ }
+
+ /**
+ * Returns filter collection.
+ *
+ * @param integer $filter_type Is filter having filter or where filter.
+ * @param integer $filter_scope Filter subtype: FLT_NORMAL,FLT_SYSTEM,FLT_SEARCH,FLT_VIEW,FLT_CUSTOM.
+ *
+ * @return kMultipleFilter
+ */
+ protected function getFilterCollection($filter_type = self::WHERE_FILTER, $filter_scope = self::FLT_SYSTEM)
+ {
+ $filter_source = array(
self::WHERE_FILTER => 'WhereFilter',
self::HAVING_FILTER => 'HavingFilter',
self::AGGREGATE_FILTER => 'AggregateFilter'
);
- $filter_name = $filter_source[$filter_type];
-
- $filter =& $this->$filter_name;
- $filter =& $filter[$filter_scope];
- /* @var $filter kMultipleFilter */
+ /** @var kMultipleFilter[] $filters */
+ $property_name = $filter_source[$filter_type];
+ $filters =& $this->$property_name;
- $filter->removeFilter($name);
+ return $filters[$filter_scope];
}
/**
@@ -390,11 +379,11 @@
*/
public function clearFilters()
{
- $filters = $this->getFilterStructure();
+ foreach ( $this->getFilterStructure() as $filter_params ) {
+ $property_name = $filter_params['type'];
+ $filter_group =& $this->$property_name;
- foreach ($filters as $filter_params) {
- $filter =& $this->$filter_params['type'];
- $filter[ $filter_params['class'] ]->clearFilters();
+ $filter_group[$filter_params['class']]->clearFilters();
}
}
Index: core/units/categories/cache_updater.php
===================================================================
--- core/units/categories/cache_updater.php
+++ core/units/categories/cache_updater.php
@@ -18,7 +18,10 @@
var $Stack;
- function clsRecursionStack()
+ /**
+ * Creates instance of clsRecursionStack class.
+ */
+ public function __construct()
{
$this->Stack = Array();
}
@@ -541,4 +544,4 @@
$this->SaveData();
}
- }
\ No newline at end of file
+ }
Index: core/units/helpers/mailbox_helper.php
===================================================================
--- core/units/helpers/mailbox_helper.php
+++ core/units/helpers/mailbox_helper.php
@@ -261,9 +261,9 @@
$good['fromemail'] = $esender->ExtractRecipientEmail($this->headers['from']);
$good['fromname'] = $esender->ExtractRecipientName($this->headers['from'], $good['fromemail']);
- // Get the list of recipients
- if (!$verify_callback[0]->$verify_callback[1]($callback_params)) {
- // error: mail is propably spam
+ // Get the list of recipients.
+ if ( !call_user_func($verify_callback, $callback_params) ) {
+ // Error: mail is probably spam.
return false;
}
@@ -356,7 +356,7 @@
'Size' => strlen($message),
);
- return $process_callback[0]->$process_callback[1]($callback_params, $fields_hash);
+ return call_user_func($process_callback, $callback_params, $fields_hash);
}
/**
@@ -492,4 +492,4 @@
$parts['headers'] = $decoded->headers; // headers of next parts overwrite previous part headers
}
- }
\ No newline at end of file
+ }
Index: core/units/images/image_tag_processor.php
===================================================================
--- core/units/images/image_tag_processor.php
+++ core/units/images/image_tag_processor.php
@@ -70,7 +70,9 @@
function ItemImageTag($params)
{
$this->LoadItemImage($params);
- return $this->$params['original_tag']($params);
+ $tag_name = $params['original_tag'];
+
+ return $this->$tag_name($params);
}
function LargeImageExists($params)
Index: modules/in-commerce/units/gateways/gw_classes/google_checkout.php
===================================================================
--- modules/in-commerce/units/gateways/gw_classes/google_checkout.php
+++ modules/in-commerce/units/gateways/gw_classes/google_checkout.php
@@ -176,7 +176,7 @@
*/
function getRequestXML()
{
- $xml_data = $GLOBALS['HTTP_RAW_POST_DATA'];
+ $xml_data = file_get_contents('php://input');
if ( $this->Application->isDebugMode() ) {
$this->toLog($xml_data, 'xml_request.html');
@@ -937,4 +937,4 @@
{
}
- }
\ No newline at end of file
+ }
Event Timeline
Log In to Comment