Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
7443aed9
Commit
7443aed9
authored
Feb 13, 2026
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maintain: Part2
parent
9946dd02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
179 deletions
+0
-179
src/Controller/HomeController.php
src/Controller/HomeController.php
+0
-33
src/Installer.php
src/Installer.php
+0
-42
src/View/DiscuzTemplateRenderer.php
src/View/DiscuzTemplateRenderer.php
+0
-57
src/ViewInjection/ApplicationViewInjection.php
src/ViewInjection/ApplicationViewInjection.php
+0
-47
No files found.
src/Controller/HomeController.php
deleted
100644 → 0
View file @
9946dd02
<?php
declare
(
strict_types
=
1
);
namespace
NMForce\PHPDTS\Controller
;
use
Psr\Http\Message\ResponseInterface
;
use
Yiisoft\Yii\View\ViewRenderer
;
final
class
HomeController
{
public
function
__construct
(
private
ViewRenderer
$viewRenderer
,
)
{
}
public
function
index
()
:
ResponseInterface
{
$now
=
time
()
+
8
*
3600
+
0
*
60
;
list
(
$sec
,
$min
,
$hour
,
$day
,
$month
,
$year
,
$wday
)
=
explode
(
','
,
date
(
"s,i,H,j,n,Y,w"
,
$now
));
return
$this
->
viewRenderer
->
render
(
'index'
,
[
'sec'
=>
$sec
,
'min'
=>
$min
,
'hour'
=>
$hour
,
'day'
=>
$day
,
'month'
=>
$month
,
'year'
=>
$year
,
'wday'
=>
$wday
,
'now'
=>
$now
,
]);
}
}
src/Installer.php
deleted
100644 → 0
View file @
9946dd02
<?php
declare
(
strict_types
=
1
);
namespace
NMForce\PHPDTS
;
use
FilesystemIterator
as
FSIterator
;
use
RecursiveDirectoryIterator
as
DirIterator
;
use
RecursiveIteratorIterator
as
RIterator
;
final
class
Installer
{
/**
* @psalm-suppress UndefinedClass
*/
public
static
function
postUpdate
()
:
void
{
self
::
chmodRecursive
(
'runtime'
,
0777
);
}
private
static
function
chmodRecursive
(
string
$path
,
int
$mode
)
:
void
{
chmod
(
$path
,
$mode
);
/** @psalm-var iterable<array-key, string> $iterator */
$iterator
=
new
RIterator
(
new
DirIterator
(
$path
,
FSIterator
::
SKIP_DOTS
|
FSIterator
::
CURRENT_AS_PATHNAME
),
RIterator
::
SELF_FIRST
);
foreach
(
$iterator
as
$item
)
{
chmod
(
$item
,
$mode
);
}
}
public
static
function
copyEnvFile
()
:
void
{
if
(
!
file_exists
(
'.env'
))
{
copy
(
'.env.example'
,
'.env'
);
}
}
}
src/View/DiscuzTemplateRenderer.php
deleted
100644 → 0
View file @
9946dd02
<?php
declare
(
strict_types
=
1
);
namespace
NMForce\PHPDTS\View
;
use
Throwable
;
use
function
extract
;
use
function
func_get_arg
;
use
function
ob_end_clean
;
use
function
ob_get_clean
;
use
function
ob_get_level
;
use
function
ob_implicit_flush
;
use
function
ob_start
;
use
Yiisoft\Aliases\Aliases
;
use
Yiisoft\View\ViewInterface
;
use
Yiisoft\View\TemplateRendererInterface
;
final
class
DiscuzTemplateRenderer
implements
TemplateRendererInterface
{
public
function
__construct
(
private
Aliases
$aliases
)
{
}
public
function
render
(
ViewInterface
$view
,
string
$template
,
array
$parameters
)
:
string
{
defined
(
'IN_GAME'
)
or
define
(
'IN_GAME'
,
TRUE
);
defined
(
'GAME_ROOT'
)
or
define
(
'GAME_ROOT'
,
"
{
$this
->
aliases
->
get
(
'@root'
)
}
/"
);
defined
(
'TPLDIR'
)
or
define
(
'TPLDIR'
,
'./templates/default'
);
defined
(
'TEMPLATEID'
)
or
define
(
'TEMPLATEID'
,
1
);
defined
(
'CURSCRIPT'
)
or
define
(
'CURSCRIPT'
,
'index'
);
$tplrefresh
=
1
;
require_once
GAME_ROOT
.
'./include/global.func.php'
;
$renderer
=
function
()
:
void
{
extract
(
func_get_arg
(
1
),
EXTR_OVERWRITE
);
require
template
(
basename
(
func_get_arg
(
0
),
'.htm'
));
};
$obInitialLevel
=
ob_get_level
();
ob_start
();
ob_implicit_flush
(
false
);
try
{
$renderer
->
bindTo
(
$view
)(
$template
,
$parameters
);
return
ob_get_clean
();
}
catch
(
Throwable
$e
)
{
while
(
ob_get_level
()
>
$obInitialLevel
)
{
ob_end_clean
();
}
throw
$e
;
}
}
}
src/ViewInjection/ApplicationViewInjection.php
deleted
100644 → 0
View file @
9946dd02
<?php
declare
(
strict_types
=
1
);
namespace
NMForce\PHPDTS\ViewInjection
;
use
Yiisoft\Yii\View\CommonParametersInjectionInterface
;
use
Yiisoft\Aliases\Aliases
;
final
class
ApplicationViewInjection
implements
CommonParametersInjectionInterface
{
public
function
__construct
(
private
Aliases
$aliases
)
{
}
public
function
getCommonParameters
()
:
array
{
defined
(
'IN_GAME'
)
or
define
(
'IN_GAME'
,
TRUE
);
defined
(
'GAME_ROOT'
)
or
define
(
'GAME_ROOT'
,
"
{
$this
->
aliases
->
get
(
'@root'
)
}
/"
);
require
GAME_ROOT
.
'./include/global.func.php'
;
$vars
=
get_defined_vars
();
require
GAME_ROOT
.
'./config.inc.php'
;
require
GAME_ROOT
.
'./gamedata/system.php'
;
require
GAME_ROOT
.
'./gamedata/gameinfo.php'
;
require
GAME_ROOT
.
'./gamedata/combatinfo.php'
;
$adminmsg
=
file_get_contents
(
GAME_ROOT
.
'./gamedata/adminmsg.htm'
);
$systemmsg
=
file_get_contents
(
GAME_ROOT
.
'./gamedata/systemmsg.htm'
);
$cuser
=
'苹果'
;
$error
=
''
;
require
config
(
'resources'
);
require
config
(
'gamecfg'
);
$vars
=
array_diff
(
get_defined_vars
(),
$vars
);
return
$vars
;
// return [
// // 'charset' => $this->charset,
// // 'allowcsscache' => 1,
// // 'homepage' => 'http://www.amarilloviridian.com/',
// // 'gameversion'=> 'GE942 ~TORONTO',
// ];
}
}
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