mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
comment out optimize block (Ashe, please review)
moved phpbb_unlink to functions_admin (used in more than one script) git-svn-id: file:///svn/phpbb/trunk@4572 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
32683fda12
commit
7924d903b0
1 changed files with 32 additions and 0 deletions
|
@ -342,6 +342,8 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
sync('topic_reported', $where_type, $where_ids);
|
sync('topic_reported', $where_type, $where_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Not an option here, deleting one post takes > 200 seconds for me (only this query)
|
||||||
|
/*
|
||||||
// Optimize/vacuum tables
|
// Optimize/vacuum tables
|
||||||
switch (SQL_LAYER)
|
switch (SQL_LAYER)
|
||||||
{
|
{
|
||||||
|
@ -358,6 +360,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
$db->sql_query('VACUUM');
|
$db->sql_query('VACUUM');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
@ -418,6 +421,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
sync('forum', 'forum_id', $forum_ids, TRUE);
|
sync('forum', 'forum_id', $forum_ids, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Not an option here, deleting one post takes > 200 seconds for me (only this query)
|
||||||
|
/*
|
||||||
// Optimize/vacuum tables
|
// Optimize/vacuum tables
|
||||||
switch (SQL_LAYER)
|
switch (SQL_LAYER)
|
||||||
{
|
{
|
||||||
|
@ -434,6 +439,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE)
|
||||||
$db->sql_query('VACUUM');
|
$db->sql_query('VACUUM');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return count($post_ids);
|
return count($post_ids);
|
||||||
}
|
}
|
||||||
|
@ -693,6 +699,32 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = TRUE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete File
|
||||||
|
function phpbb_unlink($filename, $mode = 'file')
|
||||||
|
{
|
||||||
|
global $config, $user;
|
||||||
|
|
||||||
|
$filename = ($mode == 'thumbnail') ? $config['upload_dir'] . '/thumbs/t_' . $filename : $config['upload_dir'] . '/' . $filename;
|
||||||
|
$deleted = @unlink($filename);
|
||||||
|
|
||||||
|
if (file_exists($filename))
|
||||||
|
{
|
||||||
|
$filesys = str_replace('/','\\', $filename);
|
||||||
|
$deleted = @system("del $filesys");
|
||||||
|
|
||||||
|
if (file_exists($filename))
|
||||||
|
{
|
||||||
|
@chmod($filename, 0777);
|
||||||
|
if (!($deleted = @unlink($filename)))
|
||||||
|
{
|
||||||
|
$deleted = @system("del $filename");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $deleted;
|
||||||
|
}
|
||||||
|
|
||||||
// All-encompasing sync function
|
// All-encompasing sync function
|
||||||
//
|
//
|
||||||
// Usage:
|
// Usage:
|
||||||
|
|
Loading…
Add table
Reference in a new issue