Skip to content

Instantly share code, notes, and snippets.

@r-plus
Created December 6, 2012 13:50
Show Gist options
  • Select an option

  • Save r-plus/4224581 to your computer and use it in GitHub Desktop.

Select an option

Save r-plus/4224581 to your computer and use it in GitHub Desktop.
<?php
require_once 'classTextile.php';
if ( isset($_SERVER['PATH_TRANSLATED']) ) {
$file = realpath($_SERVER['PATH_TRANSLATED']);
$ext = substr($file, strrpos($file, '.') + 1);
}
if ( $file and is_readable($file) and $ext === 'textile') {
$textile = new Textile();
$body = $textile->TextileThis(file_get_contents($file));
} else {
$body = '<p>cannot read file</p>';
}
header('Content-Type: text/html;');
echo '<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
' .
$body
. ' </body>
</html>
';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment