diff --git a/config.php.sample b/config.php.sample index 1651aec..2ac4480 100644 --- a/config.php.sample +++ b/config.php.sample @@ -1,10 +1,9 @@ 'https://' . $_SERVER['HTTP_HOST'] .'/', @@ -47,9 +46,6 @@ $config = array( # the IndieAuth token endpoint to use 'token_endpoint' => 'https://tokens.indieauth.com/token', - # the timezone to use for all times - 'tz' => 'America/New_York', - # the command used to build the site 'command' => '/var/www/bin/hugo --quiet --config /var/www/skippy/config.yaml -s /var/www/skippy/ -d /var/www/html/', ); diff --git a/inc/content.php b/inc/content.php index 71e7ad5..ea3e823 100644 --- a/inc/content.php +++ b/inc/content.php @@ -114,7 +114,7 @@ function reply_or_repost($properties, $content) { # given an array of front matter and body content, return a full post function build_post( $front_matter, $content) { ksort($front_matter); - return "---\n" . Yaml::dump($front_matter) . "---\n" . $content . "\n"; + return "---\n" . Yaml::dump($front_matter) . "---\n" . $content . "\n"; } function write_file($file, $content, $overwrite = false) { @@ -130,13 +130,9 @@ function write_file($file, $content, $overwrite = false) { if (file_exists($file) && ($overwrite == false) ) { quit(400, 'file_conflict', 'The specified file exists'); } - if ( ! $fh = fopen( $file, 'w' ) ) { + if ( FALSE === file_put_contents( $file, $content ) ) { quit(400, 'file_error', 'Unable to open Markdown file'); } - if ( fwrite($fh, $content ) === FALSE ) { - quit(400, 'write_error', 'Unable to write to Markdown file'); - } - fclose($fh); } function delete($request) { diff --git a/index.php b/index.php index 9d551c4..e14bf3d 100644 --- a/index.php +++ b/index.php @@ -5,7 +5,6 @@ die; } $config = include_once './config.php'; -date_default_timezone_set($config['tz']); # invoke the composer autoloader for our dependencies require_once __DIR__.'/vendor/autoload.php';