本文整理汇总了PHP中Art::gc方法的典型用法代码示例。如果您正苦于以下问题:PHP Art::gc方法的具体用法?PHP Art::gc怎么用?PHP Art::gc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Art
的用法示例。
在下文中一共展示了Art::gc方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove_from_disk
public function remove_from_disk()
{
$deleted = true;
$season_ids = $this->get_seasons();
foreach ($season_ids as $id) {
$season = new TVShow_Season($id);
$deleted = $season->remove_from_disk();
if (!$deleted) {
debug_event('tvshow', 'Error when deleting the season `' . $id . '`.', 1);
break;
}
}
if ($deleted) {
$sql = "DELETE FROM `tvshow` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('tvshow', $this->id);
Userflag::gc('tvshow', $this->id);
Rating::gc('tvshow', $this->id);
Shoutbox::gc('tvshow', $this->id);
Useractivity::gc('tvshow', $this->id);
}
}
return $deleted;
}
示例2: gc
/**
* gc
*
* This is a wrapper function for all of the different cleaning
* functions, it runs them in an order that resembles correctness.
*/
public static function gc()
{
debug_event('catalog', 'Database cleanup started', 5);
Song::gc();
Album::gc();
Artist::gc();
Video::gc();
Art::gc();
Stats::gc();
Rating::gc();
Userflag::gc();
Useractivity::gc();
Playlist::gc();
Tmp_Playlist::gc();
Shoutbox::gc();
Tag::gc();
// TODO: use InnoDB with foreign keys and on delete cascade to get rid of garbage collection
\Lib\Metadata\Repository\Metadata::gc();
\Lib\Metadata\Repository\MetadataField::gc();
debug_event('catalog', 'Database cleanup ended', 5);
}
示例3: gc
/**
* gc
*
* This is a wrapper function for all of the different cleaning
* functions, it runs them in an order that resembles correctness.
*/
public static function gc()
{
debug_event('catalog', 'Database cleanup started', 5);
Song::gc();
Album::gc();
Artist::gc();
Art::gc();
Stats::gc();
Rating::gc();
Userflag::gc();
Playlist::gc();
Tmp_Playlist::gc();
Shoutbox::gc();
Tag::gc();
debug_event('catalog', 'Database cleanup ended', 5);
}
示例4: remove_from_disk
public function remove_from_disk()
{
$deleted = true;
$video_ids = $this->get_episodes();
foreach ($video_ids as $id) {
$video = Video::create_from_id($id);
$deleted = $video->remove_from_disk();
if (!$deleted) {
debug_event('tvshow_season', 'Error when deleting the video `' . $id . '`.', 1);
break;
}
}
if ($deleted) {
$sql = "DELETE FROM `tvshow_season` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('tvshow_season', $this->id);
Userflag::gc('tvshow_season', $this->id);
Rating::gc('tvshow_season', $this->id);
Shoutbox::gc('tvshow_season', $this->id);
}
}
return $deleted;
}
示例5: remove
public function remove()
{
$sql = "DELETE FROM `label` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('label', $this->id);
Userflag::gc('label', $this->id);
Rating::gc('label', $this->id);
Shoutbox::gc('label', $this->id);
Useractivity::gc('label', $this->id);
}
return $deleted;
}
示例6: remove_from_disk
public function remove_from_disk()
{
$deleted = true;
$song_ids = $this->get_songs();
foreach ($song_ids as $id) {
$song = new Song($id);
$deleted = $song->remove_from_disk();
if (!$deleted) {
debug_event('album', 'Error when deleting the song `' . $id . '`.', 1);
break;
}
}
if ($deleted) {
$sql = "DELETE FROM `album` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('album', $this->id);
Userflag::gc('album', $this->id);
Rating::gc('album', $this->id);
Shoutbox::gc('album', $this->id);
Useractivity::gc('album', $this->id);
}
}
return $deleted;
}
示例7: remove_from_disk
/**
* Remove the video from disk.
*/
public function remove_from_disk()
{
if (file_exists($this->file)) {
$deleted = unlink($this->file);
} else {
$deleted = true;
}
if ($deleted === true) {
$sql = "DELETE FROM `video` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('video', $this->id);
Userflag::gc('video', $this->id);
Rating::gc('video', $this->id);
Shoutbox::gc('video', $this->id);
Useractivity::gc('video', $this->id);
}
} else {
debug_event('video', 'Cannot delete ' . $this->file . 'file. Please check permissions.', 1);
}
return $deleted;
}
示例8: remove_from_disk
public function remove_from_disk()
{
$deleted = true;
$album_ids = $this->get_albums();
foreach ($album_ids as $id) {
$album = new Album($id);
$deleted = $album->remove_from_disk();
if (!$deleted) {
debug_event('artist', 'Error when deleting the album `' . $id . '`.', 1);
break;
}
}
if ($deleted) {
$sql = "DELETE FROM `artist` WHERE `id` = ?";
$deleted = Dba::write($sql, array($this->id));
if ($deleted) {
Art::gc('artist', $this->id);
Userflag::gc('artist', $this->id);
Rating::gc('artist', $this->id);
Shoutbox::gc('artist', $this->id);
}
}
return $deleted;
}