|
@@ -23,10 +23,12 @@ class Project
|
|
$host = DEVER_APP_HOST;
|
|
$host = DEVER_APP_HOST;
|
|
if (strpos($host, '/src/' . DEVER_APP_NAME)) {
|
|
if (strpos($host, '/src/' . DEVER_APP_NAME)) {
|
|
$host = explode('/src/' . DEVER_APP_NAME, $host)[0] . '/';
|
|
$host = explode('/src/' . DEVER_APP_NAME, $host)[0] . '/';
|
|
- } elseif (strpos($host, '/package/' . DEVER_APP_NAME)) {
|
|
+ } elseif (strpos($host, '/app/' . DEVER_APP_NAME)) {
|
|
|
|
+ $host = explode('/app/' . DEVER_APP_NAME, $host)[0] . '/';
|
|
|
|
+ }elseif (strpos($host, '/package/' . DEVER_APP_NAME)) {
|
|
$host = explode('/package/' . DEVER_APP_NAME, $host)[0] . '/';
|
|
$host = explode('/package/' . DEVER_APP_NAME, $host)[0] . '/';
|
|
}
|
|
}
|
|
- self::write($host, 'package');self::write($host, 'src');
|
|
+ self::write($host, 'package');self::write($host, 'src');self::write($host, 'app');
|
|
self::$content[DEVER_APP_NAME]['url'] = DEVER_APP_HOST;
|
|
self::$content[DEVER_APP_NAME]['url'] = DEVER_APP_HOST;
|
|
if (isset(self::$content['manage'])) {
|
|
if (isset(self::$content['manage'])) {
|
|
$manage = self::$content['manage'];
|
|
$manage = self::$content['manage'];
|
|
@@ -46,31 +48,33 @@ class Project
|
|
public static function write($host, $name)
|
|
public static function write($host, $name)
|
|
{
|
|
{
|
|
$dir = DEVER_PROJECT_PATH . $name . '/';
|
|
$dir = DEVER_PROJECT_PATH . $name . '/';
|
|
- $data = scandir($dir);
|
|
+ if (is_dir($dir)) {
|
|
- foreach ($data as $v) {
|
|
+ $data = scandir($dir);
|
|
- if (empty(self::$content[$v]) && is_dir($dir . '/' . $v) && $v !== '.' && $v !== '..') {
|
|
+ foreach ($data as $v) {
|
|
- if (is_file($dir . $v . '/index.php')) {
|
|
+ if (empty(self::$content[$v]) && is_dir($dir . '/' . $v) && $v !== '.' && $v !== '..') {
|
|
- $k = $name . '/' . $v . '/';
|
|
+ if (is_file($dir . $v . '/index.php')) {
|
|
- self::$content[$v] = array();
|
|
+ $k = $name . '/' . $v . '/';
|
|
- if (strstr($name, 'package')) {
|
|
+ self::$content[$v] = array();
|
|
- if (strstr($name, 'package/manage')) {
|
|
+ if (strstr($name, 'package')) {
|
|
- unset(self::$content[$v]);
|
|
+ if (strstr($name, 'package/manage')) {
|
|
- $v = 'manage';
|
|
+ unset(self::$content[$v]);
|
|
- self::$content[$v] = array();
|
|
+ $v = 'manage';
|
|
- self::$content[$v]['path'] = DEVER_PATH . $name . '/';
|
|
+ self::$content[$v] = array();
|
|
- } elseif($v == 'manage') {
|
|
+ self::$content[$v]['path'] = DEVER_PATH . $name . '/';
|
|
- self::$content[$v]['path'] = DEVER_PATH . $k;
|
|
+ } elseif($v == 'manage') {
|
|
- $k .= 'api/';
|
|
+ self::$content[$v]['path'] = DEVER_PATH . $k;
|
|
|
|
+ $k .= 'api/';
|
|
|
|
+ } else {
|
|
|
|
+ self::$content[$v]['path'] = DEVER_PATH . $k;
|
|
|
|
+ }
|
|
|
|
+ self::$content[$v]['setup'] = DEVER_PROJECT_PATH . $k;
|
|
} else {
|
|
} else {
|
|
- self::$content[$v]['path'] = DEVER_PATH . $k;
|
|
+ self::$content[$v]['path'] = DEVER_PROJECT_PATH . $k;
|
|
}
|
|
}
|
|
- self::$content[$v]['setup'] = DEVER_PROJECT_PATH . $k;
|
|
+ self::$content[$v]['url'] = $host . $k;
|
|
} else {
|
|
} else {
|
|
- self::$content[$v]['path'] = DEVER_PROJECT_PATH . $k;
|
|
+ self::write($host, $name . '/' . $v);
|
|
}
|
|
}
|
|
- self::$content[$v]['url'] = $host . $k;
|
|
|
|
- } else {
|
|
|
|
- self::write($host, $name . '/' . $v);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|