| @ -1,4 +1,4 @@ | |||
| { | |||
| "id": 782014, | |||
| "tag_name": "v2.5" | |||
| "id": 782014, | |||
| "tag_name": "v2.5.1" | |||
| } | |||
| @ -1,20 +1,21 @@ | |||
| { | |||
| "config": { | |||
| "vendor-dir": "system/vendor/", | |||
| "optimize-autoloader": true | |||
| }, | |||
| "require": { | |||
| "michelf/php-markdown": "~1.4", | |||
| "suin/php-rss-writer": "~1", | |||
| "kanti/hub-updater": "~0.3" | |||
| }, | |||
| "autoload": { | |||
| "files": [ | |||
| "system/includes/dispatch.php", | |||
| "system/includes/functions.php", | |||
| "system/admin/admin.php", | |||
| "system/includes/session.php", | |||
| "system/includes/opml.php" | |||
| ] | |||
| } | |||
| "config": { | |||
| "vendor-dir": "system/vendor/", | |||
| "optimize-autoloader": true | |||
| }, | |||
| "require": { | |||
| "michelf/php-markdown": "~1.4", | |||
| "suin/php-rss-writer": "~1", | |||
| "kanti/hub-updater": "~0.3", | |||
| "ircmaxell/password-compat": "~1.0" | |||
| }, | |||
| "autoload": { | |||
| "files": [ | |||
| "system/includes/dispatch.php", | |||
| "system/includes/functions.php", | |||
| "system/admin/admin.php", | |||
| "system/includes/session.php", | |||
| "system/includes/opml.php" | |||
| ] | |||
| } | |||
| } | |||
| @ -1,5 +1,5 @@ | |||
| <?php | |||
| $config_file = 'config/config.ini'; | |||
| require 'system/vendor/autoload.php'; | |||
| require_once "system/upgrade/run.php"; | |||
| require 'system/htmly.php'; | |||
| @ -1,12 +1,19 @@ | |||
| { | |||
| "name": "pagedown", | |||
| "version": "1.1.0", | |||
| "description": "markdown converter, based on showdown", | |||
| "repository": { "type": "hg", "url": "https://code.google.com/p/pagedown/" }, | |||
| "keywords": ["markdown"], | |||
| "license": "MIT", | |||
| "files": ["Markdown.Converter.js", "Markdown.Sanitizer.js", "node-pagedown.js"], | |||
| "main": "node-pagedown.js", | |||
| "bugs": "http://code.google.com/p/pagedown/issues/list", | |||
| "homepage": "http://code.google.com/p/pagedown/wiki/PageDown" | |||
| "name": "pagedown", | |||
| "version": "1.1.0", | |||
| "description": "markdown converter, based on showdown", | |||
| "repository": { | |||
| "type": "hg", | |||
| "url": "https://code.google.com/p/pagedown/" | |||
| }, | |||
| "keywords": ["markdown"], | |||
| "license": "MIT", | |||
| "files": [ | |||
| "Markdown.Converter.js", | |||
| "Markdown.Sanitizer.js", | |||
| "node-pagedown.js" | |||
| ], | |||
| "main": "node-pagedown.js", | |||
| "bugs": "http://code.google.com/p/pagedown/issues/list", | |||
| "homepage": "http://code.google.com/p/pagedown/wiki/PageDown" | |||
| } | |||
| @ -1,19 +1,20 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8" /> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" /> | |||
| <title>404 Not Found - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" /> | |||
| <!-- Include the Open Sans font --> | |||
| <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8"/> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/> | |||
| <title>404 Not Found - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/> | |||
| <!-- Include the Open Sans font --> | |||
| <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> | |||
| </head> | |||
| <body> | |||
| <div class="center message"> | |||
| <h1>This page doesn't exist!</h1> | |||
| <p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| <div class="center message"> | |||
| <h1>This page doesn't exist!</h1> | |||
| <p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @ -1,30 +1,47 @@ | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" /> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script> | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="wmd-panel"> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span><br><input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/><br><br> | |||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the page title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea> | |||
| <br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea><br/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Publish"/> | |||
| </form> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span><br><input type="text" class="text <?php if (isset($postTitle)) { | |||
| if (empty($postTitle)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||
| echo $postTitle; | |||
| } ?>"/><br><br> | |||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||
| echo $postUrl; | |||
| } ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the page title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { | |||
| echo $p->description; | |||
| } ?></textarea> | |||
| <br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||
| if (empty($postContent)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||
| echo $postContent; | |||
| } ?></textarea><br/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Publish"/> | |||
| </form> | |||
| </div> | |||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||
| <script type="text/javascript"> | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| var editor = new Markdown.Editor(converter); | |||
| var editor = new Markdown.Editor(converter); | |||
| editor.run(); | |||
| })(); | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| @ -1,31 +1,60 @@ | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" /> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script> | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="wmd-panel"> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/><br><br> | |||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" name="tag" value="<?php if (isset($postTag)) { echo $postTag;} ?>"/><br><br> | |||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea> | |||
| <br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea><br/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Publish"/> | |||
| </form> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||
| if (empty($postTitle)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||
| echo $postTitle; | |||
| } ?>"/><br><br> | |||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||
| if (empty($postTag)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||
| echo $postTag; | |||
| } ?>"/><br><br> | |||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||
| echo $postUrl; | |||
| } ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { | |||
| echo $p->description; | |||
| } ?></textarea> | |||
| <br><br> | |||
| Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php if (isset($postFi)) { | |||
| echo $postFi; | |||
| } ?>"/><br><br> | |||
| Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php if (isset($postVid)) { | |||
| echo $postVid; | |||
| } ?>"/><br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||
| if (empty($postContent)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||
| echo $postContent; | |||
| } ?></textarea><br/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Publish"/> | |||
| </form> | |||
| </div> | |||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||
| <script type="text/javascript"> | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| var editor = new Markdown.Editor(converter); | |||
| var editor = new Markdown.Editor(converter); | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| @ -1,15 +1,15 @@ | |||
| <?php | |||
| if(login()) { | |||
| if(isset($_GET['file'])) { | |||
| $file = $_GET['file']; | |||
| <?php | |||
| if (login()) { | |||
| if (isset($_GET['file'])) { | |||
| $file = $_GET['file']; | |||
| if(!empty($file)) { | |||
| unlink($file); | |||
| } | |||
| } | |||
| } | |||
| if (!empty($file)) { | |||
| unlink($file); | |||
| } | |||
| } | |||
| } | |||
| ?> | |||
| <a href="<?php echo site_url() ?>admin/backup-start">Create backup</a> | |||
| <h2>Your backups</h2> | |||
| <a href="<?php echo site_url() ?>admin/backup-start">Create backup</a> | |||
| <h2>Your backups</h2> | |||
| <?php echo get_backup_files() ?> | |||
| @ -1,40 +1,38 @@ | |||
| <?php | |||
| if(isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } | |||
| $url = $p->file; | |||
| $oldurl = explode('_', $url); | |||
| $oldtag = $oldurl[1]; | |||
| $oldmd = str_replace('.md','',$oldurl[2]); | |||
| if (isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } | |||
| $url = $p->file; | |||
| $oldurl = explode('_', $url); | |||
| $oldtag = $oldurl[1]; | |||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||
| $t = str_replace('-', '', $dt); | |||
| $time = new DateTime($t); | |||
| $timestamp = $time->format("Y-m-d"); | |||
| // The post date | |||
| $postdate = strtotime($timestamp); | |||
| // The post URL | |||
| $post = site_url() . date('Y/m', $postdate) . '/' . $oldmd; | |||
| if (isset($destination)) { | |||
| if ($destination == 'post') { | |||
| $back = $post; | |||
| } else { | |||
| $back = site_url() . $destination; | |||
| } | |||
| } else { | |||
| $back = site_url(); | |||
| } | |||
| $replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/'; | |||
| $dt = str_replace($replaced,'',$oldurl[0]); | |||
| $t = str_replace('-','',$dt); | |||
| $time = new DateTime($t); | |||
| $timestamp= $time->format("Y-m-d"); | |||
| // The post date | |||
| $postdate = strtotime($timestamp); | |||
| // The post URL | |||
| $post = site_url().date('Y/m', $postdate).'/'.$oldmd; | |||
| if(isset($destination)) { | |||
| if($destination == 'post') { | |||
| $back = $post; | |||
| } | |||
| else { | |||
| $back = site_url() . $destination; | |||
| } | |||
| } | |||
| else { | |||
| $back = site_url(); | |||
| } | |||
| ?> | |||
| <?php echo '<p>Are you sure want to delete <strong>' . $p->title . '</strong>?</p>';?> | |||
| <?php echo '<p>Are you sure want to delete <strong>' . $p->title . '</strong>?</p>'; ?> | |||
| <form method="POST"> | |||
| <input type="hidden" name="file" value="<?php echo $p->file ?>"/><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" value="Delete"/> | |||
| <span><a href="<?php echo $back ?>">Cancel</a></span> | |||
| <input type="hidden" name="file" value="<?php echo $p->file ?>"/><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" value="Delete"/> | |||
| <span><a href="<?php echo $back ?>">Cancel</a></span> | |||
| </form> | |||
| @ -1,56 +1,66 @@ | |||
| <?php | |||
| if(isset($p->file)) { | |||
| $url = $p->file; | |||
| } | |||
| else { | |||
| $url = $oldfile; | |||
| } | |||
| $content = file_get_contents($url); | |||
| $oldtitle = get_content_tag('t',$content,'Untitled'); | |||
| $oldcontent = remove_html_comments($content); | |||
| if(isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } | |||
| else { | |||
| $destination = 'admin'; | |||
| } | |||
| $dir = substr($url, 0, strrpos($url, '/')); | |||
| $oldurl = str_replace($dir . '/','',$url); | |||
| $oldmd = str_replace('.md','',$oldurl); | |||
| $delete = $p->url . '/delete?destination=' . $destination; | |||
| if (isset($p->file)) { | |||
| $url = $p->file; | |||
| } else { | |||
| $url = $oldfile; | |||
| } | |||
| $content = file_get_contents($url); | |||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||
| $oldcontent = remove_html_comments($content); | |||
| if (isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } else { | |||
| $destination = 'admin'; | |||
| } | |||
| $dir = substr($url, 0, strrpos($url, '/')); | |||
| $oldurl = str_replace($dir . '/', '', $url); | |||
| $oldmd = str_replace('.md', '', $oldurl); | |||
| $delete = $p->url . '/delete?destination=' . $destination; | |||
| ?> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" /> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script> | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="wmd-panel"> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span><br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br> | |||
| Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the page title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea> | |||
| <br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete?>">Delete</a> | |||
| </form> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span><br><input type="text" name="title" | |||
| class="text <?php if (isset($postTitle)) { | |||
| if (empty($postTitle)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" value="<?php echo $oldtitle ?>"/><br><br> | |||
| Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the page title.</span><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { | |||
| echo $p->description; | |||
| } ?></textarea> | |||
| <br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||
| if (empty($postContent)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete ?>">Delete</a> | |||
| </form> | |||
| </div> | |||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||
| <script type="text/javascript"> | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| var editor = new Markdown.Editor(converter); | |||
| var editor = new Markdown.Editor(converter); | |||
| editor.run(); | |||
| })(); | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| @ -1,71 +1,90 @@ | |||
| <?php | |||
| if(isset($p->file)) { | |||
| $url = $p->file; | |||
| } | |||
| else { | |||
| $url = $oldfile; | |||
| } | |||
| if (isset($p->file)) { | |||
| $url = $p->file; | |||
| } else { | |||
| $url = $oldfile; | |||
| } | |||
| $content = file_get_contents($url); | |||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||
| $oldfi = get_content_tag('fi', $content); | |||
| $oldvid = get_content_tag('vid', $content); | |||
| $oldcontent = remove_html_comments($content); | |||
| $dir = substr($url, 0, strrpos($url, '/')); | |||
| $oldurl = explode('_', $url); | |||
| $oldtag = $oldurl[1]; | |||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||
| if (isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } else { | |||
| $destination = 'admin'; | |||
| } | |||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||
| $t = str_replace('-', '', $dt); | |||
| $time = new DateTime($t); | |||
| $timestamp = $time->format("Y-m-d"); | |||
| // The post date | |||
| $postdate = strtotime($timestamp); | |||
| // The post URL | |||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||
| $content = file_get_contents($url); | |||
| $oldtitle = get_content_tag('t',$content,'Untitled'); | |||
| $oldcontent = remove_html_comments($content); | |||
| $dir = substr($url, 0, strrpos($url, '/')); | |||
| $oldurl = explode('_', $url); | |||
| $oldtag = $oldurl[1]; | |||
| $oldmd = str_replace('.md','',$oldurl[2]); | |||
| if(isset($_GET['destination'])) { | |||
| $destination = $_GET['destination']; | |||
| } | |||
| else { | |||
| $destination = 'admin'; | |||
| } | |||
| $replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/'; | |||
| $dt = str_replace($replaced,'',$oldurl[0]); | |||
| $t = str_replace('-','',$dt); | |||
| $time = new DateTime($t); | |||
| $timestamp= $time->format("Y-m-d"); | |||
| // The post date | |||
| $postdate = strtotime($timestamp); | |||
| // The post URL | |||
| $delete= site_url().date('Y/m', $postdate).'/'.$oldmd . '/delete?destination=' . $destination; | |||
| ?> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" /> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script> | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="wmd-panel"> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br> | |||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" value="<?php echo $oldtag?>"/><br><br> | |||
| Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||
| Date Time<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><input type="time" name="time" class="text" value="<?php echo $time->format('H:i'); ?>"><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea> | |||
| <br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete?>">Delete</a> | |||
| </form> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" name="title" | |||
| class="text <?php if (isset($postTitle)) { | |||
| if (empty($postTitle)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" value="<?php echo $oldtitle ?>"/><br><br> | |||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||
| if (empty($postTag)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" value="<?php echo $oldtag ?>"/><br><br> | |||
| Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br> | |||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||
| Date Time<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><input | |||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i'); ?>"><br><br> | |||
| Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { | |||
| echo $p->description; | |||
| } ?></textarea> | |||
| <br><br> | |||
| Featured Image (optional)<br><input type="text" class="text" name="fi" value="<?php echo $oldfi ?>"/><br><br> | |||
| Embed Youtube Video (optional)<br><input type="text" class="text" name="vid" value="<?php echo $oldvid ?>"/><br><br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||
| if (empty($postContent)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete ?>">Delete</a> | |||
| </form> | |||
| </div> | |||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||
| <script type="text/javascript"> | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| var editor = new Markdown.Editor(converter); | |||
| var editor = new Markdown.Editor(converter); | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| @ -1,47 +1,56 @@ | |||
| <?php | |||
| if(isset($_SESSION[config("site.url")]['user'])) { | |||
| $user = $_SESSION[config("site.url")]['user']; | |||
| } | |||
| $filename = 'content/' . $user . '/author.md'; | |||
| if(file_exists($filename)) { | |||
| $content = file_get_contents($filename); | |||
| $oldtitle = get_content_tag('t',$content,'user'); | |||
| $oldcontent = remove_html_comments($content); | |||
| } | |||
| else { | |||
| $oldtitle = $user; | |||
| $oldcontent = 'Just another HTMLy user.'; | |||
| } | |||
| if (isset($_SESSION[config("site.url")]['user'])) { | |||
| $user = $_SESSION[config("site.url")]['user']; | |||
| } | |||
| $filename = 'content/' . $user . '/author.md'; | |||
| if (file_exists($filename)) { | |||
| $content = file_get_contents($filename); | |||
| $oldtitle = get_content_tag('t', $content, 'user'); | |||
| $oldcontent = remove_html_comments($content); | |||
| } else { | |||
| $oldtitle = $user; | |||
| $oldcontent = 'Just another HTMLy user.'; | |||
| } | |||
| ?> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" /> | |||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script> | |||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script> | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <div class="wmd-panel"> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br> | |||
| <br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> | |||
| </form> | |||
| <form method="POST"> | |||
| Title <span class="required">*</span> <br><input type="text" name="title" | |||
| class="text <?php if (isset($postTitle)) { | |||
| if (empty($postTitle)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" value="<?php echo $oldtitle ?>"/><br><br> | |||
| <br> | |||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||
| if (empty($postContent)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Save"/> | |||
| </form> | |||
| </div> | |||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||
| <script type="text/javascript"> | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| (function () { | |||
| var converter = new Markdown.Converter(); | |||
| var editor = new Markdown.Editor(converter); | |||
| var editor = new Markdown.Editor(converter); | |||
| editor.run(); | |||
| })(); | |||
| editor.run(); | |||
| })(); | |||
| </script> | |||
| @ -1,11 +1,15 @@ | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error?></div> | |||
| <?php } ?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <h1>Import RSS Feed 2.0</h1> | |||
| <p>By using this importer you are agree if the feed is yours, or at least you have the authority to publish it.</p> | |||
| <form method="POST"> | |||
| Feed Url <span class="required">*</span> <br><input type="url" class="text <?php if (isset($url)) { if (empty($url)) { echo 'error';}} ?>" name="url"/><br><br> | |||
| Add source link (optional) <input type="checkbox" class="checkbox" name="credit" value="yes"/><br><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <input type="submit" name="submit" class="submit" value="Import"/> | |||
| Feed Url <span class="required">*</span> <br><input type="url" class="text <?php if (isset($url)) { | |||
| if (empty($url)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="url"/><br><br> | |||
| Add source link (optional) <input type="checkbox" class="checkbox" name="credit" value="yes"/><br><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <input type="submit" name="submit" class="submit" value="Import"/> | |||
| </form> | |||
| @ -1,54 +1,58 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <?php echo $head_contents ?> | |||
| <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet" /> | |||
| <link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> | |||
| <?php if (publisher()):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?> | |||
| <!--[if lt IE 9]> | |||
| <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |||
| <![endif]--> | |||
| <?php echo $head_contents ?> | |||
| <link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/> | |||
| <link href='//fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> | |||
| <?php if (publisher()): ?> | |||
| <link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?> | |||
| <!--[if lt IE 9]> | |||
| <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |||
| <![endif]--> | |||
| </head> | |||
| <body class="admin <?php echo $bodyclass; ?>" itemscope="itemscope" itemtype="http://schema.org/Blog"> | |||
| <div class="hide"> | |||
| <meta content="<?php echo blog_title() ?>" itemprop="name"/> | |||
| <meta content="<?php echo blog_description() ?>" itemprop="description"/> | |||
| </div> | |||
| <?php if(login()) { toolbar();} ?> | |||
| <div id="outer-wrapper"> | |||
| <div id="menu-wrapper"> | |||
| <div class="container"> | |||
| <nav id="menu"> | |||
| <?php echo menu() ?> | |||
| <?php echo search() ?> | |||
| </nav> | |||
| </div> | |||
| </div> | |||
| <div id="header-wrapper"> | |||
| <div class="container"> | |||
| <header id="header"> | |||
| <section id="branding"> | |||
| <h1 class="blog-title"><a href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1> | |||
| <div class="blog-tagline"><p><?php echo blog_tagline() ?></p></div> | |||
| </section> | |||
| </header> | |||
| </div> | |||
| </div> | |||
| <div id="content-wrapper"> | |||
| <div class="container"> | |||
| <section id="content"> | |||
| <?php echo content()?> | |||
| </section> | |||
| </div> | |||
| </div> | |||
| <div id="footer-wrapper"> | |||
| <div class="container"> | |||
| <footer id="footer"> | |||
| <div class="copyright"><?php echo copyright() ?></div> | |||
| </footer> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <?php if (analytics()):?><?php echo analytics() ?><?php endif;?> | |||
| <div class="hide"> | |||
| <meta content="<?php echo blog_title() ?>" itemprop="name"/> | |||
| <meta content="<?php echo blog_description() ?>" itemprop="description"/> | |||
| </div> | |||
| <?php if (login()) { | |||
| toolbar(); | |||
| } ?> | |||
| <div id="outer-wrapper"> | |||
| <div id="menu-wrapper"> | |||
| <div class="container"> | |||
| <nav id="menu"> | |||
| <?php echo menu() ?> | |||
| <?php echo search() ?> | |||
| </nav> | |||
| </div> | |||
| </div> | |||
| <div id="header-wrapper"> | |||
| <div class="container"> | |||
| <header id="header"> | |||
| <section id="branding"> | |||
| <h1 class="blog-title"><a href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1> | |||
| <div class="blog-tagline"><p><?php echo blog_tagline() ?></p></div> | |||
| </section> | |||
| </header> | |||
| </div> | |||
| </div> | |||
| <div id="content-wrapper"> | |||
| <div class="container"> | |||
| <section id="content"> | |||
| <?php echo content() ?> | |||
| </section> | |||
| </div> | |||
| </div> | |||
| <div id="footer-wrapper"> | |||
| <div class="container"> | |||
| <footer id="footer"> | |||
| <div class="copyright"><?php echo copyright() ?></div> | |||
| </footer> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?> | |||
| </body> | |||
| </html> | |||
| @ -1,19 +1,29 @@ | |||
| <?php if (isset($error)) { ?> | |||
| <div class="error-message"><?php echo $error?></div> | |||
| <?php } ?> | |||
| <?php if(!login()) {?> | |||
| <h1>Login</h1> | |||
| <form method="POST" action="login"> | |||
| User <span class="required">*</span> <br> | |||
| <input type="text" class="<?php if (isset($username)) { if (empty($username)) { echo 'error';}} ?>" name="user"/><br><br> | |||
| Password <span class="required">*</span> <br> | |||
| <input type="password" class="<?php if (isset($password)) { if (empty($password)) { echo 'error';}} ?>" name="password"/><br><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf()?>"> | |||
| <?php if(config("google.reCaptcha")):?> | |||
| <div class="error-message"><?php echo $error ?></div> | |||
| <?php } ?> | |||
| <?php if (!login()) { ?> | |||
| <h1>Login</h1> | |||
| <form method="POST" action="login"> | |||
| User <span class="required">*</span> <br> | |||
| <input type="text" class="<?php if (isset($username)) { | |||
| if (empty($username)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="user"/><br><br> | |||
| Password <span class="required">*</span> <br> | |||
| <input type="password" class="<?php if (isset($password)) { | |||
| if (empty($password)) { | |||
| echo 'error'; | |||
| } | |||
| } ?>" name="password"/><br><br> | |||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||
| <?php if (config("google.reCaptcha")): ?> | |||
| <script src='https://www.google.com/recaptcha/api.js'></script> | |||
| <div class="g-recaptcha" data-sitekey="<?php echo config("google.reCaptcha.public"); ?>"></div> | |||
| <br/> | |||
| <?php endif;?> | |||
| <input type="submit" name="submit" value="Login"/> | |||
| </form> | |||
| <?php } else {header('location: admin');} ?> | |||
| <?php endif; ?> | |||
| <input type="submit" name="submit" value="Login"/> | |||
| </form> | |||
| <?php } else { | |||
| header('location: admin'); | |||
| } ?> | |||
| @ -1,5 +1,5 @@ | |||
| <?php | |||
| <?php | |||
| echo '<h2>Your recent posts</h2>'; | |||
| get_recent_posts(); | |||
| get_recent_posts(); | |||
| echo '<h2>Static pages</h2>'; | |||
| get_recent_pages(); ?> | |||
| @ -1,39 +1,49 @@ | |||
| <h2 class="post-index"><?php echo $heading?></h2> | |||
| <?php if(!empty($posts)) {?> | |||
| <table class="post-list"> | |||
| <tr class="head"><th>Title</th><th>Published</th><?php if(config("views.counter") == "true"):?><th>Views</th><?php endif;?><th>Author</th><th>Tag</th><th>Operations</th></tr> | |||
| <?php $i = 0; $len = count($posts);?> | |||
| <?php foreach($posts as $p):?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'item first'; | |||
| } | |||
| elseif ($i == $len - 1) { | |||
| $class = 'item last'; | |||
| } | |||
| else { | |||
| $class = 'item'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <tr class="<?php echo $class ?>"> | |||
| <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td> | |||
| <td><?php echo date('d F Y', $p->date) ?></td> | |||
| <?php if(config("views.counter") == "true"):?><td><?php echo $p->views ?></td><?php endif;?> | |||
| <td><a target="_blank" href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></td> | |||
| <td><?php echo $p->tag ?></td> | |||
| <td><a href="<?php echo $p->url ?>/edit?destination=admin/posts">Edit</a> <a href="<?php echo $p->url ?>/delete?destination=admin/posts">Delete</a></td> | |||
| </tr> | |||
| <?php endforeach;?> | |||
| </table> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])):?> | |||
| <span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif;?> | |||
| <?php if (!empty($pagination['next'])):?> | |||
| <span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif;?> | |||
| </div> | |||
| <?php endif;?> | |||
| <?php } else { echo 'No posts found!'; }?> | |||
| <h2 class="post-index"><?php echo $heading ?></h2> | |||
| <?php if (!empty($posts)) { ?> | |||
| <table class="post-list"> | |||
| <tr class="head"> | |||
| <th>Title</th> | |||
| <th>Published</th><?php if (config("views.counter") == "true"): ?> | |||
| <th>Views</th><?php endif; ?> | |||
| <th>Author</th> | |||
| <th>Tag</th> | |||
| <th>Operations</th> | |||
| </tr> | |||
| <?php $i = 0; | |||
| $len = count($posts); ?> | |||
| <?php foreach ($posts as $p): ?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'item first'; | |||
| } elseif ($i == $len - 1) { | |||
| $class = 'item last'; | |||
| } else { | |||
| $class = 'item'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <tr class="<?php echo $class ?>"> | |||
| <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td> | |||
| <td><?php echo date('d F Y', $p->date) ?></td> | |||
| <?php if (config("views.counter") == "true"): ?> | |||
| <td><?php echo $p->views ?></td><?php endif; ?> | |||
| <td><a target="_blank" href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></td> | |||
| <td><?php echo $p->tag ?></td> | |||
| <td><a href="<?php echo $p->url ?>/edit?destination=admin/posts">Edit</a> <a | |||
| href="<?php echo $p->url ?>/delete?destination=admin/posts">Delete</a></td> | |||
| </tr> | |||
| <?php endforeach; ?> | |||
| </table> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])): ?> | |||
| <span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif; ?> | |||
| <?php if (!empty($pagination['next'])): ?> | |||
| <span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif; ?> | |||
| </div> | |||
| <?php endif; ?> | |||
| <?php } else { | |||
| echo 'No posts found!'; | |||
| } ?> | |||
| @ -1,6 +1,8 @@ | |||
| <h3>Updated to<h3> | |||
| <h2>[<?php echo $info['tag_name'];?>] <?php echo $info['name']; ?></h2> | |||
| <p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']);?></p> | |||
| <h3>Updated to | |||
| <h3> | |||
| <h2>[<?php echo $info['tag_name']; ?>] <?php echo $info['name']; ?></h2> | |||
| <p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']); ?></p> | |||
| <?php | |||
| require_once "system/upgrade/run.php"; | |||
| @ -1,38 +1,47 @@ | |||
| <h2 class="post-index"><?php echo $heading?></h2> | |||
| <?php if(!empty($posts)) {?> | |||
| <table class="post-list"> | |||
| <tr class="head"><th>Title</th><th>Published</th><?php if(config("views.counter") == "true"):?><th>Views</th><?php endif; ?><th>Tag</th><th>Operations</th></tr> | |||
| <?php $i = 0; $len = count($posts);?> | |||
| <?php foreach($posts as $p):?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'item first'; | |||
| } | |||
| elseif ($i == $len - 1) { | |||
| $class = 'item last'; | |||
| } | |||
| else { | |||
| $class = 'item'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <tr class="<?php echo $class ?>"> | |||
| <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td> | |||
| <td><?php echo date('d F Y', $p->date) ?></td> | |||
| <?php if(config("views.counter") == "true"):?><td><?php echo $p->views ?></td><?php endif;?> | |||
| <td><?php echo $p->tag ?></td> | |||
| <td><a href="<?php echo $p->url ?>/edit?destination=admin/mine">Edit</a> <a href="<?php echo $p->url ?>/delete?destination=admin/mine">Delete</a></td> | |||
| </tr> | |||
| <?php endforeach;?> | |||
| </table> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])):?> | |||
| <span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif;?> | |||
| <?php if (!empty($pagination['next'])):?> | |||
| <span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif;?> | |||
| </div> | |||
| <?php endif;?> | |||
| <?php } else { echo 'No posts found!'; }?> | |||
| <h2 class="post-index"><?php echo $heading ?></h2> | |||
| <?php if (!empty($posts)) { ?> | |||
| <table class="post-list"> | |||
| <tr class="head"> | |||
| <th>Title</th> | |||
| <th>Published</th><?php if (config("views.counter") == "true"): ?> | |||
| <th>Views</th><?php endif; ?> | |||
| <th>Tag</th> | |||
| <th>Operations</th> | |||
| </tr> | |||
| <?php $i = 0; | |||
| $len = count($posts); ?> | |||
| <?php foreach ($posts as $p): ?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'item first'; | |||
| } elseif ($i == $len - 1) { | |||
| $class = 'item last'; | |||
| } else { | |||
| $class = 'item'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <tr class="<?php echo $class ?>"> | |||
| <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td> | |||
| <td><?php echo date('d F Y', $p->date) ?></td> | |||
| <?php if (config("views.counter") == "true"): ?> | |||
| <td><?php echo $p->views ?></td><?php endif; ?> | |||
| <td><?php echo $p->tag ?></td> | |||
| <td><a href="<?php echo $p->url ?>/edit?destination=admin/mine">Edit</a> <a | |||
| href="<?php echo $p->url ?>/delete?destination=admin/mine">Delete</a></td> | |||
| </tr> | |||
| <?php endforeach; ?> | |||
| </table> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])): ?> | |||
| <span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif; ?> | |||
| <?php if (!empty($pagination['next'])): ?> | |||
| <span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif; ?> | |||
| </div> | |||
| <?php endif; ?> | |||
| <?php } else { | |||
| echo 'No posts found!'; | |||
| } ?> | |||
| @ -1,207 +1,218 @@ | |||
| /* line 7, ../sass/lightbox.sass */ | |||
| body:after { | |||
| content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png); | |||
| display: none; | |||
| content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png); | |||
| display: none; | |||
| } | |||
| /* line 11, ../sass/lightbox.sass */ | |||
| .lightboxOverlay { | |||
| position: absolute; | |||
| top: 0; | |||
| left: 0; | |||
| z-index: 9999; | |||
| background-color: black; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); | |||
| opacity: 0.8; | |||
| display: none; | |||
| position: absolute; | |||
| top: 0; | |||
| left: 0; | |||
| z-index: 9999; | |||
| background-color: black; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); | |||
| opacity: 0.8; | |||
| display: none; | |||
| } | |||
| /* line 20, ../sass/lightbox.sass */ | |||
| .lightbox { | |||
| position: absolute; | |||
| left: 0; | |||
| width: 100%; | |||
| z-index: 10000; | |||
| text-align: center; | |||
| line-height: 0; | |||
| font-weight: normal; | |||
| position: absolute; | |||
| left: 0; | |||
| width: 100%; | |||
| z-index: 10000; | |||
| text-align: center; | |||
| line-height: 0; | |||
| font-weight: normal; | |||
| } | |||
| /* line 28, ../sass/lightbox.sass */ | |||
| .lightbox .lb-image { | |||
| display: block; | |||
| height: auto; | |||
| -webkit-border-radius: 3px; | |||
| -moz-border-radius: 3px; | |||
| -ms-border-radius: 3px; | |||
| -o-border-radius: 3px; | |||
| border-radius: 3px; | |||
| display: block; | |||
| height: auto; | |||
| -webkit-border-radius: 3px; | |||
| -moz-border-radius: 3px; | |||
| -ms-border-radius: 3px; | |||
| -o-border-radius: 3px; | |||
| border-radius: 3px; | |||
| } | |||
| /* line 32, ../sass/lightbox.sass */ | |||
| .lightbox a img { | |||
| border: none; | |||
| border: none; | |||
| } | |||
| /* line 35, ../sass/lightbox.sass */ | |||
| .lb-outerContainer { | |||
| position: relative; | |||
| background-color: white; | |||
| *zoom: 1; | |||
| width: 250px; | |||
| height: 250px; | |||
| margin: 0 auto; | |||
| -webkit-border-radius: 4px; | |||
| -moz-border-radius: 4px; | |||
| -ms-border-radius: 4px; | |||
| -o-border-radius: 4px; | |||
| border-radius: 4px; | |||
| position: relative; | |||
| background-color: white; | |||
| *zoom: 1; | |||
| width: 250px; | |||
| height: 250px; | |||
| margin: 0 auto; | |||
| -webkit-border-radius: 4px; | |||
| -moz-border-radius: 4px; | |||
| -ms-border-radius: 4px; | |||
| -o-border-radius: 4px; | |||
| border-radius: 4px; | |||
| } | |||
| /* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ | |||
| .lb-outerContainer:after { | |||
| content: ""; | |||
| display: table; | |||
| clear: both; | |||
| content: ""; | |||
| display: table; | |||
| clear: both; | |||
| } | |||
| /* line 44, ../sass/lightbox.sass */ | |||
| .lb-container { | |||
| padding: 4px; | |||
| padding: 4px; | |||
| } | |||
| /* line 47, ../sass/lightbox.sass */ | |||
| .lb-loader { | |||
| position: absolute; | |||
| top: 43%; | |||
| left: 0%; | |||
| height: 25%; | |||
| width: 100%; | |||
| text-align: center; | |||
| line-height: 0; | |||
| position: absolute; | |||
| top: 43%; | |||
| left: 0%; | |||
| height: 25%; | |||
| width: 100%; | |||
| text-align: center; | |||
| line-height: 0; | |||
| } | |||
| /* line 56, ../sass/lightbox.sass */ | |||
| .lb-cancel { | |||
| display: block; | |||
| width: 32px; | |||
| height: 32px; | |||
| margin: 0 auto; | |||
| background: url(../img/loading.gif) no-repeat; | |||
| display: block; | |||
| width: 32px; | |||
| height: 32px; | |||
| margin: 0 auto; | |||
| background: url(../img/loading.gif) no-repeat; | |||
| } | |||
| /* line 63, ../sass/lightbox.sass */ | |||
| .lb-nav { | |||
| position: absolute; | |||
| top: 0; | |||
| left: 0; | |||
| height: 100%; | |||
| width: 100%; | |||
| z-index: 10; | |||
| position: absolute; | |||
| top: 0; | |||
| left: 0; | |||
| height: 100%; | |||
| width: 100%; | |||
| z-index: 10; | |||
| } | |||
| /* line 71, ../sass/lightbox.sass */ | |||
| .lb-container > .nav { | |||
| left: 0; | |||
| left: 0; | |||
| } | |||
| /* line 74, ../sass/lightbox.sass */ | |||
| .lb-nav a { | |||
| outline: none; | |||
| outline: none; | |||
| } | |||
| /* line 77, ../sass/lightbox.sass */ | |||
| .lb-prev, .lb-next { | |||
| width: 49%; | |||
| height: 100%; | |||
| cursor: pointer; | |||
| /* Trick IE into showing hover */ | |||
| display: block; | |||
| width: 49%; | |||
| height: 100%; | |||
| cursor: pointer; | |||
| /* Trick IE into showing hover */ | |||
| display: block; | |||
| } | |||
| /* line 84, ../sass/lightbox.sass */ | |||
| .lb-prev { | |||
| left: 0; | |||
| float: left; | |||
| left: 0; | |||
| float: left; | |||
| } | |||
| /* line 87, ../sass/lightbox.sass */ | |||
| .lb-prev:hover { | |||
| background: url(../img/prev.png) left 48% no-repeat; | |||
| background: url(../img/prev.png) left 48% no-repeat; | |||
| } | |||
| /* line 90, ../sass/lightbox.sass */ | |||
| .lb-next { | |||
| right: 0; | |||
| float: right; | |||
| right: 0; | |||
| float: right; | |||
| } | |||
| /* line 93, ../sass/lightbox.sass */ | |||
| .lb-next:hover { | |||
| background: url(../img/next.png) right 48% no-repeat; | |||
| background: url(../img/next.png) right 48% no-repeat; | |||
| } | |||
| /* line 96, ../sass/lightbox.sass */ | |||
| .lb-dataContainer { | |||
| margin: 0 auto; | |||
| padding-top: 5px; | |||
| *zoom: 1; | |||
| width: 100%; | |||
| -moz-border-radius-bottomleft: 4px; | |||
| -webkit-border-bottom-left-radius: 4px; | |||
| border-bottom-left-radius: 4px; | |||
| -moz-border-radius-bottomright: 4px; | |||
| -webkit-border-bottom-right-radius: 4px; | |||
| border-bottom-right-radius: 4px; | |||
| margin: 0 auto; | |||
| padding-top: 5px; | |||
| *zoom: 1; | |||
| width: 100%; | |||
| -moz-border-radius-bottomleft: 4px; | |||
| -webkit-border-bottom-left-radius: 4px; | |||
| border-bottom-left-radius: 4px; | |||
| -moz-border-radius-bottomright: 4px; | |||
| -webkit-border-bottom-right-radius: 4px; | |||
| border-bottom-right-radius: 4px; | |||
| } | |||
| /* line 38, ../../../../.rvm/gems/ruby-1.9.3-p392/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */ | |||
| .lb-dataContainer:after { | |||
| content: ""; | |||
| display: table; | |||
| clear: both; | |||
| content: ""; | |||
| display: table; | |||
| clear: both; | |||
| } | |||
| /* line 103, ../sass/lightbox.sass */ | |||
| .lb-data { | |||
| padding: 0 4px; | |||
| color: #bbbbbb; | |||
| padding: 0 4px; | |||
| color: #bbbbbb; | |||
| } | |||
| /* line 106, ../sass/lightbox.sass */ | |||
| .lb-data .lb-details { | |||
| width: 85%; | |||
| float: left; | |||
| text-align: left; | |||
| line-height: 1.1em; | |||
| width: 85%; | |||
| float: left; | |||
| text-align: left; | |||
| line-height: 1.1em; | |||
| } | |||
| /* line 111, ../sass/lightbox.sass */ | |||
| .lb-data .lb-caption { | |||
| font-size: 13px; | |||
| font-weight: bold; | |||
| line-height: 1em; | |||
| font-size: 13px; | |||
| font-weight: bold; | |||
| line-height: 1em; | |||
| } | |||
| /* line 115, ../sass/lightbox.sass */ | |||
| .lb-data .lb-number { | |||
| display: block; | |||
| clear: left; | |||
| padding-bottom: 1em; | |||
| font-size: 12px; | |||
| color: #999999; | |||
| display: block; | |||
| clear: left; | |||
| padding-bottom: 1em; | |||
| font-size: 12px; | |||
| color: #999999; | |||
| } | |||
| /* line 121, ../sass/lightbox.sass */ | |||
| .lb-data .lb-close { | |||
| display: block; | |||
| float: right; | |||
| width: 30px; | |||
| height: 30px; | |||
| background: url(../img/close.png) top right no-repeat; | |||
| text-align: right; | |||
| outline: none; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); | |||
| opacity: 0.7; | |||
| display: block; | |||
| float: right; | |||
| width: 30px; | |||
| height: 30px; | |||
| background: url(../img/close.png) top right no-repeat; | |||
| text-align: right; | |||
| outline: none; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); | |||
| opacity: 0.7; | |||
| } | |||
| /* line 130, ../sass/lightbox.sass */ | |||
| .lb-data .lb-close:hover { | |||
| cursor: pointer; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); | |||
| opacity: 1; | |||
| cursor: pointer; | |||
| filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); | |||
| opacity: 1; | |||
| } | |||
| /* fix image preview */ | |||
| .lb-image { | |||
| max-width: inherit!important; | |||
| max-width: inherit !important; | |||
| } | |||
| @ -1,10 +1,10 @@ | |||
| (function ($) { | |||
| $(document).ready(function() { | |||
| $('.teaser-body img, .post-body img').each(function() { | |||
| var currentImage = $(this); | |||
| currentImage.wrap("<a class='img-wrap' title='" + currentImage.attr("alt") + "' data-lightbox='lightbox' href='" + currentImage.attr("src") + "'></a>"); | |||
| }); | |||
| }); | |||
| $(document).ready(function () { | |||
| $('.teaser-body img, .post-body img').each(function () { | |||
| var currentImage = $(this); | |||
| currentImage.wrap("<a class='img-wrap' title='" + currentImage.attr("alt") + "' data-lightbox='lightbox' href='" + currentImage.attr("src") + "'></a>"); | |||
| }); | |||
| }); | |||
| })(jQuery); | |||
| @ -1,4 +1,5 @@ | |||
| <?php | |||
| $config_file = 'config/config.ini'; | |||
| require 'system/vendor/autoload.php'; | |||
| require 'system/htmly.php'; | |||
| @ -0,0 +1,7 @@ | |||
| .gitattributes export-ignore | |||
| .gitignore export-ignore | |||
| example.php export-ignore | |||
| example2.php export-ignore | |||
| .updateignore export-ignore | |||
| README.md export-ignore | |||
| tests export-ignore | |||
| @ -0,0 +1 @@ | |||
| README.md | |||
| @ -1,39 +0,0 @@ | |||
| <?php | |||
| namespace Kanti; | |||
| class CacheOneFile | |||
| { | |||
| protected $fileName = ""; | |||
| protected $holdTime = 43200; //12h | |||
| public function __construct($fileName, $holdTime = 43200) | |||
| { | |||
| $this->fileName = $fileName; | |||
| $this->holdTime = $holdTime; | |||
| } | |||
| public function is() | |||
| { | |||
| if (! HelperClass::fileExists($this->fileName)) { | |||
| return false; | |||
| } | |||
| if (filemtime($this->fileName) < ( time() - $this->holdTime )) { | |||
| unlink($this->fileName); | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| public function get() | |||
| { | |||
| return file_get_contents($this->fileName); | |||
| } | |||
| public function set($content) | |||
| { | |||
| file_put_contents($this->fileName, $content); | |||
| } | |||
| } | |||
| @ -1,12 +0,0 @@ | |||
| <?php | |||
| namespace Kanti; | |||
| class HelperClass{ | |||
| static public function fileExists($file){ | |||
| return file_exists(dirname($_SERVER["SCRIPT_FILENAME"]) . "/" . $file); | |||
| } | |||
| static public function isInPhar() { | |||
| return substr(__FILE__,0,7) === "phar://"; | |||
| } | |||
| } | |||
| @ -0,0 +1,122 @@ | |||
| #HubUpdater | |||
|   | |||
| Simple Github Updater for Web Projects [PHP] | |||
| ## is HubUpdater for me? [Checklist] | |||
| - [ ] I have an little product/projekt on github. (~ <=30MB) | |||
| - [ ] it can run PHP and uses [composer](https://getcomposer.org/)s autoloader | |||
| - [ ] I want my users to update my Product with one click | |||
| ## check for an update [simple] | |||
| ```php | |||
| <?php | |||
| require 'vendor/autoload.php'; | |||
| $updater = new \Kanti\HubUpdater('kanti/test'); | |||
| $updater->update(); | |||
| ``` | |||
| ## how to provide an update? | |||
| - Go to your Repository on github.com ‣‣ | |||
| - click on the ``releases`` tab ‣‣ | |||
| - click on ``Draft a new release`` ‣‣ | |||
| - Enter your release details ‣‣ | |||
| - click on ``Publish release`` ‣‣ | |||
| - now you can use HubUpdater to update to the newest version. | |||
| - _note: <sub>The timestamp of the release is used. NOT the version number!!</sub>_ | |||
| ## install via composer | |||
| The recommended way to install hub-updater is through | |||
| [Composer](http://getcomposer.org). | |||
| ```bash | |||
| # Install Composer | |||
| curl -sS https://getcomposer.org/installer | php | |||
| ``` | |||
| Next, run the Composer command to install the latest stable version of HubUpdater: | |||
| ```bash | |||
| composer require kanti/hub-updater ~0.3 | |||
| ``` | |||
| After installing, you need to require Composer's autoloader: | |||
| ```php | |||
| <?php | |||
| require 'vendor/autoload.php'; | |||
| ``` | |||
| ## settings | |||
| ```php | |||
| $settings = array( | |||
| "settingsKey" => 'value', | |||
| ); | |||
| new \Kanti\HubUpdater($settings); | |||
| ``` | |||
| |setting|description|default| | |||
| |---|---|---| | |||
| |name|the name your Repository has |**must be set**| | |||
| |branch|the branch you like to watch. |``master``| | |||
| |cache|the directory you like to put the cache stuff |``./cache/``| | |||
| |save|the directory you like to put the content of the zip |``./``| | |||
| |prerelease|would you like to download the prereleases? |``false``| | |||
| |cacheFile|name of the InformationCacheFile(in cacheDir)|``downloadInfo.json``| | |||
| |holdTime|time(seconds) the Cached-Information will be used|``43200``| | |||
| |versionFile|name of the InstalledVersionInformation is safed(in cacheDir)|``installedVersion.json``| | |||
| |zipFile|name of the temporary zip file(in cacheDir)|``tmpZipFile.zip``| | |||
| |updateignore|name of the updateignore file(in root of project)|``.updateignore``| | |||
| |exceptions|if true, will ``throw new \Exception`` on failure|``false``| | |||
| ## Check for an update [complete] | |||
| ```php | |||
| <?php | |||
| require 'vendor/autoload.php'; | |||
| $updater = new \Kanti\HubUpdater(array( | |||
| "cacheFile" => "downloadInfo.json",//name of the InformationCacheFile(in cacheDir) | |||
| "holdTime" => 43200,//time(seconds) the Cached-Information will be used | |||
| "versionFile" => "installedVersion.json",//name of the InstalledVersionInformation is safed(in cacheDir) | |||
| "zipFile" => "tmpZipFile.zip",//name of the temporary zip file(in cacheDir) | |||
| "updateignore" => ".updateignore",//name of the updateignore file(in root of project) | |||
| "name" => 'kanti/test',//Repository to watch | |||
| "branch" => 'master',//wich branch to watch | |||
| "cache" => 'cache/',//were to put the caching stuff | |||
| "save" => 'save/',//there to put the downloaded Version[default ./] | |||
| "prerelease" => true,//accept prereleases? | |||
| "exceptions" => true,//if true, will throw new \Exception on failure | |||
| )); | |||
| if ($updater->able()) { | |||
| if (isset($_GET['update'])) { | |||
| $updater->update(); | |||
| echo '<p>updated :)</p>'; | |||
| } else { | |||
| echo '<a href="?update">Update Me</a>'; //only update if they klick this link | |||
| } | |||
| } else { | |||
| echo '<p>uptodate :)</p>'; | |||
| } | |||
| ``` | |||
| ## the .updateignore file | |||
| ### syntax: | |||
| put a file in one line and it will not be updated. _note <sub>put the .updateignore in your projects root directory</sub>_ | |||
| ``` | |||
| .htaccess | |||
| favicon.ico | |||
| there/the/config.ini/is.ini | |||
| ``` | |||
| ## Thanks: | |||
| - ca_bundle.crt form [bagder/ca-bundle](https://github.com/bagder/ca-bundle) | |||
| @ -0,0 +1,974 @@ | |||
| { | |||
| "_readme": [ | |||
| "This file locks the dependencies of your project to a known state", | |||
| "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | |||
| "This file is @generated automatically" | |||
| ], | |||
| "hash": "b8e4efa9ea29bd0bab50ed2191d4b9cb", | |||
| "packages": [], | |||
| "packages-dev": [ | |||
| { | |||
| "name": "doctrine/instantiator", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/doctrine/instantiator.git", | |||
| "reference": "3d9669e597439e8d205baf315efb757038fb4dea" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/doctrine/instantiator/zipball/3d9669e597439e8d205baf315efb757038fb4dea", | |||
| "reference": "3d9669e597439e8d205baf315efb757038fb4dea", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3,<8.0-DEV" | |||
| }, | |||
| "require-dev": { | |||
| "athletic/athletic": "~0.1.8", | |||
| "ext-pdo": "*", | |||
| "ext-phar": "*", | |||
| "phpunit/phpunit": "~4.0", | |||
| "squizlabs/php_codesniffer": "~2.0" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.0.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "psr-4": { | |||
| "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" | |||
| } | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "MIT" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Marco Pivetta", | |||
| "email": "ocramius@gmail.com", | |||
| "homepage": "http://ocramius.github.com/" | |||
| } | |||
| ], | |||
| "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", | |||
| "homepage": "https://github.com/doctrine/instantiator", | |||
| "keywords": [ | |||
| "constructor", | |||
| "instantiate" | |||
| ], | |||
| "time": "2015-01-16 19:29:51" | |||
| }, | |||
| { | |||
| "name": "phpdocumentor/reflection-docblock", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", | |||
| "reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/fd0ac2007401505fb596fdfb859ec4e103d69e55", | |||
| "reference": "fd0ac2007401505fb596fdfb859ec4e103d69e55", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.0" | |||
| }, | |||
| "suggest": { | |||
| "dflydev/markdown": "~1.0", | |||
| "erusev/parsedown": "~1.0" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "2.0.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "psr-0": { | |||
| "phpDocumentor": [ | |||
| "src/" | |||
| ] | |||
| } | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "MIT" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Mike van Riel", | |||
| "email": "mike.vanriel@naenius.com" | |||
| } | |||
| ], | |||
| "time": "2014-09-02 14:26:20" | |||
| }, | |||
| { | |||
| "name": "phpspec/prophecy", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/phpspec/prophecy.git", | |||
| "reference": "d647e27524f9f7edc37baf63a114b52f5975808f" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d647e27524f9f7edc37baf63a114b52f5975808f", | |||
| "reference": "d647e27524f9f7edc37baf63a114b52f5975808f", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "doctrine/instantiator": "^1.0.2", | |||
| "phpdocumentor/reflection-docblock": "~2.0", | |||
| "sebastian/comparator": "~1.1" | |||
| }, | |||
| "require-dev": { | |||
| "phpspec/phpspec": "~2.0" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.3.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "psr-0": { | |||
| "Prophecy\\": "src/" | |||
| } | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "MIT" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Konstantin Kudryashov", | |||
| "email": "ever.zet@gmail.com", | |||
| "homepage": "http://everzet.com" | |||
| }, | |||
| { | |||
| "name": "Marcello Duarte", | |||
| "email": "marcello.duarte@gmail.com" | |||
| } | |||
| ], | |||
| "description": "Highly opinionated mocking framework for PHP 5.3+", | |||
| "homepage": "https://github.com/phpspec/prophecy", | |||
| "keywords": [ | |||
| "Double", | |||
| "Dummy", | |||
| "fake", | |||
| "mock", | |||
| "spy", | |||
| "stub" | |||
| ], | |||
| "time": "2015-01-26 10:50:16" | |||
| }, | |||
| { | |||
| "name": "phpunit/php-code-coverage", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/php-code-coverage.git", | |||
| "reference": "34cc484af1ca149188d0d9e91412191e398e0b67" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/34cc484af1ca149188d0d9e91412191e398e0b67", | |||
| "reference": "34cc484af1ca149188d0d9e91412191e398e0b67", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3", | |||
| "phpunit/php-file-iterator": "~1.3", | |||
| "phpunit/php-text-template": "~1.2", | |||
| "phpunit/php-token-stream": "~1.3", | |||
| "sebastian/environment": "~1.0", | |||
| "sebastian/version": "~1.0" | |||
| }, | |||
| "require-dev": { | |||
| "ext-xdebug": ">=2.1.4", | |||
| "phpunit/phpunit": "~4" | |||
| }, | |||
| "suggest": { | |||
| "ext-dom": "*", | |||
| "ext-xdebug": ">=2.2.1", | |||
| "ext-xmlwriter": "*" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "2.0.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sb@sebastian-bergmann.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", | |||
| "homepage": "https://github.com/sebastianbergmann/php-code-coverage", | |||
| "keywords": [ | |||
| "coverage", | |||
| "testing", | |||
| "xunit" | |||
| ], | |||
| "time": "2015-01-24 10:06:35" | |||
| }, | |||
| { | |||
| "name": "phpunit/php-file-iterator", | |||
| "version": "1.3.4", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/php-file-iterator.git", | |||
| "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", | |||
| "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "type": "library", | |||
| "autoload": { | |||
| "classmap": [ | |||
| "File/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "include-path": [ | |||
| "" | |||
| ], | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sb@sebastian-bergmann.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "FilterIterator implementation that filters files based on a list of suffixes.", | |||
| "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", | |||
| "keywords": [ | |||
| "filesystem", | |||
| "iterator" | |||
| ], | |||
| "time": "2013-10-10 15:34:57" | |||
| }, | |||
| { | |||
| "name": "phpunit/php-text-template", | |||
| "version": "1.2.0", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/php-text-template.git", | |||
| "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", | |||
| "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "type": "library", | |||
| "autoload": { | |||
| "classmap": [ | |||
| "Text/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "include-path": [ | |||
| "" | |||
| ], | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sb@sebastian-bergmann.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "Simple template engine.", | |||
| "homepage": "https://github.com/sebastianbergmann/php-text-template/", | |||
| "keywords": [ | |||
| "template" | |||
| ], | |||
| "time": "2014-01-30 17:20:04" | |||
| }, | |||
| { | |||
| "name": "phpunit/php-timer", | |||
| "version": "1.0.5", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/php-timer.git", | |||
| "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", | |||
| "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "type": "library", | |||
| "autoload": { | |||
| "classmap": [ | |||
| "PHP/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "include-path": [ | |||
| "" | |||
| ], | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sb@sebastian-bergmann.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "Utility class for timing", | |||
| "homepage": "https://github.com/sebastianbergmann/php-timer/", | |||
| "keywords": [ | |||
| "timer" | |||
| ], | |||
| "time": "2013-08-02 07:42:54" | |||
| }, | |||
| { | |||
| "name": "phpunit/php-token-stream", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/php-token-stream.git", | |||
| "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db32c18eba00b121c145575fcbcd4d4d24e6db74", | |||
| "reference": "db32c18eba00b121c145575fcbcd4d4d24e6db74", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "ext-tokenizer": "*", | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.2" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.4-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| } | |||
| ], | |||
| "description": "Wrapper around PHP's tokenizer extension.", | |||
| "homepage": "https://github.com/sebastianbergmann/php-token-stream/", | |||
| "keywords": [ | |||
| "tokenizer" | |||
| ], | |||
| "time": "2015-01-17 09:51:32" | |||
| }, | |||
| { | |||
| "name": "phpunit/phpunit", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/phpunit.git", | |||
| "reference": "e85198bbce24ea11075ce8bdfc2cfffb818aae8c" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e85198bbce24ea11075ce8bdfc2cfffb818aae8c", | |||
| "reference": "e85198bbce24ea11075ce8bdfc2cfffb818aae8c", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "ext-dom": "*", | |||
| "ext-json": "*", | |||
| "ext-pcre": "*", | |||
| "ext-reflection": "*", | |||
| "ext-spl": "*", | |||
| "php": ">=5.3.3", | |||
| "phpspec/prophecy": "~1.3.1", | |||
| "phpunit/php-code-coverage": "~2.0", | |||
| "phpunit/php-file-iterator": "~1.3", | |||
| "phpunit/php-text-template": "~1.2", | |||
| "phpunit/php-timer": "~1.0", | |||
| "phpunit/phpunit-mock-objects": "~2.3", | |||
| "sebastian/comparator": "~1.1", | |||
| "sebastian/diff": "~1.2", | |||
| "sebastian/environment": "~1.2", | |||
| "sebastian/exporter": "~1.2", | |||
| "sebastian/global-state": "~1.0", | |||
| "sebastian/version": "~1.0", | |||
| "symfony/yaml": "~2.1|~3.0" | |||
| }, | |||
| "suggest": { | |||
| "phpunit/php-invoker": "~1.1" | |||
| }, | |||
| "bin": [ | |||
| "phpunit" | |||
| ], | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "4.6.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "The PHP Unit Testing framework.", | |||
| "homepage": "https://phpunit.de/", | |||
| "keywords": [ | |||
| "phpunit", | |||
| "testing", | |||
| "xunit" | |||
| ], | |||
| "time": "2015-01-27 07:32:25" | |||
| }, | |||
| { | |||
| "name": "phpunit/phpunit-mock-objects", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", | |||
| "reference": "b752b41e3fead4feee99f3a2f2972cef517abb8b" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/b752b41e3fead4feee99f3a2f2972cef517abb8b", | |||
| "reference": "b752b41e3fead4feee99f3a2f2972cef517abb8b", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "doctrine/instantiator": "~1.0,>=1.0.2", | |||
| "php": ">=5.3.3", | |||
| "phpunit/php-text-template": "~1.2" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "4.4.*@dev" | |||
| }, | |||
| "suggest": { | |||
| "ext-soap": "*" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "2.4.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sb@sebastian-bergmann.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "Mock Object library for PHPUnit", | |||
| "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", | |||
| "keywords": [ | |||
| "mock", | |||
| "xunit" | |||
| ], | |||
| "time": "2015-01-18 10:44:19" | |||
| }, | |||
| { | |||
| "name": "sebastian/comparator", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/comparator.git", | |||
| "reference": "6a1e846331bb3cc1a305168125d047fb86260e3d" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1e846331bb3cc1a305168125d047fb86260e3d", | |||
| "reference": "6a1e846331bb3cc1a305168125d047fb86260e3d", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3", | |||
| "sebastian/diff": "~1.1", | |||
| "sebastian/exporter": "~1.0" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.1" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.1.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Jeff Welch", | |||
| "email": "whatthejeff@gmail.com" | |||
| }, | |||
| { | |||
| "name": "Volker Dusch", | |||
| "email": "github@wallbash.com" | |||
| }, | |||
| { | |||
| "name": "Bernhard Schussek", | |||
| "email": "bschussek@2bepublished.at" | |||
| }, | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| } | |||
| ], | |||
| "description": "Provides the functionality to compare PHP values for equality", | |||
| "homepage": "http://www.github.com/sebastianbergmann/comparator", | |||
| "keywords": [ | |||
| "comparator", | |||
| "compare", | |||
| "equality" | |||
| ], | |||
| "time": "2015-01-05 16:29:00" | |||
| }, | |||
| { | |||
| "name": "sebastian/diff", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/diff.git", | |||
| "reference": "6dc90302a4cdf8486c221a0ad3a4da53859fcfa5" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6dc90302a4cdf8486c221a0ad3a4da53859fcfa5", | |||
| "reference": "6dc90302a4cdf8486c221a0ad3a4da53859fcfa5", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.2" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.2-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Kore Nordmann", | |||
| "email": "mail@kore-nordmann.de" | |||
| }, | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| } | |||
| ], | |||
| "description": "Diff implementation", | |||
| "homepage": "http://www.github.com/sebastianbergmann/diff", | |||
| "keywords": [ | |||
| "diff" | |||
| ], | |||
| "time": "2015-01-01 09:20:29" | |||
| }, | |||
| { | |||
| "name": "sebastian/environment", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/environment.git", | |||
| "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", | |||
| "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.4" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.3.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| } | |||
| ], | |||
| "description": "Provides functionality to handle HHVM/PHP environments", | |||
| "homepage": "http://www.github.com/sebastianbergmann/environment", | |||
| "keywords": [ | |||
| "Xdebug", | |||
| "environment", | |||
| "hhvm" | |||
| ], | |||
| "time": "2015-01-01 10:01:08" | |||
| }, | |||
| { | |||
| "name": "sebastian/exporter", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/exporter.git", | |||
| "reference": "84839970d05254c73cde183a721c7af13aede943" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", | |||
| "reference": "84839970d05254c73cde183a721c7af13aede943", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3", | |||
| "sebastian/recursion-context": "~1.0" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.4" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.2.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Jeff Welch", | |||
| "email": "whatthejeff@gmail.com" | |||
| }, | |||
| { | |||
| "name": "Volker Dusch", | |||
| "email": "github@wallbash.com" | |||
| }, | |||
| { | |||
| "name": "Bernhard Schussek", | |||
| "email": "bschussek@2bepublished.at" | |||
| }, | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| }, | |||
| { | |||
| "name": "Adam Harvey", | |||
| "email": "aharvey@php.net" | |||
| } | |||
| ], | |||
| "description": "Provides the functionality to export PHP variables for visualization", | |||
| "homepage": "http://www.github.com/sebastianbergmann/exporter", | |||
| "keywords": [ | |||
| "export", | |||
| "exporter" | |||
| ], | |||
| "time": "2015-01-27 07:23:06" | |||
| }, | |||
| { | |||
| "name": "sebastian/global-state", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/global-state.git", | |||
| "reference": "007c441df427cf0e175372fcbb9d196bce7eb743" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/007c441df427cf0e175372fcbb9d196bce7eb743", | |||
| "reference": "007c441df427cf0e175372fcbb9d196bce7eb743", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.2" | |||
| }, | |||
| "suggest": { | |||
| "ext-uopz": "*" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.0-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| } | |||
| ], | |||
| "description": "Snapshotting of global state", | |||
| "homepage": "http://www.github.com/sebastianbergmann/global-state", | |||
| "keywords": [ | |||
| "global state" | |||
| ], | |||
| "time": "2015-01-20 04:09:31" | |||
| }, | |||
| { | |||
| "name": "sebastian/recursion-context", | |||
| "version": "dev-master", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/recursion-context.git", | |||
| "reference": "3989662bbb30a29d20d9faa04a846af79b276252" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", | |||
| "reference": "3989662bbb30a29d20d9faa04a846af79b276252", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.3" | |||
| }, | |||
| "require-dev": { | |||
| "phpunit/phpunit": "~4.4" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "1.0.x-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Jeff Welch", | |||
| "email": "whatthejeff@gmail.com" | |||
| }, | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de" | |||
| }, | |||
| { | |||
| "name": "Adam Harvey", | |||
| "email": "aharvey@php.net" | |||
| } | |||
| ], | |||
| "description": "Provides functionality to recursively process PHP variables", | |||
| "homepage": "http://www.github.com/sebastianbergmann/recursion-context", | |||
| "time": "2015-01-24 09:48:32" | |||
| }, | |||
| { | |||
| "name": "sebastian/version", | |||
| "version": "1.0.4", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/sebastianbergmann/version.git", | |||
| "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/a77d9123f8e809db3fbdea15038c27a95da4058b", | |||
| "reference": "a77d9123f8e809db3fbdea15038c27a95da4058b", | |||
| "shasum": "" | |||
| }, | |||
| "type": "library", | |||
| "autoload": { | |||
| "classmap": [ | |||
| "src/" | |||
| ] | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "BSD-3-Clause" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Sebastian Bergmann", | |||
| "email": "sebastian@phpunit.de", | |||
| "role": "lead" | |||
| } | |||
| ], | |||
| "description": "Library that helps with managing the version number of Git-hosted PHP projects", | |||
| "homepage": "https://github.com/sebastianbergmann/version", | |||
| "time": "2014-12-15 14:25:24" | |||
| }, | |||
| { | |||
| "name": "symfony/yaml", | |||
| "version": "dev-master", | |||
| "target-dir": "Symfony/Component/Yaml", | |||
| "source": { | |||
| "type": "git", | |||
| "url": "https://github.com/symfony/Yaml.git", | |||
| "reference": "13ef40ee1437582f86fa805445363d0c694dae3a" | |||
| }, | |||
| "dist": { | |||
| "type": "zip", | |||
| "url": "https://api.github.com/repos/symfony/Yaml/zipball/13ef40ee1437582f86fa805445363d0c694dae3a", | |||
| "reference": "13ef40ee1437582f86fa805445363d0c694dae3a", | |||
| "shasum": "" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.5.9" | |||
| }, | |||
| "type": "library", | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-master": "3.0-dev" | |||
| } | |||
| }, | |||
| "autoload": { | |||
| "psr-0": { | |||
| "Symfony\\Component\\Yaml\\": "" | |||
| } | |||
| }, | |||
| "notification-url": "https://packagist.org/downloads/", | |||
| "license": [ | |||
| "MIT" | |||
| ], | |||
| "authors": [ | |||
| { | |||
| "name": "Symfony Community", | |||
| "homepage": "http://symfony.com/contributors" | |||
| }, | |||
| { | |||
| "name": "Fabien Potencier", | |||
| "email": "fabien@symfony.com" | |||
| } | |||
| ], | |||
| "description": "Symfony Yaml Component", | |||
| "homepage": "http://symfony.com", | |||
| "time": "2015-01-25 04:42:01" | |||
| } | |||
| ], | |||
| "aliases": [], | |||
| "minimum-stability": "dev", | |||
| "stability-flags": { | |||
| "phpunit/phpunit": 20 | |||
| }, | |||
| "prefer-stable": false, | |||
| "prefer-lowest": false, | |||
| "platform": { | |||
| "php": ">=5.3.0" | |||
| }, | |||
| "platform-dev": [] | |||
| } | |||
| @ -0,0 +1,5 @@ | |||
| <?php | |||
| require 'vendor/autoload.php'; | |||
| $updater = new \Kanti\HubUpdater('kanti/test'); | |||
| $updater->update(); | |||
| @ -0,0 +1,29 @@ | |||
| <?php | |||
| require 'vendor/autoload.php'; | |||
| $updater = new \Kanti\HubUpdater(array( | |||
| "cacheFile" => "downloadInfo.json",//name of the InformationCacheFile(in cacheDir) | |||
| "holdTime" => 43200,//time(seconds) the Cached-Information will be used | |||
| "versionFile" => "installedVersion.json",//name of the InstalledVersionInformation is safed(in cacheDir) | |||
| "zipFile" => "tmpZipFile.zip",//name of the temporary zip file(in cacheDir) | |||
| "updateignore" => ".updateignore",//name of the updateignore file(in root of project) | |||
| "name" => 'kanti/test',//Repository to watch | |||
| "branch" => 'master',//wich branch to watch | |||
| "cache" => 'cache/',//were to put the caching stuff | |||
| "save" => 'save/',//there to put the downloaded Version[default ./] | |||
| "prerelease" => true,//accept prereleases? | |||
| "exceptions" => true,//if true, will throw new \Exception on failure | |||
| )); | |||
| if ($updater->able()) { | |||
| if (isset($_GET['update'])) { | |||
| $updater->update(); | |||
| echo '<p>updated :)</p>'; | |||
| } else { | |||
| echo '<a href="?update">Update Me</a>'; //only update if they klick this link | |||
| } | |||
| } else { | |||
| echo '<p>uptodate :)</p>'; | |||
| } | |||
| @ -0,0 +1,58 @@ | |||
| <?php | |||
| namespace Kanti; | |||
| class CacheOneFile | |||
| { | |||
| protected $fileName = ""; | |||
| protected $holdTime = 43200; //12h | |||
| public function __construct($fileName, $holdTime = 43200) | |||
| { | |||
| $this->fileName = $fileName; | |||
| $this->holdTime = $holdTime; | |||
| } | |||
| public function is() | |||
| { | |||
| if (!HelperClass::fileExists($this->fileName)) { | |||
| return false; | |||
| } | |||
| clearstatcache(); | |||
| if (filemtime($this->fileName) < (time() - $this->holdTime)) { | |||
| unlink($this->fileName); | |||
| return false; | |||
| } | |||
| return true; | |||
| } | |||
| protected function file_force_contents() | |||
| { | |||
| $args = func_get_args(); | |||
| $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $args[0]); | |||
| $parts = explode(DIRECTORY_SEPARATOR, $path); | |||
| array_pop($parts); | |||
| $directory = ''; | |||
| foreach ($parts as $part): | |||
| $check_path = $directory . $part; | |||
| if (is_dir($check_path . DIRECTORY_SEPARATOR) === FALSE) { | |||
| mkdir($check_path, 0755); | |||
| } | |||
| $directory = $check_path . DIRECTORY_SEPARATOR; | |||
| endforeach; | |||
| call_user_func_array('file_put_contents', $args); | |||
| } | |||
| public function get() | |||
| { | |||
| return file_get_contents($this->fileName); | |||
| } | |||
| public function set($content) | |||
| { | |||
| $this->file_force_contents($this->fileName, $content); | |||
| } | |||
| } | |||
| @ -0,0 +1,28 @@ | |||
| <?php | |||
| namespace Kanti; | |||
| class HelperClass | |||
| { | |||
| protected static function isAbsolutePath($path) | |||
| { | |||
| return ('/' == $path[0] || '\\' == $path[0] || (strlen($path) > 3 && ctype_alpha($path[0]) && $path[1] == ':' && | |||
| ('\\' == $path[2] || '/' == $path[2]))); | |||
| } | |||
| public static function fileExists($file) | |||
| { | |||
| if (is_bool($file) || is_array($file)) { | |||
| throw new \InvalidArgumentException; | |||
| } | |||
| if(strlen($file) >= 3 && static::isAbsolutePath($file)){ | |||
| return file_exists($file); | |||
| } | |||
| return file_exists(dirname($_SERVER["SCRIPT_FILENAME"]) . "/" . $file); | |||
| } | |||
| static public function isInPhar() | |||
| { | |||
| return substr(__FILE__, 0, 7) === "phar://"; | |||
| } | |||
| } | |||
| @ -0,0 +1,73 @@ | |||
| <?php | |||
| /** | |||
| * Created by PhpStorm. | |||
| * User: Matthias | |||
| * Date: 27.01.2015 | |||
| * Time: 08:55 | |||
| */ | |||
| namespace Kanti\Test; | |||
| use Kanti\CacheOneFile; | |||
| class CacheOneFileTest extends \PHPUnit_Framework_TestCase | |||
| { | |||
| private $invalidContent = [ | |||
| true, | |||
| false, | |||
| array('content'), | |||
| ]; | |||
| private $validContent = [ | |||
| '', | |||
| 'a', | |||
| 'ab', | |||
| 'abc', | |||
| 1, | |||
| 12, | |||
| 123, | |||
| ]; | |||
| public function testIs() | |||
| { | |||
| $fileName = __DIR__ . "/asserts/testfile.txt"; | |||
| $time = 60*60;//1h | |||
| if(file_exists($fileName)){ | |||
| unlink($fileName); | |||
| } | |||
| $cache = new CacheOneFile($fileName,$time); | |||
| if($cache->is()){ | |||
| $this->fail("is not set"); | |||
| } | |||
| touch($fileName); | |||
| if(! $cache->is()){ | |||
| $this->fail("could not set"); | |||
| } | |||
| touch($fileName,0); | |||
| if($cache->is()){ | |||
| $this->fail("does not reset"); | |||
| } | |||
| } | |||
| public function testGet(){ | |||
| $fileName = __DIR__ . "/asserts/testfile.txt"; | |||
| $time = 60*60;//1h | |||
| $cache = new CacheOneFile($fileName,$time); | |||
| foreach ($this->validContent as $value) { | |||
| $cache->set($value); | |||
| if($cache->get() !== (string)$value){ | |||
| $this->fail("get set dosen't match for value{" . print_r($value,true) . "}"); | |||
| } | |||
| } | |||
| unlink($fileName); | |||
| foreach ($this->invalidContent as $value) { | |||
| $cache->set($value); | |||
| if($cache->get() === $value){ | |||
| $this->fail("get set does match for value{" . print_r($value,true) . "}"); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,54 @@ | |||
| <?php | |||
| /** | |||
| * Created by PhpStorm. | |||
| * User: Matthias | |||
| * Date: 27.01.2015 | |||
| * Time: 08:41 | |||
| */ | |||
| namespace Kanti\Test; | |||
| use Kanti\HelperClass; | |||
| class HelperClassTest extends \PHPUnit_Framework_TestCase { | |||
| private $invalidFileNames = [ | |||
| true, | |||
| false, | |||
| array('array'), | |||
| ]; | |||
| private $validFileNames = [ | |||
| '', | |||
| 'a', | |||
| 'ab', | |||
| 'abc', | |||
| 1, | |||
| 12, | |||
| 123, | |||
| ]; | |||
| public function testStaticFileExists() | |||
| { | |||
| foreach ($this->invalidFileNames as $value) { | |||
| try { | |||
| HelperClass::fileExists($value); | |||
| } catch (\InvalidArgumentException $e) { | |||
| // Good, we got an exception! | |||
| continue; | |||
| } | |||
| $this->fail('Expected exception not raised on value: "' . $value . '".'); | |||
| } | |||
| foreach ($this->validFileNames as $value) { | |||
| HelperClass::fileExists($value); | |||
| } | |||
| } | |||
| public function testIsInPhar(){ | |||
| if(HelperClass::isInPhar()){ | |||
| $this->fail("unit test is in phar?"); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1 @@ | |||
| content | |||
| @ -0,0 +1,9 @@ | |||
| <?php | |||
| ini_set('error_reporting', E_ALL); // or error_reporting(E_ALL); | |||
| ini_set('display_errors', '1'); | |||
| ini_set('display_startup_errors', '1'); | |||
| $_SERVER['SCRIPT_FILENAME'] = dirname(__DIR__) . "\index.php"; | |||
| chdir(dirname(__DIR__)); | |||
| require_once __DIR__ . "/../vendor/autoload.php"; | |||
| @ -0,0 +1,29 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <phpunit bootstrap="bootstrap.php" | |||
| backupGlobals="false" | |||
| backupStaticAttributes="false" | |||
| colors="true" | |||
| verbose="true" | |||
| convertErrorsToExceptions="true" | |||
| convertNoticesToExceptions="true" | |||
| convertWarningsToExceptions="true" | |||
| processIsolation="false" | |||
| stopOnFailure="false"> | |||
| <testsuites> | |||
| <testsuite name="Hub-Updater Test Suite"> | |||
| <directory>./</directory> | |||
| </testsuite> | |||
| </testsuites> | |||
| <filter> | |||
| <whitelist> | |||
| <directory suffix=".php">../src/</directory> | |||
| </whitelist> | |||
| </filter> | |||
| <logging> | |||
| <log type="tap" target="../build/report.tap"/> | |||
| <log type="junit" target="../build/report.junit.xml"/> | |||
| <log type="coverage-html" target="../build/coverage" charset="UTF-8" yui="true" highlight="true"/> | |||
| <log type="coverage-text" target="../build/coverage.txt"/> | |||
| <log type="coverage-clover" target="../build/logs/clover.xml"/> | |||
| </logging> | |||
| </phpunit> | |||
| @ -1,36 +0,0 @@ | |||
| PHP Markdown Lib | |||
| Copyright (c) 2004-2014 Michel Fortin | |||
| <http://michelf.ca/> | |||
| All rights reserved. | |||
| Based on Markdown | |||
| Copyright (c) 2003-2006 John Gruber | |||
| <http://daringfireball.net/> | |||
| All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| * Redistributions of source code must retain the above copyright notice, | |||
| this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above copyright | |||
| notice, this list of conditions and the following disclaimer in the | |||
| documentation and/or other materials provided with the distribution. | |||
| * Neither the name "Markdown" nor the names of its contributors may | |||
| be used to endorse or promote products derived from this software | |||
| without specific prior written permission. | |||
| This software is provided by the copyright holders and contributors "as | |||
| is" and any express or implied warranties, including, but not limited | |||
| to, the implied warranties of merchantability and fitness for a | |||
| particular purpose are disclaimed. In no event shall the copyright owner | |||
| or contributors be liable for any direct, indirect, incidental, special, | |||
| exemplary, or consequential damages (including, but not limited to, | |||
| procurement of substitute goods or services; loss of use, data, or | |||
| profits; or business interruption) however caused and on any theory of | |||
| liability, whether in contract, strict liability, or tort (including | |||
| negligence or otherwise) arising in any way out of the use of this | |||
| software, even if advised of the possibility of such damage. | |||
| @ -1,10 +0,0 @@ | |||
| <?php | |||
| # Use this file if you cannot use class autoloading. It will include all the | |||
| # files needed for the Markdown parser. | |||
| # | |||
| # Take a look at the PSR-0-compatible class autoloading implementation | |||
| # in the Readme.php file if you want a simple autoloader setup. | |||
| require_once dirname(__FILE__) . '/MarkdownInterface.php'; | |||
| require_once dirname(__FILE__) . '/Markdown.php'; | |||
| @ -1,11 +0,0 @@ | |||
| <?php | |||
| # Use this file if you cannot use class autoloading. It will include all the | |||
| # files needed for the MarkdownExtra parser. | |||
| # | |||
| # Take a look at the PSR-0-compatible class autoloading implementation | |||
| # in the Readme.php file if you want a simple autoloader setup. | |||
| require_once dirname(__FILE__) . '/MarkdownInterface.php'; | |||
| require_once dirname(__FILE__) . '/Markdown.php'; | |||
| require_once dirname(__FILE__) . '/MarkdownExtra.php'; | |||
| @ -1,38 +0,0 @@ | |||
| <?php | |||
| # | |||
| # Markdown Extra - A text-to-HTML conversion tool for web writers | |||
| # | |||
| # PHP Markdown Extra | |||
| # Copyright (c) 2004-2014 Michel Fortin | |||
| # <http://michelf.com/projects/php-markdown/> | |||
| # | |||
| # Original Markdown | |||
| # Copyright (c) 2004-2006 John Gruber | |||
| # <http://daringfireball.net/projects/markdown/> | |||
| # | |||
| namespace Michelf; | |||
| # Just force Michelf/Markdown.php to load. This is needed to load | |||
| # the temporary implementation class. See below for details. | |||
| \Michelf\Markdown::MARKDOWNLIB_VERSION; | |||
| # | |||
| # Markdown Extra Parser Class | |||
| # | |||
| # Note: Currently the implementation resides in the temporary class | |||
| # \Michelf\MarkdownExtra_TmpImpl (in the same file as \Michelf\Markdown). | |||
| # This makes it easier to propagate the changes between the three different | |||
| # packaging styles of PHP Markdown. Once this issue is resolved, the | |||
| # _MarkdownExtra_TmpImpl will disappear and this one will contain the code. | |||
| # | |||
| class MarkdownExtra extends \Michelf\_MarkdownExtra_TmpImpl { | |||
| ### Parser Implementation ### | |||
| # Temporarily, the implemenation is in the _MarkdownExtra_TmpImpl class. | |||
| # See note above. | |||
| } | |||
| @ -1,9 +0,0 @@ | |||
| <?php | |||
| # Use this file if you cannot use class autoloading. It will include all the | |||
| # files needed for the MarkdownInterface interface. | |||
| # | |||
| # Take a look at the PSR-0-compatible class autoloading implementation | |||
| # in the Readme.php file if you want a simple autoloader setup. | |||
| require_once dirname(__FILE__) . '/MarkdownInterface.php'; | |||
| @ -1,37 +0,0 @@ | |||
| <?php | |||
| # | |||
| # Markdown - A text-to-HTML conversion tool for web writers | |||
| # | |||
| # PHP Markdown | |||
| # Copyright (c) 2004-2014 Michel Fortin | |||
| # <http://michelf.com/projects/php-markdown/> | |||
| # | |||
| # Original Markdown | |||
| # Copyright (c) 2004-2006 John Gruber | |||
| # <http://daringfireball.net/projects/markdown/> | |||
| # | |||
| namespace Michelf; | |||
| # | |||
| # Markdown Parser Interface | |||
| # | |||
| interface MarkdownInterface { | |||
| # | |||
| # Initialize the parser and return the result of its transform method. | |||
| # This will work fine for derived classes too. | |||
| # | |||
| public static function defaultTransform($text); | |||
| # | |||
| # Main function. Performs some preprocessing on the input text | |||
| # and pass it through the document gamut. | |||
| # | |||
| public function transform($text); | |||
| } | |||
| ?> | |||
| @ -1,305 +0,0 @@ | |||
| PHP Markdown | |||
| ============ | |||
| PHP Markdown Lib 1.4.1 - 4 May 2013 | |||
| by Michel Fortin | |||
| <http://michelf.ca/> | |||
| based on Markdown by John Gruber | |||
| <http://daringfireball.net/> | |||
| Introduction | |||
| ------------ | |||
| This is a library package that includes the PHP Markdown parser and its | |||
| sibling PHP Markdown Extra with additional features. | |||
| Markdown is a text-to-HTML conversion tool for web writers. Markdown | |||
| allows you to write using an easy-to-read, easy-to-write plain text | |||
| format, then convert it to structurally valid XHTML (or HTML). | |||
| "Markdown" is actually two things: a plain text markup syntax, and a | |||
| software tool, originally written in Perl, that converts the plain text | |||
| markup to HTML. PHP Markdown is a port to PHP of the original Markdown | |||
| program by John Gruber. | |||
| * [Full documentation of the Markdown syntax](<http://daringfireball.net/projects/markdown/>) | |||
| - Daring Fireball (John Gruber) | |||
| * [Markdown Extra syntax additions](<http://michelf.ca/projects/php-markdown/extra/>) | |||
| - Michel Fortin | |||
| Requirement | |||
| ----------- | |||
| This library package requires PHP 5.3 or later. | |||
| Note: The older plugin/library hybrid package for PHP Markdown and | |||
| PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later. | |||
| Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small | |||
| in many situations. You might need to set it to higher values. Later PHP | |||
| releases defaults to 1 000 000, which is usually fine. | |||
| Usage | |||
| ----- | |||
| This library package is meant to be used with class autoloading. For autoloading | |||
| to work, your project needs have setup a PSR-0-compatible autoloader. See the | |||
| included Readme.php file for a minimal autoloader setup. (If you cannot use | |||
| autoloading, see below.) | |||
| With class autoloading in place, putting the 'Michelf' folder in your | |||
| include path should be enough for this to work: | |||
| use \Michelf\Markdown; | |||
| $my_html = Markdown::defaultTransform($my_text); | |||
| Markdown Extra syntax is also available the same way: | |||
| use \Michelf\MarkdownExtra; | |||
| $my_html = MarkdownExtra::defaultTransform($my_text); | |||
| If you wish to use PHP Markdown with another text filter function | |||
| built to parse HTML, you should filter the text *after* the `transform` | |||
| function call. This is an example with [PHP SmartyPants][psp]: | |||
| use \Michelf\Markdown, \Michelf\SmartyPants; | |||
| $my_html = Markdown::defaultTransform($my_text); | |||
| $my_html = SmartyPants::defaultTransform($my_html); | |||
| All these examples are using the static `defaultTransform` static function | |||
| found inside the parser class. If you want to customize the parser | |||
| configuration, you can also instantiate it directly and change some | |||
| configuration variables: | |||
| use \Michelf\MarkdownExtra; | |||
| $parser = new MarkdownExtra; | |||
| $parser->fn_id_prefix = "post22-"; | |||
| $my_html = $parser->transform($my_text); | |||
| To learn more, see the full list of [configuration variables]. | |||
| [configuration variables]: http://michelf.ca/projects/php-markdown/configuration/ | |||
| ### Usage without an autoloader | |||
| If you cannot use class autoloading, you can still use `include` or `require` | |||
| to access the parser. To load the `\Michelf\Markdown` parser, do it this way: | |||
| require_once 'Michelf/Markdown.inc.php'; | |||
| Or, if you need the `\Michelf\MarkdownExtra` parser: | |||
| require_once 'Michelf/MarkdownExtra.inc.php'; | |||
| While the plain `.php` files depend on autoloading to work correctly, using the | |||
| `.inc.php` files instead will eagerly load the dependencies that would be | |||
| loaded on demand if you were using autoloading. | |||
| Public API and Versioning Policy | |||
| --------------------------------- | |||
| Version numbers are of the form *major*.*minor*.*patch*. | |||
| The public API of PHP Markdown consist of the two parser classes `Markdown` | |||
| and `MarkdownExtra`, their constructors, the `transform` and `defaultTransform` | |||
| functions and their configuration variables. The public API is stable for | |||
| a given major version number. It might get additions when the minor version | |||
| number increments. | |||
| **Protected members are not considered public API.** This is unconventional | |||
| and deserves an explanation. Incrementing the major version number every time | |||
| the underlying implementation of something changes is going to give | |||
| nonessential version numbers for the vast majority of people who just use the | |||
| parser. Protected members are meant to create parser subclasses that behave in | |||
| different ways. Very few people create parser subclasses. I don't want to | |||
| discourage it by making everything private, but at the same time I can't | |||
| guarantee any stable hook between versions if you use protected members. | |||
| **Syntax changes** will increment the minor number for new features, and the | |||
| patch number for small corrections. A *new feature* is something that needs a | |||
| change in the syntax documentation. Note that since PHP Markdown Lib includes | |||
| two parsers, a syntax change for either of them will increment the minor | |||
| number. Also note that there is nothing perfectly backward-compatible with the | |||
| Markdown syntax: all inputs are always valid, so new features always replace | |||
| something that was previously legal, although generally nonsensical to do. | |||
| Bugs | |||
| ---- | |||
| To file bug reports please send email to: | |||
| <michel.fortin@michelf.ca> | |||
| Please include with your report: (1) the example input; (2) the output you | |||
| expected; (3) the output PHP Markdown actually produced. | |||
| If you have a problem where Markdown gives you an empty result, first check | |||
| that the backtrack limit is not too low by running `php --info | grep pcre`. | |||
| See Installation and Requirement above for details. | |||
| Development and Testing | |||
| ----------------------- | |||
| Pull requests for fixing bugs are welcome. Proposed new features are | |||
| going meticulously reviewed -- taking into account backward compatibility, | |||
| potential side effects, and future extensibility -- before deciding on | |||
| acceptance or rejection. | |||
| If you make a pull request that includes changes to the parser please add | |||
| tests for what is being changed to [MDTest][] and make a pull request there | |||
| too. | |||
| [MDTest]: https://github.com/michelf/mdtest/ | |||
| Donations | |||
| --------- | |||
| If you wish to make a donation that will help me devote more time to | |||
| PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to | |||
| [1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]. | |||
| [michelf.ca/donate]: https://michelf.ca/donate/#!Thanks%20for%20PHP%20Markdown | |||
| [1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]: bitcoin:1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH | |||
| Version History | |||
| --------------- | |||
| PHP Markdown Lib 1.4.1 (4 May 2014) | |||
| * The HTML block parser will now treat `<figure>` as a block-level element | |||
| (as it should) and no longer wrap it in `<p>` or parse it's content with | |||
| the as Markdown syntax (although with Extra you can use `markdown="1"` | |||
| if you wish to use the Markdown syntax inside it). | |||
| * The content of `<style>` elements will now be left alone, its content | |||
| won't be interpreted as Markdown. | |||
| * Corrected an bug where some inline links with spaces in them would not | |||
| work even when surounded with angle brackets: | |||
| [link](<s p a c e s>) | |||
| * Fixed an issue where email addresses with quotes in them would not always | |||
| have the quotes escaped in the link attribute, causing broken links (and | |||
| invalid HTML). | |||
| * Fixed the case were a link definition following a footnote definition would | |||
| be swallowed by the footnote unless it was separated by a blank line. | |||
| PHP Markdown Lib 1.4.0 (29 Nov 2013) | |||
| * Added support for the `tel:` URL scheme in automatic links. | |||
| <tel:+1-111-111-1111> | |||
| It gets converted to this (note the `tel:` prefix becomes invisible): | |||
| <a href="tel:+1-111-111-1111">+1-111-111-1111</a> | |||
| * Added backtick fenced code blocks to MarkdownExtra, originally from | |||
| Github-Flavored Markdown. | |||
| * Added an interface called MarkdownInterface implemented by both | |||
| the Markdown and MarkdownExtra parsers. You can use the interface if | |||
| you want to create a mockup parser object for unit testing. | |||
| * For those of you who cannot use class autoloading, you can now | |||
| include `Michelf/Markdown.inc.php` or `Michelf/MarkdownExtra.inc.php` (note | |||
| the `.inc.php` extension) to automatically include other files required | |||
| by the parser. | |||
| PHP Markdown Lib 1.3 (11 Apr 2013) | |||
| This is the first release of PHP Markdown Lib. This package requires PHP | |||
| version 5.3 or later and is designed to work with PSR-0 autoloading and, | |||
| optionally with Composer. Here is a list of the changes since | |||
| PHP Markdown Extra 1.2.6: | |||
| * Plugin interface for WordPress and other systems is no longer present in | |||
| the Lib package. The classic package is still available if you need it: | |||
| <http://michelf.ca/projects/php-markdown/classic/> | |||
| * Added `public` and `protected` protection attributes, plus a section about | |||
| what is "public API" and what isn't in the Readme file. | |||
| * Changed HTML output for footnotes: now instead of adding `rel` and `rev` | |||
| attributes, footnotes links have the class name `footnote-ref` and | |||
| backlinks `footnote-backref`. | |||
| * Fixed some regular expressions to make PCRE not shout warnings about POSIX | |||
| collation classes (dependent on your version of PCRE). | |||
| * Added optional class and id attributes to images and links using the same | |||
| syntax as for headers: | |||
| [link](url){#id .class} | |||
| {#id .class} | |||
| It work too for reference-style links and images. In this case you need | |||
| to put those attributes at the reference definition: | |||
| [link][linkref] or [linkref] | |||
| ![img][linkref] | |||
| [linkref]: url "optional title" {#id .class} | |||
| * Fixed a PHP notice message triggered when some table column separator | |||
| markers are missing on the separator line below column headers. | |||
| * Fixed a small mistake that could cause the parser to retain an invalid | |||
| state related to parsing links across multiple runs. This was never | |||
| observed (that I know of), but it's still worth fixing. | |||
| Copyright and License | |||
| --------------------- | |||
| PHP Markdown Lib | |||
| Copyright (c) 2004-2014 Michel Fortin | |||
| <http://michelf.ca/> | |||
| All rights reserved. | |||
| Based on Markdown | |||
| Copyright (c) 2003-2005 John Gruber | |||
| <http://daringfireball.net/> | |||
| All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| * Redistributions of source code must retain the above copyright | |||
| notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above copyright | |||
| notice, this list of conditions and the following disclaimer in the | |||
| documentation and/or other materials provided with the | |||
| distribution. | |||
| * Neither the name "Markdown" nor the names of its contributors may | |||
| be used to endorse or promote products derived from this software | |||
| without specific prior written permission. | |||
| This software is provided by the copyright holders and contributors "as | |||
| is" and any express or implied warranties, including, but not limited | |||
| to, the implied warranties of merchantability and fitness for a | |||
| particular purpose are disclaimed. In no event shall the copyright owner | |||
| or contributors be liable for any direct, indirect, incidental, special, | |||
| exemplary, or consequential damages (including, but not limited to, | |||
| procurement of substitute goods or services; loss of use, data, or | |||
| profits; or business interruption) however caused and on any theory of | |||
| liability, whether in contract, strict liability, or tort (including | |||
| negligence or otherwise) arising in any way out of the use of this | |||
| software, even if advised of the possibility of such damage. | |||
| @ -1,31 +0,0 @@ | |||
| <?php | |||
| # This file passes the content of the Readme.md file in the same directory | |||
| # through the Markdown filter. You can adapt this sample code in any way | |||
| # you like. | |||
| # Install PSR-0-compatible class autoloader | |||
| spl_autoload_register(function($class){ | |||
| require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; | |||
| }); | |||
| # Get Markdown class | |||
| use \Michelf\Markdown; | |||
| # Read file and pass content through the Markdown parser | |||
| $text = file_get_contents('Readme.md'); | |||
| $html = Markdown::defaultTransform($text); | |||
| ?> | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <title>PHP Markdown Lib - Readme</title> | |||
| </head> | |||
| <body> | |||
| <?php | |||
| # Put HTML content in the document | |||
| echo $html; | |||
| ?> | |||
| </body> | |||
| </html> | |||
| @ -1,31 +0,0 @@ | |||
| { | |||
| "name": "michelf/php-markdown", | |||
| "type": "library", | |||
| "description": "PHP Markdown", | |||
| "homepage": "http://michelf.ca/projects/php-markdown/", | |||
| "keywords": ["markdown"], | |||
| "license": "BSD-3-Clause", | |||
| "authors": [ | |||
| { | |||
| "name": "Michel Fortin", | |||
| "email": "michel.fortin@michelf.ca", | |||
| "homepage": "http://michelf.ca/", | |||
| "role": "Developer" | |||
| }, | |||
| { | |||
| "name": "John Gruber", | |||
| "homepage": "http://daringfireball.net/" | |||
| } | |||
| ], | |||
| "require": { | |||
| "php": ">=5.3.0" | |||
| }, | |||
| "autoload": { | |||
| "psr-0": { "Michelf": "" } | |||
| }, | |||
| "extra": { | |||
| "branch-alias": { | |||
| "dev-lib": "1.4.x-dev" | |||
| } | |||
| } | |||
| } | |||
| @ -1,11 +0,0 @@ | |||
| language: php | |||
| php: | |||
| - 5.3 | |||
| - 5.4 | |||
| before_script: | |||
| - cd Tests | |||
| - wget http://getcomposer.org/composer.phar | |||
| - php composer.phar install | |||
| script: ./phpunit --coverage-text --configuration phpunit.xml.dist | |||
| @ -1,96 +0,0 @@ | |||
| # \Suin\RSSWriter | |||
| `\Suin\RSSWriter` is yet another simple RSS writer library for PHP 5.3 or later. This component is Licensed under MIT license. | |||
| This library can also be used to publish Podcasts. | |||
| The build status of the current master branch is tracked by Travis CI: [](http://travis-ci.org/suin/php-rss-writer) | |||
| Implementation: | |||
| ```php | |||
| <?php | |||
| $feed = new Feed(); | |||
| $channel = new Channel(); | |||
| $channel | |||
| ->title("Channel Title") | |||
| ->description("Channel Description") | |||
| ->url('http://blog.example.com') | |||
| ->appendTo($feed); | |||
| // RSS item | |||
| $item = new Item(); | |||
| $item | |||
| ->title("Blog Entry Title") | |||
| ->description("<div>Blog body</div>") | |||
| ->url('http://blog.example.com/2012/08/21/blog-entry/') | |||
| ->appendTo($channel); | |||
| // Podcast item | |||
| $item = new Item(); | |||
| $item | |||
| ->title("Some Podcast Entry") | |||
| ->description("<div>Podcast body</div>") | |||
| ->url('http://podcast.example.com/2012/08/21/podcast-entry/') | |||
| ->enclosure('http://link-to-audio-file.com/2013/08/21/podcast.mp3', 4889, 'audio/mpeg') | |||
| ->appendTo($channel); | |||
| echo $feed; | |||
| ``` | |||
| Output: | |||
| ```xml | |||
| <?xml version="1.0"?> | |||
| <rss version="2.0"> | |||
| <channel> | |||
| <title>Channel Title</title> | |||
| <link>http://blog.example.com</link> | |||
| <description>Channel Description</description> | |||
| <item> | |||
| <title>Blog Entry Title</title> | |||
| <link>http://blog.example.com/2012/08/21/blog-entry/</link> | |||
| <description><div>Blog body</div></description> | |||
| </item> | |||
| </channel> | |||
| </rss> | |||
| ``` | |||
| ## Installation | |||
| You can install via Composer. | |||
| At first create `composer.json` file: | |||
| ```json | |||
| { | |||
| "require": { | |||
| "suin/php-rss-writer": ">=1.0" | |||
| } | |||
| } | |||
| ``` | |||
| Run composer to install. | |||
| ``` | |||
| $ composer install | |||
| ``` | |||
| Finally, include `vendor/autoload.php` in your product. | |||
| ``` | |||
| require_once 'vendor/autoload.php'; | |||
| ``` | |||
| ## How to Use | |||
| `example.php` is an example usage of RSSWriter. | |||
| If you want to know APIs, please see `FeedInterface`, `ChannelInterface` and `ItemInterface`. | |||
| ## License | |||
| MIT license | |||
| @ -1,189 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Suin\RSSWriter\SimpleXMLElement; | |||
| class Channel implements \Suin\RSSWriter\ChannelInterface | |||
| { | |||
| /** @var string */ | |||
| protected $title; | |||
| /** @var string */ | |||
| protected $url; | |||
| /** @var string */ | |||
| protected $description; | |||
| /** @var string */ | |||
| protected $language; | |||
| /** @var string */ | |||
| protected $copyright; | |||
| /** @var int */ | |||
| protected $pubDate; | |||
| /** @var int */ | |||
| protected $lastBuildDate; | |||
| /** @var int */ | |||
| protected $ttl; | |||
| /** @var \Suin\RSSWriter\ItemInterface[] */ | |||
| protected $items = array(); | |||
| /** | |||
| * Set channel title | |||
| * @param string $title | |||
| * @return $this | |||
| */ | |||
| public function title($title) | |||
| { | |||
| $this->title = $title; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel URL | |||
| * @param string $url | |||
| * @return $this | |||
| */ | |||
| public function url($url) | |||
| { | |||
| $this->url = $url; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel description | |||
| * @param string $description | |||
| * @return $this | |||
| */ | |||
| public function description($description) | |||
| { | |||
| $this->description = $description; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set ISO639 language code | |||
| * | |||
| * The language the channel is written in. This allows aggregators to group all | |||
| * Italian language sites, for example, on a single page. A list of allowable | |||
| * values for this element, as provided by Netscape, is here. You may also use | |||
| * values defined by the W3C. | |||
| * | |||
| * @param string $language | |||
| * @return $this | |||
| */ | |||
| public function language($language) | |||
| { | |||
| $this->language = $language; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel copyright | |||
| * @param string $copyright | |||
| * @return $this | |||
| */ | |||
| public function copyright($copyright) | |||
| { | |||
| $this->copyright = $copyright; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel published date | |||
| * @param int $pubDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function pubDate($pubDate) | |||
| { | |||
| $this->pubDate = $pubDate; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel last build date | |||
| * @param int $lastBuildDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function lastBuildDate($lastBuildDate) | |||
| { | |||
| $this->lastBuildDate = $lastBuildDate; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set channel ttl (minutes) | |||
| * @param int $ttl | |||
| * @return $this | |||
| */ | |||
| public function ttl($ttl) | |||
| { | |||
| $this->ttl = $ttl; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Add item object | |||
| * @param \Suin\RSSWriter\ItemInterface $item | |||
| * @return $this | |||
| */ | |||
| public function addItem(ItemInterface $item) | |||
| { | |||
| $this->items[] = $item; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Append to feed | |||
| * @param \Suin\RSSWriter\FeedInterface $feed | |||
| * @return $this | |||
| */ | |||
| public function appendTo(FeedInterface $feed) | |||
| { | |||
| $feed->addChannel($this); | |||
| return $this; | |||
| } | |||
| /** | |||
| * Return XML object | |||
| * @return \Suin\RSSWriter\SimpleXMLElement | |||
| */ | |||
| public function asXML() | |||
| { | |||
| $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel></channel>', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL); | |||
| $xml->addChild('title', $this->title); | |||
| $xml->addChild('link', $this->url); | |||
| $xml->addChild('description', $this->description); | |||
| if ( $this->language !== null ) | |||
| { | |||
| $xml->addChild('language', $this->language); | |||
| } | |||
| if ( $this->copyright !== null ) | |||
| { | |||
| $xml->addChild('copyright', $this->copyright); | |||
| } | |||
| if ( $this->pubDate !== null ) | |||
| { | |||
| $xml->addChild('pubDate', date(DATE_RSS, $this->pubDate)); | |||
| } | |||
| if ( $this->lastBuildDate !== null ) | |||
| { | |||
| $xml->addChild('lastBuildDate', date(DATE_RSS, $this->lastBuildDate)); | |||
| } | |||
| if ( $this->ttl !== null ) | |||
| { | |||
| $xml->addChild('ttl', $this->ttl); | |||
| } | |||
| foreach ( $this->items as $item ) | |||
| { | |||
| $toDom = dom_import_simplexml($xml); | |||
| $fromDom = dom_import_simplexml($item->asXML()); | |||
| $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); | |||
| } | |||
| return $xml; | |||
| } | |||
| } | |||
| @ -1,91 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Suin\RSSWriter\FeedInterface; | |||
| use \Suin\RSSWriter\ItemInterface; | |||
| interface ChannelInterface | |||
| { | |||
| /** | |||
| * Set channel title | |||
| * @param string $title | |||
| * @return $this | |||
| */ | |||
| public function title($title); | |||
| /** | |||
| * Set channel URL | |||
| * @param string $url | |||
| * @return $this | |||
| */ | |||
| public function url($url); | |||
| /** | |||
| * Set channel description | |||
| * @param string $description | |||
| * @return $this | |||
| */ | |||
| public function description($description); | |||
| /** | |||
| * Set ISO639 language code | |||
| * | |||
| * The language the channel is written in. This allows aggregators to group all | |||
| * Italian language sites, for example, on a single page. A list of allowable | |||
| * values for this element, as provided by Netscape, is here. You may also use | |||
| * values defined by the W3C. | |||
| * | |||
| * @param string $language | |||
| * @return $this | |||
| */ | |||
| public function language($language); | |||
| /** | |||
| * Set channel copyright | |||
| * @param string $copyright | |||
| * @return $this | |||
| */ | |||
| public function copyright($copyright); | |||
| /** | |||
| * Set channel published date | |||
| * @param int $pubDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function pubDate($pubDate); | |||
| /** | |||
| * Set channel last build date | |||
| * @param int $lastBuildDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function lastBuildDate($lastBuildDate); | |||
| /** | |||
| * Set channel ttl (minutes) | |||
| * @param int $ttl | |||
| * @return $this | |||
| */ | |||
| public function ttl($ttl); | |||
| /** | |||
| * Add item object | |||
| * @param \Suin\RSSWriter\ItemInterface $item | |||
| * @return $this | |||
| */ | |||
| public function addItem(ItemInterface $item); | |||
| /** | |||
| * Append to feed | |||
| * @param \Suin\RSSWriter\FeedInterface $feed | |||
| * @return $this | |||
| */ | |||
| public function appendTo(FeedInterface $feed); | |||
| /** | |||
| * Return XML object | |||
| * @return \Suin\RSSWriter\SimpleXMLElement | |||
| */ | |||
| public function asXML(); | |||
| } | |||
| @ -1,54 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \DOMDocument; | |||
| use \Suin\RSSWriter\ChannelInterface; | |||
| use \Suin\RSSWriter\SimpleXMLElement; | |||
| class Feed implements \Suin\RSSWriter\FeedInterface | |||
| { | |||
| /** @var \Suin\RSSWriter\ChannelInterface[] */ | |||
| protected $channels = array(); | |||
| /** | |||
| * Add channel | |||
| * @param \Suin\RSSWriter\ChannelInterface $channel | |||
| * @return $this | |||
| */ | |||
| public function addChannel(ChannelInterface $channel) | |||
| { | |||
| $this->channels[] = $channel; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Render XML | |||
| * @return string | |||
| */ | |||
| public function render() | |||
| { | |||
| $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" />', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL); | |||
| foreach ( $this->channels as $channel ) | |||
| { | |||
| $toDom = dom_import_simplexml($xml); | |||
| $fromDom = dom_import_simplexml($channel->asXML()); | |||
| $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); | |||
| } | |||
| $dom = new DOMDocument('1.0', 'UTF-8'); | |||
| $dom->appendChild($dom->importNode(dom_import_simplexml($xml), true)); | |||
| $dom->formatOutput = true; | |||
| return $dom->saveXML(); | |||
| } | |||
| /** | |||
| * Render XML | |||
| * @return string | |||
| */ | |||
| public function __toString() | |||
| { | |||
| return $this->render(); | |||
| } | |||
| } | |||
| @ -1,27 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Suin\RSSWriter\ChannelInterface; | |||
| interface FeedInterface | |||
| { | |||
| /** | |||
| * Add channel | |||
| * @param \Suin\RSSWriter\ChannelInterface $channel | |||
| * @return $thisJ | |||
| */ | |||
| public function addChannel(ChannelInterface $channel); | |||
| /** | |||
| * Render XML | |||
| * @return string | |||
| */ | |||
| public function render(); | |||
| /** | |||
| * Render XML | |||
| * @return string | |||
| */ | |||
| public function __toString(); | |||
| } | |||
| @ -1,169 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Suin\RSSWriter\SimpleXMLElement; | |||
| class Item implements \Suin\RSSWriter\ItemInterface | |||
| { | |||
| /** @var string */ | |||
| protected $title; | |||
| /** @var string */ | |||
| protected $url; | |||
| /** @var string */ | |||
| protected $description; | |||
| /** @var array */ | |||
| protected $categories = array(); | |||
| /** @var string */ | |||
| protected $guid; | |||
| /** @var bool */ | |||
| protected $isPermalink; | |||
| /** @var int */ | |||
| protected $pubDate; | |||
| /** @var array */ | |||
| protected $enclosure; | |||
| /** | |||
| * Set item title | |||
| * @param string $title | |||
| * @return $this | |||
| */ | |||
| public function title($title) | |||
| { | |||
| $this->title = $title; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set item URL | |||
| * @param string $url | |||
| * @return $this | |||
| */ | |||
| public function url($url) | |||
| { | |||
| $this->url = $url; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set item description | |||
| * @param string $description | |||
| * @return $this | |||
| */ | |||
| public function description($description) | |||
| { | |||
| $this->description = $description; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set item category | |||
| * @param string $name Category name | |||
| * @param string $domain Category URL | |||
| * @return $this | |||
| */ | |||
| public function category($name, $domain = null) | |||
| { | |||
| $this->categories[] = array($name, $domain); | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set GUID | |||
| * @param string $guid | |||
| * @param bool $isPermalink | |||
| * @return $this | |||
| */ | |||
| public function guid($guid, $isPermalink = false) | |||
| { | |||
| $this->guid = $guid; | |||
| $this->isPermalink = $isPermalink; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set published date | |||
| * @param int $pubDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function pubDate($pubDate) | |||
| { | |||
| $this->pubDate = $pubDate; | |||
| return $this; | |||
| } | |||
| /** | |||
| * Set enclosure | |||
| * @param var $url Url to media file | |||
| * @param int $length Length in bytes of the media file | |||
| * @param var $type Media type, default is audio/mpeg | |||
| * @return $this | |||
| */ | |||
| public function enclosure($url, $length = 0, $type = 'audio/mpeg') | |||
| { | |||
| $this->enclosure = array('url' => $url, 'length' => $length, 'type' => $type); | |||
| return $this; | |||
| } | |||
| /** | |||
| * Append item to the channel | |||
| * @param \Suin\RSSWriter\ChannelInterface $channel | |||
| * @return $this | |||
| */ | |||
| public function appendTo(ChannelInterface $channel) | |||
| { | |||
| $channel->addItem($this); | |||
| return $this; | |||
| } | |||
| /** | |||
| * Return XML object | |||
| * @return \Suin\RSSWriter\SimpleXMLElement | |||
| */ | |||
| public function asXML() | |||
| { | |||
| $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item></item>', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_ERR_FATAL); | |||
| $xml->addChild('title', $this->title); | |||
| $xml->addChild('link', $this->url); | |||
| $xml->addChild('description', $this->description); | |||
| foreach ( $this->categories as $category ) | |||
| { | |||
| $element = $xml->addChild('category', $category[0]); | |||
| if ( isset($category[1]) ) | |||
| { | |||
| $element->addAttribute('domain', $category[1]); | |||
| } | |||
| } | |||
| if ( $this->guid ) | |||
| { | |||
| $guid = $xml->addChild('guid', $this->guid); | |||
| if ( $this->isPermalink ) | |||
| { | |||
| $guid->addAttribute('isPermaLink', 'true'); | |||
| } | |||
| } | |||
| if ( $this->pubDate !== null ) | |||
| { | |||
| $xml->addChild('pubDate', date(DATE_RSS, $this->pubDate)); | |||
| } | |||
| if (is_array($this->enclosure) && (count($this->enclosure) == 3)) | |||
| { | |||
| $element = $xml->addChild('enclosure'); | |||
| $element->addAttribute('url', $this->enclosure['url']); | |||
| $element->addAttribute('type', $this->enclosure['type']); | |||
| if ($this->enclosure['length']) | |||
| { | |||
| $element->addAttribute('length', $this->enclosure['length']); | |||
| } | |||
| } | |||
| return $xml; | |||
| } | |||
| } | |||
| @ -1,75 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Suin\RSSWriter\ChannelInterface; | |||
| use \Suin\RSSWriter\SimpleXMLElement; | |||
| interface ItemInterface | |||
| { | |||
| /** | |||
| * Set item title | |||
| * @param string $title | |||
| * @return $this | |||
| */ | |||
| public function title($title); | |||
| /** | |||
| * Set item URL | |||
| * @param string $url | |||
| * @return $this | |||
| */ | |||
| public function url($url); | |||
| /** | |||
| * Set item description | |||
| * @param string $description | |||
| * @return $this | |||
| */ | |||
| public function description($description); | |||
| /** | |||
| * Set item category | |||
| * @param string $name Category name | |||
| * @param string $domain Category URL | |||
| * @return $this | |||
| */ | |||
| public function category($name, $domain = null); | |||
| /** | |||
| * Set GUID | |||
| * @param string $guid | |||
| * @param bool $isPermalink | |||
| * @return $this | |||
| */ | |||
| public function guid($guid, $isPermalink = false); | |||
| /** | |||
| * Set published date | |||
| * @param int $pubDate Unix timestamp | |||
| * @return $this | |||
| */ | |||
| public function pubDate($pubDate); | |||
| /** | |||
| * Set enclosure | |||
| * @param var $url Url to media file | |||
| * @param int $length Length in bytes of the media file | |||
| * @param var $type Media type, default is audio/mpeg | |||
| * @return $this | |||
| */ | |||
| public function enclosure($url, $length = 0, $type = 'audio/mpeg'); | |||
| /** | |||
| * Append item to the channel | |||
| * @param \Suin\RSSWriter\ChannelInterface $channel | |||
| * @return $this | |||
| */ | |||
| public function appendTo(ChannelInterface $channel); | |||
| /** | |||
| * Return XML object | |||
| * @return \Suin\RSSWriter\SimpleXMLElement | |||
| */ | |||
| public function asXML(); | |||
| } | |||
| @ -1,16 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| class SimpleXMLElement extends \SimpleXMLElement | |||
| { | |||
| public function addChild($name, $value = null, $namespace = null) | |||
| { | |||
| if ( $value !== null and is_string($value) === true ) | |||
| { | |||
| $value = str_replace('&', '&', $value); | |||
| } | |||
| return parent::addChild($name, $value, $namespace); | |||
| } | |||
| } | |||
| @ -1,8 +0,0 @@ | |||
| <?php | |||
| // For composer | |||
| require_once 'Vendor/autoload.php'; | |||
| // Load test target classes | |||
| spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; }); | |||
| set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__DIR__).'/Source'); | |||
| @ -1,28 +0,0 @@ | |||
| # How to Test | |||
| ## Installation | |||
| Install [composer](https://github.com/composer/composer) to your ~/bin: | |||
| ```sh | |||
| $ curl -s http://getcomposer.org/installer | php | |||
| ``` | |||
| Run composer and install depending packages: | |||
| ```sh | |||
| $ composer.phar install | |||
| ``` | |||
| ## Executing Tests | |||
| Run phpunit: | |||
| ```sh | |||
| $ ./phpunit | |||
| ``` | |||
| ## View Reports | |||
| If you want to see code coverages, open Coverage/index.html. | |||
| @ -1,252 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| class ChannelTest extends \XoopsUnit\TestCase | |||
| { | |||
| private $itemInterface = '\Suin\RSSWriter\ItemInterface'; | |||
| private $feedInterface = '\Suin\RSSWriter\FeedInterface'; | |||
| public function testTitle() | |||
| { | |||
| $title = uniqid(); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->title($title)); | |||
| $this->assertAttributeSame($title, 'title', $channel); | |||
| } | |||
| public function testUrl() | |||
| { | |||
| $url = uniqid(); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->url($url)); | |||
| $this->assertAttributeSame($url, 'url', $channel); | |||
| } | |||
| public function testDescription() | |||
| { | |||
| $description = uniqid(); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->description($description)); | |||
| $this->assertAttributeSame($description, 'description', $channel); | |||
| } | |||
| public function testLanguage() | |||
| { | |||
| $language = uniqid(); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->language($language)); | |||
| $this->assertAttributeSame($language, 'language', $channel); | |||
| } | |||
| public function testCopyright() | |||
| { | |||
| $copyright = uniqid(); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->copyright($copyright)); | |||
| $this->assertAttributeSame($copyright, 'copyright', $channel); | |||
| } | |||
| public function testPubDate() | |||
| { | |||
| $pubDate = mt_rand(0, 9999999); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->pubDate($pubDate)); | |||
| $this->assertAttributeSame($pubDate, 'pubDate', $channel); | |||
| } | |||
| public function testLastBuildDate() | |||
| { | |||
| $lastBuildDate = mt_rand(0, 9999999); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->lastBuildDate($lastBuildDate)); | |||
| $this->assertAttributeSame($lastBuildDate, 'lastBuildDate', $channel); | |||
| } | |||
| public function testTtl() | |||
| { | |||
| $ttl = mt_rand(0, 99999999); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->ttl($ttl)); | |||
| $this->assertAttributeSame($ttl, 'ttl', $channel); | |||
| } | |||
| public function testAddItem() | |||
| { | |||
| $item = $this->getMock($this->itemInterface); | |||
| $channel = new Channel(); | |||
| $this->assertSame($channel, $channel->addItem($item)); | |||
| $this->assertAttributeSame(array($item), 'items', $channel); | |||
| } | |||
| public function testAppendTo() | |||
| { | |||
| $channel = new Channel(); | |||
| $feed = $this->getMock($this->feedInterface); | |||
| $feed->expects($this->once())->method('addChannel')->with($channel); | |||
| $this->assertSame($channel, $channel->appendTo($feed)); | |||
| } | |||
| /** | |||
| * @param $expect | |||
| * @param array $data | |||
| * @dataProvider dataForAsXML | |||
| */ | |||
| public function testAsXML($expect, array $data) | |||
| { | |||
| $data = (object) $data; | |||
| $channel = new Channel(); | |||
| foreach ( $data as $key => $value ) | |||
| { | |||
| $this->reveal($channel)->attr($key, $value); | |||
| } | |||
| $this->assertXmlStringEqualsXmlString($expect, $channel->asXML()->asXML()); | |||
| } | |||
| public static function dataForAsXML() | |||
| { | |||
| $now = time(); | |||
| $nowString = date(DATE_RSS, $now); | |||
| return array( | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| ) | |||
| ), | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <language>en-us</language> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| 'language' => 'en-us', | |||
| ) | |||
| ), | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <pubDate>{$nowString}</pubDate> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| 'pubDate' => $now, | |||
| ) | |||
| ), | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <lastBuildDate>{$nowString}</lastBuildDate> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| 'lastBuildDate' => $now, | |||
| ) | |||
| ), | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <ttl>60</ttl> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| 'ttl' => 60, | |||
| ) | |||
| ), | |||
| array( | |||
| " | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <copyright>Copyright 2002, Spartanburg Herald-Journal</copyright> | |||
| </channel> | |||
| ", | |||
| array( | |||
| 'title' => "GoUpstate.com News Headlines", | |||
| 'url' => 'http://www.goupstate.com/', | |||
| 'description' => "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.", | |||
| 'copyright' => "Copyright 2002, Spartanburg Herald-Journal", | |||
| ) | |||
| ), | |||
| ); | |||
| } | |||
| public function testAppendTo_with_items() | |||
| { | |||
| $channel = new Channel(); | |||
| $xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item1</title></item>'); | |||
| $xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item2</title></item>'); | |||
| $xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><item><title>item3</title></item>'); | |||
| $item1 = $this->getMock($this->itemInterface); | |||
| $item1->expects($this->once())->method('asXML')->will($this->returnValue($xml1)); | |||
| $item2= $this->getMock($this->itemInterface); | |||
| $item2->expects($this->once())->method('asXML')->will($this->returnValue($xml2)); | |||
| $item3 = $this->getMock($this->itemInterface); | |||
| $item3->expects($this->once())->method('asXML')->will($this->returnValue($xml3)); | |||
| $this->reveal($channel) | |||
| ->attr('title', "GoUpstate.com News Headlines") | |||
| ->attr('url', 'http://www.goupstate.com/') | |||
| ->attr('description', "The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.") | |||
| ->attr('items', array($item1, $item2, $item3)); | |||
| $expect = '<?xml version="1.0" encoding="UTF-8" ?> | |||
| <channel> | |||
| <title>GoUpstate.com News Headlines</title> | |||
| <link>http://www.goupstate.com/</link> | |||
| <description>The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site.</description> | |||
| <item> | |||
| <title>item1</title> | |||
| </item> | |||
| <item> | |||
| <title>item2</title> | |||
| </item> | |||
| <item> | |||
| <title>item3</title> | |||
| </item> | |||
| </channel> | |||
| '; | |||
| $this->assertXmlStringEqualsXmlString($expect, $channel->asXML()->asXML()); | |||
| } | |||
| } | |||
| @ -1,96 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| use \Mockery; | |||
| class FeedTest extends \XoopsUnit\TestCase | |||
| { | |||
| private $channelInterface = '\Suin\RSSWriter\ChannelInterface'; | |||
| public function testAddChannel() | |||
| { | |||
| $channel = Mockery::mock($this->channelInterface); | |||
| $feed = new Feed(); | |||
| $this->assertSame($feed, $feed->addChannel($channel)); | |||
| $this->assertAttributeSame(array($channel), 'channels', $feed); | |||
| } | |||
| public function testRender() | |||
| { | |||
| $feed = new Feed(); | |||
| $xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel1</title></channel>'); | |||
| $xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel2</title></channel>'); | |||
| $xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel3</title></channel>'); | |||
| $channel1 = $this->getMock($this->channelInterface); | |||
| $channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1)); | |||
| $channel2 = $this->getMock($this->channelInterface); | |||
| $channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2)); | |||
| $channel3 = $this->getMock($this->channelInterface); | |||
| $channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3)); | |||
| $this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3)); | |||
| $expect = '<?xml version="1.0" encoding="UTF-8" ?> | |||
| <rss version="2.0"> | |||
| <channel><title>channel1</title></channel> | |||
| <channel><title>channel2</title></channel> | |||
| <channel><title>channel3</title></channel> | |||
| </rss> | |||
| '; | |||
| $this->assertXmlStringEqualsXmlString($expect, $feed->render()); | |||
| } | |||
| public function testRender_with_japanese() | |||
| { | |||
| $feed = new Feed(); | |||
| $xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語1</title></channel>'); | |||
| $xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語2</title></channel>'); | |||
| $xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>日本語3</title></channel>'); | |||
| $channel1 = $this->getMock($this->channelInterface); | |||
| $channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1)); | |||
| $channel2 = $this->getMock($this->channelInterface); | |||
| $channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2)); | |||
| $channel3 = $this->getMock($this->channelInterface); | |||
| $channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3)); | |||
| $this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3)); | |||
| $expect = <<< 'XML' | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <rss version="2.0"> | |||
| <channel> | |||
| <title>日本語1</title> | |||
| </channel> | |||
| <channel> | |||
| <title>日本語2</title> | |||
| </channel> | |||
| <channel> | |||
| <title>日本語3</title> | |||
| </channel> | |||
| </rss> | |||
| XML; | |||
| $this->assertSame($expect, $feed->render()); | |||
| } | |||
| public function test__toString() | |||
| { | |||
| $feed = new Feed(); | |||
| $xml1 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel1</title></channel>'); | |||
| $xml2 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel2</title></channel>'); | |||
| $xml3 = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><channel><title>channel3</title></channel>'); | |||
| $channel1 = $this->getMock($this->channelInterface); | |||
| $channel1->expects($this->once())->method('asXML')->will($this->returnValue($xml1)); | |||
| $channel2 = $this->getMock($this->channelInterface); | |||
| $channel2->expects($this->once())->method('asXML')->will($this->returnValue($xml2)); | |||
| $channel3 = $this->getMock($this->channelInterface); | |||
| $channel3->expects($this->once())->method('asXML')->will($this->returnValue($xml3)); | |||
| $this->reveal($feed)->attr('channels', array($channel1, $channel2, $channel3)); | |||
| $expect = '<?xml version="1.0" encoding="UTF-8" ?> | |||
| <rss version="2.0"> | |||
| <channel><title>channel1</title></channel> | |||
| <channel><title>channel2</title></channel> | |||
| <channel><title>channel3</title></channel> | |||
| </rss> | |||
| '; | |||
| $this->assertXmlStringEqualsXmlString($expect, $feed); | |||
| } | |||
| } | |||
| @ -1,200 +0,0 @@ | |||
| <?php | |||
| namespace Suin\RSSWriter; | |||
| class ItemTest extends \XoopsUnit\TestCase | |||
| { | |||
| private $channelInterface = '\Suin\RSSWriter\ChannelInterface'; | |||
| public function testTitle() | |||
| { | |||
| $title = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->title($title)); | |||
| $this->assertAttributeSame($title, 'title', $item); | |||
| } | |||
| public function testUrl() | |||
| { | |||
| $url = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->url($url)); | |||
| $this->assertAttributeSame($url, 'url', $item); | |||
| } | |||
| public function testDescription() | |||
| { | |||
| $description = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->description($description)); | |||
| $this->assertAttributeSame($description, 'description', $item); | |||
| } | |||
| public function testCategory() | |||
| { | |||
| $category = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->category($category)); | |||
| $this->assertAttributeSame(array( | |||
| array($category, null), | |||
| ), 'categories', $item); | |||
| } | |||
| public function testCategory_with_domain() | |||
| { | |||
| $category = uniqid(); | |||
| $domain = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->category($category, $domain)); | |||
| $this->assertAttributeSame(array( | |||
| array($category, $domain), | |||
| ), 'categories', $item); | |||
| } | |||
| public function testGuid() | |||
| { | |||
| $guid = uniqid(); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->guid($guid)); | |||
| $this->assertAttributeSame($guid, 'guid', $item); | |||
| } | |||
| public function testGuid_with_permalink() | |||
| { | |||
| $item = new Item(); | |||
| $item->guid('guid', true); | |||
| $this->assertAttributeSame(true, 'isPermalink', $item); | |||
| $item->guid('guid', false); | |||
| $this->assertAttributeSame(false, 'isPermalink', $item); | |||
| $item->guid('guid'); // default | |||
| $this->assertAttributeSame(false, 'isPermalink', $item); | |||
| } | |||
| public function testPubDate() | |||
| { | |||
| $pubDate = mt_rand(1000000, 9999999); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->pubDate($pubDate)); | |||
| $this->assertAttributeSame($pubDate, 'pubDate', $item); | |||
| } | |||
| public function testAppendTo() | |||
| { | |||
| $item = new Item(); | |||
| $channel = $this->getMock($this->channelInterface); | |||
| $channel->expects($this->once())->method('addItem')->with($item); | |||
| $this->assertSame($item, $item->appendTo($channel)); | |||
| } | |||
| public function testEnclosure() | |||
| { | |||
| $url = uniqid(); | |||
| $enclosure = array('url' => $url, 'length' => 0, 'type' => 'audio/mpeg'); | |||
| $item = new Item(); | |||
| $this->assertSame($item, $item->enclosure($url)); | |||
| $this->assertAttributeSame($enclosure, 'enclosure', $item); | |||
| } | |||
| public function testAsXML() | |||
| { | |||
| $now = time(); | |||
| $nowString = date(DATE_RSS, $now); | |||
| $data = array( | |||
| 'title' => "Venice Film Festival Tries to Quit Sinking", | |||
| 'url' => 'http://nytimes.com/2004/12/07FEST.html', | |||
| 'description' => "Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.", | |||
| 'categories' => array( | |||
| array("Grateful Dead", null), | |||
| array("MSFT", 'http://www.fool.com/cusips'), | |||
| ), | |||
| 'guid' => "http://inessential.com/2002/09/01.php#a2", | |||
| 'isPermalink' => true, | |||
| 'pubDate' => $now, | |||
| 'enclosure' => array( | |||
| 'url' => 'http://link-to-audio-file.com/test.mp3', | |||
| 'length' => 4992, | |||
| 'type' => 'audio/mpeg') | |||
| ); | |||
| $item = new Item(); | |||
| foreach ( $data as $key => $value ) | |||
| { | |||
| $this->reveal($item)->attr($key, $value); | |||
| } | |||
| $expect =" | |||
| <item> | |||
| <title>{$data['title']}</title> | |||
| <link>{$data['url']}</link> | |||
| <description>{$data['description']}</description> | |||
| <category>{$data['categories'][0][0]}</category> | |||
| <category domain=\"{$data['categories'][1][1]}\">{$data['categories'][1][0]}</category> | |||
| <guid isPermaLink=\"true\">{$data['guid']}</guid> | |||
| <pubDate>{$nowString}</pubDate> | |||
| <enclosure url=\"{$data['enclosure']['url']}\" length=\"{$data['enclosure']['length']}\" type=\"{$data['enclosure']['type']}\"/> | |||
| </item> | |||
| "; | |||
| $this->assertXmlStringEqualsXmlString($expect, $item->asXML()->asXML()); | |||
| } | |||
| public function testAsXML_test_Japanese() | |||
| { | |||
| $now = time(); | |||
| $nowString = date(DATE_RSS, $now); | |||
| $data = array( | |||
| 'title' => "Venice Film Festival", | |||
| 'url' => 'http://nytimes.com/2004/12/07FEST.html', | |||
| 'description' => "Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.", | |||
| ); | |||
| $item = new Item(); | |||
| foreach ( $data as $key => $value ) | |||
| { | |||
| $this->reveal($item)->attr($key, $value); | |||
| } | |||
| $expect = " | |||
| <item> | |||
| <title>{$data['title']}</title> | |||
| <link>{$data['url']}</link> | |||
| <description>{$data['description']}</description> | |||
| </item> | |||
| "; | |||
| $this->assertXmlStringEqualsXmlString($expect, $item->asXML()->asXML()); | |||
| } | |||
| public function test_with_amp() | |||
| { | |||
| $item = new Item(); | |||
| $item | |||
| ->title('test&test') | |||
| ->url('url&url') | |||
| ->description('desc&desc'); | |||
| $expect = '<?xml version="1.0" encoding="UTF-8"?> | |||
| <item><title>test&test</title><link>url&url</link><description>desc&desc</description></item> | |||
| '; | |||
| $this->assertSame($expect, $item->asXML()->asXML()); | |||
| } | |||
| public function test_fail_safe_against_invalid_string() | |||
| { | |||
| $item = new Item(); | |||
| $item | |||
| ->title("test\0test") | |||
| ->url("url\0test") | |||
| ->description("desc\0desc"); | |||
| $expect = '<?xml version="1.0" encoding="UTF-8"?> | |||
| <item><title>test</title><link>url</link><description>desc</description></item> | |||
| '; | |||
| $this->assertSame($expect, $item->asXML()->asXML()); | |||
| } | |||
| } | |||
| @ -1,12 +0,0 @@ | |||
| { | |||
| "config": { | |||
| "bin-dir": ".", | |||
| "vendor-dir": "Vendor" | |||
| }, | |||
| "require": { | |||
| "php": ">=5.3.2", | |||
| "EHER/PHPUnit": ">=1.6", | |||
| "suin/xoopsunit": ">=1.2", | |||
| "mockery/mockery": ">=0.7.2" | |||
| } | |||
| } | |||
| @ -1,42 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <phpunit | |||
| bootstrap="Bootstrap.php" | |||
| processIsolation="false" | |||
| verbose="true" | |||
| strict="false" | |||
| colors="true"> | |||
| <testsuites> | |||
| <testsuite name="PHPUnit"> | |||
| <directory>Suin</directory> | |||
| </testsuite> | |||
| </testsuites> | |||
| <logging> | |||
| <log | |||
| type="coverage-html" | |||
| target="Coverage" | |||
| charset="UTF-8" | |||
| yui="true" | |||
| highlight="false" | |||
| lowUpperBound="35" | |||
| highLowerBound="70" /> | |||
| <!-- <log type="coverage-text" target="php://stdout" lowUpperBound="35" highLowerBound="70" /> --> | |||
| </logging> | |||
| <filter> | |||
| <whitelist> | |||
| <directory suffix=".php">../Source</directory> | |||
| <!-- <file>/path/to/file</file> --> | |||
| <exclude> | |||
| <file>../Public/index.php</file> | |||
| <directory suffix="Interface.php">../Source</directory> | |||
| </exclude> | |||
| </whitelist> | |||
| <blacklist> | |||
| <directory suffix=".php" group="PHPUNIT">../Vendor</directory> | |||
| </blacklist> | |||
| </filter> | |||
| <listeners> | |||
| <listener class="\Mockery\Adapter\Phpunit\TestListener" file="Vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" /> | |||
| </listeners> | |||
| </phpunit> | |||
| @ -1,20 +0,0 @@ | |||
| { | |||
| "name": "suin/php-rss-writer", | |||
| "type": "library", | |||
| "description": "Yet another simple RSS writer library for PHP 5.3 or later.", | |||
| "keywords": ["rss", "generator", "writer", "feed"], | |||
| "homepage": "https://github.com/suin/php-rss-writer", | |||
| "license": "MIT", | |||
| "authors": [ | |||
| { | |||
| "name": "Hidehito Nozawa aka Suin", | |||
| "email": "suinyeze@gmail.com" | |||
| } | |||
| ], | |||
| "require": { | |||
| "php": ">=5.3.0" | |||
| }, | |||
| "autoload": { | |||
| "psr-0": { "Suin\\RSSWriter": "Source" } | |||
| } | |||
| } | |||
| @ -1,35 +0,0 @@ | |||
| <?php | |||
| // Load test target classes | |||
| spl_autoload_register(function($c) { @include_once strtr($c, '\\_', '//').'.php'; }); | |||
| set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/Source'); | |||
| use \Suin\RSSWriter\Feed; | |||
| use \Suin\RSSWriter\Channel; | |||
| use \Suin\RSSWriter\Item; | |||
| $feed = new Feed(); | |||
| $channel = new Channel(); | |||
| $channel | |||
| ->title("Channel Title") | |||
| ->description("Channel Description") | |||
| ->url('http://blog.example.com') | |||
| ->language('en-US') | |||
| ->copyright('Copyright 2012, Foo Bar') | |||
| ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900')) | |||
| ->lastBuildDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900')) | |||
| ->ttl(60) | |||
| ->appendTo($feed); | |||
| $item = new Item(); | |||
| $item | |||
| ->title("Blog Entry Title") | |||
| ->description("<div>Blog body</div>") | |||
| ->url('http://blog.example.com/2012/08/21/blog-entry/') | |||
| ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900')) | |||
| ->guid('http://blog.example.com/2012/08/21/blog-entry/', true) | |||
| ->appendTo($channel); | |||
| echo $feed; // or echo $feed->render(); | |||
| @ -1,22 +1,23 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8" /> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" /> | |||
| <title>Search results not found! - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" /> | |||
| <!-- Include the Open Sans font --> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" /> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8"/> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/> | |||
| <title>Search results not found! - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/> | |||
| <!-- Include the Open Sans font --> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/> | |||
| </head> | |||
| <body> | |||
| <div class="center message"> | |||
| <h1>Search results not found!</h1> | |||
| <div class="search"> | |||
| <?php echo search() ?> | |||
| </div> | |||
| <p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| <div class="center message"> | |||
| <h1>Search results not found!</h1> | |||
| <div class="search"> | |||
| <?php echo search() ?> | |||
| </div> | |||
| <p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @ -1,19 +1,20 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8" /> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no" /> | |||
| <title>404 Not Found - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" /> | |||
| <!-- Include the Open Sans font --> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" /> | |||
| <link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/> | |||
| <meta charset="utf-8"/> | |||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |||
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/> | |||
| <title>404 Not Found - <?php echo blog_title() ?></title> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/> | |||
| <!-- Include the Open Sans font --> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/> | |||
| </head> | |||
| <body> | |||
| <div class="center message"> | |||
| <h1>This page doesn't exist!</h1> | |||
| <p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| <div class="center message"> | |||
| <h1>This page doesn't exist!</h1> | |||
| <p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p> | |||
| </div> | |||
| </body> | |||
| </html> | |||
| @ -1,40 +1,45 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
| <?php echo $head_contents ?> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet" /> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet" /> | |||
| <?php if (publisher()):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?> | |||
| <!--[if lt IE 9]> | |||
| <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |||
| <![endif]--> | |||
| <?php echo $head_contents ?> | |||
| <link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/> | |||
| <link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/> | |||
| <?php if (publisher()): ?> | |||
| <link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?> | |||
| <!--[if lt IE 9]> | |||
| <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |||
| <![endif]--> | |||
| </head> | |||
| <body class="<?php echo $bodyclass; ?>" itemscope="itemscope" itemtype="http://schema.org/Blog"> | |||
| <div class="hide"> | |||
| <meta content="<?php echo blog_title() ?>" itemprop="name"/> | |||
| <meta content="<?php echo blog_description() ?>" itemprop="description"/> | |||
| </div> | |||
| <?php if(facebook()) { echo facebook();} ?> | |||
| <?php if(login()) { toolbar();} ?> | |||
| <aside> | |||
| <?php if(is_index()) {?> | |||
| <h1 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1> | |||
| <?php } else {?> | |||
| <h2 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h2> | |||
| <?php } ?> | |||
| <div class="search"> | |||
| <?php echo search() ?> | |||
| </div> | |||
| <div class="social"><?php echo social() ?></div> | |||
| <div class="menu"><?php echo menu() ?></div> | |||
| <div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div> | |||
| <div class="archive"><?php echo archive_list()?></div> | |||
| <div class="tagcloud"><?php echo tag_cloud()?></div> | |||
| <div class="copyright"><?php echo copyright() ?></div> | |||
| </aside> | |||
| <section id="content"> | |||
| <?php echo content()?> | |||
| </section> | |||
| <?php if (analytics()):?><?php echo analytics() ?><?php endif;?> | |||
| <div class="hide"> | |||
| <meta content="<?php echo blog_title() ?>" itemprop="name"/> | |||
| <meta content="<?php echo blog_description() ?>" itemprop="description"/> | |||
| </div> | |||
| <?php if (facebook()) { | |||
| echo facebook(); | |||
| } ?> | |||
| <?php if (login()) { | |||
| toolbar(); | |||
| } ?> | |||
| <aside> | |||
| <?php if (is_index()) { ?> | |||
| <h1 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h1> | |||
| <?php } else { ?> | |||
| <h2 class="blog-title"><a rel="home" href="<?php echo site_url() ?>"><?php echo blog_title() ?></a></h2> | |||
| <?php } ?> | |||
| <div class="search"> | |||
| <?php echo search() ?> | |||
| </div> | |||
| <div class="social"><?php echo social() ?></div> | |||
| <div class="menu"><?php echo menu() ?></div> | |||
| <div class="recent"><h3>Recent Posts</h3><?php echo recent() ?></div> | |||
| <div class="archive"><?php echo archive_list() ?></div> | |||
| <div class="tagcloud"><?php echo tag_cloud() ?></div> | |||
| <div class="copyright"><?php echo copyright() ?></div> | |||
| </aside> | |||
| <section id="content"> | |||
| <?php echo content() ?> | |||
| </section> | |||
| <?php if (analytics()): ?><?php echo analytics() ?><?php endif; ?> | |||
| </body> | |||
| </html> | |||
| @ -1,48 +1,63 @@ | |||
| <?php if (!empty($breadcrumb)):?><div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif;?> | |||
| <?php $i = 0; $len = count($posts);?> | |||
| <?php foreach($posts as $p):?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'post first'; | |||
| } | |||
| elseif ($i == $len - 1) { | |||
| $class = 'post last'; | |||
| } | |||
| else { | |||
| $class = 'post'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <div class="<?php echo $class ?>" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"> | |||
| <div class="main"> | |||
| <h2 class="title-index" itemprop="name"><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></h2> | |||
| <div class="date"> | |||
| <span itemprop="datePublished"><?php echo date('d F Y', $p->date)?></span> - Posted in | |||
| <span itemprop="articleSection"><?php echo $p->tag ?></span> by | |||
| <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> | |||
| <?php | |||
| if (disqus_count()) {?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span> | |||
| <?php } elseif (facebook()){ ?> - | |||
| <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a> | |||
| <?php } ?> | |||
| </div> | |||
| <div class="teaser-body" itemprop="articleBody"> | |||
| <?php echo get_thumbnail($p->body)?> | |||
| <?php echo get_teaser($p->body, $p->url)?> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <?php endforeach;?> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])):?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])):?> | |||
| <span><a href="?page=<?php echo $page-1?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif;?> | |||
| <?php if (!empty($pagination['next'])):?> | |||
| <span><a href="?page=<?php echo $page+1?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif;?> | |||
| </div> | |||
| <?php endif;?> | |||
| <?php if (disqus_count()):?> | |||
| <?php echo disqus_count() ?> | |||
| <?php endif;?> | |||
| <?php if (!empty($breadcrumb)): ?> | |||
| <div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif; ?> | |||
| <?php $i = 0; | |||
| $len = count($posts); ?> | |||
| <?php foreach ($posts as $p): ?> | |||
| <?php | |||
| if ($i == 0) { | |||
| $class = 'post first'; | |||
| } elseif ($i == $len - 1) { | |||
| $class = 'post last'; | |||
| } else { | |||
| $class = 'post'; | |||
| } | |||
| $i++; | |||
| ?> | |||
| <div class="<?php echo $class ?>" itemprop="blogPost" itemscope="itemscope" | |||
| itemtype="http://schema.org/BlogPosting"> | |||
| <div class="main"> | |||
| <h2 class="title-index" itemprop="name"><a href="<?php echo $p->url ?>"><?php echo $p->title ?></a></h2> | |||
| <div class="date"> | |||
| <?php if (!empty($p->feature)) { ?> | |||
| <div class="featured-image"> | |||
| <a href="<?php echo $p->url ?>"><img src="<?php echo $p->feature; ?>" | |||
| alt="<?php echo $p->title ?>"/></a> | |||
| </div> | |||
| <?php } ?> | |||
| <?php if (!empty($p->video)) { ?> | |||
| <div class="featured-video"> | |||
| <iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" | |||
| frameborder="0" allowfullscreen></iframe> | |||
| </div> | |||
| <?php } ?> | |||
| <span itemprop="datePublished"><?php echo date('d F Y', $p->date) ?></span> - Posted in | |||
| <span itemprop="articleSection"><?php echo $p->tag ?></span> by | |||
| <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> | |||
| <?php | |||
| if (disqus_count()) { ?> - <span><a href="<?php echo $p->url ?>#disqus_thread">Comments</a></span> | |||
| <?php } elseif (facebook()) { ?> - | |||
| <a href="<?php echo $p->url ?>#comments"><span><fb:comments-count | |||
| href=<?php echo $p->url ?>></fb:comments-count> Comments</span></a> | |||
| <?php } ?> | |||
| </div> | |||
| <div class="teaser-body" itemprop="articleBody"> | |||
| <?php echo get_thumbnail($p->body) ?> | |||
| <?php echo get_teaser($p->body, $p->url) ?> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <?php endforeach; ?> | |||
| <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?> | |||
| <div class="pager"> | |||
| <?php if (!empty($pagination['prev'])): ?> | |||
| <span><a href="?page=<?php echo $page - 1 ?>" class="pagination-arrow newer" rel="prev">Newer</a></span> | |||
| <?php endif; ?> | |||
| <?php if (!empty($pagination['next'])): ?> | |||
| <span><a href="?page=<?php echo $page + 1 ?>" class="pagination-arrow older" rel="next">Older</a></span> | |||
| <?php endif; ?> | |||
| </div> | |||
| <?php endif; ?> | |||
| <?php if (disqus_count()): ?> | |||
| <?php echo disqus_count() ?> | |||
| <?php endif; ?> | |||
| @ -1,48 +1,73 @@ | |||
| <?php if (!empty($breadcrumb)):?><div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif;?> | |||
| <?php if(login()) { echo tab($p);} ?> | |||
| <?php if (!empty($breadcrumb)): ?> | |||
| <div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif; ?> | |||
| <?php if (login()) { | |||
| echo tab($p); | |||
| } ?> | |||
| <div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting"> | |||
| <div class="main"> | |||
| <a name="more"></a> | |||
| <h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1> | |||
| <div class="date"> | |||
| <span itemprop="datePublished"><a href="<?php echo $p->archive ?>" title="Show all posts made on this day"><?php echo date('d F Y', $p->date)?></a></span> - Posted in | |||
| <span itemprop="articleSection"><?php echo $p->tag ?></span> by | |||
| <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> - | |||
| <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span> | |||
| </div> | |||
| <div class="post-body" itemprop="articleBody"> | |||
| <?php echo $p->body; ?> | |||
| </div> | |||
| </div> | |||
| <div class="separator">→</div> | |||
| <div class="share-box"> | |||
| <?php echo $authorinfo ?> | |||
| <div class="share"> | |||
| <h4>Share this post</h4> | |||
| <a class="twitter" target="_blank" href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title?>">Twitter</a> | |||
| <a class="facebook" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo $p->url ?>&t=<?php echo $p->title?>">Facebook</a> | |||
| <a class="googleplus" target="_blank" href="https://plus.google.com/share?url=<?php echo $p->url ?>">Google+</a> | |||
| </div> | |||
| </div> | |||
| <?php echo get_related($p->tag)?> | |||
| <div id="comments" class="comments border"> | |||
| <?php if (facebook()):?> | |||
| <div class="fb-comments" data-href="<?php echo $p->url ?>" data-numposts="<?php echo config('fb.num') ?>" data-colorscheme="<?php echo config('fb.color') ?>"></div> | |||
| <?php endif;?> | |||
| <?php if (disqus()):?> | |||
| <div id="disqus_thread"></div> | |||
| <?php endif;?> | |||
| </div> | |||
| <div class="postnav"> | |||
| <?php if (!empty($next)):?> | |||
| <span><a href="<?php echo ($next['url']);?>" class="pagination-arrow newer" rel="next"><?php echo ($next['title']);?></a></span> | |||
| <?php endif;?> | |||
| <div class="main"> | |||
| <a name="more"></a> | |||
| <?php if (!empty($prev)):?> | |||
| <span><a href="<?php echo ($prev['url']); ?>" class="pagination-arrow older" rel="prev"><?php echo ($prev['title']); ?></a></span> | |||
| <?php endif;?> | |||
| </div> | |||
| <?php if (disqus()):?> | |||
| <?php echo disqus($p->title, $p->url) ?> | |||
| <?php endif;?> | |||
| </div> | |||
| <h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1> | |||
| <div class="date"> | |||
| <?php if (!empty($p->feature)) { ?> | |||
| <div class="featured-image"> | |||
| <a href="<?php echo $p->url ?>"><img src="<?php echo $p->feature; ?>" | |||
| alt="<?php echo $p->title ?>"/></a> | |||
| </div> | |||
| <?php } ?> | |||
| <?php if (!empty($p->video)) { ?> | |||
| <div class="featured-video"> | |||
| <iframe src="https://www.youtube.com/embed/<?php echo $p->video; ?>" width="560" height="315" | |||
| frameborder="0" allowfullscreen></iframe> | |||
| </div> | |||
| <?php } ?> | |||
| <span itemprop="datePublished"><a href="<?php echo $p->archive ?>" | |||
| title="Show all posts made on this day"><?php echo date('d F Y', $p->date) ?></a></span> | |||
| - Posted in | |||
| <span itemprop="articleSection"><?php echo $p->tag ?></span> by | |||
| <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span> - | |||
| <span><a href="<?php echo $p->url ?>" rel="permalink">Permalink</a></span> | |||
| </div> | |||
| <div class="post-body" itemprop="articleBody"> | |||
| <?php echo $p->body; ?> | |||
| </div> | |||
| </div> | |||
| <div class="separator">→</div> | |||
| <div class="share-box"> | |||
| <?php echo $authorinfo ?> | |||
| <div class="share"> | |||
| <h4>Share this post</h4> | |||
| <a class="twitter" target="_blank" | |||
| href="https://twitter.com/share?url=<?php echo $p->url ?>&text=<?php echo $p->title ?>">Twitter</a> | |||
| <a class="facebook" target="_blank" | |||
| href="https://www.facebook.com/sharer.php?u=<?php echo $p->url ?>&t=<?php echo $p->title ?>">Facebook</a> | |||
| <a class="googleplus" target="_blank" | |||
| href="https://plus.google.com/share?url=<?php echo $p->url ?>">Google+</a> | |||
| </div> | |||
| </div> | |||
| <?php echo get_related($p->tag) ?> | |||
| <div id="comments" class="comments border"> | |||
| <?php if (facebook()): ?> | |||
| <div class="fb-comments" data-href="<?php echo $p->url ?>" data-numposts="<?php echo config('fb.num') ?>" | |||
| data-colorscheme="<?php echo config('fb.color') ?>"></div> | |||
| <?php endif; ?> | |||
| <?php if (disqus()): ?> | |||
| <div id="disqus_thread"></div> | |||
| <?php endif; ?> | |||
| </div> | |||
| <div class="postnav"> | |||
| <?php if (!empty($next)): ?> | |||
| <span><a href="<?php echo($next['url']); ?>" class="pagination-arrow newer" | |||
| rel="next"><?php echo($next['title']); ?></a></span> | |||
| <?php endif; ?> | |||
| <?php if (!empty($prev)): ?> | |||
| <span><a href="<?php echo($prev['url']); ?>" class="pagination-arrow older" | |||
| rel="prev"><?php echo($prev['title']); ?></a></span> | |||
| <?php endif; ?> | |||
| </div> | |||
| <?php if (disqus()): ?> | |||
| <?php echo disqus($p->title, $p->url) ?> | |||
| <?php endif; ?> | |||
| </div> | |||