- Timestamp:
- 10/01/08 04:26:27 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/sabel/trunk/app/aspects/UserCache.php
r20329 r20334 27 27 28 28 $cache = UserCache::getInstance(); 29 if ($data = $cache->read($userId)) {30 if ($fp = $cache->lock($userId)) {31 $data["statuses"]++;32 $data["comment"] = $comment;33 $cache->write($fp, $data);34 }29 list ($fp, $data) = $cache->lock($userId); 30 31 if ($data) { 32 $data["statuses"]++; 33 $data["comment"] = $comment; 34 $cache->write($fp, $data); 35 35 } 36 36 } … … 41 41 42 42 $cache = UserCache::getInstance(); 43 if ($data = $cache->read($userId)) {44 if ($fp = $cache->lock($userId)) {45 $data["statuses"]--;46 $data["comment"] = Status::getLatestCommentByUserId($userId);47 $cache->write($fp, $data);48 }43 list ($fp, $data) = $cache->lock($userId); 44 45 if ($data) { 46 $data["statuses"]--; 47 $data["comment"] = Status::getLatestCommentByUserId($userId); 48 $cache->write($fp, $data); 49 49 } 50 50 } … … 55 55 56 56 $cache = UserCache::getInstance(); 57 list ($fp, $data) = $cache->lock($userId); 57 58 58 if ($data = $cache->read($userId)) { 59 if ($fp = $cache->lock($userId)) { 60 $data["friends"]++; 61 $cache->write($fp, $data); 62 } 59 if ($data) { 60 $data["friends"]++; 61 $cache->write($fp, $data); 63 62 } 64 63 65 if ($data = $cache->read($targetId)) {66 if ($fp = $cache->lock($targetId)) {67 $data["followers"]++;68 $cache->write($fp, $data);69 }64 list ($fp, $data) = $cache->lock($targetId); 65 66 if ($data) { 67 $data["followers"]++; 68 $cache->write($fp, $data); 70 69 } 71 70 } … … 76 75 77 76 $cache = UserCache::getInstance(); 77 list ($fp, $data) = $cache->lock($userId); 78 78 79 if ($data = $cache->read($userId)) { 80 if ($fp = $cache->lock($userId)) { 81 $data["friends"]--; 82 $cache->write($fp, $data); 83 } 79 if ($data) { 80 $data["friends"]--; 81 $cache->write($fp, $data); 84 82 } 85 83 86 if ($data = $cache->read($targetId)) {87 if ($fp = $cache->lock($targetId)) {88 $data["followers"]--;89 $cache->write($fp, $data);90 }84 list ($fp, $data) = $cache->lock($targetId); 85 86 if ($data) { 87 $data["followers"]--; 88 $cache->write($fp, $data); 91 89 } 92 90 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)