Open Social Bug in code

http://www.boonex.com/trac/dolphin/ticket/1139

Rules → http://www.boonex.com/terms
Quote · 11 Sep 2009

BUMP for more eyes.

Anyone have theirs working?

Quote · 19 Oct 2009

I've the problem.

I've found what to change, please write me a mail in unity with the request and your real mail address, I'll reply to you with the 2 modified files (CacheStorageFile.php and container.php).

PS: This error happen because opensocial/partuza config file refer to server's tmp folder instead of tmp folder inside your public_html!

Quote · 19 Oct 2009

Here's the fix, all credit goes to luca_it for coding it.  Boonex please put on trac and fix this so all can have the open social.


You have to edit 2 files.  Open /modules/open_social/shinding/php/config/container.php and edit line 145 to show as follows:

'cache_root' => $_SERVER["DOCUMENT_ROOT"] . '/tmp/shindig',

Open modules/open_source/integration/Library/CacheStorageFile.php

copy and replace it with the following

<?php
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/

class CacheStorageFile extends CacheStorage {
private $prefix = null;

public function __construct($name) {
$this->prefix = $name;
}

public function store($key, $value) {
$cacheDir = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheDir($key);
$cacheFile = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheFile($key);
if (! is_dir($cacheDir)) {
if (! @mkdir($cacheDir, 0755, true)) {
throw new CacheException("Could not create cache directory");
}
}

return file_put_contents($cacheFile, $value);
}

public function fetch($key) {
$cacheFile = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheFile($key);
if (file_exists($cacheFile) && is_readable($cacheFile)) {
return @file_get_contents($cacheFile);
}
return false;
}

public function delete($key) {
$cacheFile = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheFile($key);
if (! @unlink($cacheFile)) {
throw new CacheException("Cache file could not be deleted");
}
}

public function isLocked($key) {
// our lock file convention is simple: /the/file/path.lock
clearstatcache();
return file_exists($key . '.lock');
}

public function lock($key) {
$cacheDir = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheDir($key);
$cacheFile = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheFile($key);
if (! is_dir($cacheDir)) {
if (! @mkdir($cacheDir, 0755, true)) {
// make sure the failure isn't because of a concurency issue
if (! is_dir($cacheDir)) {
throw new CacheException("Could not create cache directory");
}
}
}
@touch($cacheFile . '.lock');
}

public function unlock($key) {
// suppress all warnings, if some other process removed it that's ok too
$cacheFile = $_SERVER["DOCUMENT_ROOT"] . '/'  . CacheStorageFile::getCacheFile($key);
@unlink($cacheFile . '.lock');
}

private function getCacheDir($key) {
// use the first 2 characters of the hash as a directory prefix
// this should prevent slowdowns due to huge directory listings
// and thus give some basic amount of scalability
return PartuzaConfig::get('cache_root') . '/' . $this->prefix . '/' . substr($key, 0, 2);
}

private function getCacheFile($key) {
return $this->getCacheDir($key) . '/' . $key;
}
}

Quote · 20 Oct 2009

Hi,

No one that add this to trac?

And I don't know if you have seen but an open social app with a non standard dimensions (higher than the box in profile) don't fit in the opensocial box in profile...

Thank

Quote · 25 Oct 2009

Ticket re-opened: http://www.boonex.com/trac/dolphin/ticket/1139#comment:2

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 25 Oct 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.