Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/*************************************************************************** | ||
* For license information see doc/license.txt | ||
* | ||
* Unicode Reminder メモ | ||
* | ||
* Returns a list of all caches which have been hidden after publish. | ||
* This allows an easier synchronization of this information on a | ||
* replicated system than the XML interface. | ||
***************************************************************************/ | ||
|
||
$opt['rootpath'] = '../'; | ||
require($opt['rootpath'] . 'lib2/web.inc.php'); | ||
|
||
header('Content-type: text/plain; charset=utf-8'); | ||
|
||
$rs = sql(" | ||
SELECT `wp_oc` | ||
FROM `caches` | ||
JOIN `cache_status` ON `cache_status`.`id`=`caches`.`status` | ||
WHERE `cache_status`.`allow_user_view`=0 AND `caches`.`status` != 5 | ||
ORDER BY `cache_id`"); | ||
$wp_ocs = sql_fetch_column($rs); | ||
foreach ($wp_ocs as $wp_oc) | ||
echo $wp_oc."\n"; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/*************************************************************************** | ||
* For license information see doc/license.txt | ||
* | ||
* Unicode Reminder メモ | ||
* | ||
* Replicate database contents between different OC installations/nodes | ||
***************************************************************************/ | ||
|
||
checkJob(new replicate()); | ||
|
||
class replicate | ||
{ | ||
var $name = 'replicate'; | ||
var $interval = 3600; | ||
|
||
function run() | ||
{ | ||
global $opt; | ||
|
||
if ($opt['cron']['replicate']['delete_hidden_caches']['url']) | ||
{ | ||
// This is used to remove unwanted data from test.opencaching.de | ||
// (where any users may have admin rights and see hidden caches). | ||
|
||
$hidden_caches = file_get_contents($opt['cron']['replicate']['delete_hidden_caches']['url']); | ||
$hc = explode("\n", trim($hidden_caches)); | ||
$hc_imploded_and_escaped = "'" . implode("','", array_map('sql_escape', $hc)) . "'"; | ||
sql("DELETE FROM `caches` WHERE `wp_oc` IN (" .$hc_imploded_and_escaped. ")"); | ||
// All dependent data in other tables is deleted via trigger. | ||
} | ||
} | ||
} | ||
|
||
?> |