From c78c2006928c34279c65ad441dee6e48daccbfb8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 15 Sep 2006 11:43:05 +0000 Subject: [PATCH] rename a function borrowed from Moodle to avoid double definition when PMA is called by Moodle --- ChangeLog | 5 +++++ libraries/Config.class.php | 4 ++-- libraries/common.lib.php | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70cf10d49..54a066584 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-09-15 Marc Delisle + * libraries/common.lib.php libraries/Config.class.php: + rename a function borrowed from Moodle to avoid double definition + when PMA is called by Moodle + 2006-09-14 Michal Čihař * db_details_structure.php: Fix table footer when MySQL does not support collations (bug #1554885, patch #1557269, thanks to Isaac Bennetch - diff --git a/libraries/Config.class.php b/libraries/Config.class.php index f6e93db89..042bcde42 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -731,9 +731,9 @@ class PMA_Config if ($postsize = ini_get('post_max_size')) { $this->set('max_upload_size', - min(get_real_size($filesize), get_real_size($postsize))); + min(PMA_get_real_size($filesize), PMA_get_real_size($postsize))); } else { - $this->set('max_upload_size', get_real_size($filesize)); + $this->set('max_upload_size', PMA_get_real_size($filesize)); } } diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 5609f4c86..6ce32d0d3 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -357,11 +357,14 @@ function PMA_safe_db_list($only_db_check, $controllink, $dblist_cnt, $userlink, /** * Converts numbers like 10M into bytes + * Used with permission from Moodle (http://moodle.org) by Martin Dougiamas + * (renamed with PMA prefix to avoid double definition when embedded + * in Moodle) * * @param string $size * @return integer $size */ -function get_real_size($size = 0) +function PMA_get_real_size($size = 0) { if (!$size) { return 0; @@ -383,7 +386,7 @@ function get_real_size($size = 0) } } return $size; -} // end function get_real_size() +} // end function PMA_get_real_size() /** * loads php module