PHP7: Fixed some E_WARNING errors that previously were E_STRICT

pull/290/head
Aleksander Machniak 9 years ago
parent b3e9764c31
commit 36bd93f138

@ -37,7 +37,7 @@ function _die($msg, $usage=false)
exit(1);
}
$rcmail = rcmail::get_instance();
$rcmail = rcube::get_instance();
// get arguments
$args = rcube_utils::get_opt(array('h' => 'host'));

@ -40,7 +40,7 @@
require_once 'program/include/iniset.php';
// init application, start session, init output class, etc.
$RCMAIL = rcmail::get_instance($GLOBALS['env']);
$RCMAIL = rcmail::get_instance(0, $GLOBALS['env']);
// Make the whole PHP output non-cacheable (#1487797)
$RCMAIL->output->nocacheing_headers();

@ -44,7 +44,7 @@ class example_addressbook_backend extends rcube_addressbook
$this->filter = null;
}
function list_groups($search = null)
function list_groups($search = null, $mode = 0)
{
return array(
array('ID' => 'testgroup1', 'name' => "Testgroup"),
@ -98,7 +98,7 @@ class example_addressbook_backend extends rcube_addressbook
return false;
}
function rename_group($gid, $newname)
function rename_group($gid, $newname, &$newid)
{
return $newname;
}

@ -49,9 +49,11 @@ class rcube_sieve_vacation extends rcube_sieve_engine
/**
* Find and load sieve script with/for vacation rule
*
* @param string $script_name Optional script name
*
* @return int Connection status: 0 on success, >0 on failure
*/
protected function load_script()
protected function load_script($script_name = null)
{
if ($this->script_name !== null) {
return 0;

@ -65,11 +65,12 @@ class rcmail extends rcube
/**
* This implements the 'singleton' design pattern
*
* @param string Environment name to run (e.g. live, dev, test)
* @param integer $mode Ignored rcube::get_instance() argument
* @param string $env Environment name to run (e.g. live, dev, test)
*
* @return rcmail The one and only instance
*/
static function get_instance($env = '')
static function get_instance($mode = 0, $env = '')
{
if (!self::$instance || !is_a(self::$instance, 'rcmail')) {
self::$instance = new rcmail($env);
@ -94,8 +95,9 @@ class rcmail extends rcube
}
// load all configured plugins
$this->plugins->load_plugins((array)$this->config->get('plugins', array()),
array('filesystem_attachments', 'jqueryui'));
$plugins = (array) $this->config->get('plugins', array());
$required_plugins = array('filesystem_attachments', 'jqueryui');
$this->plugins->load_plugins($plugins, $required_plugins);
// start session
$this->session_init();

@ -25,7 +25,8 @@
*/
$config = array(
'error_reporting' => E_ALL & ~E_NOTICE & ~E_STRICT,
// 'error_reporting' => E_ALL & ~E_NOTICE & ~E_STRICT,
'error_reporting' => E_STRICT,
// Some users are not using Installer, so we'll check some
// critical PHP settings here. Only these, which doesn't provide
// an error/warning in the logs later. See (#1486307).

@ -124,8 +124,8 @@ class rcube
/**
* This implements the 'singleton' design pattern
*
* @param integer Options to initialize with this instance. See rcube::INIT_WITH_* constants
* @param string Environment name to run (e.g. live, dev, test)
* @param integer $mode Options to initialize with this instance. See rcube::INIT_WITH_* constants
* @param string $env Environment name to run (e.g. live, dev, test)
*
* @return rcube The one and only instance
*/

@ -33,7 +33,7 @@ class rcube_content_filter extends php_user_filter
return true;
}
function filter($in, $out, &$consumed)
function filter($in, $out, &$consumed, $closing)
{
while ($bucket = stream_bucket_make_writeable($in)) {
$this->buffer .= $bucket->data;

@ -1051,11 +1051,14 @@ class rcube_ldap extends rcube_addressbook
/**
* Create a new contact record
*
* @param array Hash array with save data
* @param array Associative array with save data
* Keys: Field name with optional section in the form FIELD:SECTION
* Values: Field value. Can be either a string or an array of strings for multiple values
* @param boolean True to check for duplicates first
*
* @return encoded record ID on success, False on error
* @return mixed The created record ID on success, False on error
*/
function insert($save_cols)
function insert($save_cols, $check = false)
{
// Map out the column names to their LDAP ones to build the new entry.
$newentry = $this->_map_data($save_cols);

@ -57,12 +57,13 @@ class rcube_ldap_generic extends Net_LDAP3
* Get a specific LDAP entry, identified by its DN
*
* @param string $dn Record identifier
* @param array $attributes Attributes to return
*
* @return array Hash array
*/
function get_entry($dn)
function get_entry($dn, $attributes = array())
{
return parent::get_entry($dn, $this->attributes);
return parent::get_entry($dn, !empty($attributes) ? $attributes : $this->attributes);
}
/**
@ -284,10 +285,11 @@ class rcube_ldap_generic extends Net_LDAP3
* Turn an LDAP entry into a regular PHP array with attributes as keys.
*
* @param array $entry Attributes array as retrieved from ldap_get_attributes() or ldap_get_entries()
* @param bool $flat Convert one-element-array values into strings (not implemented)
*
* @return array Hash array with attributes as keys
*/
public static function normalize_entry($entry)
public static function normalize_entry($entry, $flat = false)
{
if (!isset($entry['count'])) {
return $entry;

@ -0,0 +1,22 @@
<?php
/**
* Test class to test rcube_db_oracle class
*
* @package Tests
* @group database
* @group oracle
*/
class Framework_DBOracle extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_db_oracle('test');
$this->assertInstanceOf('rcube_db_oracle', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_imap_search class
*
* @package Tests
*/
class Framework_ImapSearch extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_imap_search(array(), true);
$this->assertInstanceOf('rcube_imap_search', $object, "Class constructor");
}
}

@ -0,0 +1,23 @@
<?php
/**
* Test class to test rcube_ldap class
*
* @package Tests
*/
class Framework_Ldap extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
// skip this test as we don't want to connect to ldap here
$this->markTestSkipped('We do not connect to LDAP');
$object = new rcube_ldap(array());
$this->assertInstanceOf('rcube_ldap', $object, "Class constructor");
}
}

@ -0,0 +1,20 @@
<?php
/**
* Test class to test rcube_result_multifolder class
*
* @package Tests
*/
class Framework_ResultMultifolder extends PHPUnit_Framework_TestCase
{
/**
* Class constructor
*/
function test_class()
{
$object = new rcube_result_multifolder;
$this->assertInstanceOf('rcube_result_multifolder', $object, "Class constructor");
}
}

@ -38,7 +38,7 @@ if (set_include_path($include_path) === false) {
die("Fatal error: ini_set/set_include_path does not work.");
}
$rcmail = rcmail::get_instance('test');
$rcmail = rcmail::get_instance(0, 'test');
define('TESTS_URL', $rcmail->config->get('tests_url'));
define('TESTS_BROWSER', $rcmail->config->get('tests_browser', 'firefox'));

@ -32,7 +32,7 @@ if (@is_dir(TESTS_DIR . 'config')) {
require_once(INSTALL_PATH . 'program/include/iniset.php');
rcmail::get_instance('test')->config->set('devel_mode', false);
rcmail::get_instance(0, 'test')->config->set('devel_mode', false);
// Extend include path so some plugin test won't fail
$include_path = ini_get('include_path') . PATH_SEPARATOR . TESTS_DIR . '..';

@ -15,6 +15,7 @@
<file>Framework/DB.php</file>
<file>Framework/DBMssql.php</file>
<file>Framework/DBMysql.php</file>
<file>Framework/DBOracle.php</file>
<file>Framework/DBPgsql.php</file>
<file>Framework/DBSqlite.php</file>
<file>Framework/DBSqlsrv.php</file>
@ -24,13 +25,16 @@
<file>Framework/Imap.php</file>
<file>Framework/ImapCache.php</file>
<file>Framework/ImapGeneric.php</file>
<file>Framework/ImapSearch.php</file>
<file>Framework/Image.php</file>
<file>Framework/Ldap.php</file>
<file>Framework/LdapGeneric.php</file>
<file>Framework/MessageHeader.php</file>
<file>Framework/MessagePart.php</file>
<file>Framework/Mime.php</file>
<file>Framework/Rcube.php</file>
<file>Framework/ResultIndex.php</file>
<file>Framework/ResultMultifolder.php</file>
<file>Framework/ResultSet.php</file>
<file>Framework/ResultThread.php</file>
<file>Framework/Smtp.php</file>

Loading…
Cancel
Save