added CalFileParser handling and debug output

This commit is contained in:
Harald Milz 2019-03-22 21:26:37 +01:00
parent e78d731379
commit e6a243766d
2 changed files with 9 additions and 3 deletions

View file

@ -4,8 +4,7 @@ INSTALLDIR = /usr/share/wordpress/wp-content/plugins/$(NAME)
VERSION = 0.1.0
release:
cd ..
zip -9 -r $(NAME)-$(VERSION).zip $(NAME)/*.php $(NAME)/*.txt
( cd .. ; zip -9 -r $(NAME)-$(VERSION).zip . -i $(NAME)/*.php $(NAME)/*.txt $(NAME)/*.md )
install:
mkdir -p $(INSTALLDIR)

View file

@ -51,13 +51,20 @@ function gcal_import_worker()
error_log ("gcal_import_worker finished", 0);
}
include ('CalFileParser.php');
function gcal_import_process_category($category) {
global $wpdb;
$table = $wpdb->prefix.GCAL_TABLE;
$structure = "SELECT gcal_link from $table WHERE gcal_category = '$category' AND gcal_active = '1' ;";
$link = $wpdb->query($structure);
error_log ("found active link $link for category $category");
$cal = new CalFileParser();
// will this also work with a proxy? After all, it does a file_get_contents internally.
$result = $cal->parse($link);
$file = "/tmp/$category-array.txt";
file_put_contents ($file, print_r ($result, TRUE));
}