#19 - flock rss.xml and rss errors doesn't block adding anymore

This commit is contained in:
ArthurHoaro 2013-04-11 13:52:55 +02:00
parent c0134348e2
commit 1cdb3e051d
2 changed files with 10 additions and 5 deletions

View file

@ -198,8 +198,8 @@ class FileRSSFeed extends RSSFeed {
foreach($merger->getFeeds(20) as $f) {
parent::addItem($f->title,$f->link,$f->description,$f->author,$f->guid,$f->time);
}
file_put_contents( $this->filename, $this->xml->asXML() );
file_put_contents( $this->filename, $this->xml->asXML(), LOCK_EX );
}
}

View file

@ -89,9 +89,14 @@ function createAutoblog($type, $sitename, $siteurl, $rssurl, $error = array()) {
/**
* RSS
**/
require_once('class_rssfeed.php');
$rss = new AutoblogRSS(RSS_FILE);
$rss->addNewAutoblog($sitename, $foldername, $siteurl, $rssurl);
try {
require_once('class_rssfeed.php');
$rss = new AutoblogRSS(RSS_FILE);
$rss->addNewAutoblog($sitename, $foldername, $siteurl, $rssurl);
}
catch (Exception $e) {
;
}
$fp = fopen($foldername .'/index.php', 'w+');
if( !fwrite($fp, "<?php require_once '../autoblog.php'; ?>") )