Skip to content
Permalink
Browse files

Introduce the attrs module (A-codes)

Update issue 70
  • Loading branch information...
wrygiel committed Jun 25, 2013
1 parent 07bcf5b commit 00aec0ec35194943d112043f6e83b5a74b25c770

This file was deleted.

Oops, something went wrong.
@@ -781,6 +781,14 @@ public function acquire()
flock($this->lock, LOCK_EX);
}
public function try_acquire()
{
if ($this->lock !== null)
return flock($this->lock, LOCK_EX | LOCK_NB);
else
return true; # $lock can be null only when debugging
}
public function release()
{
if ($this->lock !== null)
@@ -922,45 +930,6 @@ public static function get_var_dir()
throw new Exception("You need to set a valid VAR_DIR.");
}
/**
* Get an array of all site-specific attributes in the following format:
* $arr[<id_of_the_attribute>][<language_code>] = <attribute_name>.
*/
public static function get_all_atribute_names()
{
if (Settings::get('OC_BRANCH') == 'oc.pl')
{
# OCPL branch uses cache_attrib table to store attribute names. It has
# different structure than the OCDE cache_attrib table. OCPL does not
# have translation tables.
$rs = Db::query("select id, language, text_long from cache_attrib order by id");
}
else
{
# OCDE branch uses translation tables. Let's make a select which will
# produce results compatible with the one above.
$rs = Db::query("
select
ca.id,
stt.lang as language,
stt.text as text_long
from
cache_attrib ca,
sys_trans_text stt
where ca.trans_id = stt.trans_id
order by ca.id
");
}
$dict = array();
while ($row = mysql_fetch_assoc($rs)) {
$dict[$row['id']][strtolower($row['language'])] = $row['text_long'];
}
return $dict;
}
/** Returns something like "Opencaching.PL" or "Opencaching.DE". */
public static function get_normalized_site_name($site_url = null)
{
@@ -26,8 +26,8 @@
use okapi\OkapiServiceRunner;
use okapi\OkapiInternalRequest;
use okapi\OkapiInternalConsumer;
use okapi\services\replicate\ReplicateCommon;
use okapi\services\attrs\AttrHelper;
use okapi\services\replicate\ReplicateCommon;
class CronJobController
{
@@ -51,7 +51,6 @@ public static function get_enabled_cronjobs()
new FulldumpGeneratorJob(),
new TileTreeUpdater(),
new SearchSetsCleanerJob(),
// WRCLEANIT: new AttrsRefresherJob(),
new TableOptimizerJob(),
);
foreach ($cache as $cronjob)
@@ -776,24 +775,6 @@ public function execute()
}
}
/**
* Once every hour, update the official cache attributes listing.
*
* WRTODO: Make it 12 hours later.
*
* WRCLEANIT
*
class AttrsRefresherJob extends Cron5Job
{
public function get_period() { return 3600; }
public function execute()
{
require_once($GLOBALS['rootpath']."okapi/services/attrs/attr_helper.inc.php");
AttrHelper::refresh_if_stale();
}
}
*/
/** Once per day, optimize certain MySQL tables. */
class TableOptimizerJob extends Cron5Job
{
@@ -23,7 +23,9 @@ class OkapiServiceRunner
'services/apiref/method',
'services/apiref/method_index',
'services/apiref/issue',
// Issue 70 - in progress: 'services/attrs/info',
'services/attrs/attribute_index',
'services/attrs/attribute',
'services/attrs/attributes',
'services/oauth/request_token',
'services/oauth/authorize',
'services/oauth/access_token',
Oops, something went wrong.

0 comments on commit 00aec0e

Please sign in to comment.
You can’t perform that action at this time.