We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b53391e5 authored by Evan Prodromou's avatar Evan Prodromou

Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x

parents 7dd532b6 7cfbe7c2

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @author Evan Prodromou <evan@status.net> * @author Evan Prodromou <evan@status.net>
* @author Zach Copley <zach@status.net> * @author Zach Copley <zach@status.net>
* @author Sarven Capadisli <csarven@status.net> * @author Sarven Capadisli <csarven@status.net>
* @copyright 2008-2010 StatusNet, Inc. * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
...@@ -92,7 +92,6 @@ class PathsadminpanelAction extends AdminPanelAction ...@@ -92,7 +92,6 @@ class PathsadminpanelAction extends AdminPanelAction
'site' => array('path', 'locale_path', 'ssl', 'sslserver'), 'site' => array('path', 'locale_path', 'ssl', 'sslserver'),
'theme' => array('server', 'dir', 'path', 'sslserver', 'sslpath'), 'theme' => array('server', 'dir', 'path', 'sslserver', 'sslpath'),
'avatar' => array('server', 'dir', 'path'), 'avatar' => array('server', 'dir', 'path'),
'background' => array('server', 'dir', 'path', 'sslserver', 'sslpath'),
'attachments' => array('server', 'dir', 'path', 'sslserver', 'sslpath') 'attachments' => array('server', 'dir', 'path', 'sslserver', 'sslpath')
); );
...@@ -163,14 +162,6 @@ class PathsadminpanelAction extends AdminPanelAction ...@@ -163,14 +162,6 @@ class PathsadminpanelAction extends AdminPanelAction
$this->clientError(sprintf(_('Avatar directory not writable: %s.'), $values['avatar']['dir'])); $this->clientError(sprintf(_('Avatar directory not writable: %s.'), $values['avatar']['dir']));
} }
// Validate background dir
if (empty($values['background']['dir']) || !is_writable($values['background']['dir'])) {
// TRANS: Client error in Paths admin panel.
// TRANS: %s is the background directory that could not be written to.
$this->clientError(sprintf(_('Background directory not writable: %s.'), $values['background']['dir']));
}
// Validate locales dir // Validate locales dir
// XXX: What else do we need to validate for lacales path here? --Z // XXX: What else do we need to validate for lacales path here? --Z
......
...@@ -36,7 +36,7 @@ class Memcached_DataObject extends Safe_DataObject ...@@ -36,7 +36,7 @@ class Memcached_DataObject extends Safe_DataObject
$v = $k; $v = $k;
$keys = self::pkeyCols($cls); $keys = self::pkeyCols($cls);
if (count($keys) > 1) { if (count($keys) > 1) {
// FIXME: maybe call pkeyGet() ourselves? // FIXME: maybe call pkeyGet() ourselves?
throw new Exception('Use pkeyGet() for compound primary keys'); throw new Exception('Use pkeyGet() for compound primary keys');
} }
$k = $keys[0]; $k = $keys[0];
...@@ -113,10 +113,10 @@ class Memcached_DataObject extends Safe_DataObject ...@@ -113,10 +113,10 @@ class Memcached_DataObject extends Safe_DataObject
} else { } else {
$result = array_fill_keys($keyVals, null); $result = array_fill_keys($keyVals, null);
} }
$toFetch = array(); $toFetch = array();
foreach ($keyVals as $keyVal) { foreach ($keyVals as $keyVal) {
if (is_array($keyCol)) { if (is_array($keyCol)) {
$kv = array_combine($keyCol, $keyVal); $kv = array_combine($keyCol, $keyVal);
...@@ -124,25 +124,26 @@ class Memcached_DataObject extends Safe_DataObject ...@@ -124,25 +124,26 @@ class Memcached_DataObject extends Safe_DataObject
$kv = array($keyCol => $keyVal); $kv = array($keyCol => $keyVal);
} }
$kv = array_merge($otherCols, $kv); $kv = array_merge($otherCols, $kv);
$i = self::multicache($cls, $kv); $i = self::multicache($cls, $kv);
if ($i !== false) { if ($i !== false) {
if (is_array($keyCol)) { if (is_array($keyCol)) {
$result[implode(',', $keyVal)] = $i; $result[implode(',', $keyVal)] = $i;
} else { } else {
$result[$keyVal] = $i; $result[$keyVal] = $i;
} }
} else if (!empty($keyVal)) { } else if (!empty($keyVal)) {
$toFetch[] = $keyVal; $toFetch[] = $keyVal;
} }
} }
if (count($toFetch) > 0) { if (count($toFetch) > 0) {
$i = DB_DataObject::factory($cls); $i = DB_DataObject::factory($cls);
if (empty($i)) { if (empty($i)) {
throw new Exception(_('Cannot instantiate class ' . $cls)); // TRANS: Exception thrown when a program code class (%s) cannot be instantiated.
throw new Exception(sprintf(_('Cannot instantiate class %s.'),$cls));
} }
foreach ($otherCols as $otherKeyCol => $otherKeyVal) { foreach ($otherCols as $otherKeyCol => $otherKeyVal) {
$i->$otherKeyCol = $otherKeyVal; $i->$otherKeyCol = $otherKeyVal;
...@@ -152,10 +153,10 @@ class Memcached_DataObject extends Safe_DataObject ...@@ -152,10 +153,10 @@ class Memcached_DataObject extends Safe_DataObject
} else { } else {
$i->whereAddIn($keyCol, $toFetch, $i->columnType($keyCol)); $i->whereAddIn($keyCol, $toFetch, $i->columnType($keyCol));
} }
if ($i->find()) { if ($i->find()) {
while ($i->fetch()) { while ($i->fetch()) {
$copy = clone($i); $copy = clone($i);
$copy->encache(); $copy->encache();
if (is_array($keyCol)) { if (is_array($keyCol)) {
$vals = array(); $vals = array();
foreach ($keyCol as $k) { foreach ($keyCol as $k) {
...@@ -165,36 +166,36 @@ class Memcached_DataObject extends Safe_DataObject ...@@ -165,36 +166,36 @@ class Memcached_DataObject extends Safe_DataObject
} else { } else {
$result[$i->$keyCol] = $copy; $result[$i->$keyCol] = $copy;
} }
} }
} }
// Save state of DB misses // Save state of DB misses
foreach ($toFetch as $keyVal) { foreach ($toFetch as $keyVal) {
$r = null; $r = null;
if (is_array($keyCol)) { if (is_array($keyCol)) {
$r = $result[implode(',', $keyVal)]; $r = $result[implode(',', $keyVal)];
} else { } else {
$r = $result[$keyVal]; $r = $result[$keyVal];
} }
if (empty($r)) { if (empty($r)) {
if (is_array($keyCol)) {