Permalink
Browse files

Bug #15126 - less use of references / E_NOTICE

git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@275328 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
CloCkWeRX committed Feb 7, 2009
1 parent 0ceeef2 commit 861f662d3dd4ad138876b2282b96496241743fcb
Showing with 33 additions and 33 deletions.
  1. +1 −1 Auth/PEARAuth.php
  2. +1 −1 Auth/XML.php
  3. +23 −23 LiveUser.php
  4. +2 −2 Perm/Storage/XML.php
  5. +3 −3 docs/examples/example5/admin.php
  6. +2 −2 docs/examples/example5/home.php
  7. +1 −1 sql/install.php
View
@@ -111,7 +111,7 @@ function init(&$conf, $containerName)
parent::init($conf, $containerName);
if (!is_a($this->pearAuth, 'auth') && $this->container) {
- $pearAuth = &new Auth($this->container, $this->options, '', false);
+ $pearAuth = new Auth($this->container, $this->options, '', false);
if (PEAR::isError($pearAuth)) {
$this->stack->push(LIVEUSER_ERROR_INIT_ERROR, 'error',
array('container' => 'could not connect: '.$pearAuth->getMessage(),
View
@@ -112,7 +112,7 @@ function init(&$conf, $containerName)
$this->file = getenv('DOCUMENT_ROOT') . $this->file;
}
- $tree =& new XML_Tree($this->file);
+ $tree = new XML_Tree($this->file);
$err =& $tree->getTreeFromFile();
if (PEAR::isError($err)) {
$this->stack->push(LIVEUSER_ERROR, 'exception', array(),
View
@@ -345,16 +345,16 @@ function LiveUser(&$debug)
$this->stack = &PEAR_ErrorStack::singleton('LiveUser');
if ($debug) {
- $log =& LiveUser::PEARLogFactory($debug);
+ $log = LiveUser::PEARLogFactory($debug);
if ($log) {
- $this->log =& $log;
+ $this->log = $log;
$this->stack->setLogger($this->log);
}
}
$this->stack->setErrorMessageTemplate($this->_errorMessages);
- $this->dispatcher =& Event_Dispatcher::getInstance();
+ $this->dispatcher = Event_Dispatcher::getInstance();
}
/**
@@ -464,16 +464,16 @@ function &factory(&$conf)
{
$debug = false;
if (array_key_exists('debug', $conf)) {
- $debug =& $conf['debug'];
+ $debug = $conf['debug'];
}
- $obj = &new LiveUser($debug);
+ $obj = new LiveUser($debug);
if (is_array($conf)) {
$obj->readConfig($conf);
}
- return $obj;
+ return &$obj;
}
/**
@@ -509,7 +509,7 @@ function &singleton(&$conf, $signature = null)
}
if (!array_key_exists($signature, $instances)) {
- $instances[$signature] =& LiveUser::factory($conf);
+ $instances[$signature] = LiveUser::factory($conf);
}
return $instances[$signature];
@@ -574,12 +574,12 @@ function &authFactory(&$conf, $containerName, $classprefix = 'LiveUser_')
$auth = false;
$classname = $classprefix.'Auth_' . $conf['type'];
if (LiveUser::loadClass($classname)) {
- $auth = &new $classname();
+ $auth = new $classname();
if ($auth->init($conf, $containerName) === false) {
$auth = false;
}
}
- return $auth;
+ return &$auth;
}
/**
@@ -597,13 +597,13 @@ function &permFactory(&$conf, $classprefix = 'LiveUser_')
$perm = false;
$classname = $classprefix.'Perm_' . $conf['type'];
if (LiveUser::loadClass($classname)) {
- $perm = &new $classname();
+ $perm = new $classname();
if ($perm->init($conf) === false) {
$perm = false;
}
}
- return $perm;
+ return &$perm;
}
/**
@@ -633,24 +633,24 @@ function &storageFactory(&$confArray, $classprefix = 'LiveUser_Perm_')
array_pop($keys);
$newConfArray = array();
foreach ($keys as $key) {
- $newConfArray[$key] =& $confArray[$key];
+ $newConfArray[$key] = $confArray[$key];
}
- $storage =& LiveUser::storageFactory($newConfArray, $classprefix);
+ $storage = LiveUser::storageFactory($newConfArray, $classprefix);
return $storage;
}
}
- $storageConf =& $confArray[$key];
+ $storageConf = $confArray[$key];
$newConfArray = array();
foreach ($confArray as $keyNew => $foo) {
if ($key !== $keyNew) {
- $newConfArray[$keyNew] =& $confArray[$keyNew];
+ $newConfArray[$keyNew] = $confArray[$keyNew];
}
}
- $storage = &new $storageName();
+ $storage = new $storageName();
if ($storage->init($storageConf, $newConfArray) === false) {
$storage = false;
}
- return $storage;
+ return &$storage;
}
/**
@@ -738,10 +738,10 @@ function classExists($classname)
function readConfig($conf)
{
if (array_key_exists('authContainers', $conf)) {
- $this->_authContainers =& $conf['authContainers'];
+ $this->_authContainers = $conf['authContainers'];
}
if (array_key_exists('permContainer', $conf)) {
- $this->_permContainer =& $conf['permContainer'];
+ $this->_permContainer = $conf['permContainer'];
}
$this->_options = LiveUser::arrayMergeClobber($this->_options, $conf);
@@ -797,7 +797,7 @@ function &PEARLogFactory(&$log)
}
require_once 'Log.php';
- $log =& Log::factory('composite');
+ $log = Log::factory('composite');
if (!is_a($log, 'Log_composite')) {
$this->stack->push(
LIVEUSER_ERROR_CONFIG, 'exception', array(),
@@ -818,7 +818,7 @@ function &PEARLogFactory(&$log)
PEAR_LOG_DEBUG => 'black',
),
);
- $winlog =& Log::factory('win', 'LiveUser', 'LiveUser', $conf);
+ $winlog = Log::factory('win', 'LiveUser', 'LiveUser', $conf);
if (!is_a($winlog, 'Log_win')) {
$this->stack->push(
LIVEUSER_ERROR_CONFIG, 'exception', array(),
@@ -915,7 +915,7 @@ function &cryptRC4Factory($secret)
{
$rc4 = false;
if (LiveUser::loadClass('Crypt_Rc4')) {
- $rc4 =& new Crypt_Rc4($secret);
+ $rc4 = new Crypt_Rc4($secret);
}
return $rc4;
}
@@ -945,7 +945,7 @@ function cryptRC4($data, $secret, $crypt = true)
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
} else {
- $rc4 =& LiveUser::cryptRC4Factory($secret);
+ $rc4 = LiveUser::cryptRC4Factory($secret);
if (!$rc4) {
$this->stack->push(
LIVEUSER_ERROR_CONFIG, 'exception', array(),
View
@@ -117,7 +117,7 @@ function init(&$storageConf)
$this->file = getenv('DOCUMENT_ROOT') . $this->file;
}
- $tree =& new XML_Tree($this->file);
+ $tree = new XML_Tree($this->file);
$err =& $tree->getTreeFromFile();
if (PEAR::isError($err)) {
$this->stack->push(LIVEUSER_ERROR, 'exception', array(),
@@ -221,4 +221,4 @@ function disconnect()
return true;
}
}
-?>
+?>
@@ -44,7 +44,7 @@
$news = getNewsList($db, $category);
}
-$tpl =& new HTML_Template_IT('./');
+$tpl = new HTML_Template_IT('./');
$tpl->loadTemplatefile('admin.tpl');
// assign the content to the vars
@@ -78,7 +78,7 @@ function getNewsList(&$db, $category)
if (PEAR::isError($news)) {
die($news->getMessage() . ' ' . $news->getUserinfo());
} else {
- $tpl =& new HTML_Template_IT('./');
+ $tpl = new HTML_Template_IT('./');
$tpl->loadTemplatefile('news_list.tpl', false, false);
@@ -130,7 +130,7 @@ function getNewsContent(&$db, $news = null)
if (PEAR::isError($news)) {
die($news->getMessage() . ' ' . $news->getUserinfo());
} else {
- $tpl =& new HTML_Template_IT('./');
+ $tpl = new HTML_Template_IT('./');
$tpl->loadTemplatefile('news_edit.tpl', false, false);
@@ -6,7 +6,7 @@
// Setup template objects
if (!$usr->isLoggedIn()) {
- $tpl =& new HTML_Template_IT('./');
+ $tpl = new HTML_Template_IT('./');
$tpl->loadTemplatefile('login_form.tpl', true, false);
$login = $tpl->get();
} else {
@@ -47,7 +47,7 @@ function getNews(&$db, $newsCategory)
if (PEAR::isError($news)) {
die($news->getMessage() . ' ' . $news->getUserinfo());
} else {
- $tpl =& new HTML_Template_IT('./');
+ $tpl = new HTML_Template_IT('./');
$tpl->loadTemplatefile('news.tpl', true, true);
View
@@ -348,7 +348,7 @@ function generateSchema($obj, $file, $lengths = array(), $defaults = array())
function writeSchema($definition, $file)
{
require_once 'MDB2/Schema/Writer.php';
- $writer =& new MDB2_Schema_Writer();
+ $writer = new MDB2_Schema_Writer();
$arguments = array(
'output_mode' => 'file',
'output' => $file,

0 comments on commit 861f662

Please sign in to comment.