Skip to content

Commit

Permalink
Merge branch 'QA_4_4'
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Apr 15, 2015
2 parents e00ec30 + 77369e5 commit 1ad1a38
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -32,6 +32,7 @@ phpMyAdmin - ChangeLog
- bug #4794 Server error viewing table content
- bug Fix issues related to number of decimal places in time
- bug #4853 Relation view between 1600 and 1780 px
- bug PHP 7 compatibility in php-gettext

4.4.2.0 (2015-04-13)
- bug #4835 PMA_hideShowConnection not called after submit_num_fields
Expand Down
2 changes: 1 addition & 1 deletion libraries/php-gettext/gettext.php
Expand Up @@ -98,7 +98,7 @@ function readintarray($count) {
* @param object Reader the StreamReader object
* @param boolean enable_cache Enable or disable caching of strings (default on)
*/
function gettext_reader($Reader, $enable_cache = true) {
public function __construct($Reader, $enable_cache = true) {
// If there isn't a StreamReader, turn on short circuit mode.
if (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true;
Expand Down
6 changes: 3 additions & 3 deletions libraries/php-gettext/streams.php
Expand Up @@ -49,7 +49,7 @@ class StringReader {
var $_pos;
var $_str;

function StringReader($str='') {
public function __construct($str='') {
$this->_str = $str;
$this->_pos = 0;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ class FileReader {
var $_fd;
var $_length;

function FileReader($filename) {
public function __construct($filename) {
if (file_exists($filename)) {

$this->_length=filesize($filename);
Expand Down Expand Up @@ -143,7 +143,7 @@ function close() {
// Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader {
function CachedFileReader($filename) {
public function __construct($filename) {
if (file_exists($filename)) {

$length=filesize($filename);
Expand Down
8 changes: 5 additions & 3 deletions test/libraries/php-gettext/PMA_FileReader_test.php
Expand Up @@ -121,20 +121,22 @@ public function testClose()
public function testForNonExistingFile()
{
$file = new FileReader('./path/for/no/file.txt');
// looking at the return value of a constructor is curious
// but the constructor returns a value
$this->assertFalse(
$file->FileReader('./path/for/no/file.txt')
$file->__construct('./path/for/no/file.txt')
);
}

public function testForCachedFileReader()
{
$reader = new CachedFileReader('./test/test_data/test.file');
$this->assertEquals(
$reader->CachedFileReader('./test/test_data/test.file'),
$reader->__construct('./test/test_data/test.file'),
null
);
$this->assertFalse(
$reader->CachedFileReader('./path/for/no/file.txt')
$reader->__construct('./path/for/no/file.txt')
);

}
Expand Down

0 comments on commit 1ad1a38

Please sign in to comment.