Merge branch 'refactoring' of git.kde.org:owncloud into refactoring

This commit is contained in:
Frank Karlitschek 2011-04-16 20:35:15 +02:00
commit fb74de326d
4 changed files with 17 additions and 18 deletions

View File

@ -279,7 +279,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function setOptions(&$db, $options) static function setOptions(&$db, $options)
{ {
if (is_array($options)) { if (is_array($options)) {
foreach ($options as $option => $value) { foreach ($options as $option => $value) {
@ -304,7 +304,7 @@ class MDB2
* @static * @static
* @access public * @access public
*/ */
function classExists($classname) static function classExists($classname)
{ {
if (version_compare(phpversion(), "5.0", ">=")) { if (version_compare(phpversion(), "5.0", ">=")) {
return class_exists($classname, false); return class_exists($classname, false);
@ -325,7 +325,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function loadClass($class_name, $debug) static function loadClass($class_name, $debug)
{ {
if (!MDB2::classExists($class_name)) { if (!MDB2::classExists($class_name)) {
$file_name = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php'; $file_name = str_replace('_', DIRECTORY_SEPARATOR, $class_name).'.php';
@ -374,7 +374,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function &factory($dsn, $options = false) static function factory($dsn, $options = false)
{ {
$dsninfo = MDB2::parseDSN($dsn); $dsninfo = MDB2::parseDSN($dsn);
if (empty($dsninfo['phptype'])) { if (empty($dsninfo['phptype'])) {
@ -390,7 +390,7 @@ class MDB2
return $err; return $err;
} }
$db =& new $class_name(); $db =new $class_name();
$db->setDSN($dsninfo); $db->setDSN($dsninfo);
$err = MDB2::setOptions($db, $options); $err = MDB2::setOptions($db, $options);
if (PEAR::isError($err)) { if (PEAR::isError($err)) {
@ -516,7 +516,7 @@ class MDB2
* @param array $arr2 * @param array $arr2
* @return boolean * @return boolean
*/ */
function areEquals($arr1, $arr2) static function areEquals($arr1, $arr2)
{ {
if (count($arr1) != count($arr2)) { if (count($arr1) != count($arr2)) {
return false; return false;
@ -686,7 +686,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function isResultCommon($value) static function isResultCommon($value)
{ {
return is_a($value, 'MDB2_Result_Common'); return is_a($value, 'MDB2_Result_Common');
} }
@ -723,7 +723,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function errorMessage($value = null) static function errorMessage($value = null)
{ {
static $errorMessages; static $errorMessages;
@ -824,7 +824,7 @@ class MDB2
* @access public * @access public
* @author Tomas V.V.Cox <cox@idecnet.com> * @author Tomas V.V.Cox <cox@idecnet.com>
*/ */
function parseDSN($dsn) static function parseDSN($dsn)
{ {
$parsed = $GLOBALS['_MDB2_dsninfo_default']; $parsed = $GLOBALS['_MDB2_dsninfo_default'];
@ -954,7 +954,7 @@ class MDB2
* *
* @access public * @access public
*/ */
function fileExists($file) static function fileExists($file)
{ {
// safe_mode does notwork with is_readable() // safe_mode does notwork with is_readable()
global $SERVERROOT; global $SERVERROOT;
@ -1498,7 +1498,7 @@ class MDB2_Driver_Common extends PEAR
} }
} }
$err =& PEAR::raiseError(null, $code, $mode, $options, $userinfo, 'MDB2_Error', true); $err = PEAR::raiseError(null, $code, $mode, $options, $userinfo, 'MDB2_Error', true);
if ($err->getMode() !== PEAR_ERROR_RETURN if ($err->getMode() !== PEAR_ERROR_RETURN
&& isset($this->nested_transaction_counter) && !$this->has_transaction_error) { && isset($this->nested_transaction_counter) && !$this->has_transaction_error) {
$this->has_transaction_error =& $err; $this->has_transaction_error =& $err;
@ -2097,7 +2097,7 @@ class MDB2_Driver_Common extends PEAR
* @access public * @access public
* @since 2.1.1 * @since 2.1.1
*/ */
function setTransactionIsolation($isolation, $options = array()) static function setTransactionIsolation($isolation, $options = array())
{ {
$this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true)); $this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
@ -2647,7 +2647,7 @@ class MDB2_Driver_Common extends PEAR
'result class does not exist '.$class_name, __FUNCTION__); 'result class does not exist '.$class_name, __FUNCTION__);
return $err; return $err;
} }
$result =& new $class_name($this, $result, $limit, $offset); $result =new $class_name($this, $result, $limit, $offset);
if (!MDB2::isResultCommon($result)) { if (!MDB2::isResultCommon($result)) {
$err =& $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null, $err =& $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'result class is not extended from MDB2_Result_Common', __FUNCTION__); 'result class is not extended from MDB2_Result_Common', __FUNCTION__);

View File

@ -462,7 +462,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
* @access public * @access public
* @since 2.1.1 * @since 2.1.1
*/ */
function setTransactionIsolation($isolation) static function setTransactionIsolation($isolation, $options = array())
{ {
$this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true)); $this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
if (!$this->supports('transactions')) { if (!$this->supports('transactions')) {

View File

@ -247,7 +247,7 @@ class PEAR
* @access public * @access public
* @return bool true if parameter is an error * @return bool true if parameter is an error
*/ */
function isError($data, $code = null) static function isError($data, $code = null)
{ {
if (is_a($data, 'PEAR_Error')) { if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) { if (is_null($code)) {

View File

@ -23,8 +23,7 @@
// set some stuff // set some stuff
//ob_start(); //ob_start();
// error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
error_reporting( E_ERROR | E_PARSE | E_WARNING ); // MDB2 gives loads of strict error, disabling for now
date_default_timezone_set('Europe/Berlin'); date_default_timezone_set('Europe/Berlin');
ini_set('arg_separator.output','&amp;'); ini_set('arg_separator.output','&amp;');
@ -305,7 +304,7 @@ class OC_UTIL {
}else{ }else{
//TODO: premisions checks for windows hosts //TODO: premisions checks for windows hosts
} }
if(!is_writable($CONFIG_DATADIRECTORY_ROOT)){ if(is_dir($CONFIG_DATADIRECTORY_ROOT) and !is_writable($CONFIG_DATADIRECTORY_ROOT)){
$errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') not writable by ownCloud<br/>','hint'=>$permissionsHint); $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') not writable by ownCloud<br/>','hint'=>$permissionsHint);
} }