Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
d1cea9f9
Commit
d1cea9f9
authored
Feb 23, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
01bbb87c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
18 deletions
+25
-18
Wiki.php
vendor/Text/Wiki.php
+9
-9
Code.php
vendor/Text/Wiki/Parse/Default/Code.php
+1
-1
Code.php
vendor/Text/Wiki/Render/Xhtml/Code.php
+15
-8
No files found.
vendor/Text/Wiki.php
View file @
d1cea9f9
...
...
@@ -408,15 +408,15 @@ class Text_Wiki {
* in further calls it will be effectively ignored.
* @return &object a reference to the Text_Wiki unique instantiation.
*/
function
&
singleton
(
$parser
=
'Default'
,
$rules
=
null
)
function
singleton
(
$parser
=
'Default'
,
$rules
=
null
)
{
static
$only
=
array
();
if
(
!
isset
(
$only
[
$parser
]))
{
$ret
=
&
Text_Wiki
::
factory
(
$parser
,
$rules
);
$ret
=
Text_Wiki
::
factory
(
$parser
,
$rules
);
if
(
Text_Wiki
::
isError
(
$ret
))
{
return
$ret
;
}
$only
[
$parser
]
=
&
$ret
;
$only
[
$parser
]
=
$ret
;
}
return
$only
[
$parser
];
}
...
...
@@ -432,7 +432,7 @@ class Text_Wiki {
* {@see Text_Wiki::singleton} for a list of rules
* @return Text_Wiki a Parser object extended from Text_Wiki
*/
function
&
factory
(
$parser
=
'Default'
,
$rules
=
null
)
function
factory
(
$parser
=
'Default'
,
$rules
=
null
)
{
$class
=
'Text_Wiki_'
.
$parser
;
$file
=
str_replace
(
'_'
,
'/'
,
$class
)
.
'.php'
;
...
...
@@ -445,7 +445,7 @@ class Text_Wiki {
}
}
$obj
=
&
new
$class
(
$rules
);
$obj
=
new
$class
(
$rules
);
return
$obj
;
}
...
...
@@ -920,7 +920,7 @@ class Text_Wiki {
// load may have failed; only parse if
// an object is in the array now
if
(
is_object
(
$this
->
parseObj
[
$name
]))
{
if
(
is
set
(
$this
->
parseObj
[
$name
])
&&
is
_object
(
$this
->
parseObj
[
$name
]))
{
$this
->
parseObj
[
$name
]
->
parse
();
}
}
...
...
@@ -1222,7 +1222,7 @@ class Text_Wiki {
}
}
$this
->
parseObj
[
$rule
]
=
&
new
$class
(
$this
);
$this
->
parseObj
[
$rule
]
=
new
$class
(
$this
);
}
...
...
@@ -1258,7 +1258,7 @@ class Text_Wiki {
}
}
$this
->
renderObj
[
$rule
]
=
&
new
$class
(
$this
);
$this
->
renderObj
[
$rule
]
=
new
$class
(
$this
);
}
...
...
@@ -1291,7 +1291,7 @@ class Text_Wiki {
}
}
$this
->
formatObj
[
$format
]
=
&
new
$class
(
$this
);
$this
->
formatObj
[
$format
]
=
new
$class
(
$this
);
}
...
...
vendor/Text/Wiki/Parse/Default/Code.php
View file @
d1cea9f9
vendor/Text/Wiki/Render/Xhtml/Code.php
View file @
d1cea9f9
...
...
@@ -58,35 +58,39 @@ class Text_Wiki_Render_Xhtml_Code extends Text_Wiki_Render {
$css_html
=
$this
->
formatConf
(
' class="%s"'
,
'css_html'
);
$css_filename
=
$this
->
formatConf
(
' class="%s"'
,
'css_filename'
);
if
(
$type
==
'php'
)
{
if
(
$type
==
'php'
||
true
)
{
if
(
substr
(
$options
[
'text'
],
0
,
5
)
!=
'<?php'
)
{
// PHP code example:
// add the PHP tags
$text
=
"<?php
\n
"
.
$options
[
'text'
]
.
"
\n
?>"
;
// <?php
$text
=
"<?php
"
.
$options
[
'text'
]
.
"
\n
?>"
;
// <?php
}
// convert tabs to four spaces
$text
=
str_replace
(
"
\t
"
,
"
"
,
$text
);
$text
=
str_replace
(
"
\t
"
,
"
%nbsp;
"
,
$text
);
// colorize the code block (also converts HTML entities and adds
// <code>...</code> tags)
ob_start
();
highlight_string
(
$text
);
$text
=
ob_get_contents
();
ob_end_clean
();
$h
=
new
PHP_Highlight
;
$h
->
loadString
(
$text
);
$text
=
$h
->
toHtml
(
true
);
// replace <br /> tags with simple newlines.
// replace non-breaking space with simple spaces.
// translate HTML <font> and color to XHTML <span> and style.
// courtesy of research by A. Kalin :-).
/**
$map = array(
'<br />' => "\n",
' ' => ' ',
"\n" => "<br \>",
'<font' => '<span',
'</font>' => '</span>',
'color="' => 'style="color:'
);
$text = strtr($text, $map);
*/
// get rid of the last newline inside the code block
// (becuase higlight_string puts one there)
...
...
@@ -100,7 +104,10 @@ class Text_Wiki_Render_Xhtml_Code extends Text_Wiki_Render {
}
// done
$text
=
"<pre
$css
>
$text
</pre>"
;
$text
=
"<table border=1 class='dashed' cellpadding=0 cellspacing=0>
<tr><td><b>
$text
</b></td></tr>
</table>"
;
}
elseif
(
$type
==
'html'
||
$type
==
'xhtml'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment