Rector to rename print to echo calls
This commit is contained in:
parent
a4c648fffd
commit
26dfc2323f
|
@ -3,6 +3,7 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
use dokuwiki\test\rector\DokuWikiPtlnRector;
|
||||
use dokuwiki\test\rector\DokuWikiRenamePrintToEcho;
|
||||
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
|
||||
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
|
||||
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
|
||||
|
@ -40,6 +41,7 @@ use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
|
|||
return static function (RectorConfig $rectorConfig): void {
|
||||
// FIXME we may want to autoload these later
|
||||
require_once __DIR__ . '/rector/DokuWikiPtlnRector.php';
|
||||
require_once __DIR__ . '/rector/DokuWikiRenamePrintToEcho.php';
|
||||
|
||||
$rectorConfig->paths([
|
||||
__DIR__ . '/../inc/',
|
||||
|
@ -191,4 +193,5 @@ return static function (RectorConfig $rectorConfig): void {
|
|||
]);
|
||||
|
||||
$rectorConfig->rule(DokuWikiPtlnRector::class);
|
||||
$rectorConfig->rule(DokuWikiRenamePrintToEcho::class);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace dokuwiki\test\rector;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\Print_;
|
||||
use PhpParser\Node\Stmt\Echo_;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
|
||||
/**
|
||||
* Replace print calls with echo
|
||||
*/
|
||||
class DokuWikiRenamePrintToEcho extends AbstractRector
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Replace print calls with echo', [
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
print 'Hello World';
|
||||
CODE_SAMPLE,
|
||||
<<<'CODE_SAMPLE'
|
||||
echo 'Hello World';
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
return [Expression::class];
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
public function refactor(Node $node)
|
||||
{
|
||||
if (!$node->expr instanceof Print_) {
|
||||
return null;
|
||||
}
|
||||
return new Echo_([$node->expr->expr], $node->getAttributes());
|
||||
}
|
||||
}
|
|
@ -85,7 +85,7 @@ class WantedPagesCLI extends CLI
|
|||
Sort::ksort($this->result);
|
||||
foreach ($this->result as $main => $subs) {
|
||||
if ($this->skip) {
|
||||
print "$main\n";
|
||||
echo "$main\n";
|
||||
} else {
|
||||
$subs = array_unique($subs);
|
||||
Sort::sort($subs);
|
||||
|
|
4
feed.php
4
feed.php
|
@ -52,7 +52,7 @@ header('X-Robots-Tag: noindex');
|
|||
if ($cache->useCache($depends)) {
|
||||
http_conditionalRequest($cache->getTime());
|
||||
if ($conf['allowdebug']) header("X-CacheUsed: $cache->cache");
|
||||
print $cache->retrieveCache();
|
||||
echo $cache->retrieveCache();
|
||||
exit;
|
||||
} else {
|
||||
http_conditionalRequest(time());
|
||||
|
@ -100,7 +100,7 @@ $feed = $rss->createFeed($opt['feed_type']);
|
|||
$cache->storeCache($feed);
|
||||
|
||||
// finally deliver
|
||||
print $feed;
|
||||
echo $feed;
|
||||
|
||||
// ---------------------------------------------------------------- //
|
||||
|
||||
|
|
|
@ -47,6 +47,6 @@ class Denied extends AbstractAction
|
|||
public function showBanner()
|
||||
{
|
||||
// print intro
|
||||
print p_locale_xhtml('denied');
|
||||
echo p_locale_xhtml('denied');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class Export extends AbstractAction
|
|||
if (is_array($data['headers'])) foreach ($data['headers'] as $key => $val) {
|
||||
header("$key: $val");
|
||||
}
|
||||
print $pre . $data['output'] . $post;
|
||||
echo $pre . $data['output'] . $post;
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ class Locked extends AbstractAction
|
|||
$min = round(($conf['locktime'] - (time() - $locktime) )/60);
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('locked');
|
||||
echo p_locale_xhtml('locked');
|
||||
|
||||
print '<ul>';
|
||||
print '<li><div class="li"><strong>'.$lang['lockedby'].'</strong> '.editorinfo($INFO['locked']).'</div></li>';
|
||||
print '<li><div class="li"><strong>'.$lang['lockexpire'].'</strong> '.$expire.' ('.$min.' min)</div></li>';
|
||||
print '</ul>'.DOKU_LF;
|
||||
echo '<ul>';
|
||||
echo '<li><div class="li"><strong>'.$lang['lockedby'].'</strong> '.editorinfo($INFO['locked']).'</div></li>';
|
||||
echo '<li><div class="li"><strong>'.$lang['lockexpire'].'</strong> '.$expire.' ('.$min.' min)</div></li>';
|
||||
echo '</ul>'.DOKU_LF;
|
||||
}
|
||||
}
|
||||
|
|
10
inc/Ajax.php
10
inc/Ajax.php
|
@ -30,7 +30,7 @@ class Ajax
|
|||
} else {
|
||||
$evt = new Event('AJAX_CALL_UNKNOWN', $call);
|
||||
if ($evt->advise_before()) {
|
||||
print "AJAX call '" . hsc($call) . "' unknown!\n";
|
||||
echo "AJAX call '" . hsc($call) . "' unknown!\n";
|
||||
} else {
|
||||
$evt->advise_after();
|
||||
unset($evt);
|
||||
|
@ -60,8 +60,8 @@ class Ajax
|
|||
|
||||
if ($data === []) return;
|
||||
|
||||
print '<strong>' . $lang['quickhits'] . '</strong>';
|
||||
print '<ul>';
|
||||
echo '<strong>' . $lang['quickhits'] . '</strong>';
|
||||
echo '<ul>';
|
||||
$counter = 0;
|
||||
foreach ($data as $id => $title) {
|
||||
if (useHeading('navigation')) {
|
||||
|
@ -82,7 +82,7 @@ class Ajax
|
|||
break;
|
||||
}
|
||||
}
|
||||
print '</ul>';
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -119,7 +119,7 @@ class Ajax
|
|||
];
|
||||
|
||||
header('Content-Type: application/x-suggestions+json');
|
||||
print json_encode($suggestions, JSON_THROW_ON_ERROR);
|
||||
echo json_encode($suggestions, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -739,13 +739,13 @@ class HTTPClient
|
|||
*/
|
||||
protected function debugHtml($info, $var = null)
|
||||
{
|
||||
print '<b>' . $info . '</b> ' . (microtime(true) - $this->start) . 's<br />';
|
||||
echo '<b>' . $info . '</b> ' . (microtime(true) - $this->start) . 's<br />';
|
||||
if (!is_null($var)) {
|
||||
ob_start();
|
||||
print_r($var);
|
||||
$content = htmlspecialchars(ob_get_contents());
|
||||
ob_end_clean();
|
||||
print '<pre>' . $content . '</pre>';
|
||||
echo '<pre>' . $content . '</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -757,9 +757,9 @@ class HTTPClient
|
|||
*/
|
||||
protected function debugText($info, $var = null)
|
||||
{
|
||||
print '*' . $info . '* ' . (microtime(true) - $this->start) . "s\n";
|
||||
echo '*' . $info . '* ' . (microtime(true) - $this->start) . "s\n";
|
||||
if (!is_null($var)) print_r($var);
|
||||
print "\n-----------------------------------------------\n";
|
||||
echo "\n-----------------------------------------------\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -79,7 +79,7 @@ class TaskRunner
|
|||
header('Content-Type: image/gif');
|
||||
header('Content-Length: '.strlen($img));
|
||||
header('Connection: Close');
|
||||
print $img;
|
||||
echo $img;
|
||||
tpl_flush();
|
||||
// Browser should drop connection after this
|
||||
// Thinks it's got the whole image
|
||||
|
@ -196,7 +196,7 @@ class TaskRunner
|
|||
protected function runIndexer()
|
||||
{
|
||||
global $ID;
|
||||
print 'runIndexer(): started' . NL;
|
||||
echo 'runIndexer(): started' . NL;
|
||||
|
||||
if ((string) $ID === '') {
|
||||
return false;
|
||||
|
@ -217,9 +217,9 @@ class TaskRunner
|
|||
*/
|
||||
protected function runSitemapper()
|
||||
{
|
||||
print 'runSitemapper(): started' . NL;
|
||||
echo 'runSitemapper(): started' . NL;
|
||||
$result = Mapper::generate() && Mapper::pingSearchEngines();
|
||||
print 'runSitemapper(): finished' . NL;
|
||||
echo 'runSitemapper(): finished' . NL;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,20 +23,20 @@ class Backlinks extends Ui
|
|||
global $lang;
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('backlinks');
|
||||
echo p_locale_xhtml('backlinks');
|
||||
|
||||
$data = ft_backlinks($ID);
|
||||
|
||||
if (!empty($data)) {
|
||||
print '<ul class="idx">';
|
||||
echo '<ul class="idx">';
|
||||
foreach ($data as $blink) {
|
||||
print '<li><div class="li">';
|
||||
print html_wikilink(':' . $blink, useHeading('navigation') ? null : $blink);
|
||||
print '</div></li>';
|
||||
echo '<li><div class="li">';
|
||||
echo html_wikilink(':' . $blink, useHeading('navigation') ? null : $blink);
|
||||
echo '</div></li>';
|
||||
}
|
||||
print '</ul>';
|
||||
echo '</ul>';
|
||||
} else {
|
||||
print '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
|
||||
echo '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ class Index extends Ui
|
|||
public function show()
|
||||
{
|
||||
// print intro
|
||||
print p_locale_xhtml('index');
|
||||
echo p_locale_xhtml('index');
|
||||
|
||||
print $this->sitemap();
|
||||
echo $this->sitemap();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,8 +40,8 @@ class Login extends Ui
|
|||
global $INPUT;
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('login');
|
||||
print '<div class="centeralign">' . NL;
|
||||
echo p_locale_xhtml('login');
|
||||
echo '<div class="centeralign">' . NL;
|
||||
|
||||
// create the login form
|
||||
$form = new Form(['id' => 'dw__login', 'action' => wl($ID)]);
|
||||
|
@ -76,8 +76,8 @@ class Login extends Ui
|
|||
$form->addHTML('<p>' . $lang['pwdforget'] . ': ' . $resendPwLink . '</p>');
|
||||
}
|
||||
|
||||
print $form->toHTML('Login');
|
||||
echo $form->toHTML('Login');
|
||||
|
||||
print '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,10 +110,10 @@ class MediaRevisions extends Revisions
|
|||
|
||||
$form->addTagClose('div'); // close div class=no
|
||||
|
||||
print $form->toHTML('Revisions');
|
||||
echo $form->toHTML('Revisions');
|
||||
|
||||
// provide navigation for paginated revision list (of pages and/or media files)
|
||||
print $this->navigation(
|
||||
echo $this->navigation(
|
||||
$first,
|
||||
$hasNext,
|
||||
static fn($n) => media_managerURL(['first' => $n], '&', false, true)
|
||||
|
|
|
@ -39,7 +39,7 @@ class PageConflict extends Ui
|
|||
global $lang;
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('conflict');
|
||||
echo p_locale_xhtml('conflict');
|
||||
|
||||
// create the form
|
||||
$form = new Form(['id' => 'dw__editform']);
|
||||
|
@ -52,9 +52,9 @@ class PageConflict extends Ui
|
|||
$form->addButton('do[cancel]', $lang['btn_cancel'])->attrs(['type' => 'submit']);
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('Conflict');
|
||||
echo $form->toHTML('Conflict');
|
||||
|
||||
print '<br /><br /><br /><br />';
|
||||
echo '<br /><br /><br /><br />';
|
||||
|
||||
// print difference
|
||||
(new PageDiff($INFO['id']))->compareWith($this->text)->preference('showIntro', false)->show();
|
||||
|
|
|
@ -29,7 +29,7 @@ class PageDraft extends Ui
|
|||
$text = $draft->getDraftText();
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('draft');
|
||||
echo p_locale_xhtml('draft');
|
||||
|
||||
// print difference
|
||||
(new PageDiff($INFO['id']))->compareWith($text)->preference('showIntro', false)->show();
|
||||
|
@ -49,6 +49,6 @@ class PageDraft extends Ui
|
|||
$form->addButton('do[show]', $lang['btn_cancel'])->attrs(['type' => 'submit', 'tabindex' => '3']);
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('Draft');
|
||||
echo $form->toHTML('Draft');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class PageRevisions extends Revisions
|
|||
$revisions = $this->getRevisions($first, $hasNext);
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('revisions');
|
||||
echo p_locale_xhtml('revisions');
|
||||
|
||||
// create the form
|
||||
$form = new Form([
|
||||
|
@ -108,9 +108,9 @@ class PageRevisions extends Revisions
|
|||
|
||||
$form->addTagClose('div'); // close div class=no
|
||||
|
||||
print $form->toHTML('Revisions');
|
||||
echo $form->toHTML('Revisions');
|
||||
|
||||
// provide navigation for paginated revision list (of pages and/or media files)
|
||||
print $this->navigation($first, $hasNext, static fn($n) => ['do' => 'revisions', 'first' => $n]);
|
||||
echo $this->navigation($first, $hasNext, static fn($n) => ['do' => 'revisions', 'first' => $n]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,6 @@ class PageView extends Ui
|
|||
*/
|
||||
public function showrev()
|
||||
{
|
||||
print p_locale_xhtml('showrev');
|
||||
echo p_locale_xhtml('showrev');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,10 +51,10 @@ class Recent extends Ui
|
|||
$recents = $this->getRecents($first, $hasNext);
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('recent');
|
||||
echo p_locale_xhtml('recent');
|
||||
|
||||
if (getNS($ID) != '') {
|
||||
print '<div class="level1"><p>'
|
||||
echo '<div class="level1"><p>'
|
||||
. sprintf($lang['recent_global'], getNS($ID), wl('', 'do=recent'))
|
||||
. '</p></div>';
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ class Recent extends Ui
|
|||
// provide navigation for paginated recent list (of pages and/or media files)
|
||||
$form->addHTML($this->htmlNavigation($first, $hasNext));
|
||||
|
||||
print $form->toHTML('Recent');
|
||||
echo $form->toHTML('Recent');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,7 +109,7 @@ class Subscribe extends Ui
|
|||
$form->addButton('do[subscribe]', $lang['subscr_m_subscribe'])->attr('type', 'submit');
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('Subscribe');
|
||||
echo $form->toHTML('Subscribe');
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ class UserProfile extends Ui
|
|||
global $auth;
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('updateprofile');
|
||||
print '<div class="centeralign">';
|
||||
echo p_locale_xhtml('updateprofile');
|
||||
echo '<div class="centeralign">';
|
||||
|
||||
$fullname = $INPUT->post->str('fullname', $INFO['userinfo']['name'], true);
|
||||
$email = $INPUT->post->str('email', $INFO['userinfo']['mail'], true);
|
||||
|
@ -87,7 +87,7 @@ class UserProfile extends Ui
|
|||
$form->addFieldsetClose();
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('UpdateProfile');
|
||||
echo $form->toHTML('UpdateProfile');
|
||||
|
||||
|
||||
if ($auth->canDo('delUser') && actionOK('profile_delete')) {
|
||||
|
@ -116,9 +116,9 @@ class UserProfile extends Ui
|
|||
$form->addFieldsetClose();
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('ProfileDelete');
|
||||
echo $form->toHTML('ProfileDelete');
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ class UserRegister extends Ui
|
|||
$email_attrs = $base_attrs + ['type' => 'email'];
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('register');
|
||||
print '<div class="centeralign">';
|
||||
echo p_locale_xhtml('register');
|
||||
echo '<div class="centeralign">';
|
||||
|
||||
// create the login form
|
||||
$form = new Form(['id' => 'dw__register']);
|
||||
|
@ -66,8 +66,8 @@ class UserRegister extends Ui
|
|||
$form->addFieldsetClose();
|
||||
$form->addTagClose('div');
|
||||
|
||||
print $form->toHTML('Register');
|
||||
echo $form->toHTML('Register');
|
||||
|
||||
print '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ class UserResendPwd extends Ui
|
|||
$token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth'));
|
||||
|
||||
// print intro
|
||||
print p_locale_xhtml('resetpwd');
|
||||
print '<div class="centeralign">';
|
||||
echo p_locale_xhtml('resetpwd');
|
||||
echo '<div class="centeralign">';
|
||||
|
||||
if (!$conf['autopasswd'] && $token) {
|
||||
$form = $this->formSetNewPassword($token);
|
||||
|
@ -36,9 +36,9 @@ class UserResendPwd extends Ui
|
|||
$form = $this->formResendPassword();
|
||||
}
|
||||
|
||||
print $form->toHTML('ResendPwd');
|
||||
echo $form->toHTML('ResendPwd');
|
||||
|
||||
print '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,7 +96,7 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null, $csp
|
|||
http_rangeRequest($fp, filesize($file), $mime);
|
||||
} else {
|
||||
http_status(500);
|
||||
print "Could not read $file - bad permissions?";
|
||||
echo "Could not read $file - bad permissions?";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
86
inc/html.php
86
inc/html.php
|
@ -644,9 +644,9 @@ function html_msgarea()
|
|||
$hash = md5($msg['msg']);
|
||||
if (isset($shown[$hash])) continue; // skip double messages
|
||||
if (info_msg_allowed($msg)) {
|
||||
print '<div class="'.$msg['lvl'].'">';
|
||||
print $msg['msg'];
|
||||
print '</div>';
|
||||
echo '<div class="'.$msg['lvl'].'">';
|
||||
echo $msg['msg'];
|
||||
echo '</div>';
|
||||
}
|
||||
$shown[$hash] = 1;
|
||||
}
|
||||
|
@ -727,68 +727,68 @@ function html_debug()
|
|||
$ses = $_SESSION;
|
||||
debug_guard($ses);
|
||||
|
||||
print '<html><body>';
|
||||
echo '<html><body>';
|
||||
|
||||
print '<p>When reporting bugs please send all the following ';
|
||||
print 'output as a mail to andi@splitbrain.org ';
|
||||
print 'The best way to do this is to save this page in your browser</p>';
|
||||
echo '<p>When reporting bugs please send all the following ';
|
||||
echo 'output as a mail to andi@splitbrain.org ';
|
||||
echo 'The best way to do this is to save this page in your browser</p>';
|
||||
|
||||
print '<b>$INFO:</b><pre>';
|
||||
echo '<b>$INFO:</b><pre>';
|
||||
print_r($nfo);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>$_SERVER:</b><pre>';
|
||||
echo '<b>$_SERVER:</b><pre>';
|
||||
print_r($_SERVER);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>$conf:</b><pre>';
|
||||
echo '<b>$conf:</b><pre>';
|
||||
print_r($cnf);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>DOKU_BASE:</b><pre>';
|
||||
print DOKU_BASE;
|
||||
print '</pre>';
|
||||
echo '<b>DOKU_BASE:</b><pre>';
|
||||
echo DOKU_BASE;
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>abs DOKU_BASE:</b><pre>';
|
||||
print DOKU_URL;
|
||||
print '</pre>';
|
||||
echo '<b>abs DOKU_BASE:</b><pre>';
|
||||
echo DOKU_URL;
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>rel DOKU_BASE:</b><pre>';
|
||||
print dirname($_SERVER['PHP_SELF']).'/';
|
||||
print '</pre>';
|
||||
echo '<b>rel DOKU_BASE:</b><pre>';
|
||||
echo dirname($_SERVER['PHP_SELF']).'/';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>PHP Version:</b><pre>';
|
||||
print phpversion();
|
||||
print '</pre>';
|
||||
echo '<b>PHP Version:</b><pre>';
|
||||
echo phpversion();
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>locale:</b><pre>';
|
||||
print setlocale(LC_ALL, 0);
|
||||
print '</pre>';
|
||||
echo '<b>locale:</b><pre>';
|
||||
echo setlocale(LC_ALL, 0);
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>encoding:</b><pre>';
|
||||
print $lang['encoding'];
|
||||
print '</pre>';
|
||||
echo '<b>encoding:</b><pre>';
|
||||
echo $lang['encoding'];
|
||||
echo '</pre>';
|
||||
|
||||
if ($auth) {
|
||||
print '<b>Auth backend capabilities:</b><pre>';
|
||||
echo '<b>Auth backend capabilities:</b><pre>';
|
||||
foreach ($auth->getCapabilities() as $cando) {
|
||||
print ' '.str_pad($cando, 16) .' => '. (int)$auth->canDo($cando) . DOKU_LF;
|
||||
echo ' '.str_pad($cando, 16) .' => '. (int)$auth->canDo($cando) . DOKU_LF;
|
||||
}
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
print '<b>$_SESSION:</b><pre>';
|
||||
echo '<b>$_SESSION:</b><pre>';
|
||||
print_r($ses);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>Environment:</b><pre>';
|
||||
echo '<b>Environment:</b><pre>';
|
||||
print_r($_ENV);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
print '<b>PHP settings:</b><pre>';
|
||||
echo '<b>PHP settings:</b><pre>';
|
||||
$inis = ini_get_all();
|
||||
print_r($inis);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
|
||||
if (function_exists('apache_get_version')) {
|
||||
$apache = [];
|
||||
|
@ -797,12 +797,12 @@ function html_debug()
|
|||
if (function_exists('apache_get_modules')) {
|
||||
$apache['modules'] = apache_get_modules();
|
||||
}
|
||||
print '<b>Apache</b><pre>';
|
||||
echo '<b>Apache</b><pre>';
|
||||
print_r($apache);
|
||||
print '</pre>';
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
print '</body></html>';
|
||||
echo '</body></html>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -124,7 +124,7 @@ function http_rangeRequest($fh, $size, $mime)
|
|||
if (!$end) $end = $size - 1;
|
||||
if ($start > $end || $start > $size || $end > $size) {
|
||||
header('HTTP/1.1 416 Requested Range Not Satisfiable');
|
||||
print 'Bad Range Request!';
|
||||
echo 'Bad Range Request!';
|
||||
exit;
|
||||
}
|
||||
$len = $end - $start + 1;
|
||||
|
@ -168,7 +168,7 @@ function http_rangeRequest($fh, $size, $mime)
|
|||
$chunk = ($len > HTTP_CHUNK_SIZE) ? HTTP_CHUNK_SIZE : $len;
|
||||
while (!feof($fh) && $chunk > 0) {
|
||||
@set_time_limit(30); // large files can take a lot of time
|
||||
print fread($fh, $chunk);
|
||||
echo fread($fh, $chunk);
|
||||
flush();
|
||||
$len -= $chunk;
|
||||
$chunk = ($len > HTTP_CHUNK_SIZE) ? HTTP_CHUNK_SIZE : $len;
|
||||
|
@ -261,9 +261,9 @@ function http_cached_finish($file, $content)
|
|||
if ($conf['gzip_output'] && DOKU_HAS_GZIP) {
|
||||
header('Vary: Accept-Encoding');
|
||||
header('Content-Encoding: gzip');
|
||||
print gzencode($content, 9, FORCE_GZIP);
|
||||
echo gzencode($content, 9, FORCE_GZIP);
|
||||
} else {
|
||||
print $content;
|
||||
echo $content;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,13 +125,13 @@ function idx_addPage($page, $verbose = false, $force = false)
|
|||
// check if page was deleted but is still in the index
|
||||
if (!page_exists($page)) {
|
||||
if (!file_exists($idxtag)) {
|
||||
if ($verbose) print("Indexer: $page does not exist, ignoring".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: $page does not exist, ignoring".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
$Indexer = idx_get_indexer();
|
||||
$result = $Indexer->deletePage($page);
|
||||
if ($result === "locked") {
|
||||
if ($verbose) print("Indexer: locked".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: locked".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
@unlink($idxtag);
|
||||
|
@ -143,7 +143,7 @@ function idx_addPage($page, $verbose = false, $force = false)
|
|||
if (trim(io_readFile($idxtag)) == idx_get_version()) {
|
||||
$last = @filemtime($idxtag);
|
||||
if ($last > @filemtime(wikiFN($page))) {
|
||||
if ($verbose) print("Indexer: index for $page up to date".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: index for $page up to date".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -156,19 +156,19 @@ function idx_addPage($page, $verbose = false, $force = false)
|
|||
$Indexer = idx_get_indexer();
|
||||
$result = $Indexer->deletePage($page);
|
||||
if ($result === "locked") {
|
||||
if ($verbose) print("Indexer: locked".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: locked".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
@unlink($idxtag);
|
||||
}
|
||||
if ($verbose) print("Indexer: index disabled for $page".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: index disabled for $page".DOKU_LF;
|
||||
return $result;
|
||||
}
|
||||
|
||||
$Indexer = idx_get_indexer();
|
||||
$pid = $Indexer->getPID($page);
|
||||
if ($pid === false) {
|
||||
if ($verbose) print("Indexer: getting the PID failed for $page".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: getting the PID failed for $page".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
$body = '';
|
||||
|
@ -191,14 +191,14 @@ function idx_addPage($page, $verbose = false, $force = false)
|
|||
|
||||
$result = $Indexer->addPageWords($page, $body);
|
||||
if ($result === "locked") {
|
||||
if ($verbose) print("Indexer: locked".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: locked".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$result = $Indexer->addMetaKeys($page, $metadata);
|
||||
if ($result === "locked") {
|
||||
if ($verbose) print("Indexer: locked".DOKU_LF);
|
||||
if ($verbose) echo "Indexer: locked".DOKU_LF;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ function idx_addPage($page, $verbose = false, $force = false)
|
|||
if ($result)
|
||||
io_saveFile(metaFN($page, '.indexed'), idx_get_version());
|
||||
if ($verbose) {
|
||||
print("Indexer: finished".DOKU_LF);
|
||||
echo "Indexer: finished".DOKU_LF;
|
||||
return true;
|
||||
}
|
||||
return $result;
|
||||
|
|
|
@ -386,7 +386,7 @@ function msg($message, $lvl = 0, $line = '', $file = '', $allow = MSG_PUBLIC)
|
|||
if (function_exists('html_msgarea')) {
|
||||
html_msgarea();
|
||||
} else {
|
||||
print "ERROR(".$msgdata['lvl'].") ".$msgdata['msg']."\n";
|
||||
echo "ERROR(".$msgdata['lvl'].") ".$msgdata['msg']."\n";
|
||||
}
|
||||
unset($GLOBALS['MSG']);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ function media_filesinuse($data, $id)
|
|||
} else $hidden++;
|
||||
}
|
||||
if ($hidden) {
|
||||
print '<div class="mediaref_hidden">'.$lang['ref_hidden'].'</div>';
|
||||
echo '<div class="mediaref_hidden">'.$lang['ref_hidden'].'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -879,7 +879,7 @@ function media_tab_files_options()
|
|||
$form->addHTML('</li>'.NL);
|
||||
$form->addHTML('</ul>'.NL);
|
||||
$form->addTagClose('div');
|
||||
print $form->toHTML();
|
||||
echo $form->toHTML();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1657,7 +1657,7 @@ function media_searchform($ns, $query = '', $fullscreen = false)
|
|||
$form->addButton('', $lang['btn_search'])->attr('type', 'submit');
|
||||
$form->addTagClose('p');
|
||||
$form->addTagClose('div');
|
||||
print $form->toHTML('SearchMedia');
|
||||
echo $form->toHTML('SearchMedia');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -459,7 +459,7 @@ function tpl_link($url, $name, $more = '', $return = false)
|
|||
if ($more) $out .= ' '.$more;
|
||||
$out .= ">$name</a>";
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ function tpl_pagelink($id, $name = null, $return = false)
|
|||
{
|
||||
$out = '<bdi>'.html_wikilink($id, $name).'</bdi>';
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -692,7 +692,7 @@ function tpl_action($type, $link = false, $wrapper = false, $return = false, $pr
|
|||
if ($out && $wrapper) $out = "<$wrapper>$out</$wrapper>";
|
||||
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return (bool) $out;
|
||||
}
|
||||
|
||||
|
@ -797,7 +797,7 @@ function tpl_breadcrumbs($sep = null, $return = false)
|
|||
if ($i == $last) $out .= '</span>';
|
||||
}
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return (bool) $out;
|
||||
}
|
||||
|
||||
|
@ -855,20 +855,20 @@ function tpl_youarehere($sep = null, $return = false)
|
|||
$page = (new PageResolver('root'))->resolveId($page);
|
||||
if ($page == $part . $parts[$i]) {
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$page = $part.$parts[$i];
|
||||
if ($page == $conf['start']) {
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return true;
|
||||
}
|
||||
$out .= $sep;
|
||||
$out .= tpl_pagelink($page, null, true);
|
||||
if ($return) return $out;
|
||||
print $out;
|
||||
echo $out;
|
||||
return (bool) $out;
|
||||
}
|
||||
|
||||
|
@ -889,7 +889,7 @@ function tpl_userinfo()
|
|||
global $INPUT;
|
||||
|
||||
if ($INPUT->server->str('REMOTE_USER')) {
|
||||
print $lang['loggedinas'].' '.userlink();
|
||||
echo $lang['loggedinas'].' '.userlink();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1034,7 +1034,7 @@ function tpl_pagetitle($id = null, $ret = false)
|
|||
if ($ret) {
|
||||
return hsc($page_title);
|
||||
} else {
|
||||
print hsc($page_title);
|
||||
echo hsc($page_title);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1220,9 +1220,9 @@ function _tpl_img_action($data)
|
|||
global $lang;
|
||||
$p = buildAttributes($data['params']);
|
||||
|
||||
if ($data['url']) print '<a href="'.hsc($data['url']).'" title="'.$lang['mediaview'].'">';
|
||||
print '<img '.$p.'/>';
|
||||
if ($data['url']) print '</a>';
|
||||
if ($data['url']) echo '<a href="'.hsc($data['url']).'" title="'.$lang['mediaview'].'">';
|
||||
echo '<img '.$p.'/>';
|
||||
if ($data['url']) echo '</a>';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1245,7 +1245,7 @@ function tpl_indexerWebBug()
|
|||
$p['height'] = 1;
|
||||
$p['alt'] = '';
|
||||
$att = buildAttributes($p);
|
||||
print "<img $att />";
|
||||
echo "<img $att />";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ function toolbar_JSdefines($varname)
|
|||
unset($evt);
|
||||
|
||||
// use JSON to build the JavaScript array
|
||||
print "var $varname = ".json_encode($menu, JSON_THROW_ON_ERROR).";\n";
|
||||
echo "var $varname = ".json_encode($menu, JSON_THROW_ON_ERROR).";\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -120,9 +120,9 @@ header('Content-Type: text/html; charset=utf-8');
|
|||
if (file_exists(DOKU_INC . 'inc/lang/' . $LC . '/install.html')) {
|
||||
include(DOKU_INC . 'inc/lang/' . $LC . '/install.html');
|
||||
} else {
|
||||
print "<div lang=\"en\" dir=\"ltr\">\n";
|
||||
echo "<div lang=\"en\" dir=\"ltr\">\n";
|
||||
include(DOKU_INC . 'inc/lang/en/install.html');
|
||||
print "</div>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
?>
|
||||
<a style="
|
||||
|
|
|
@ -145,26 +145,26 @@ function css_out()
|
|||
$cssData = $media_files[$mediatype];
|
||||
|
||||
// Print the styles.
|
||||
print NL;
|
||||
echo NL;
|
||||
if ($cssData['encapsulate'] === true) {
|
||||
print $cssData['encapsulationPrefix'] . ' {';
|
||||
echo $cssData['encapsulationPrefix'] . ' {';
|
||||
}
|
||||
print '/* START ' . $cssData['mediatype'] . ' styles */' . NL;
|
||||
echo '/* START ' . $cssData['mediatype'] . ' styles */' . NL;
|
||||
|
||||
// load files
|
||||
foreach ($cssData['files'] as $file => $location) {
|
||||
$display = str_replace(fullpath(DOKU_INC), '', fullpath($file));
|
||||
print "\n/* XXXXXXXXX $display XXXXXXXXX */\n";
|
||||
print css_loadfile($file, $location);
|
||||
echo "\n/* XXXXXXXXX $display XXXXXXXXX */\n";
|
||||
echo css_loadfile($file, $location);
|
||||
}
|
||||
|
||||
print NL;
|
||||
echo NL;
|
||||
if ($cssData['encapsulate'] === true) {
|
||||
print '} /* /@media ';
|
||||
echo '} /* /@media ';
|
||||
} else {
|
||||
print '/*';
|
||||
echo '/*';
|
||||
}
|
||||
print ' END ' . $cssData['mediatype'] . ' styles */' . NL;
|
||||
echo ' END ' . $cssData['mediatype'] . ' styles */' . NL;
|
||||
}
|
||||
|
||||
// end output buffering and get contents
|
||||
|
@ -321,10 +321,10 @@ function css_filewrapper($mediatype, $files = [])
|
|||
function css_defaultstyles()
|
||||
{
|
||||
// print the default classes for interwiki links and file downloads
|
||||
print '@media screen {';
|
||||
echo '@media screen {';
|
||||
css_interwiki();
|
||||
css_filetypes();
|
||||
print '}';
|
||||
echo '}';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -81,7 +81,7 @@ if ($evt->advise_before()) {
|
|||
}
|
||||
// die on errors
|
||||
if ($data['status'] > 203) {
|
||||
print $data['statusmessage'];
|
||||
echo $data['statusmessage'];
|
||||
if (defined('SIMPLE_TEST')) return;
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -98,17 +98,17 @@ function js_out()
|
|||
ob_start();
|
||||
|
||||
// add some global variables
|
||||
print "var DOKU_BASE = '" . DOKU_BASE . "';";
|
||||
print "var DOKU_TPL = '" . tpl_basedir($tpl) . "';";
|
||||
print "var DOKU_COOKIE_PARAM = " . json_encode([
|
||||
echo "var DOKU_BASE = '" . DOKU_BASE . "';";
|
||||
echo "var DOKU_TPL = '" . tpl_basedir($tpl) . "';";
|
||||
echo "var DOKU_COOKIE_PARAM = " . json_encode([
|
||||
'path' => empty($conf['cookiedir']) ? DOKU_REL : $conf['cookiedir'],
|
||||
'secure' => $conf['securecookie'] && is_ssl()
|
||||
], JSON_THROW_ON_ERROR) . ";";
|
||||
// FIXME: Move those to JSINFO
|
||||
print "Object.defineProperty(window, 'DOKU_UHN', { get: function() {" .
|
||||
echo "Object.defineProperty(window, 'DOKU_UHN', { get: function() {" .
|
||||
"console.warn('Using DOKU_UHN is deprecated. Please use JSINFO.useHeadingNavigation instead');" .
|
||||
"return JSINFO.useHeadingNavigation; } });";
|
||||
print "Object.defineProperty(window, 'DOKU_UHC', { get: function() {" .
|
||||
echo "Object.defineProperty(window, 'DOKU_UHC', { get: function() {" .
|
||||
"console.warn('Using DOKU_UHC is deprecated. Please use JSINFO.useHeadingContent instead');" .
|
||||
"return JSINFO.useHeadingContent; } });";
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ class admin_plugin_usermanager extends AdminPlugin
|
|||
global $ID;
|
||||
|
||||
if (is_null($this->auth)) {
|
||||
print $this->lang['badauth'];
|
||||
echo $this->lang['badauth'];
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -209,8 +209,8 @@ class admin_plugin_usermanager extends AdminPlugin
|
|||
$editable = $this->auth->canDo('UserMod');
|
||||
$export_label = empty($this->filter) ? $this->lang['export_all'] : $this->lang['export_filtered'];
|
||||
|
||||
print $this->locale_xhtml('intro');
|
||||
print $this->locale_xhtml('list');
|
||||
echo $this->locale_xhtml('intro');
|
||||
echo $this->locale_xhtml('list');
|
||||
|
||||
echo '<div id="user__manager">';
|
||||
echo '<div class="level2">';
|
||||
|
@ -321,7 +321,7 @@ class admin_plugin_usermanager extends AdminPlugin
|
|||
|
||||
if ($this->auth->canDo('addUser')) {
|
||||
echo '<div' . $style . '>';
|
||||
print $this->locale_xhtml('add');
|
||||
echo $this->locale_xhtml('add');
|
||||
echo '<div class="level2">';
|
||||
|
||||
$this->htmlUserForm('add', null, [], 4);
|
||||
|
@ -332,7 +332,7 @@ class admin_plugin_usermanager extends AdminPlugin
|
|||
|
||||
if ($this->edit_user && $this->auth->canDo('UserMod')) {
|
||||
echo '<div' . $style . ' id="scroll__here">';
|
||||
print $this->locale_xhtml('edit');
|
||||
echo $this->locale_xhtml('edit');
|
||||
echo '<div class="level2">';
|
||||
|
||||
$this->htmlUserForm('modify', $this->edit_user, $this->edit_userdata, 4);
|
||||
|
@ -586,7 +586,7 @@ class admin_plugin_usermanager extends AdminPlugin
|
|||
$failure_download_link = wl($ID, ['do' => 'admin', 'page' => 'usermanager', 'fn[importfails]' => 1]);
|
||||
|
||||
echo '<div class="level2 import_users">';
|
||||
print $this->locale_xhtml('import');
|
||||
echo $this->locale_xhtml('import');
|
||||
echo '<form action="' . wl($ID) . '" method="post" enctype="multipart/form-data">';
|
||||
formSecurityToken();
|
||||
echo '<label>' . $this->lang['import_userlistcsv'] . '<input type="file" name="import" /></label>';
|
||||
|
|
Loading…
Reference in New Issue