Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
PSDI Army
yii2
Commits
c9c7db9a
Commit
c9c7db9a
authored
Feb 18, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed several issues with apidoc generator
parent
9190e0f4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
5 deletions
+53
-5
caching.md
docs/guide/caching.md
+1
-1
RenderController.php
extensions/apidoc/commands/RenderController.php
+5
-0
composer.json
extensions/apidoc/composer.json
+2
-1
ApiMarkdown.php
extensions/apidoc/helpers/ApiMarkdown.php
+42
-0
main.php
extensions/apidoc/templates/bootstrap/layouts/main.php
+1
-1
BaseMarkdown.php
framework/helpers/BaseMarkdown.php
+2
-2
No files found.
docs/guide/caching.md
View file @
c9c7db9a
...
@@ -61,7 +61,7 @@ is a summary of the available cache components:
...
@@ -61,7 +61,7 @@ is a summary of the available cache components:
the fastest one when dealing with cache in a distributed applications (e.g. with several servers, load
the fastest one when dealing with cache in a distributed applications (e.g. with several servers, load
balancers, etc.)
balancers, etc.)
*
[
[\yii\
caching\Redis
Cache
]
]: implements a cache component based on
[
Redis
](
http://redis.io/
)
key-value store
*
[
[\yii\
redis\
Cache
]
]: implements a cache component based on
[
Redis
](
http://redis.io/
)
key-value store
(redis version 2.6.12 or higher is required).
(redis version 2.6.12 or higher is required).
*
[
[\yii\caching\WinCache
]
]: uses PHP
[
WinCache
](
http://iis.net/downloads/microsoft/wincache-extension
)
*
[
[\yii\caching\WinCache
]
]: uses PHP
[
WinCache
](
http://iis.net/downloads/microsoft/wincache-extension
)
...
...
extensions/apidoc/commands/RenderController.php
View file @
c9c7db9a
...
@@ -65,6 +65,11 @@ class RenderController extends Controller
...
@@ -65,6 +65,11 @@ class RenderController extends Controller
$this
->
stdout
(
'done.'
.
PHP_EOL
,
Console
::
FG_GREEN
);
$this
->
stdout
(
'done.'
.
PHP_EOL
,
Console
::
FG_GREEN
);
if
(
empty
(
$files
))
{
$this
->
stderr
(
'Error: No php files found to process.'
.
PHP_EOL
);
return
1
;
}
$context
=
new
Context
();
$context
=
new
Context
();
$cacheFile
=
$targetDir
.
'/cache/'
.
md5
(
serialize
(
$files
))
.
'.tmp'
;
$cacheFile
=
$targetDir
.
'/cache/'
.
md5
(
serialize
(
$files
))
.
'.tmp'
;
...
...
extensions/apidoc/composer.json
View file @
c9c7db9a
...
@@ -21,7 +21,8 @@
...
@@ -21,7 +21,8 @@
"require"
:
{
"require"
:
{
"yiisoft/yii2"
:
"*"
,
"yiisoft/yii2"
:
"*"
,
"yiisoft/yii2-bootstrap"
:
"*"
,
"yiisoft/yii2-bootstrap"
:
"*"
,
"phpdocumentor/reflection"
:
">=1.0.3"
"phpdocumentor/reflection"
:
">=1.0.3"
,
"nikic/php-parser"
:
"0.9.*"
},
},
"autoload"
:
{
"autoload"
:
{
"psr-4"
:
{
"yii
\\
apidoc
\\
"
:
""
}
"psr-4"
:
{
"yii
\\
apidoc
\\
"
:
""
}
...
...
extensions/apidoc/helpers/ApiMarkdown.php
View file @
c9c7db9a
...
@@ -30,6 +30,48 @@ class ApiMarkdown extends GithubMarkdown
...
@@ -30,6 +30,48 @@ class ApiMarkdown extends GithubMarkdown
protected
$context
;
protected
$context
;
/**
/**
* @inheritDoc
*/
protected
function
identifyLine
(
$lines
,
$current
)
{
if
(
strncmp
(
$lines
[
$current
],
'~~~'
,
3
)
===
0
)
{
return
'fencedCode'
;
}
return
parent
::
identifyLine
(
$lines
,
$current
);
}
/**
* Consume lines for a fenced code block
*/
protected
function
consumeFencedCode
(
$lines
,
$current
)
{
// consume until ```
$block
=
[
'type'
=>
'code'
,
'content'
=>
[],
];
$line
=
rtrim
(
$lines
[
$current
]);
if
(
strncmp
(
$lines
[
$current
],
'~~~'
,
3
)
===
0
)
{
$fence
=
'~~~'
;
$language
=
'php'
;
}
else
{
$fence
=
substr
(
$line
,
0
,
$pos
=
strrpos
(
$line
,
'`'
)
+
1
);
$language
=
substr
(
$line
,
$pos
);
}
if
(
!
empty
(
$language
))
{
$block
[
'language'
]
=
$language
;
}
for
(
$i
=
$current
+
1
,
$count
=
count
(
$lines
);
$i
<
$count
;
$i
++
)
{
if
(
rtrim
(
$line
=
$lines
[
$i
])
!==
$fence
)
{
$block
[
'content'
][]
=
$line
;
}
else
{
break
;
}
}
return
[
$block
,
$i
];
}
/**
* Renders a code block
* Renders a code block
*/
*/
protected
function
renderCode
(
$block
)
protected
function
renderCode
(
$block
)
...
...
extensions/apidoc/templates/bootstrap/layouts/main.php
View file @
c9c7db9a
...
@@ -31,7 +31,7 @@ $this->beginPage();
...
@@ -31,7 +31,7 @@ $this->beginPage();
'options'
=>
[
'options'
=>
[
'class'
=>
'navbar-inverse navbar-fixed-top'
,
'class'
=>
'navbar-inverse navbar-fixed-top'
,
],
],
'
padded
'
=>
false
,
'
renderInnerContainer
'
=>
false
,
'view'
=>
$this
,
'view'
=>
$this
,
]);
]);
$extItems
=
[];
$extItems
=
[];
...
...
framework/helpers/BaseMarkdown.php
View file @
c9c7db9a
...
@@ -57,7 +57,7 @@ class BaseMarkdown
...
@@ -57,7 +57,7 @@ class BaseMarkdown
public
static
function
process
(
$markdown
,
$flavor
=
'original'
)
public
static
function
process
(
$markdown
,
$flavor
=
'original'
)
{
{
$parser
=
static
::
getParser
(
$flavor
);
$parser
=
static
::
getParser
(
$flavor
);
return
$parser
->
parse
(
$
parser
);
return
$parser
->
parse
(
$
markdown
);
}
}
/**
/**
...
@@ -73,7 +73,7 @@ class BaseMarkdown
...
@@ -73,7 +73,7 @@ class BaseMarkdown
public
static
function
processParagraph
(
$markdown
,
$flavor
=
'original'
)
public
static
function
processParagraph
(
$markdown
,
$flavor
=
'original'
)
{
{
$parser
=
static
::
getParser
(
$flavor
);
$parser
=
static
::
getParser
(
$flavor
);
return
$parser
->
parseParagraph
(
$
parser
);
return
$parser
->
parseParagraph
(
$
markdown
);
}
}
/**
/**
...
...
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