git.cweiske.de
/
anoweco.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update composer package pear2/services_linkback from v0.3.0 to v0.4.0
[anoweco.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index 1b4a6858bd6683d6ef6528b4cd80301c05e71521..ec7e8b3dafc3d1e59963de74466507d402d6e3ee 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-1,10
+1,11
@@
<?php
<?php
+require __DIR__ . '/../data/config.php';
require_once __DIR__ . '/../src/anoweco/autoload.php';
require_once __DIR__ . '/../src/anoweco/autoload.php';
-
\Twig_Autoloader::register(
);
+
header("Access-Control-Allow-Origin: *"
);
-$loader = new \Twig
_Loader_Filesystem
(__DIR__ . '/../data/templates/');
-$twig = new \Twig
_
Environment(
+$loader = new \Twig
\Loader\FilesystemLoader
(__DIR__ . '/../data/templates/');
+$twig = new \Twig
\
Environment(
$loader,
array(
//'cache' => '/path/to/compilation_cache',
$loader,
array(
//'cache' => '/path/to/compilation_cache',
@@
-64,7
+65,7
@@
function error($description, $status = 'HTTP/1.0 400 Bad Request')
function render($tplname, $vars = array(), $return = false)
{
function render($tplname, $vars = array(), $return = false)
{
- $template = $GLOBALS['twig']->load
Template
($tplname . '.htm');
+ $template = $GLOBALS['twig']->load($tplname . '.htm');
if ($return) {
return $template->render($vars);
if ($return) {
return $template->render($vars);
@@
-72,4
+73,13
@@
function render($tplname, $vars = array(), $return = false)
echo $template->render($vars);
}
}
echo $template->render($vars);
}
}
-?>
\ No newline at end of file
+
+/**
+ * No trailing slash
+ */
+function getBaseUrl()
+{
+ return $_SERVER['REQUEST_SCHEME']
+ . '://' . $_SERVER['HTTP_HOST'];
+}
+?>