Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
vbot
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c0bd1927
authored
Jan 30, 2017
by
HanSon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
缓存目录增加用户文件夹
1 parent
ee5e9f1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
src/Collections/ContactFactory.php
src/Support/FileManager.php
src/Collections/ContactFactory.php
View file @
c0bd192
...
...
@@ -9,8 +9,7 @@
namespace
Hanson\Vbot\Collections
;
use
Hanson\Vbot\Core\Server
;
use
Hanson\Vbot\Support\Console
;
use
Hanson\Vbot\Support\FileManager
;
class
ContactFactory
{
...
...
@@ -59,11 +58,11 @@ class ContactFactory
$this
->
getBatchGroupMembers
();
if
(
server
()
->
config
[
'debug'
]){
file_put_contents
(
server
()
->
config
[
'tmp'
]
.
'contact.json'
,
json_encode
(
contact
()
->
all
()));
file_put_contents
(
server
()
->
config
[
'tmp'
]
.
'member.json'
,
json_encode
(
member
()
->
all
()));
file_put_contents
(
server
()
->
config
[
'tmp'
]
.
'group.json'
,
json_encode
(
group
()
->
all
()));
file_put_contents
(
server
()
->
config
[
'tmp'
]
.
'official.json'
,
json_encode
(
Official
::
getInstance
()
->
all
()));
file_put_contents
(
server
()
->
config
[
'tmp'
]
.
'special.json'
,
json_encode
(
Special
::
getInstance
()
->
all
()));
FileManager
::
download
(
'contact.json'
,
json_encode
(
contact
()
->
all
()));
FileManager
::
download
(
'member.json'
,
json_encode
(
member
()
->
all
()));
FileManager
::
download
(
'group.json'
,
json_encode
(
group
()
->
all
()));
FileManager
::
download
(
'official.json'
,
json_encode
(
official
()
->
all
()));
FileManager
::
download
(
'special.json'
,
json_encode
(
Special
::
getInstance
()
->
all
()));
}
}
...
...
src/Support/FileManager.php
View file @
c0bd192
...
...
@@ -12,9 +12,9 @@ namespace Hanson\Vbot\Support;
class
FileManager
{
public
static
function
download
(
$name
,
$data
,
$path
)
public
static
function
download
(
$name
,
$data
,
$path
=
''
)
{
$path
=
server
()
->
config
[
'tmp'
]
.
$path
;
$path
=
server
()
->
config
[
'tmp'
]
.
myself
()
->
nickname
.
'/'
.
$path
;
if
(
!
is_dir
(
realpath
(
$path
))){
mkdir
(
$path
,
0700
,
true
);
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment