forked from topdown/VVV-Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
203 lines (173 loc) · 6.09 KB
/
index.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php
$path = '..';
/**
* Create an array of the hosts from all of the VVV host files
*
* @author Jeff Behnke <[email protected]>
* @copyright (c) 2014 ValidWebs.com
*
* Created: 5/23/14, 12:57 PM
*
* @param $path
*
* @return array
*/
function getHosts( $path ) {
$array = array();
$depth = 2;
$ite = new RecursiveDirectoryIterator( $path, RecursiveDirectoryIterator::SKIP_DOTS );
$files = new RecursiveIteratorIterator( $ite );
$files->setMaxDepth( $depth );
// Loop through the file list and find what we want
foreach ( $files as $name => $object ) {
if ( strstr( $name, 'vvv-hosts' ) && !is_dir( 'vvv-hosts' ) ) {
$lines = file( $name );
// read through the lines in our host files
foreach ( $lines as $num => $line ) {
// skip comment lines
if ( !strstr( $line, '#' ) && trim( $line ) != 'vvv.dev' ) {
$array[] = trim( $line );
}
} // end foreach
}
} // end foreach
return $array;
}
$hosts = getHosts( $path );
?>
<!DOCTYPE html>
<html>
<head>
<title>Varying Vagrant Vagrants Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="./">Dashboard</a>
</div>
<ul class="nav navbar-nav">
<li><a href="database-admin/" target="_blank">phpMyAdmin</a></li>
<li><a href="memcached-admin/" target="_blank">phpMemcachedAdmin</a></li>
<li><a href="opcache-status/opcache.php" target="_blank">Opcache Status</a></li>
<li><a href="webgrind/" target="_blank">Webgrind</a></li>
<li><a href="phpinfo/" target="_blank">PHP Info</a></li>
</ul>
</div>
</div>
<div class="container-fluid">
<div class="col-sm-4 col-md-3 sidebar">
<p class="sidebar-title">References & Extras</p>
<ul class="nav">
<li><a target="_blank" href="https://github.com/aliso/vvv-site-wizard">VVV Site Wizard</a></li>
<li><a href="https://github.com/varying-vagrant-vagrants/vvv/" target="_blank">Varying Vagrant Vagrants</a></li>
<li><a href="https://github.com/topdown/VVV-Dashboard" target="_blank">VVV Dashboard Repo</a></li>
<li><a href="https://github.com/topdown/VVV-Dashboard/issues" target="_blank">VVV Dashboard Issues</a></li>
<li><a href="https://github.com/aubreypwd/wordpress-themereview-vvv" target="_blank">VVV WordPress ThemeReview</a></li>
</ul>
</div>
<div class="col-sm-8 col-sm-offset-4 col-md-9 col-md-offset-3 main">
<h1 class="page-header">VVV Dashboard</h1>
<div class="row">
<div class="col-sm-8 col-md-7">
<p><strong>Current Hosts</strong></p>
<small>Note: To profile, <code>xdebug_on</code> must be set.</small>
<ul class="list-unstyled sites">
<?php
foreach ( $hosts as $host ) {
echo '<li class="row">
<span class=" col-sm-7">' . $host . '</span>
<div class=" col-sm-5">
<a class="btn btn-primary btn-xs" href="http://' . $host . '/" target="_blank">Visit Site</a>
<a class="btn btn-warning btn-xs" href="http://' . $host . '/wp-admin" target="_blank">Admin/Login</a>
<a class="btn btn-success btn-xs" href="http://' . $host . '/?XDEBUG_PROFILE" target="_blank">Profiler</a>
</div>
</li>' . "\n";
} // end foreach
unset( $host ); ?>
</ul>
</div>
<div class="col-sm-8 col-md-4">
<p><strong>Useful Commands</strong></p>
<a href="https://github.com/varying-vagrant-vagrants/vvv/#now-what" target="_blank">Commands Link</a>
<br />
<ul class="list-unstyled">
<li><code>vagrant up</code></li>
<li><code>vagrant halt</code></li>
<li><code>vagrant ssh</code></li>
<li><code>vagrant suspend</code></li>
<li><code>vagrant resume</code></li>
<li><code>xdebug_on</code> <a href="https://github.com/Varying-Vagrant-Vagrants/VVV/wiki/Code-Debugging#turning-on-xdebug" target="_blank">Link</a></li>
</ul>
</div>
</div>
<h1>If Using <a href="https://github.com/aliso/vvv-site-wizard" target="_blank">VVV Site Wizard</a></h1>
<p>This bash script makes it easy to spin up a new WordPress site using
<a href="https://github.com/Varying-Vagrant-Vagrants/VVV">Varying Vagrant Vagrants</a>.</p>
<h2>Usage</h2>
<p>Type <code>vvv</code> in the command line to use. None of the options are required:
if a required piece of information is not included in the original command,
the wizard will prompt you for it.</p>
<pre><code>vvv -a list
vvv -a new -n mysite -d mysite.dev -v 3.9.1 -x
vvv -a delete mysite
</code></pre>
<h3>Options</h3>
<table class="table table-striped">
<thead>
<tr>
<th>Option</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>-a</code></td>
<td>action</td>
<td>
<code>new</code>/<code>create</code>/<code>make</code> runs the site creation wizard,
<br /><code>rm</code>/<code>delete</code>/<code>teardown</code> runs the site teardown wizard,
<br /><code>list</code> lists all current VVV sites
</td>
</tr>
<tr>
<td><code>-d</code></td>
<td>domain</td>
<td>Desired domain (e.g. mysite.dev)</td>
</tr>
<tr>
<td><code>-f</code></td>
<td>files only</td>
<td>Do not provision Vagrant, just create the site directory and files</td>
</tr>
<tr>
<td><code>-n</code></td>
<td>site name</td>
<td>Desired name for the site directory (e.g. mysite)</td>
</tr>
<tr>
<td><code>-p</code></td>
<td>path</td>
<td>Path to VVV root (e.g. ~/vagrant-local)</td>
</tr>
<tr>
<td><code>-v</code></td>
<td>version</td>
<td>Version of WordPress to install</td>
</tr>
<tr>
<td><code>-x</code></td>
<td>debug</td>
<td>Turn on WP_DEBUG and WP_DEBUG_LOG</td>
</tr>
</tbody>
</table>
<p><strong>NOTE: </strong>This Dashboard project has no affiliation with Varying Vagrant Vagrants or any other components listed here.</p>
</div>
</div>
</body>
</html>