Skip to content

Commit 0e5ecc8

Browse files
committed
Add necessary vendor/easybook to the package
1 parent 22662d2 commit 0e5ecc8

File tree

322 files changed

+92340
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+92340
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
!/vendor
2+
/vendor/*
3+
!/vendor/easybook

vendor/easybook/geshi/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GeSHi - Generic Syntax Highlighter #
2+
3+
This repository has been created just to be able to install GeSHi as a Composer
4+
package. Technically it's a port of the GeSHi project code found on SourceForge:
5+
http://sourceforge.net/projects/geshi/
6+
7+
Differences from the official SourceForge repository:
8+
9+
* 3/mar/2016: removed the closing `?>` tag from PHP files.
10+
* 11/may/2014: added `sass.php` file to highlight Sass stylesheets.
11+
* 28/sep/2012: added `twig.php` file to highlight Twig templates.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "easybook/geshi",
3+
"type": "library",
4+
"description": "GeSHi - Generic Syntax Highlighter. This is an unmodified port of GeSHi project code found on SourceForge.",
5+
"homepage": "http://qbnz.com/highlighter",
6+
"keywords": ["highlighter", "highlight", "syntax"],
7+
"license": "GPL-2.0",
8+
"authors": [
9+
{
10+
"name": "Benny Baumann",
11+
"email": "BenBE@geshi.org"
12+
},
13+
{
14+
"name": "Nigel McNie",
15+
"email": "nigel@geshi.org"
16+
}
17+
],
18+
"require": {
19+
"php": ">=5.0"
20+
},
21+
"autoload": {
22+
"classmap": ["./"]
23+
}
24+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<?php
2+
3+
/**
4+
* Another GeSHi example script
5+
*
6+
* Configure your Apache server with 'AcceptPathInfo true' and something like
7+
* 'Alias /viewmysource /var/www/geshi/contrib/aliased.php'. Don't forget
8+
* to protect this alias as necessary.
9+
*
10+
* Usage - visit /viewmysource/file.name.ext to see that file with syntax
11+
* highlighting, where "viewmysource" is the name of the alias you set up.
12+
* You can use this without an alias too, just by visiting
13+
* aliased.php/file.name.ext.
14+
*
15+
* @author Ross Golder <ross@golder.org>
16+
* @version $Id: aliased.php 2533 2012-08-15 18:49:04Z benbe $
17+
*/
18+
19+
// Your config here
20+
define("SOURCE_ROOT", "/var/www/your/source/root/");
21+
22+
// Assume you've put geshi in the include_path already
23+
require_once("geshi.php");
24+
25+
// Get path info
26+
$path = SOURCE_ROOT.$_SERVER['PATH_INFO'];
27+
28+
// Check for dickheads trying to use '../' to get to sensitive areas
29+
$base_path_len = strlen(SOURCE_ROOT);
30+
$real_path = realpath($path);
31+
if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) {
32+
exit("Access outside acceptable path.");
33+
}
34+
35+
// Check file exists
36+
if(!file_exists($path)) {
37+
exit("File not found ($path).");
38+
}
39+
40+
// Prepare GeSHi instance
41+
$geshi = new GeSHi();
42+
$geshi->set_language('text');
43+
$geshi->load_from_file($path);
44+
$geshi->set_header_type(GESHI_HEADER_PRE);
45+
$geshi->enable_classes();
46+
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
47+
$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
48+
$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true);
49+
$geshi->set_code_style('color: #000020;', 'color: #000020;');
50+
$geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
51+
$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
52+
$geshi->set_header_content('Source code viewer - ' . $path . ' - ' . $geshi->get_language_name());
53+
$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
54+
$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>');
55+
$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
56+
57+
?>
58+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
59+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
60+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
61+
<head>
62+
<title>Source code viewer - <?php echo $path; ?> - <?php $geshi->get_language_name(); ?></title>
63+
<style type="text/css">
64+
<!--
65+
<?php
66+
// Output the stylesheet. Note it doesn't output the <style> tag
67+
echo $geshi->get_stylesheet();
68+
?>
69+
html {
70+
background-color: #f0f0f0;
71+
}
72+
body {
73+
font-family: Verdana, Arial, sans-serif;
74+
margin: 10px;
75+
border: 2px solid #e0e0e0;
76+
background-color: #fcfcfc;
77+
padding: 5px;
78+
}
79+
h2 {
80+
margin: .1em 0 .2em .5em;
81+
border-bottom: 1px solid #b0b0b0;
82+
color: #b0b0b0;
83+
font-weight: normal;
84+
font-size: 150%;
85+
}
86+
h3 {
87+
margin: .1em 0 .2em .5em;
88+
color: #b0b0b0;
89+
font-weight: normal;
90+
font-size: 120%;
91+
}
92+
#footer {
93+
text-align: center;
94+
font-size: 80%;
95+
color: #a9a9a9;
96+
}
97+
#footer a {
98+
color: #9999ff;
99+
}
100+
textarea {
101+
border: 1px solid #b0b0b0;
102+
font-size: 90%;
103+
color: #333;
104+
margin-left: 20px;
105+
}
106+
select, input {
107+
margin-left: 20px;
108+
}
109+
p {
110+
font-size: 90%;
111+
margin-left: .5em;
112+
}
113+
-->
114+
</style>
115+
</head>
116+
<body>
117+
<?php
118+
// The fun part :)
119+
echo $geshi->parse_code();
120+
?>
121+
<hr/>
122+
</body>
123+
</html>

0 commit comments

Comments
 (0)