The temporary paths (temp, lock, itemcache) are now detected automatically when used.
This commit is contained in:
parent
38fb43702f
commit
5ed5773f57
8 changed files with 75 additions and 13 deletions
|
@ -764,7 +764,7 @@ function get_photo_info($url) {
|
|||
if (is_null($data)) {
|
||||
$img_str = fetch_url($url, true, $redirects, 4);
|
||||
|
||||
$tempfile = tempnam(get_config("system","temppath"), "cache");
|
||||
$tempfile = tempnam(get_temppath(), "cache");
|
||||
file_put_contents($tempfile, $img_str);
|
||||
$data = getimagesize($tempfile);
|
||||
unlink($tempfile);
|
||||
|
|
|
@ -424,7 +424,7 @@ function bb_ShareAttributes($match) {
|
|||
|
||||
$posted = "";
|
||||
|
||||
$itemcache = get_config("system","itemcache");
|
||||
$itemcache = get_itemcachepath();
|
||||
|
||||
// relative dates only make sense when they aren't cached
|
||||
if ($itemcache == "") {
|
||||
|
@ -661,7 +661,7 @@ function bb_ShareAttributes($share, $simplehtml) {
|
|||
|
||||
$posted = "";
|
||||
|
||||
$itemcache = get_config("system","itemcache");
|
||||
$itemcache = get_itemcachepath();
|
||||
|
||||
// relative dates only make sense when they aren't cached
|
||||
if ($itemcache == "") {
|
||||
|
@ -949,8 +949,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
|
|||
|
||||
// removing multiplicated newlines
|
||||
if (get_config("system", "remove_multiplicated_lines")) {
|
||||
$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n");
|
||||
$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]");
|
||||
$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ");
|
||||
$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ");
|
||||
do {
|
||||
$oldtext = $Text;
|
||||
$Text = str_replace($search, $replace, $Text);
|
||||
|
|
|
@ -35,7 +35,7 @@ function cronhooks_run(&$argv, &$argc){
|
|||
}
|
||||
}
|
||||
|
||||
$lockpath = get_config('system','lockpath');
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'cronhooks');
|
||||
if($pidfile->is_already_running()) {
|
||||
|
|
|
@ -58,7 +58,7 @@ function onepoll_run(&$argv, &$argc){
|
|||
}
|
||||
|
||||
// Test
|
||||
$lockpath = get_config('system','lockpath');
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'onepoll'.$contact_id);
|
||||
if($pidfile->is_already_running()) {
|
||||
|
|
|
@ -41,7 +41,7 @@ function poller_run(&$argv, &$argc){
|
|||
}
|
||||
}
|
||||
|
||||
$lockpath = get_config('system','lockpath');
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'poller');
|
||||
if($pidfile->is_already_running()) {
|
||||
|
|
|
@ -84,7 +84,7 @@ function queue_run(&$argv, &$argc){
|
|||
load_config('config');
|
||||
load_config('system');
|
||||
|
||||
$lockpath = get_config('system','lockpath');
|
||||
$lockpath = get_lockpath();
|
||||
if ($lockpath != '') {
|
||||
$pidfile = new pidfile($lockpath, 'queue');
|
||||
if($pidfile->is_already_running()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue