Skip to content

Commit ee71310

Browse files
committed
reconstruct the template structure
1 parent f7d0526 commit ee71310

25 files changed

+322
-260
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.idea/
2-
.vscode/
3-
/vendor/
1+
vendor/
42
composer.lock
53
data.json

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Built-in web server",
9+
"type": "php",
10+
"request": "launch",
11+
"cwd": "${workspaceRoot}/webroot",
12+
"runtimeArgs": [
13+
"-dxdebug.mode=debug",
14+
"-dxdebug.start_with_request=yes",
15+
"-S",
16+
"localhost:8000"
17+
],
18+
"serverReadyAction": {
19+
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
20+
"uriFormat": "http://localhost:%s",
21+
"action": "openExternally"
22+
},
23+
"env": {
24+
"DEVNET_ENVIRONMENT": "development"
25+
}
26+
}
27+
]
28+
}

Controllers/AccountController.php

Lines changed: 0 additions & 112 deletions
This file was deleted.

Controllers/HomeController.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DevNet MVC Web Application Template
2-
This package is a Model-View-Controller web application template of DevNet Framewark.
2+
This package is a DevNet Model-View-Controller web application template.
33

44
## Requirements
55
- [PHP](https://www.php.net/) version 8.0 or higher

Views/Account/register.phtml

Lines changed: 0 additions & 50 deletions
This file was deleted.

bin/apphost

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@
22

33
use DevNet\System\Runtime\Launcher;
44

5-
// get the path environment variable
5+
$root = dirname(__FILE__, 2);
6+
7+
// Loads local devnet core host if exist
8+
if (is_file($root . '/vendor/devnet/core/host/corehost.php')) {
9+
require $root . '/vendor/devnet/core/host/corehost.php';
10+
}
11+
12+
// Gets the path environment variable
613
if (PHP_OS_FAMILY == 'Windows') {
714
$paths = explode(';', getenv('path'));
815
} else {
916
$paths = explode(':', getenv('PATH'));
1017
}
1118

12-
// search and load global composer autoload
19+
// Search for the global devnet core host
1320
foreach ($paths as $path) {
14-
if (file_exists($path . '/../autoload.php')) {
15-
require $path . '/../autoload.php';
21+
if (is_file($path . '/../devnet/core/host/corehost.php')) {
22+
require $path . '/../devnet/core/host/corehost.php';
1623
break;
1724
}
1825
}
1926

20-
$root = dirname(__FILE__, 2);
21-
// load local composer autoload
22-
if (file_exists($root . '/vendor/autoload.php')) {
23-
require $root . '/vendor/autoload.php';
24-
}
2527

26-
// get the console arguments without command name
28+
// Gets the console arguments without command name
2729
$args = $GLOBALS['argv'] ?? [];
2830
array_shift($args);
2931

30-
// initialize and launch the application
31-
$launcher = Launcher::initialize($root.'/devnet.proj');
32-
$launcher->launch($args);
32+
// Initialize and launch the application
33+
$launcher = Launcher::initialize($root . '/devnet.proj');
34+
$launcher->launch($args);

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "devnet/mvc-template",
33
"description": "DevNet Web Application (Model-View-Controller)",
4-
"type": "devnet-project",
4+
"type": "project",
55
"license": "MIT",
66
"minimum-stability": "dev",
7-
"prefer-stable": true
7+
"prefer-stable": true,
8+
"require": {
9+
"devnet/web": "1.0.*"
10+
}
811
}

devnet.proj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0"?>
22
<Project>
33
<Properties>
4-
<EntryPoint>Application\Program</EntryPoint>
4+
<StartupObject>Application\Program</StartupObject>
55
</Properties>
6-
<Dependencies>
7-
<Package include="vendor/autoload.php"/>
8-
</Dependencies>
9-
</Project>
6+
<Items>
7+
<CodeFile include="vendor/autoload.php"/>
8+
</Items>
9+
</Project>

settings.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
2-
"database": {
3-
"connection": "//username:[email protected]/database/?charset=utf-8"
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information"
5+
}
46
},
5-
"environment": "development"
6-
}
7+
"Database": {
8+
"ProviderType": "DevNet\\Entity\\PgSql\\PgSqlDataProvider",
9+
"ConnectionString": "host=localhost;database=dbname;user=username;password=password"
10+
}
11+
}

0 commit comments

Comments
 (0)