Skip to content
Snippets Groups Projects
Commit 89167b55 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1152 from splitbrain/composer

Use composer to add 3rd party libs
parents 38175ed4 313d3e75
No related branches found
No related tags found
No related merge requests found
Showing
with 134 additions and 1662 deletions
......@@ -9,6 +9,8 @@
.gitignore export-ignore
.editorconfig export-ignore
.travis.yml export-ignore
composer.json export-ignore
composer.lock export-ignore
_test export-ignore
_cs export-ignore
lib/plugins/testing export-ignore
......@@ -56,3 +56,15 @@
!/lib/plugins/remote.php
!/lib/plugins/syntax.php
lib/images/*/local/*
# composer default ignores
composer.phar
vendor/bin/*
vendor/*/*/phpunit.xml
vendor/*/*/.travis.yml
vendor/*/*/bin/*
vendor/*/*/tests/*
vendor/*/*/test/*
vendor/*/*/doc/*
vendor/*/*/docs/*
vendor/*/*/contrib/*
<?php
class Tar_TestCase extends DokuWikiTest {
/**
* file extensions that several tests use
*/
protected $extensions = array('tar');
public function setUp() {
parent::setUp();
if (extension_loaded('zlib')) {
$this->extensions[] = 'tgz';
}
if (extension_loaded('bz2')) {
$this->extensions[] = 'tbz';
}
}
/*
* dependency for tests needing zlib extension to pass
*/
public function test_ext_zlib() {
if (!extension_loaded('zlib')) {
$this->markTestSkipped('skipping all zlib tests. Need zlib extension');
}
}
/*
* dependency for tests needing zlib extension to pass
*/
public function test_ext_bz2() {
if (!extension_loaded('bz2')) {
$this->markTestSkipped('skipping all bzip2 tests. Need bz2 extension');
}
}
/**
* simple test that checks that the given filenames and contents can be grepped from
* the uncompressed tar stream
*
* No check for format correctness
*/
public function test_createdynamic() {
$tar = new Tar();
$dir = dirname(__FILE__).'/tar';
$tdir = ltrim($dir,'/');
$tar->create();
$tar->AddFile("$dir/testdata1.txt");
$tar->AddFile("$dir/foobar/testdata2.txt", 'noway/testdata2.txt');
$tar->addData('another/testdata3.txt', 'testcontent3');
$data = $tar->getArchive();
$this->assertTrue(strpos($data, 'testcontent1') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
// fullpath might be too long to be stored as full path FS#2802
$this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR');
$this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
// fullpath might be too long to be stored as full path FS#2802
$this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
$this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
}
/**
* simple test that checks that the given filenames and contents can be grepped from the
* uncompressed tar file
*
* No check for format correctness
*/
public function test_createfile() {
$tar = new Tar();
$dir = dirname(__FILE__).'/tar';
$tdir = ltrim($dir,'/');
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$tar->create($tmp, Tar::COMPRESS_NONE);
$tar->AddFile("$dir/testdata1.txt");
$tar->AddFile("$dir/foobar/testdata2.txt", 'noway/testdata2.txt');
$tar->addData('another/testdata3.txt', 'testcontent3');
$tar->close();
$this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
$data = file_get_contents($tmp);
$this->assertTrue(strpos($data, 'testcontent1') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR');
$this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR');
// fullpath might be too long to be stored as full path FS#2802
$this->assertTrue(strpos($data, "$tdir") !== false, "Path in TAR '$tdir'");
$this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR');
$this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR');
$this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR');
// fullpath might be too long to be stored as full path FS#2802
$this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR');
$this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR');
$this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR');
@unlink($tmp);
}
/**
* List the contents of the prebuilt TAR files
*/
public function test_tarcontent() {
$dir = dirname(__FILE__).'/tar';
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$content = $tar->contents();
$this->assertCount(4, $content, "Contents of $file");
$this->assertEquals('tar/testdata1.txt', $content[1]['filename'], "Contents of $file");
$this->assertEquals(13, $content[1]['size'], "Contents of $file");
$this->assertEquals('tar/foobar/testdata2.txt', $content[3]['filename'], "Contents of $file");
$this->assertEquals(13, $content[1]['size'], "Contents of $file");
}
}
/**
* Extract the prebuilt tar files
*/
public function test_tarextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$tar->extract($out);
clearstatcache();
$this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
$this->assertFileExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/tar/foobar/testdata2.txt'), "Extracted $file");
TestUtils::rdelete($out);
}
}
/**
* Extract the prebuilt tar files with component stripping
*/
public function test_compstripextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$tar->extract($out, 1);
clearstatcache();
$this->assertFileExists($out.'/testdata1.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/testdata1.txt'), "Extracted $file");
$this->assertFileExists($out.'/foobar/testdata2.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/foobar/testdata2.txt'), "Extracted $file");
TestUtils::rdelete($out);
}
}
/**
* Extract the prebuilt tar files with prefix stripping
*/
public function test_prefixstripextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$tar->extract($out, 'tar/foobar/');
clearstatcache();
$this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
$this->assertFileExists($out.'/testdata2.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/testdata2.txt'), "Extracted $file");
TestUtils::rdelete($out);
}
}
/**
* Extract the prebuilt tar files with include regex
*/
public function test_includeextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$tar->extract($out, '', '', '/\/foobar\//');
clearstatcache();
$this->assertFileNotExists($out.'/tar/testdata1.txt', "Extracted $file");
$this->assertFileExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/tar/foobar/testdata2.txt'), "Extracted $file");
TestUtils::rdelete($out);
}
}
/**
* Extract the prebuilt tar files with exclude regex
*/
public function test_excludeextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach($this->extensions as $ext) {
$tar = new Tar();
$file = "$dir/test.$ext";
$tar->open($file);
$tar->extract($out, '', '/\/foobar\//');
clearstatcache();
$this->assertFileExists($out.'/tar/testdata1.txt', "Extracted $file");
$this->assertEquals(13, filesize($out.'/tar/testdata1.txt'), "Extracted $file");
$this->assertFileNotExists($out.'/tar/foobar/testdata2.txt', "Extracted $file");
TestUtils::rdelete($out);
}
}
/**
* Check the extension to compression guesser
*/
public function test_filetype() {
$tar = new Tar();
$this->assertEquals(Tar::COMPRESS_NONE, $tar->filetype('foo'));
$this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tgz'));
$this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tGZ'));
$this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tar.GZ'));
$this->assertEquals(Tar::COMPRESS_GZIP, $tar->filetype('foo.tar.gz'));
$this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tbz'));
$this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tBZ'));
$this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.BZ2'));
$this->assertEquals(Tar::COMPRESS_BZIP, $tar->filetype('foo.tar.bz2'));
}
/**
* @depends test_ext_zlib
*/
public function test_longpathextract() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
foreach(array('ustar', 'gnu') as $format) {
$tar = new Tar();
$tar->open("$dir/longpath-$format.tgz");
$tar->extract($out);
$this->assertFileExists($out.'/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890/test.txt');
TestUtils::rdelete($out);
}
}
// FS#1442
public function test_createlongfile() {
$tar = new Tar();
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$path = '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt';
$tar->create($tmp, Tar::COMPRESS_NONE);
$tar->addData($path, 'testcontent1');
$tar->close();
$this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
$data = file_get_contents($tmp);
// We should find the complete path and a longlink entry
$this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
$this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
$this->assertTrue(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
@unlink($tmp);
}
public function test_createlongpathustar() {
$tar = new Tar();
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$path = '';
for($i=0; $i<11; $i++) $path .= '1234567890/';
$path = rtrim($path,'/');
$tar->create($tmp, Tar::COMPRESS_NONE);
$tar->addData("$path/test.txt", 'testcontent1');
$tar->close();
$this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
$data = file_get_contents($tmp);
// We should find the path and filename separated, no longlink entry
$this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
$this->assertTrue(strpos($data, 'test.txt') !== false, 'filename in TAR');
$this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
$this->assertFalse(strpos($data, "$path/test.txt") !== false, 'full filename in TAR');
$this->assertFalse(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
@unlink($tmp);
}
public function test_createlongpathgnu() {
$tar = new Tar();
$tmp = tempnam(sys_get_temp_dir(), 'dwtartest');
$path = '';
for($i=0; $i<20; $i++) $path .= '1234567890/';
$path = rtrim($path,'/');
$tar->create($tmp, Tar::COMPRESS_NONE);
$tar->addData("$path/test.txt", 'testcontent1');
$tar->close();
$this->assertTrue(filesize($tmp) > 30); //arbitrary non-zero number
$data = file_get_contents($tmp);
// We should find the complete path/filename and a longlink entry
$this->assertTrue(strpos($data, 'testcontent1') !== false, 'content in TAR');
$this->assertTrue(strpos($data, 'test.txt') !== false, 'filename in TAR');
$this->assertTrue(strpos($data, $path) !== false, 'path in TAR');
$this->assertTrue(strpos($data, "$path/test.txt") !== false, 'full filename in TAR');
$this->assertTrue(strpos($data, '@LongLink') !== false, '@LongLink in TAR');
@unlink($tmp);
}
/**
* Extract a tarbomomb
* @depends test_ext_zlib
*/
public function test_tarbomb() {
$dir = dirname(__FILE__).'/tar';
$out = sys_get_temp_dir().'/dwtartest'.md5(time());
$tar = new Tar();
$tar->open("$dir/tarbomb.tgz");
$tar->extract($out);
clearstatcache();
$this->assertFileExists($out.'/AAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB.txt');
TestUtils::rdelete($out);
}
/**
* A single zero file should be just a header block + the footer
*/
public function test_zerofile(){
$dir = dirname(__FILE__).'/tar';
$tar = new Tar();
$tar->create();
$tar->addFile("$dir/zero.txt", 'zero.txt');
$file = $tar->getArchive(Tar::COMPRESS_NONE);
$this->assertEquals(512*3, strlen($file)); // 1 header block + 2 footer blocks
}
public function test_zerodata(){
$tar = new Tar();
$tar->create();
$tar->addData('zero.txt','');
$file = $tar->getArchive(Tar::COMPRESS_NONE);
$this->assertEquals(512*3, strlen($file)); // 1 header block + 2 footer blocks
}
/**
* A file of exactly one block should be just a header block + data block + the footer
*/
public function test_blockfile(){
$dir = dirname(__FILE__).'/tar';
$tar = new Tar();
$tar->create();
$tar->addFile("$dir/block.txt", 'block.txt');
$file = $tar->getArchive(Tar::COMPRESS_NONE);
$this->assertEquals(512*4, strlen($file)); // 1 header block + data block + 2 footer blocks
}
public function test_blockdata(){
$tar = new Tar();
$tar->create();
$tar->addData('block.txt', str_pad('', 512, 'x'));
$file = $tar->getArchive(Tar::COMPRESS_NONE);
$this->assertEquals(512*4, strlen($file)); // 1 header block + data block + 2 footer blocks
}
public function test_cleanPath(){
$tar = new Tar();
$tests = array (
'/foo/bar' => 'foo/bar',
'/foo/bar/' => 'foo/bar',
'foo//bar' => 'foo/bar',
'foo/0/bar' => 'foo/0/bar',
'foo/../bar' => 'bar',
'foo/bang/bang/../../bar' => 'foo/bar',
'foo/../../bar' => 'bar',
'foo/.././../bar' => 'bar',
);
foreach($tests as $in => $out){
$this->assertEquals($out, $tar->cleanPath($in), "Input: $in");
}
}
}
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\ No newline at end of file
testcontent2
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
testcontent1
{
"require": {
"splitbrain/php-archive": "~1.0",
"easybook/geshi": "~1.0"
}
}
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "23ee0dd06136e2301c930e75055300d5",
"packages": [
{
"name": "easybook/geshi",
"version": "v1.0.8.14",
"source": {
"type": "git",
"url": "https://github.com/easybook/geshi.git",
"reference": "af589a67bf308791bb13e54bddd9aa3544b7dff8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/easybook/geshi/zipball/af589a67bf308791bb13e54bddd9aa3544b7dff8",
"reference": "af589a67bf308791bb13e54bddd9aa3544b7dff8",
"shasum": ""
},
"require": {
"php": ">4.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"./"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0"
],
"authors": [
{
"name": "Nigel McNie",
"email": "nigel@geshi.org"
},
{
"name": "Benny Baumann",
"email": "BenBE@geshi.org"
}
],
"description": "GeSHi - Generic Syntax Highlighter. This is an unmodified port of GeSHi project code found on SourceForge.",
"homepage": "http://qbnz.com/highlighter",
"keywords": [
"highlight",
"highlighter",
"syntax"
],
"time": "2015-04-15 13:21:45"
},
{
"name": "splitbrain/php-archive",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/splitbrain/php-archive.git",
"reference": "a0fbfc2f85ed491f3d2af42cff48a9cb783a8549"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/splitbrain/php-archive/zipball/a0fbfc2f85ed491f3d2af42cff48a9cb783a8549",
"reference": "a0fbfc2f85ed491f3d2af42cff48a9cb783a8549",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.5.*"
},
"type": "library",
"autoload": {
"psr-4": {
"splitbrain\\PHPArchive\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Andreas Gohr",
"email": "andi@splitbrain.org"
}
],
"description": "Pure-PHP implementation to read and write TAR and ZIP archives",
"keywords": [
"archive",
"extract",
"tar",
"unpack",
"unzip",
"zip"
],
"time": "2015-02-25 20:15:02"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
This diff is collapsed.
<?php
/*************************************************************************************
* cobol.php
* ----------
* Author: BenBE (BenBE@omorphia.org)
* Copyright: (c) 2007-2008 BenBE (http://www.omorphia.de/)
* Release Version: 1.0.8.11
* Date Started: 2007/07/02
*
* COBOL language file for GeSHi.
*
* CHANGES
* -------
*
* TODO (updated 2007/07/02)
* -------------------------
*
*************************************************************************************
*
* This file is part of GeSHi.
*
* GeSHi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GeSHi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GeSHi; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
************************************************************************************/
$language_data = array (
'LANG_NAME' => 'COBOL',
'COMMENT_SINGLE' => array(),
'COMMENT_MULTI' => array(),
'COMMENT_REGEXP' => array(1 => '/^\*.*?$/m'),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array('"', "'"),
'ESCAPE_CHAR' => '\\',
'NUMBERS' =>
GESHI_NUMBER_INT_BASIC |
GESHI_NUMBER_FLT_NONSCI |
GESHI_NUMBER_FLT_SCI_SHORT |
GESHI_NUMBER_FLT_SCI_ZERO,
'KEYWORDS' => array(
1 => array( //Compiler Directives
'ANSI', 'BLANK', 'NOBLANK', 'CALL-SHARED', 'CANCEL', 'NOCANCEL',
'CHECK', 'CODE', 'NOCODE', 'COLUMNS', 'COMPACT', 'NOCOMPACT',
'COMPILE', 'CONSULT', 'NOCONSULT', 'CROSSREF', 'NOCROSSREF',
'DIAGNOSE-74', 'NODIAGNOSE-74', 'DIAGNOSE-85', 'NODIAGNOSE-85',
'DIAGNOSEALL', 'NODIAGNOSEALL', 'ENDIF', 'ENDUNIT', 'ENV',
'ERRORFILE', 'ERRORS', 'FIPS', 'NOFIPS', 'FMAP', 'HEADING', 'HEAP',
'HIGHPIN', 'HIGHREQUESTERS', 'ICODE', 'NOICODE', 'IF', 'IFNOT',
'INNERLIST', 'NOINNERLIST', 'INSPECT', 'NOINSPECT', 'LARGEDATA',
'LD', 'LESS-CODE', 'LIBRARY', 'LINES', 'LIST', 'NOLIST', 'LMAP',
'NOLMAP', 'MAIN', 'MAP', 'NOMAP', 'NLD', 'NONSTOP', 'NON-SHARED',
'OPTIMIZE', 'PERFORM-TRACE', 'PORT', 'NOPORT', 'RESETTOG',
'RUNNABLE', 'RUNNAMED', 'SAVE', 'SAVEABEND', 'NOSAVEABEND',
'SEARCH', 'NOSEARCH', 'SECTION', 'SETTOG', 'SHARED', 'SHOWCOPY',
'NOSHOWCOPY', 'SHOWFILE', 'NOSHOWFILE', 'SOURCE', 'SQL', 'NOSQL',
'SQLMEM', 'SUBSET', 'SUBTYPE', 'SUPPRESS', 'NOSUPPRESS', 'SYMBOLS',
'NOSYMBOLS', 'SYNTAX', 'TANDEM', 'TRAP2', 'NOTRAP2', 'TRAP2-74',
'NOTRAP2-74', 'UL', 'WARN', 'NOWARN'
),
2 => array( //Statement Keywords
'ACCEPT', 'ADD', 'TO', 'GIVING', 'CORRESPONDING', 'ALTER', 'CALL',
'CHECKPOINT', 'CLOSE', 'COMPUTE', 'CONTINUE', 'COPY',
'DELETE', 'DISPLAY', 'DIVIDE', 'INTO', 'REMAINDER', 'ENTER',
'COBOL', 'EVALUATE', 'EXIT', 'GO', 'INITIALIZE',
'TALLYING', 'REPLACING', 'CONVERTING', 'LOCKFILE', 'MERGE', 'MOVE',
'MULTIPLY', 'OPEN', 'PERFORM', 'TIMES',
'UNTIL', 'VARYING', 'RETURN',
),
3 => array( //Reserved in some contexts
'ACCESS', 'ADDRESS', 'ADVANCING', 'AFTER', 'ALL',
'ALPHABET', 'ALPHABETIC', 'ALPHABETIC-LOWER', 'ALPHABETIC-UPPER',
'ALPHANUMERIC', 'ALPHANUMERIC-EDITED', 'ALSO', 'ALTERNATE',
'AND', 'ANY', 'APPROXIMATE', 'AREA', 'AREAS', 'ASCENDING', 'ASSIGN',
'AT', 'AUTHOR', 'BEFORE', 'BINARY', 'BLOCK', 'BOTTOM', 'BY',
'CD', 'CF', 'CH', 'CHARACTER', 'CHARACTERS',
'CHARACTER-SET', 'CLASS', 'CLOCK-UNITS',
'CODE-SET', 'COLLATING', 'COLUMN', 'COMMA',
'COMMON', 'COMMUNICATION', 'COMP', 'COMP-3', 'COMP-5',
'COMPUTATIONAL', 'COMPUTATIONAL-3', 'COMPUTATIONAL-5',
'CONFIGURATION', 'CONTAINS', 'CONTENT', 'CONTROL',
'CONTROLS', 'CORR', 'COUNT',
'CURRENCY', 'DATA', 'DATE', 'DATE-COMPILED', 'DATE-WRITTEN', 'DAY',
'DAY-OF-WEEK', 'DE', 'DEBUG-CONTENTS', 'DEBUG-ITEM', 'DEBUG-LINE',
'DEBUG-SUB-2', 'DEBUG-SUB-3', 'DEBUGGING', 'DECIMAL-POINT',
'DECLARATIVES', 'DEBUG-NAME', 'DEBUG-SUB-1', 'DELIMITED',
'DELIMITER', 'DEPENDING', 'DESCENDING', 'DESTINATION', 'DETAIL',
'DISABLE', 'DIVISION', 'DOWN', 'DUPLICATES',
'DYNAMIC', 'EGI', 'ELSE', 'EMI', 'ENABLE', 'END', 'END-ADD',
'END-COMPUTE', 'END-DELETE', 'END-DIVIDE', 'END-EVALUATE', 'END-IF',
'END-MULTIPLY', 'END-OF-PAGE', 'END-PERFORM', 'END-READ',
'END-RECEIVE', 'END-RETURN', 'END-REWRITE', 'END-SEARCH',
'END-START', 'END-STRING', 'END-SUBTRACT', 'END-UNSTRING',
'END-WRITE', 'EOP', 'EQUAL', 'ERROR', 'ESI',
'EVERY', 'EXCEPTION', 'EXCLUSIVE', 'EXTEND',
'EXTENDED-STORAGE', 'EXTERNAL', 'FALSE', 'FD', 'FILE',
'FILE-CONTROL', 'FILLER', 'FINAL', 'FIRST', 'FOOTING', 'FOR',
'FROM', 'FUNCTION', 'GENERATE', 'GENERIC', 'GLOBAL',
'GREATER', 'GROUP', 'GUARDIAN-ERR', 'HIGH-VALUE',
'HIGH-VALUES', 'I-O', 'I-O-CONTROL', 'IDENTIFICATION', 'IN',
'INDEX', 'INDEXED', 'INDICATE', 'INITIAL', 'INITIATE',
'INPUT', 'INPUT-OUTPUT', 'INSTALLATION',
'INVALID', 'IS', 'JUST', 'JUSTIFIED', 'KEY', 'LABEL', 'LAST',
'LEADING', 'LEFT', 'LESS', 'LIMIT', 'LIMITS', 'LINAGE',
'LINAGE-COUNTER', 'LINE', 'LINE-COUNTER', 'LINKAGE', 'LOCK',
'LOW-VALUE', 'LOW-VALUES', 'MEMORY', 'MESSAGE',
'MODE', 'MODULES', 'MULTIPLE', 'NATIVE',
'NEGATIVE', 'NEXT', 'NO', 'NOT', 'NULL', 'NULLS', 'NUMBER',
'NUMERIC', 'NUMERIC-EDITED', 'OBJECT-COMPUTER', 'OCCURS', 'OF',
'OFF', 'OMITTED', 'ON', 'OPTIONAL', 'OR', 'ORDER',
'ORGANIZATION', 'OTHER', 'OUTPUT', 'OVERFLOW', 'PACKED-DECIMAL',
'PADDING', 'PAGE', 'PAGE-COUNTER', 'PF', 'PH', 'PIC',
'PICTURE', 'PLUS', 'POINTER', 'POSITION', 'POSITIVE', 'PRINTING',
'PROCEDURE', 'PROCEDURES', 'PROCEED', 'PROGRAM', 'PROGRAM-ID',
'PROGRAM-STATUS', 'PROGRAM-STATUS-1', 'PROGRAM-STATUS-2', 'PROMPT',
'PROTECTED', 'PURGE', 'QUEUE', 'QUOTE', 'QUOTES', 'RD',
'RECEIVE', 'RECEIVE-CONTROL', 'RECORD', 'RECORDS',
'REDEFINES', 'REEL', 'REFERENCE', 'REFERENCES', 'RELATIVE',
'REMOVAL', 'RENAMES', 'REPLACE',
'REPLY', 'REPORT', 'REPORTING', 'REPORTS', 'RERUN',
'RESERVE', 'RESET', 'REVERSED', 'REWIND', 'REWRITE', 'RF',
'RH', 'RIGHT', 'ROUNDED', 'RUN', 'SAME', 'SD',
'SECURITY', 'SEGMENT', 'SEGMENT-LIMIT', 'SELECT', 'SEND',
'SENTENCE', 'SEPARATE', 'SEQUENCE', 'SEQUENTIAL', 'SET',
'SIGN', 'SIZE', 'SORT', 'SORT-MERGE', 'SOURCE-COMPUTER',
'SPACE', 'SPACES', 'SPECIAL-NAMES', 'STANDARD', 'STANDARD-1',
'STANDARD-2', 'START', 'STARTBACKUP', 'STATUS', 'STOP', 'STRING',
'SUB-QUEUE-1', 'SUB-QUEUE-2', 'SUB-QUEUE-3', 'SUBTRACT',
'SYMBOLIC', 'SYNC', 'SYNCDEPTH', 'SYNCHRONIZED',
'TABLE', 'TAL', 'TAPE', 'TERMINAL', 'TERMINATE', 'TEST',
'TEXT', 'THAN', 'THEN', 'THROUGH', 'THRU', 'TIME',
'TOP', 'TRAILING', 'TRUE', 'TYPE', 'UNIT', 'UNLOCK', 'UNLOCKFILE',
'UNLOCKRECORD', 'UNSTRING', 'UP', 'UPON', 'USAGE', 'USE',
'USING', 'VALUE', 'VALUES', 'WHEN', 'WITH', 'WORDS',
'WORKING-STORAGE', 'WRITE', 'ZERO', 'ZEROES'
),
4 => array( //Standard functions
'ACOS', 'ANNUITY', 'ASIN', 'ATAN', 'CHAR', 'COS', 'CURRENT-DATE',
'DATE-OF-INTEGER', 'DAY-OF-INTEGER', 'FACTORIAL', 'INTEGER',
'INTEGER-OF-DATE', 'INTEGER-OF-DAY', 'INTEGER-PART', 'LENGTH',
'LOG', 'LOG10', 'LOWER-CASE', 'MAX', 'MEAN', 'MEDIAN', 'MIDRANGE',
'MIN', 'MOD', 'NUMVAL', 'NUMVAL-C', 'ORD', 'ORD-MAX', 'ORD-MIN',
'PRESENT-VALUE', 'RANDOM', 'RANGE', 'REM', 'REVERSE', 'SIN', 'SQRT',
'STANDARD-DEVIATION', 'SUM', 'TAN', 'UPPER-CASE', 'VARIANCE',
'WHEN-COMPILED'
),
5 => array( //Privileged Built-in Functions
'#IN', '#OUT', '#TERM', '#TEMP', '#DYNAMIC', 'COBOL85^ARMTRAP',
'COBOL85^COMPLETION', 'COBOL_COMPLETION_', 'COBOL_CONTROL_',
'COBOL_GETENV_', 'COBOL_PUTENV_', 'COBOL85^RETURN^SORT^ERRORS',
'COBOL_RETURN_SORT_ERRORS_', 'COBOL85^REWIND^SEQUENTIAL',
'COBOL_REWIND_SEQUENTIAL_', 'COBOL85^SET^SORT^PARAM^TEXT',
'COBOL_SET_SORT_PARAM_TEXT_', 'COBOL85^SET^SORT^PARAM^VALUE',
'COBOL_SET_SORT_PARAM_VALUE_', 'COBOL_SET_MAX_RECORD_',
'COBOL_SETMODE_', 'COBOL85^SPECIAL^OPEN', 'COBOL_SPECIAL_OPEN_',
'COBOLASSIGN', 'COBOL_ASSIGN_', 'COBOLFILEINFO', 'COBOL_FILE_INFO_',
'COBOLSPOOLOPEN', 'CREATEPROCESS', 'ALTERPARAMTEXT',
'CHECKLOGICALNAME', 'CHECKMESSAGE', 'DELETEASSIGN', 'DELETEPARAM',
'DELETESTARTUP', 'GETASSIGNTEXT', 'GETASSIGNVALUE', 'GETBACKUPCPU',
'GETPARAMTEXT', 'GETSTARTUPTEXT', 'PUTASSIGNTEXT', 'PUTASSIGNVALUE',
'PUTPARAMTEXT', 'PUTSTARTUPTEXT'
)
),
'SYMBOLS' => array(
//Avoid having - in identifiers marked as symbols
' + ', ' - ', ' * ', ' / ', ' ** ',
'.', ',',
'=',
'(', ')', '[', ']'
),
'CASE_SENSITIVE' => array(
GESHI_COMMENTS => false,
1 => false,
2 => false,
3 => false,
4 => false,
5 => false
),
'STYLES' => array(
'KEYWORDS' => array(
1 => 'color: #000080; font-weight: bold;',
2 => 'color: #000000; font-weight: bold;',
3 => 'color: #008000; font-weight: bold;',
4 => 'color: #000080;',
5 => 'color: #008000;',
),
'COMMENTS' => array(
1 => 'color: #a0a0a0; font-style: italic;',
'MULTI' => 'color: #a0a0a0; font-style: italic;'
),
'ESCAPE_CHAR' => array(
0 => 'color: #000099; font-weight: bold;'
),
'BRACKETS' => array(
0 => 'color: #339933;'
),
'STRINGS' => array(
0 => 'color: #ff0000;'
),
'NUMBERS' => array(
0 => 'color: #993399;'
),
'METHODS' => array(
1 => 'color: #202020;'
),
'SYMBOLS' => array(
0 => 'color: #000066;'
),
'REGEXPS' => array(
),
'SCRIPT' => array(
)
),
'URLS' => array(
1 => '',
2 => '',
3 => '',
4 => '',
5 => ''
),
'OOLANG' => false,
'OBJECT_SPLITTERS' => array(
),
'REGEXPS' => array(
),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array(
),
'HIGHLIGHT_STRICT_BLOCK' => array(
),
'TAB_WIDTH' => 4
);
?>
......@@ -191,6 +191,7 @@ global $plugin_controller_class, $plugin_controller;
if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Controller';
// load libraries
require_once(DOKU_INC.'vendor/autoload.php');
require_once(DOKU_INC.'inc/load.php');
// disable gzip if not available
......
......@@ -70,7 +70,6 @@ function load_autoload($name){
'IXR_Client' => DOKU_INC.'inc/IXR_Library.php',
'IXR_IntrospectionServer' => DOKU_INC.'inc/IXR_Library.php',
'Doku_Plugin_Controller'=> DOKU_INC.'inc/plugincontroller.class.php',
'GeSHi' => DOKU_INC.'inc/geshi.php',
'Tar' => DOKU_INC.'inc/Tar.class.php',
'TarLib' => DOKU_INC.'inc/TarLib.class.php',
'ZipLib' => DOKU_INC.'inc/ZipLib.class.php',
......
......@@ -746,14 +746,13 @@ function p_xhtml_cached_geshi($code, $language, $wrapper='pre') {
$cache = getCacheName($language.$code,".code");
$ctime = @filemtime($cache);
if($ctime && !$INPUT->bool('purge') &&
$ctime > filemtime(DOKU_INC.'inc/geshi.php') && // geshi changed
$ctime > @filemtime(DOKU_INC.'inc/geshi/'.$language.'.php') && // language syntax definition changed
$ctime > filemtime(DOKU_INC.'vendor/composer/installed.json') && // libraries changed
$ctime > filemtime(reset($config_cascade['main']['default']))){ // dokuwiki changed
$highlighted_code = io_readFile($cache, false);
} else {
$geshi = new GeSHi($code, $language, DOKU_INC . 'inc/geshi');
$geshi = new GeSHi($code, $language);
$geshi->set_encoding('utf-8');
$geshi->enable_classes();
$geshi->set_header_type(GESHI_HEADER_PRE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment