FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-src/ext/spl/examples/tree.php at master · EndlessCoding/php-src · GitHub
EndlessCoding
/
php-src
Public
forked from
php/php-src
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
php-src
/
ext
/
spl
/
examples
/
tree.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
40 lines (30 loc) · 979 Bytes
Breadcrumbs
php-src
/
ext
/
spl
/
examples
/
tree.php
Copy path
File metadata and controls
executable file
·
40 lines (30 loc) · 979 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/** @file tree.php
* @brief Program Tree view example
* @ingroup Examples
* @author Marcus Boerger
* @date 2003 - 2005
*
* Usage: php tree.php \<path\>
*
* Simply specify the path to tree with parameter \<path\>.
*/
// The following line only operates on classes which are converted to c already.
// But does not generate a graphical output.
//foreach(new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($argv[1])), 1) as $file) {
if
(
$
argc
<
2
) {
echo
<<<EOF
Usage: php
$
{
_SERVER
[
'
PHP_SELF
'
]}
<path>
Displays a graphical tree for the given <path>.
<path> The directory for which to generate the tree graph.
EOF
;
exit
(
1
);
}
if
(!
class_exists
(
"
DirectoryTreeIterator
"
,
false
))
require_once
(
"
directorytreeiterator.inc
"
);
if
(!
class_exists
(
"
DirectoryGraphIterator
"
,
false
))
require_once
(
"
directorygraphiterator.inc
"
);
echo
$
argv
[
1
].
"\n"
;
foreach
(
new
DirectoryGraphIterator
(
$
argv
[
1
])
as
$
file
)
{
echo
$
file
.
"\n"
;
}
?>
Back
|
FazBrowse Home
|
New Git URL