PHP7: Fixed some E_WARNING errors that previously were E_STRICT
4 files added
12 files modified
| | |
| | | exit(1); |
| | | } |
| | | |
| | | $rcmail = rcmail::get_instance(); |
| | | $rcmail = rcube::get_instance(); |
| | | |
| | | // get arguments |
| | | $args = rcube_utils::get_opt(array('h' => 'host')); |
| | |
| | | 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(); |
| | |
| | | $this->filter = null; |
| | | } |
| | | |
| | | function list_groups($search = null) |
| | | function list_groups($search = null, $mode = 0) |
| | | { |
| | | return array( |
| | | array('ID' => 'testgroup1', 'name' => "Testgroup"), |
| | |
| | | return false; |
| | | } |
| | | |
| | | function rename_group($gid, $newname) |
| | | function rename_group($gid, $newname, &$newid) |
| | | { |
| | | return $newname; |
| | | } |
| | |
| | | /** |
| | | * 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; |
| | |
| | | /** |
| | | * 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); |
| | |
| | | } |
| | | |
| | | // 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(); |
| | |
| | | /** |
| | | * 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 |
| | | */ |
| | |
| | | return true; |
| | | } |
| | | |
| | | function filter($in, $out, &$consumed) |
| | | function filter($in, $out, &$consumed, $closing) |
| | | { |
| | | while ($bucket = stream_bucket_make_writeable($in)) { |
| | | $this->buffer .= $bucket->data; |
| | |
| | | /** |
| | | * 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); |
| | |
| | | * 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 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; |
New file |
| | |
| | | <?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"); |
| | | } |
| | | } |
New file |
| | |
| | | <?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"); |
| | | } |
| | | } |
New file |
| | |
| | | <?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"); |
| | | } |
| | | } |
New file |
| | |
| | | <?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"); |
| | | } |
| | | } |
| | |
| | | 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')); |
| | |
| | | |
| | | 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 . '..'; |
| | |
| | | <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> |
| | |
| | | <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> |