Update the core
Update the composer, adding PHP Markdown Extra replacing dflydev markdown.
|
|
@ -22,10 +22,8 @@ license, including:
|
|||
|
||||
Composer - Copyright (c) 2011 Nils Adermann, Jordi Boggiano
|
||||
|
||||
PHP Markdown & Extra - Copyright (c) 2011 Dragonfly Development Inc.
|
||||
PHP Markdown & Extra - Copyright (c) 2004-2009 Michel Fortin
|
||||
|
||||
Based on PHP Markdown & Extra - Copyright (c) 2004-2009 Michel Fortin
|
||||
|
||||
Based on Markdown - Copyright (c) 2003-2006 John Gruber
|
||||
Markdown - Copyright (c) 2003-2006 John Gruber
|
||||
|
||||
\Suin\RSSWriter - Copyright (c) Suin <https://github.com/suin>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"require": {
|
||||
"dflydev/markdown": "v1.0.2",
|
||||
"michelf/php-markdown": "1.4.*@dev",
|
||||
"suin/php-rss-writer": ">=1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
57
composer.lock
generated
|
|
@ -1,59 +1,60 @@
|
|||
{
|
||||
"hash": "cec61b54883fb666202e7af8d3393c29",
|
||||
"_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"
|
||||
],
|
||||
"hash": "f4031afd76d9924ba9ef2f3fe17a97ab",
|
||||
"packages": [
|
||||
{
|
||||
"name": "dflydev/markdown",
|
||||
"version": "v1.0.2",
|
||||
"name": "michelf/php-markdown",
|
||||
"version": "dev-lib",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dflydev/dflydev-markdown.git",
|
||||
"reference": "v1.0.2"
|
||||
"url": "https://github.com/michelf/php-markdown.git",
|
||||
"reference": "6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/dflydev/dflydev-markdown/zipball/v1.0.2",
|
||||
"reference": "v1.0.2",
|
||||
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8",
|
||||
"reference": "6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-lib": "1.4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"dflydev\\markdown": "src"
|
||||
"Michelf": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"New BSD License"
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dragonfly Development Inc.",
|
||||
"email": "info@dflydev.com",
|
||||
"homepage": "http://dflydev.com"
|
||||
},
|
||||
{
|
||||
"name": "Beau Simensen",
|
||||
"email": "beau@dflydev.com",
|
||||
"homepage": "http://beausimensen.com"
|
||||
},
|
||||
{
|
||||
"name": "Michel Fortin",
|
||||
"homepage": "http://michelf.com"
|
||||
"email": "michel.fortin@michelf.ca",
|
||||
"homepage": "http://michelf.ca/",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "John Gruber",
|
||||
"homepage": "http://daringfireball.net"
|
||||
"homepage": "http://daringfireball.net/"
|
||||
}
|
||||
],
|
||||
"description": "PHP Markdown & Extra",
|
||||
"homepage": "http://github.com/dflydev/dflydev-markdown",
|
||||
"description": "PHP Markdown",
|
||||
"homepage": "http://michelf.ca/projects/php-markdown/",
|
||||
"keywords": [
|
||||
"markdown"
|
||||
],
|
||||
"time": "2012-01-15 19:36:37"
|
||||
"time": "2013-11-29 21:49:31"
|
||||
},
|
||||
{
|
||||
"name": "suin/php-rss-writer",
|
||||
|
|
@ -108,9 +109,9 @@
|
|||
|
||||
],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [
|
||||
|
||||
],
|
||||
"stability-flags": {
|
||||
"michelf/php-markdown": 20
|
||||
},
|
||||
"platform": [
|
||||
|
||||
],
|
||||
|
|
|
|||
BIN
composer.phar
|
|
@ -3,7 +3,7 @@
|
|||
// Change this to your timezone
|
||||
date_default_timezone_set('Asia/Jakarta');
|
||||
|
||||
use dflydev\markdown\MarkdownParser;
|
||||
use \Michelf\MarkdownExtra;
|
||||
use \Suin\RSSWriter\Feed;
|
||||
use \Suin\RSSWriter\Channel;
|
||||
use \Suin\RSSWriter\Item;
|
||||
|
|
@ -101,9 +101,6 @@ function get_posts($posts, $page = 1, $perpage = 0){
|
|||
// Extract a specific page with results
|
||||
$posts = array_slice($posts, ($page-1) * $perpage, $perpage);
|
||||
|
||||
// Create a new instance of the markdown parser
|
||||
$md = new MarkdownParser();
|
||||
|
||||
foreach($posts as $index => $v){
|
||||
|
||||
$post = new stdClass;
|
||||
|
|
@ -140,7 +137,7 @@ function get_posts($posts, $page = 1, $perpage = 0){
|
|||
$post->tagurl = site_url(). 'tag/' . $arr[1];
|
||||
|
||||
// Get the contents and convert it to HTML
|
||||
$content = $md->transformMarkdown(file_get_contents($filepath));
|
||||
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
|
|
@ -268,9 +265,6 @@ function get_bio($author){
|
|||
|
||||
$tmp = array();
|
||||
|
||||
// Create a new instance of the markdown parser
|
||||
$md = new MarkdownParser();
|
||||
|
||||
foreach($names as $index => $v){
|
||||
$post = new stdClass;
|
||||
|
||||
|
|
@ -287,7 +281,7 @@ function get_bio($author){
|
|||
$post->url = site_url() . 'author/' . $profile;
|
||||
|
||||
// Get the contents and convert it to HTML
|
||||
$content = $md->transformMarkdown(file_get_contents($v));
|
||||
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
|
|
@ -320,9 +314,6 @@ function get_static_post($static){
|
|||
|
||||
$tmp = array();
|
||||
|
||||
// Create a new instance of the markdown parser
|
||||
$md = new MarkdownParser();
|
||||
|
||||
foreach($posts as $index => $v){
|
||||
if(strpos($v, $static.'.md') !== false){
|
||||
|
||||
|
|
@ -336,7 +327,7 @@ function get_static_post($static){
|
|||
$post->url = site_url() . str_replace('.md','',$url);
|
||||
|
||||
// Get the contents and convert it to HTML
|
||||
$content = $md->transformMarkdown(file_get_contents($v));
|
||||
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
|
||||
|
||||
// Extract the title and body
|
||||
$arr = explode('</h1>', $content);
|
||||
|
|
@ -357,14 +348,11 @@ function get_keyword($keyword){
|
|||
$posts = get_post_unsorted();
|
||||
$tmp = array();
|
||||
|
||||
// Create a new instance of the markdown parser
|
||||
$md = new MarkdownParser();
|
||||
|
||||
$words = explode(' ', $keyword);
|
||||
|
||||
foreach($posts as $index => $v){
|
||||
|
||||
$content = $md->transformMarkdown(file_get_contents($v));
|
||||
$content = MarkdownExtra::defaultTransform(file_get_contents($v));
|
||||
|
||||
foreach ($words as $word) {
|
||||
if(strpos(strtolower(strip_tags($content)), strtolower($word)) !== false){
|
||||
|
|
|
|||
26
themes/dan/404-search.html.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!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 config('blog.title') ?></title>
|
||||
<link href="<?php echo site_url() ?>themes/dan/css/style.css" rel="stylesheet" />
|
||||
<!-- Include the Open Sans font -->
|
||||
<link href="http://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-404">
|
||||
<form id="search-form-404" method="get">
|
||||
<input type="text" class="search-input" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="submit" value="Search" class="search-button">
|
||||
</form>
|
||||
<?php if(isset($_GET['search'])) {$url = site_url() . 'search/' . $_GET['search']; header ("Location: $url");} ?>
|
||||
</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>
|
||||
19
themes/dan/404.html.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!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 config('blog.title') ?></title>
|
||||
<link href="<?php echo site_url() ?>themes/dan/css/style.css" rel="stylesheet" />
|
||||
<!-- Include the Open Sans font -->
|
||||
<link href="http://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>
|
||||
</body>
|
||||
</html>
|
||||
674
themes/dan/css/style.css
Normal file
|
|
@ -0,0 +1,674 @@
|
|||
/*-------------------------
|
||||
Simple reset
|
||||
--------------------------*/
|
||||
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
font-family: Georgia, sans-serif, Arial;
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
color: #343A3F;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-weight:500;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Heading
|
||||
--------------------------*/
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
line-height: 1.3;
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Layout
|
||||
--------------------------*/
|
||||
|
||||
#outer-wrapper {
|
||||
margin:0;
|
||||
padding:0;
|
||||
float:left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#inner-wrapper {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
#header-wrapper {
|
||||
background: #546673;
|
||||
position:relative;
|
||||
padding: 1em 0;
|
||||
float:left;
|
||||
width: 100%;
|
||||
color: #ffffff;
|
||||
font-family: Georgia, sans-serif;
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
#content-wrapper {
|
||||
float:left;
|
||||
width: 100%;
|
||||
padding: 3em 0;
|
||||
}
|
||||
|
||||
#menu, #header, #content, #footer {
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#header {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Link
|
||||
--------------------------*/
|
||||
|
||||
a, a:visited {
|
||||
outline:none;
|
||||
color:#2E9FFF;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
a:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Text element
|
||||
--------------------------*/
|
||||
|
||||
blockquote:before {
|
||||
color: #BBBBBB;
|
||||
content: "“";
|
||||
font-size: 3em;
|
||||
line-height: 0.1em;
|
||||
margin-right: 0.2em;
|
||||
vertical-align: -0.4em;
|
||||
}
|
||||
|
||||
blockquote:after {
|
||||
color: #BBBBBB;
|
||||
content: "”";
|
||||
font-size: 3em;
|
||||
line-height: 0.1em;
|
||||
vertical-align: -0.45em;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-style: italic;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 1em 0;
|
||||
overflow: auto;
|
||||
background: #F1F1FF;
|
||||
}
|
||||
|
||||
pre code {
|
||||
color: #333333;
|
||||
display: block;
|
||||
font-family: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif;
|
||||
font-size: 14px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
float: left;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
margin: 5px 15px 0 0;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
padding-left: 30px;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
ul li, ol li{
|
||||
margin: 0.25em 0;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Menu
|
||||
--------------------------*/
|
||||
|
||||
#menu-wrapper {
|
||||
font-weight:bold;
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
color: #7E909D;
|
||||
padding: 10px 0;
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#menu {
|
||||
font-weight:bold;
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
color: #7E909D;
|
||||
}
|
||||
|
||||
#menu ul {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#menu a {
|
||||
color: #7E909D;
|
||||
}
|
||||
|
||||
#menu ul li {
|
||||
float:left;
|
||||
margin:0 20px 0 0;
|
||||
list-style:none;
|
||||
padding-top:2px;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Search form
|
||||
-----------------------------*/
|
||||
|
||||
#search-form {
|
||||
position:relative;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.search-input{
|
||||
margin: 0;
|
||||
padding: 4px 15px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size:14px;
|
||||
border:1px solid #0076a3;
|
||||
border-top-left-radius: 5px 5px;
|
||||
border-bottom-left-radius: 5px 5px;
|
||||
width: 120px;
|
||||
color: #888888;
|
||||
}
|
||||
.search-button {
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size:14px;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: #ffffff;
|
||||
border: solid 1px #546673;
|
||||
border-right:0px;
|
||||
background: #0095cd;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#2E9FFF), to(#2E9CCC));
|
||||
background: -moz-linear-gradient(top, #2E9FFF, #2E9CCC);
|
||||
border-top-right-radius: 5px 5px;
|
||||
border-bottom-right-radius: 5px 5px;
|
||||
width: 60px;
|
||||
}
|
||||
.search-button:hover {
|
||||
text-decoration: none;
|
||||
background: #007ead;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
|
||||
background: -moz-linear-gradient(top, #0095cc, #00678e);
|
||||
}
|
||||
/* Fixes submit button height problem in Firefox */
|
||||
.search-button::-moz-focus-inner {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Post
|
||||
--------------------------*/
|
||||
|
||||
.post {
|
||||
border-bottom: 1px solid #EBF2F6;
|
||||
padding: 1em 0;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.inpost .post {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
p, ul {
|
||||
margin :1em 0;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
font-size: 14px;
|
||||
color: #A7A7A7;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
h1.blog-title {
|
||||
font-style:normal;
|
||||
}
|
||||
|
||||
h1.title-post a, h2.title-index a{
|
||||
color:#4f4f4f;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1.title-post a:hover, h2.title-index a:hover {
|
||||
color: #2E9FFF;
|
||||
}
|
||||
|
||||
.inpost .post {
|
||||
padding-top:0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.inpage .border {
|
||||
padding:0;
|
||||
margin:0;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.inpage .post {
|
||||
padding-top:0;
|
||||
}
|
||||
|
||||
.infront .first, .inpost .post, .intag .first, .inarchive .first, .insearch .first {
|
||||
padding-top:0;
|
||||
}
|
||||
|
||||
.infront .first h2.title-index {
|
||||
margin-top:0;
|
||||
}
|
||||
|
||||
.post-list {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Share box
|
||||
--------------------------*/
|
||||
|
||||
.share-box {
|
||||
font-size: 14px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.author-info {
|
||||
width: 540px;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.share {
|
||||
width:140px;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.share a {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
vertical-align: middle;
|
||||
-o-transition: all .3s;
|
||||
-moz-transition: all .3s;
|
||||
-webkit-transition: all .3s;
|
||||
-ms-transition: all .3s;
|
||||
text-indent: -9999em;
|
||||
}
|
||||
|
||||
.share a.twitter { background: url(../img/share-twitter.png) left top no-repeat; }
|
||||
.share a.facebook { background: url(../img/share-facebook.png) left top no-repeat; }
|
||||
.share a.googleplus { background: url(../img/share-googleplus.png) left top no-repeat; }
|
||||
|
||||
.share a:hover { background-position: left -26px; }
|
||||
|
||||
/*-------------------------
|
||||
Comments
|
||||
--------------------------*/
|
||||
|
||||
.comments {
|
||||
position:relative;
|
||||
display:block;
|
||||
font-size:16px;
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.border {
|
||||
border-top: 1px solid #DFDFDF;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 10px;
|
||||
padding-bottom: 15px;
|
||||
width: 100%;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.border #disqus_thread {
|
||||
padding-top: 1.2em;
|
||||
}
|
||||
|
||||
#disqus_thread {
|
||||
font-family: Georgia, Times, Cambria, serif;
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Pagination + Postnav
|
||||
--------------------------*/
|
||||
|
||||
.postnav{
|
||||
width:100%;
|
||||
float:left;
|
||||
padding-bottom:1em;
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.postnav a {
|
||||
background: none repeat scroll 0 0 #E4E7EE;
|
||||
border-radius: 3px;
|
||||
color: #555555;
|
||||
line-height: 1;
|
||||
padding: 10px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.postnav a:hover {
|
||||
text-decoration:none;
|
||||
color:#333333;
|
||||
}
|
||||
|
||||
.postnav .newer {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.postnav .older {
|
||||
float:right;
|
||||
}
|
||||
|
||||
.pager {
|
||||
width:100%;
|
||||
float:left;
|
||||
padding: 30px 0 1em 0;
|
||||
font-family: 'Open Sans',sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.pager a {
|
||||
background: none repeat scroll 0 0 #E4E7EE;
|
||||
border-radius: 3px;
|
||||
color: #555555;
|
||||
line-height: 1;
|
||||
padding: 10px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pager .newer {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.pager .older {
|
||||
float:right;
|
||||
}
|
||||
|
||||
.pager a:hover {
|
||||
text-decoration:none;
|
||||
color:#333333;
|
||||
}
|
||||
|
||||
/*-------------------------
|
||||
Footer
|
||||
--------------------------*/
|
||||
|
||||
#footer-wrapper {
|
||||
background: #546673;
|
||||
position:relative;
|
||||
padding: 20px 0;
|
||||
float:left;
|
||||
width: 100%;
|
||||
color: #ABB6C5;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
|
||||
#footer {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#footer a {
|
||||
color: #CBD2DC;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#footer ul {
|
||||
margin:0.5em 0;
|
||||
}
|
||||
|
||||
.footer-column {
|
||||
padding-bottom: 1.5em;
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.column {
|
||||
float: left;
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.social {
|
||||
float:right;
|
||||
}
|
||||
|
||||
.social .inner {
|
||||
padding-left:30px;
|
||||
}
|
||||
|
||||
.tagcloud ul {
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.tagcloud ul li {
|
||||
float:left;
|
||||
list-style:none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
font-size: 12px;
|
||||
float:left;
|
||||
width: 100%;
|
||||
border-top: 1px solid #ABB6C5;
|
||||
padding-top:1em;
|
||||
}
|
||||
|
||||
.copyright p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
The 404 page
|
||||
-----------------------------*/
|
||||
|
||||
.message{
|
||||
padding:50px 20px 20px 20px;
|
||||
}
|
||||
|
||||
.message h1{
|
||||
font-size:36px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.message p{
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.center{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.search-404 {
|
||||
position:relative;
|
||||
float:left;
|
||||
width:100%;
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
|
||||
#search-form-404 {
|
||||
float:none;
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Media queries
|
||||
-----------------------------*/
|
||||
|
||||
@media all and (max-width: 700px) {
|
||||
|
||||
#menu, #header, #content, #footer {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#menu-wrapper {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#menu ul li {
|
||||
float:none;
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
#search-form {
|
||||
float:none;
|
||||
}
|
||||
|
||||
.author-info {
|
||||
width: 100%;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.share {
|
||||
width:100%;
|
||||
margin-right: 0;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
.column {
|
||||
float:left;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.postnav .newer {
|
||||
float:left;
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
.postnav .older {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.social .inner {
|
||||
padding-left:0px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*----------------------------
|
||||
Video
|
||||
-----------------------------*/
|
||||
|
||||
.video-wrapper {
|
||||
margin-bottom:1em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 420px) {
|
||||
|
||||
.video-wrapper {
|
||||
padding-top:315px!important;
|
||||
position:relative;
|
||||
width:100%;
|
||||
max-width:420px!important;
|
||||
max-height:315px!important;
|
||||
}
|
||||
|
||||
.video-wrapper iframe, .video-wrapper object, .video-wrapper embed {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
max-width:420px!important;
|
||||
max-height:315px!important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media all and (max-width: 420px) {
|
||||
|
||||
.video-wrapper {
|
||||
position: relative;
|
||||
padding-bottom: 56.25%;
|
||||
padding-top: 30px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.video-wrapper iframe, .video-wrapper object, .video-wrapper embed {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
themes/dan/img/facebook.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
themes/dan/img/googleplus.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
themes/dan/img/rss.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
themes/dan/img/share-facebook.png
Normal file
|
After Width: | Height: | Size: 582 B |
BIN
themes/dan/img/share-googleplus.png
Normal file
|
After Width: | Height: | Size: 836 B |
BIN
themes/dan/img/share-twitter.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
themes/dan/img/tumblr.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
themes/dan/img/twitter.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
69
themes/dan/layout.html.php
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo isset($title) ? _h($title) : config('blog.title') ?></title>
|
||||
<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" />
|
||||
<meta name="description" content="<?php echo $description; ?>" />
|
||||
<link rel="canonical" href="<?php echo $canonical; ?>" />
|
||||
<link rel="alternate" type="application/rss+xml" title="<?php echo config('blog.title')?> Feed" href="<?php echo site_url()?>feed/rss" />
|
||||
<link href="<?php echo site_url() ?>themes/dan/css/style.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic|Open+Sans:700,400"/>
|
||||
<?php if (publisher() == true):?><link href="<?php echo publisher() ?>" rel="publisher" /><?php endif;?>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body class="<?php echo $bodyclass; ?>">
|
||||
<div itemscope="itemscope" itemtype="http://schema.org/Blog" class="hide">
|
||||
<meta content="<?php echo config('blog.title') ?>" itemprop="name"/>
|
||||
<meta content="<?php echo config('blog.description')?>" itemprop="description"/>
|
||||
</div>
|
||||
<div id="outer-wrapper">
|
||||
<div id="menu-wrapper">
|
||||
<div class="container">
|
||||
<nav id="menu">
|
||||
<?php echo menu() ?>
|
||||
<form id="search-form" method="get">
|
||||
<input type="text" class="search-input" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}">
|
||||
<input type="submit" value="Search" class="search-button">
|
||||
</form>
|
||||
<?php if(isset($_GET['search'])) {$url = site_url() . 'search/' . $_GET['search']; header ("Location: $url");} ?>
|
||||
</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 config('blog.title') ?></a></h1>
|
||||
<div class="description"><p><?php echo config('blog.description')?></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="footer-column">
|
||||
<div class="archive column"><div class="inner"><?php echo archive_list()?></div></div>
|
||||
<div class="tagcloud column"><div class="inner"><?php echo tag_cloud()?></div></div>
|
||||
<div class="social column"><div class="inner"><h3>Follow</h3><?php echo social()?></div></div>
|
||||
</div>
|
||||
<div class="copyright"><?php echo copyright() ?></div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (analytics() == true):?><?php echo analytics() ?><?php endif;?>
|
||||
</body>
|
||||
</html>
|
||||
41
themes/dan/main.html.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?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 = 'first';
|
||||
}
|
||||
elseif ($i == $len - 1) {
|
||||
$class = 'last';
|
||||
}
|
||||
else {
|
||||
$class = '';
|
||||
}
|
||||
$i++;
|
||||
?>
|
||||
<div class="post <?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"><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></span> by <span itemprop="author"><a href="<?php echo $p->authorurl ?>"><?php echo $p->author ?></a></span><?php if (disqus_count() == true):?> - <span><a href="<?php echo $p->url?>#disqus_thread">Comments</a></span><?php endif;?></div>
|
||||
<div class="teaser-body" itemprop="articleBody">
|
||||
<?php if (config('img.thumbnail') == 'true'):?>
|
||||
<?php echo get_thumbnail($p->body)?>
|
||||
<?php endif;?>
|
||||
<?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() == true):?>
|
||||
<?php echo disqus_count() ?>
|
||||
<?php endif;?>
|
||||
53
themes/dan/post.html.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php if (!empty($breadcrumb)):?><div class="breadcrumb" xmlns:v="http://rdf.data-vocabulary.org/#"><?php echo $breadcrumb ?></div><?php endif;?>
|
||||
<div class="post" itemprop="blogPost" itemscope="itemscope" itemtype="http://schema.org/BlogPosting">
|
||||
<div class="main">
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<a name="more"></a>
|
||||
<?php endif;?>
|
||||
<h1 class="title-post" itemprop="name"><?php echo $p->title ?></h1>
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<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"><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></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>
|
||||
<?php endif;?>
|
||||
<div class="post-body" itemprop="articleBody">
|
||||
<?php echo $p->body; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<div class="separator">→</div>
|
||||
<div class="share-box">
|
||||
<?php if (config('author.info') == 'true'):?>
|
||||
<?php echo $authorinfo ?>
|
||||
<style>.share {float:right;}</style>
|
||||
<?php endif;?>
|
||||
<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 endif;?>
|
||||
<div class="comments border">
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<?php if (disqus(null, null) == true):?>
|
||||
<div id="disqus_thread"></div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<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 endif;?>
|
||||
<?php if ($type == 'blogpost'):?>
|
||||
<?php if (disqus(null, null) == true):?>
|
||||
<?php echo disqus($p->title, $p->url) ?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
36
themes/dan/profile.html.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php if (!empty($breadcrumb)):?><div class="breadcrumb"><?php echo $breadcrumb ?></div><?php endif;?>
|
||||
<div class="profile" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="Person">
|
||||
<h1 class="title-post" itemprop="name"><?php echo $name ?></h1>
|
||||
<div class="bio" itemprop="description"><?php echo $bio ?></div>
|
||||
</div>
|
||||
<h2 class="post-index">Posts by this author</h2>
|
||||
<ul class="post-list">
|
||||
<?php $i = 0; $len = count($posts);?>
|
||||
<?php foreach($posts as $p):?>
|
||||
<?php
|
||||
if ($i == 0) {
|
||||
$class = 'first';
|
||||
}
|
||||
elseif ($i == $len - 1) {
|
||||
$class = 'last';
|
||||
}
|
||||
else {
|
||||
$class = '';
|
||||
}
|
||||
$i++;
|
||||
?>
|
||||
<li>
|
||||
<span><a href="<?php echo $p->url?>"><?php echo $p->title ?></a></span> on <span><?php echo date('d F Y', $p->date)?></span> - Posted in <span><a href="<?php echo $p->tagurl ?>"><?php echo $p->tag ?></a></span>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
<?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;?>
|
||||
4
vendor/autoload.php
vendored
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
// autoload.php generated by Composer
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit352930101c1dc3fb72305f7934017105::getLoader();
|
||||
return ComposerAutoloaderInitd3ea151fa7d895c222811d503fe2be24::getLoader();
|
||||
|
|
|
|||
194
vendor/composer/ClassLoader.php
vendored
|
|
@ -42,19 +42,36 @@ namespace Composer\Autoload;
|
|||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
private $prefixes = array();
|
||||
private $fallbackDirs = array();
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
return $this->prefixes;
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirs;
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
|
|
@ -75,61 +92,130 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers a set of classes, merging with any others previously set.
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The classes prefix
|
||||
* @param array|string $paths The location(s) of the classes
|
||||
* @param bool $prepend Prepend the location(s)
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirs = array_merge(
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirs
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirs = array_merge(
|
||||
$this->fallbackDirs,
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
if (!isset($this->prefixes[$prefix])) {
|
||||
$this->prefixes[$prefix] = (array) $paths;
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixes[$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixes[$prefix]
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixes[$prefix] = array_merge(
|
||||
$this->prefixes[$prefix],
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of classes, replacing any others previously set.
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The classes prefix
|
||||
* @param array|string $paths The location(s) of the classes
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirs = (array) $paths;
|
||||
|
||||
return;
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*/
|
||||
public function setPsr4($prefix, $paths) {
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
$this->prefixes[$prefix] = (array) $paths;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -175,7 +261,7 @@ class ClassLoader
|
|||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True, if loaded
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
|
|
@ -191,50 +277,78 @@ class ClassLoader
|
|||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|null The path, if found
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
||||
if ('\\' == $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . '.php';
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
|
||||
$className = substr($class, $pos + 1);
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$classPath = null;
|
||||
$className = $class;
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . '.php';
|
||||
}
|
||||
|
||||
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
||||
|
||||
foreach ($this->prefixes as $prefix => $dirs) {
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
|
||||
return $dir . DIRECTORY_SEPARATOR . $classPath;
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->fallbackDirs as $dir) {
|
||||
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
|
||||
return $dir . DIRECTORY_SEPARATOR . $classPath;
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
// Remember that this class does not exist.
|
||||
return $this->classMap[$class] = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
vendor/composer/autoload_classmap.php
vendored
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php generated by Composer
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
|
|
|
|||
8
vendor/composer/autoload_namespaces.php
vendored
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php generated by Composer
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'dflydev\\markdown' => $vendorDir . '/dflydev/markdown/src',
|
||||
'Suin\\RSSWriter' => $vendorDir . '/suin/php-rss-writer/Source',
|
||||
'Suin\\RSSWriter' => array($vendorDir . '/suin/php-rss-writer/Source'),
|
||||
'Michelf' => array($vendorDir . '/michelf/php-markdown'),
|
||||
);
|
||||
|
|
|
|||
9
vendor/composer/autoload_psr4.php
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
15
vendor/composer/autoload_real.php
vendored
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php generated by Composer
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit352930101c1dc3fb72305f7934017105
|
||||
class ComposerAutoloaderInitd3ea151fa7d895c222811d503fe2be24
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
|
@ -19,16 +19,21 @@ class ComposerAutoloaderInit352930101c1dc3fb72305f7934017105
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit352930101c1dc3fb72305f7934017105', 'loadClassLoader'));
|
||||
spl_autoload_register(array('ComposerAutoloaderInitd3ea151fa7d895c222811d503fe2be24', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit352930101c1dc3fb72305f7934017105', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitd3ea151fa7d895c222811d503fe2be24', 'loadClassLoader'));
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->add($namespace, $path);
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
|
|
|
|||
109
vendor/composer/installed.json
vendored
|
|
@ -1,60 +1,4 @@
|
|||
[
|
||||
{
|
||||
"name": "dflydev/markdown",
|
||||
"version": "v1.0.2",
|
||||
"version_normalized": "1.0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dflydev/dflydev-markdown.git",
|
||||
"reference": "v1.0.2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/dflydev/dflydev-markdown/zipball/v1.0.2",
|
||||
"reference": "v1.0.2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"time": "2012-01-15 19:36:37",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"dflydev\\markdown": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"New BSD License"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dragonfly Development Inc.",
|
||||
"email": "info@dflydev.com",
|
||||
"homepage": "http://dflydev.com"
|
||||
},
|
||||
{
|
||||
"name": "Beau Simensen",
|
||||
"email": "beau@dflydev.com",
|
||||
"homepage": "http://beausimensen.com"
|
||||
},
|
||||
{
|
||||
"name": "Michel Fortin",
|
||||
"homepage": "http://michelf.com"
|
||||
},
|
||||
{
|
||||
"name": "John Gruber",
|
||||
"homepage": "http://daringfireball.net"
|
||||
}
|
||||
],
|
||||
"description": "PHP Markdown & Extra",
|
||||
"homepage": "http://github.com/dflydev/dflydev-markdown",
|
||||
"keywords": [
|
||||
"markdown"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "suin/php-rss-writer",
|
||||
"version": "1.2",
|
||||
|
|
@ -101,5 +45,58 @@
|
|||
"rss",
|
||||
"writer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "michelf/php-markdown",
|
||||
"version": "dev-lib",
|
||||
"version_normalized": "dev-lib",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/michelf/php-markdown.git",
|
||||
"reference": "6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8",
|
||||
"reference": "6f952ee180e9bd345f3dd6005aa11e0f5dcbd1b8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2013-11-29 21:49:31",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-lib": "1.4.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Michelf": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"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/"
|
||||
}
|
||||
],
|
||||
"description": "PHP Markdown",
|
||||
"homepage": "http://michelf.ca/projects/php-markdown/",
|
||||
"keywords": [
|
||||
"markdown"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
2
vendor/dflydev/markdown/.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
|||
vendor
|
||||
composer.lock
|
||||
7
vendor/dflydev/markdown/.travis.yml
vendored
|
|
@ -1,7 +0,0 @@
|
|||
language: php
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
before_script:
|
||||
- wget -nc http://getcomposer.org/composer.phar
|
||||
- php composer.phar update
|
||||
98
vendor/dflydev/markdown/README.md
vendored
|
|
@ -1,98 +0,0 @@
|
|||
PHP Markdown & Extra
|
||||
====================
|
||||
|
||||
An updated and stripped version of the original [PHP Markdown](http://michelf.com/projects/php-markdown/)
|
||||
by [Michel Fortin](http://michelf.com/). Works quite well with PSR-0
|
||||
autoloaders and is [Composer](http://packagist.org/) friendly.
|
||||
|
||||
|
||||
Changes from the official PHP Markdown & Extra
|
||||
----------------------------------------------
|
||||
|
||||
The initial pass at updating PHP Markdown & Extra left the core of
|
||||
the code more or less intact but the changes to the organization
|
||||
and naming were quite substantial. This effectively makes this package
|
||||
a hard fork from Markdown 1.0.1n and MarkdownExtra 1.2.4.
|
||||
|
||||
Updated in the following ways:
|
||||
|
||||
* Moved parser classes into their own files
|
||||
* Using PHP 5.3 namespaces
|
||||
* Following [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) standards
|
||||
* Replaced `@define` configuration variables with class `const` variables
|
||||
* Integrated with [Travis CI](http://travis-ci.org/)
|
||||
* Made [Composer](http://packagist.org/) friendly
|
||||
|
||||
Stripped in the following ways:
|
||||
|
||||
* No more embedded plugin code (WordPress, bBlog, etc.)
|
||||
* No more top level function calls (`Markdown()`, etc.)
|
||||
|
||||
Last synced with:
|
||||
|
||||
* PHP Markdown v1.0.1o
|
||||
* PHP Markdown Extra v1.2.5
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* PHP 5.3+
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Simple usage for the standard Markdown ([details](http://michelf.com/projects/php-markdown/)) parser:
|
||||
|
||||
<?php
|
||||
use dflydev\markdown\Markdown;
|
||||
|
||||
$markdownParser = new MarkdownParser();
|
||||
|
||||
// Will return <h1>Hello World</h1>
|
||||
$markdownParser->transformMarkdown("#Hello World");
|
||||
|
||||
Simple usage for the Markdown Extra ([details](http://michelf.com/projects/php-markdown/extra/)) parser:
|
||||
|
||||
<?php
|
||||
use dflydev\markdown\MarkdownExtra;
|
||||
|
||||
$markdownParser = new MarkdownExtraParser();
|
||||
|
||||
// Will return <h1>Hello World</h1>
|
||||
$markdownParser->transformMarkdown("#Hello World");
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This library is licensed under the New BSD License - see the LICENSE file for details.
|
||||
|
||||
|
||||
Community
|
||||
---------
|
||||
|
||||
If you have questions or want to help out, join us in the
|
||||
[#dflydev](irc://irc.freenode.net/#dflydev) channel on irc.freenode.net.
|
||||
|
||||
|
||||
Not Invented Here
|
||||
-----------------
|
||||
|
||||
The original [PHP Markdown](http://michelf.com/projects/php-markdown/) was
|
||||
quite excellent but was not as easy to use as it could be in more modern PHP
|
||||
applications. Having started to use [Composer](http://packagist.org/) for a
|
||||
few newer applications that needed to transform Markdown, I decided to strip
|
||||
and update the original PHP Markdown so that it could be more easily managed
|
||||
by the likes of Composer.
|
||||
|
||||
All of the initial work done for this library (which I can only assume
|
||||
was quite substantial after having looked at the code) was done by
|
||||
[Michel Fortin](http://michelf.com/) during the original port from Perl to
|
||||
PHP.
|
||||
|
||||
If you do not need to install PHP Markdown by way of Composer or need to
|
||||
leverage PSR-0 autoloading, I suggest you continue to use the official and
|
||||
likely more stable and well used original version of
|
||||
[PHP Markdown](http://michelf.com/projects/php-markdown/)
|
||||
34
vendor/dflydev/markdown/composer.json
vendored
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
"name": "dflydev/markdown",
|
||||
"type": "library",
|
||||
"description": "PHP Markdown & Extra",
|
||||
"homepage": "http://github.com/dflydev/dflydev-markdown",
|
||||
"keywords": ["markdown"],
|
||||
"license": "New BSD License",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dragonfly Development Inc.",
|
||||
"email": "info@dflydev.com",
|
||||
"homepage": "http://dflydev.com"
|
||||
},
|
||||
{
|
||||
"name": "Beau Simensen",
|
||||
"email": "beau@dflydev.com",
|
||||
"homepage": "http://beausimensen.com"
|
||||
},
|
||||
{
|
||||
"name": "Michel Fortin",
|
||||
"homepage": "http://michelf.com"
|
||||
},
|
||||
{
|
||||
"name": "John Gruber",
|
||||
"homepage": "http://daringfireball.net"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "dflydev\\markdown": "src" }
|
||||
}
|
||||
}
|
||||
28
vendor/dflydev/markdown/phpunit.xml.dist
vendored
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
syntaxCheck="false"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="dflydev-markdown Test Suite">
|
||||
<directory>./tests/dflydev/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./src/dflydev/</directory>
|
||||
<exclude>
|
||||
<directory>./src/dflydev/*/resources</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is a part of the PHP Markdown library.
|
||||
*
|
||||
* (c) Dragonfly Development Inc.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace dflydev\markdown;
|
||||
|
||||
interface IMarkdownParser {
|
||||
|
||||
/**
|
||||
* Transform Markdown text to HTML.
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public function transformMarkdown($text);
|
||||
|
||||
}
|
||||
12
vendor/dflydev/markdown/tests/bootstrap.php
vendored
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is a part of the PHP Markdown library.
|
||||
*
|
||||
* (c) Dragonfly Development Inc.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
$loader = require dirname(__DIR__).'/vendor/.composer/autoload.php';
|
||||
$loader->add('dflydev\\tests\\markdown', 'tests');
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is a part of the PHP Markdown library.
|
||||
*
|
||||
* (c) Dragonfly Development Inc.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace dflydev\tests\markdown;
|
||||
|
||||
use dflydev\markdown\MarkdownExtraParser;
|
||||
|
||||
class MarkdownExtraParserTest extends MarkdownParserTest
|
||||
{
|
||||
|
||||
protected $configKeyTabWidth = \dflydev\markdown\MarkdownExtraParser::CONFIG_TAB_WIDTH;
|
||||
|
||||
/**
|
||||
* Create a markdown parser.
|
||||
* @param array $configuration Optional configuration
|
||||
* @return \dflydev\markdown\IMarkdownParser
|
||||
*/
|
||||
public function createParser($configuration = null)
|
||||
{
|
||||
if ($configuration !== null) {
|
||||
return new \dflydev\markdown\MarkdownExtraParser($configuration);
|
||||
}
|
||||
return new \dflydev\markdown\MarkdownExtraParser();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is a part of the PHP Markdown library.
|
||||
*
|
||||
* (c) Dragonfly Development Inc.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace dflydev\tests\markdown;
|
||||
|
||||
use dflydev\markdown\MarkdownParser;
|
||||
|
||||
class MarkdownParserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
protected $configKeyTabWidth = \dflydev\markdown\MarkdownParser::CONFIG_TAB_WIDTH;
|
||||
|
||||
/**
|
||||
* Create a markdown parser.
|
||||
* @param array $configuration Optional configuration
|
||||
* @return \dflydev\markdown\IMarkdownParser
|
||||
*/
|
||||
public function createParser($configuration = null)
|
||||
{
|
||||
if ( $configuration !== null ) {
|
||||
return new \dflydev\markdown\MarkdownParser($configuration);
|
||||
}
|
||||
return new \dflydev\markdown\MarkdownParser();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple test to ensure that parser can be created and most basic of
|
||||
* Markdown can be transformed.
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$markdownParser = $this->createParser();
|
||||
$html = $markdownParser->transformMarkdown('#Hello World');
|
||||
$this->assertEquals("<h1>Hello World</h1>\n", $html, 'Simple H1 works');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test tab width for code blocks
|
||||
*/
|
||||
public function testTabWidth()
|
||||
{
|
||||
$markdownParser = $this->createParser();
|
||||
$html = $markdownParser->transformMarkdown(' Hello World');
|
||||
$this->assertEquals("<pre><code>Hello World\n</code></pre>\n", $html, 'Default 4 space tab code block works');
|
||||
$this->configureTabWidth($markdownParser, 6);
|
||||
$html = $markdownParser->transformMarkdown(' Hello World');
|
||||
$this->assertEquals("<p>Hello World</p>\n", $html, 'Default 4 space tab code block not triggered when tab width set to 6');
|
||||
$html = $markdownParser->transformMarkdown(' Hello World');
|
||||
$this->assertEquals("<pre><code>Hello World\n</code></pre>\n", $html, 'Setting 6 space tab code block (via method) works');
|
||||
$markdownParser = $this->createParser(array($this->configKeyTabWidth => 8));
|
||||
$html = $markdownParser->transformMarkdown(' Hello World');
|
||||
$this->assertEquals("<pre><code>Hello World\n</code></pre>\n", $html, 'Setting 8 space tab code block (via constructor) works');
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure a Markdown parser for a specific tab width
|
||||
* @param \dflydev\markdown\MarkdownParser $markdownParser
|
||||
* @param integer $width
|
||||
*/
|
||||
protected function configureTabWidth(MarkdownParser $markdownParser, $width)
|
||||
{
|
||||
$markdownParser->configureMarkdownParser($this->configKeyTabWidth, $width);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
PHP Markdown & Extra
|
||||
Copyright (c) 2011, Dragonfly Development Inc
|
||||
All rights reserved.
|
||||
|
||||
Based on PHP Markdown & Extra
|
||||
Copyright (c) 2004-2009 Michel Fortin
|
||||
<http://michelf.com/>
|
||||
PHP Markdown Lib
|
||||
Copyright (c) 2004-2013 Michel Fortin
|
||||
<http://michelf.ca/>
|
||||
All rights reserved.
|
||||
|
||||
Based on Markdown
|
||||
10
vendor/michelf/php-markdown/Michelf/Markdown.inc.php
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?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';
|
||||
3106
vendor/michelf/php-markdown/Michelf/Markdown.php
vendored
Normal file
11
vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?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';
|
||||
38
vendor/michelf/php-markdown/Michelf/MarkdownExtra.php
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
#
|
||||
# Markdown Extra - A text-to-HTML conversion tool for web writers
|
||||
#
|
||||
# PHP Markdown Extra
|
||||
# Copyright (c) 2004-2013 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.
|
||||
|
||||
}
|
||||
|
||||
9
vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?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';
|
||||
37
vendor/michelf/php-markdown/Michelf/MarkdownInterface.php
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
#
|
||||
# Markdown - A text-to-HTML conversion tool for web writers
|
||||
#
|
||||
# PHP Markdown
|
||||
# Copyright (c) 2004-2013 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
271
vendor/michelf/php-markdown/Readme.md
vendored
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
PHP Markdown
|
||||
============
|
||||
|
||||
PHP Markdown Lib 1.4.0 - 29 Nov 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/
|
||||
|
||||
|
||||
Version History
|
||||
---------------
|
||||
|
||||
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-2013 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.
|
||||
31
vendor/michelf/php-markdown/Readme.php
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?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>
|
||||
31
vendor/michelf/php-markdown/composer.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||