Skip to content

Commit

Permalink
Revert "Support PHP < 5.3"
Browse files Browse the repository at this point in the history
I lied. I left lambdas behind, and I don't want to drop them. Sorry.

This reverts commit e360b9d.
  • Loading branch information
igstan committed May 19, 2011
1 parent 6b6206e commit c7fdd2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.php
@@ -1,6 +1,6 @@
<?php

define('BUILD_DIR', dirname(__FILE__) . '/build');
define('BUILD_DIR', __DIR__ . '/build');
define('EBOOK_TITLE', 'Learn You Some Erlang for Great Good!');
define('EBOOK_AUTHOR', 'Frederic Trottier-Hebert');
define('EBOOK_LANGUAGE', 'en-us');
18 changes: 9 additions & 9 deletions main.php
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/config.php';
require_once __DIR__ . '/config.php';


function filter($a, $fn) {
Expand Down Expand Up @@ -155,7 +155,7 @@ function changeLayout($pageHtml) {
$original->loadHTML($pageHtml);
$content = $original->getElementById('content');

$modified->loadHTML(renderTemplate(dirname(__FILE__) . '/templates/page-layout.html', array(
$modified->loadHTML(renderTemplate(__DIR__ . '/templates/page-layout.html', array(
'title' => EBOOK_TITLE,
)));

Expand Down Expand Up @@ -282,7 +282,7 @@ function buildTocNcx($pages) {
}),
);

$ncx = renderTemplate(dirname(__FILE__) . '/templates/toc.ncx', $data);
$ncx = renderTemplate(__DIR__ . '/templates/toc.ncx', $data);
file_put_contents(BUILD_DIR . '/toc.ncx', $ncx);
return $ncx;
}
Expand All @@ -303,17 +303,17 @@ function buildOpf($pages) {
}),
);

$opf = renderTemplate(dirname(__FILE__) . '/templates/book.opf', $data);
$opf = renderTemplate(__DIR__ . '/templates/book.opf', $data);
file_put_contents(BUILD_DIR . '/book.opf', $opf);
return $opf;
}

function copyStaticFiles() {
copy(dirname(__FILE__) . '/css/main.css', BUILD_DIR . '/css/main.css');
copy(dirname(__FILE__) . '/images/cover.jpg', BUILD_DIR . '/images/cover.jpg');
copy(dirname(__FILE__) . '/images/cc.png', BUILD_DIR . '/images/cc.png');
copy(dirname(__FILE__) . '/templates/preamble.html', BUILD_DIR . '/pages/preamble.html');
copy(dirname(__FILE__) . '/templates/license.html', BUILD_DIR . '/pages/license.html');
copy(__DIR__ . '/css/main.css', BUILD_DIR . '/css/main.css');
copy(__DIR__ . '/images/cover.jpg', BUILD_DIR . '/images/cover.jpg');
copy(__DIR__ . '/images/cc.png', BUILD_DIR . '/images/cc.png');
copy(__DIR__ . '/templates/preamble.html', BUILD_DIR . '/pages/preamble.html');
copy(__DIR__ . '/templates/license.html', BUILD_DIR . '/pages/license.html');
}

function addOwnPages($pages) {
Expand Down

0 comments on commit c7fdd2e

Please sign in to comment.