diff options
author | jaquer <jaquer@users.noreply.github.com> | 2022-01-26 09:06:25 -0800 |
---|---|---|
committer | jaquer <jaquer@users.noreply.github.com> | 2022-01-26 12:10:05 -0800 |
commit | 79fd68680b2a04240af206025fd96acd239c41a0 (patch) | |
tree | cd09fde0b55dd1ce2fcd8f07768569dda480d30d /config-dist.php | |
parent | de148409fe5024e662ee79a9d6a67368b727ccfb (diff) | |
download | microblog-79fd68680b2a04240af206025fd96acd239c41a0.tar.gz microblog-79fd68680b2a04240af206025fd96acd239c41a0.tar.bz2 microblog-79fd68680b2a04240af206025fd96acd239c41a0.zip |
Ignore changes to the config file.
Diffstat (limited to 'config-dist.php')
-rw-r--r-- | config-dist.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/config-dist.php b/config-dist.php new file mode 100644 index 0000000..41c6430 --- /dev/null +++ b/config-dist.php @@ -0,0 +1,53 @@ +<?php +error_reporting(E_ALL); +ini_set('display_errors', 1); + +DEFINE('ROOT', __DIR__); +DEFINE('DS', DIRECTORY_SEPARATOR); +DEFINE('NL', "\n"); +DEFINE('BR', "<br />"); +DEFINE('NOW', time()); + +date_default_timezone_set('Europe/Berlin'); + +/* make the path easier to read */ +$path_fragments = (parse_url(str_replace(dirname($_SERVER['SCRIPT_NAME']), '', $_SERVER['REQUEST_URI']), PHP_URL_PATH)); +$path = explode('/', trim($path_fragments, '/')); +if(mb_strlen($path[0]) == 0) $path = array(); + +// (mostly) user settings +$config = array( + 'url' => 'http'.(!empty($_SERVER['HTTPS']) ? 's' : '').'://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']), + 'path' => $path, + 'language' => 'en', + 'max_characters' => 280, + 'posts_per_page' => 10, + 'microblog_account' => '', // fill in a @username if you like + 'admin_user' => 'admin', + 'admin_pass' => 'dove-life-bird-lust', + 'cookie_life' => 60*60*24*7*4, // cookie life in seconds + 'ping' => true, // enable automatic pinging of the micro.blog service + 'crosspost_to_twitter' => false, // set this to true to automatically crosspost to a twitter account (requires app credentials, see below) + 'twitter' => array( // get your tokens over at https://dev.twitter.com/apps + 'oauth_access_token' => '', + 'oauth_access_token_secret' => '', + 'consumer_key' => '', + 'consumer_secret' => '' + ) +); + +//connect or create the database and tables +try { + $db = new PDO('sqlite:'.ROOT.DS.'posts.db'); + $db->exec("CREATE TABLE IF NOT EXISTS posts ( + id integer PRIMARY KEY NOT NULL, + post_content TEXT, + post_timestamp integer(128) + );"); +} catch(PDOException $e) { + print 'Exception : '.$e->getMessage(); + die('cannot connect to or open the database'); +} + +// load functions +require_once(ROOT.DS.'functions.php');
\ No newline at end of file |