Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Remove double slash when using WEBROOT (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi authored Sep 14, 2018
1 parent 38d694b commit 1d68af7
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions core/kimai.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$database = Kimai_Registry::getDatabase();

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');

// prevent IE from caching the response
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Expand All @@ -41,7 +41,7 @@
// der updater.php weiss dann welche Aenderungen an der Datenbank vorgenommen werden muessen.
checkDBversion('..');

$extensions = new Kimai_Extensions($kga, WEBROOT . '/extensions/');
$extensions = new Kimai_Extensions($kga, WEBROOT . 'extensions/');
$extensions->loadConfigurations();

// ============================================
Expand Down Expand Up @@ -267,7 +267,7 @@
$view->assign('activity_display', $view->render("lists/activities.php"));

if (isset($kga['user'])) {
$view->assign('showInstallWarning', file_exists(WEBROOT . '/installer'));
$view->assign('showInstallWarning', file_exists(WEBROOT . 'installer'));
} else {
$view->assign('showInstallWarning', false);
}
Expand Down
4 changes: 2 additions & 2 deletions error.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
define('WEBROOT', dirname(__FILE__));
}

require_once WEBROOT . '/libraries/autoload.php';
require_once WEBROOT . 'libraries/autoload.php';

$kga = Kimai_Registry::getConfig();

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');

if (!isset($_REQUEST['err'])) {
$_REQUEST['err'] = '';
Expand Down
2 changes: 1 addition & 1 deletion extensions/#ki_demoextension/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
$out = $timeframe[1];

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/extensions/' . $dir_ext . '/' . $dir_templates);
$view->setBasePath(WEBROOT . 'extensions/' . $dir_ext . '/' . $dir_templates);

echo $view->render('index.php');
2 changes: 1 addition & 1 deletion extensions/ext_debug/processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Return the logfile in reverse order, so the last entries are shown first.
*/
case "reloadLogfile":
$logdatei = WEBROOT . '/temporary/logfile.txt';
$logdatei = WEBROOT . 'temporary/logfile.txt';
$fh = fopen($logdatei, 'r');

$theData = '';
Expand Down
2 changes: 1 addition & 1 deletion extensions/ki_adminpanel/templates/scripts/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
echo $this->translate('no');
} ?>

<?php if (file_exists(WEBROOT . '/updater/db_restore.php')) { ?>
<?php if (file_exists(WEBROOT . 'updater/db_restore.php')) { ?>
<br /><br />
<a href="../updater/db_restore.php"><?php echo $this->translate('DBbackup') ?></a>
<?php } ?>
4 changes: 2 additions & 2 deletions extensions/ki_expenses/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
$out = $timeframe[1];

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/extensions/' . $dir_ext . '/' . $dir_templates);
$view->addHelperPath(WEBROOT . '/templates/helpers', 'Zend_View_Helper');
$view->setBasePath(WEBROOT . 'extensions/' . $dir_ext . '/' . $dir_templates);
$view->addHelperPath(WEBROOT . 'templates/helpers', 'Zend_View_Helper');

$view->assign('kga', $kga);

Expand Down
4 changes: 2 additions & 2 deletions extensions/ki_timesheets/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
$out = $timeframe[1];

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/extensions/' . $dir_ext . '/' . $dir_templates);
$view->addHelperPath(WEBROOT . '/templates/helpers', 'Zend_View_Helper');
$view->setBasePath(WEBROOT . 'extensions/' . $dir_ext . '/' . $dir_templates);
$view->addHelperPath(WEBROOT . 'templates/helpers', 'Zend_View_Helper');

$view->assign('kga', $kga);

Expand Down
2 changes: 1 addition & 1 deletion forgotPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
$database = Kimai_Registry::getDatabase();

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');

$authPlugin = Kimai_Registry::getAuthenticator();

Expand Down
12 changes: 6 additions & 6 deletions includes/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
)
);

if (!file_exists(WEBROOT . '/includes/autoconf.php')) {
if (!file_exists(WEBROOT . 'includes/autoconf.php')) {
header('Location: installer/index.php');
exit;
}

ini_set('display_errors', '0');

require_once WEBROOT . '/libraries/autoload.php';
require_once WEBROOT . '/includes/func.php';
require_once WEBROOT . 'libraries/autoload.php';
require_once WEBROOT . 'includes/func.php';

// The $kga (formerly Kimai Global Array) is initialized here
// It was replaced by an proxy object, but until refactored it is still used as array in a lot of places
require_once WEBROOT . '/includes/autoconf.php';
require_once WEBROOT . 'includes/autoconf.php';
$kga = new Kimai_Config([
'server_prefix' => $server_prefix,
'server_hostname' => $server_hostname,
Expand All @@ -65,7 +65,7 @@
]);

// will inject the version variables into the Kimai_Config object
require WEBROOT . '/includes/version.php';
require WEBROOT . 'includes/version.php';

// write vars from autoconf.php into kga
if (isset($language)) {
Expand Down Expand Up @@ -141,7 +141,7 @@
);
unset($service);

$tmpDir = WEBROOT . '/temporary/';
$tmpDir = WEBROOT . 'temporary/';
if (!file_exists($tmpDir) || !is_dir($tmpDir) || !is_writable($tmpDir)) {
die('Kimai needs write permissions for: temporary/');
}
Expand Down
6 changes: 3 additions & 3 deletions includes/kspi.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
// Zend_View (configuration)
$view = new Zend_View();
if ($isCoreProcessor) {
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');
} else {
$view->setBasePath(WEBROOT . '/extensions/' . $dir_ext . '/' . $dir_templates);
$view->setBasePath(WEBROOT . 'extensions/' . $dir_ext . '/' . $dir_templates);
}
$view->addHelperPath(WEBROOT . '/templates/helpers', 'Zend_View_Helper');
$view->addHelperPath(WEBROOT . 'templates/helpers', 'Zend_View_Helper');


// ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion installer/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function quoteForSql($input)

if ($errors) {
$view = new Zend_View();
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');

$view->assign('headline', $kga['lang']['errors'][1]['hdl']);
$view->assign('message', $kga['lang']['errors'][1]['txt']);
Expand Down
2 changes: 1 addition & 1 deletion installer/processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
defined('WEBROOT') || define('WEBROOT', dirname(dirname(__FILE__)));
defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../'));

require_once WEBROOT . '/libraries/autoload.php';
require_once WEBROOT . 'libraries/autoload.php';

// from php documentation at http://www.php.net/manual/de/function.ini-get.php
function return_bytes($val)
Expand Down
2 changes: 1 addition & 1 deletion installer/steps/60_db_select_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
);

require_once WEBROOT . '/libraries/autoload.php';
require_once WEBROOT . 'libraries/autoload.php';

echo '<script type="text/javascript">current=60;</script>';

Expand Down
4 changes: 2 additions & 2 deletions libraries/Kimai/Auth/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public function __construct($database = null, $kga = null)
if ($kga !== null) {
$this->setKga($kga);
}
if (file_exists(WEBROOT . '/includes/auth.php')) {
$config = include WEBROOT . '/includes/auth.php';
if (file_exists(WEBROOT . 'includes/auth.php')) {
$config = include WEBROOT . 'includes/auth.php';
foreach ($config as $key => $value) {
$this->setConfig($key, $value);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/Kimai/Invoice/HtmlToPdfRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Kimai_Invoice_HtmlToPdfRenderer extends Kimai_Invoice_HtmlRenderer
public function render()
{
/* @var array $l */
require_once(WEBROOT . '/libraries/tecnickcom/tcpdf/examples/lang/eng.php');
require_once(WEBROOT . 'libraries/tecnickcom/tcpdf/examples/lang/eng.php');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
Expand Down
4 changes: 2 additions & 2 deletions libraries/Kimai/Translation/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Kimai_Translation_Data extends \ArrayObject
public function __construct($language)
{
$default = Kimai_Config::getDefault(Kimai_Config::DEFAULT_LANGUAGE);
$data = include WEBROOT . '/language/'.$default.'.php';
$data = include WEBROOT . 'language/'.$default.'.php';
parent::__construct($data, \ArrayObject::ARRAY_AS_PROPS);
$this->addTranslations($language);
}
Expand All @@ -55,7 +55,7 @@ public function addTranslations($language)
return;
}

$languageFile = WEBROOT . '/language/'.$language.'.php';
$languageFile = WEBROOT . 'language/'.$language.'.php';
if (!file_exists($languageFile)) {
Kimai_Logger::logfile('Requested translation is missing: ' . $language);
return;
Expand Down
2 changes: 1 addition & 1 deletion libraries/Kimai/Translation/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Kimai_Translation_Service
public static function getAvailableLanguages()
{
$languages = [];
foreach (glob(WEBROOT . '/language/*.php') as $langFile) {
foreach (glob(WEBROOT . 'language/*.php') as $langFile) {
$languages[] = str_replace(".php", "", basename($langFile));
}
sort($languages);
Expand Down
2 changes: 1 addition & 1 deletion processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
require 'includes/basics.php';

$view = new Zend_View();
$view->setBasePath(WEBROOT . '/templates');
$view->setBasePath(WEBROOT . 'templates');

// =========================
// = authentication method =
Expand Down

0 comments on commit 1d68af7

Please sign in to comment.