Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
356cc4a7
Commit
356cc4a7
authored
Oct 08, 2014
by
hancong03
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复不能自动创建路径的问题
Signed-off-by:
hancong03
<
hancong03@baidu.com
>
parent
f33de2ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
7 deletions
+34
-7
config.php
native-support/archive/config.php
+5
-0
Parser.freemind.class.php
native-support/archive/src/Parser.freemind.class.php
+16
-1
Parser.xmind.class.php
native-support/archive/src/Parser.xmind.class.php
+13
-6
No files found.
native-support/archive/config.php
0 → 100644
View file @
356cc4a7
<?php
return
array
(
'savepath'
=>
dirname
(
__FILE__
)
.
'/upload/'
);
\ No newline at end of file
native-support/archive/src/Parser.freemind.class.php
View file @
356cc4a7
...
...
@@ -27,7 +27,9 @@ class FreeMindParser {
'topic'
=>
$data
)
);
$filepath
=
getcwd
()
.
'/upload/'
.
$data
[
'meta'
][
'id'
]
.
'.mm'
;
$savepath
=
self
::
getSavePath
();
$filepath
=
$savepath
.
'/'
.
$data
[
'meta'
][
'id'
]
.
'.mm'
;
file_put_contents
(
$filepath
,
$content
);
return
$filepath
;
...
...
@@ -72,6 +74,19 @@ class FreeMindParser {
}
private
static
function
getSavePath
()
{
$config
=
require
(
dirname
(
__FILE__
)
.
'/../config.php'
);
$savepath
=
$config
[
'savepath'
];
if
(
!
file_exists
(
$savepath
)
)
{
mkdir
(
$savepath
,
0770
,
true
);
}
return
pathinfo
(
$savepath
.
'/test'
,
PATHINFO_DIRNAME
);
}
private
static
function
getTimeAndId
()
{
$timestamp
=
intval
(
microtime
(
true
)
*
1000
);
...
...
native-support/archive/src/Parser.xmind.class.php
View file @
356cc4a7
...
...
@@ -163,9 +163,7 @@ class XMindParser {
$info
=
self
::
getTimeAndId
();
$imagePath
=
getcwd
()
.
'/tmp/'
.
$info
[
'id'
]
.
$image
[
'suffix'
];
rename
(
$image
[
'filepath'
],
$imagePath
);
$imagePath
=
$image
[
'filepath'
];
$source
[
'data'
][
'image'
]
=
array
(
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
...
...
@@ -173,12 +171,12 @@ class XMindParser {
);
array_push
(
$attachments
,
array
(
$attachments
[]
=
array
(
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
'origin'
=>
$imagePath
,
'type'
=>
$image
[
'mime'
],
'meta'
=>
$info
)
)
;
);
}
...
...
@@ -200,7 +198,16 @@ class XMindParser {
private
static
function
move
(
$meta
,
$path
)
{
$filepath
=
getcwd
()
.
'/upload/'
.
$meta
[
'id'
]
.
'.xmind'
;
$config
=
require
(
diranme
(
__FILE__
)
.
'/../config.php'
);
$savepath
=
$config
[
'savepath'
];
if
(
!
file_exists
(
$savepath
)
)
{
mkdir
(
$savepath
,
0770
,
true
);
}
$savepath
=
pathinfo
(
$savepath
.
'/test'
,
PATHINFO_DIRNAME
);
$filepath
=
$savepath
.
'/'
.
$meta
[
'id'
]
.
'.xmind'
;
rename
(
$path
,
$filepath
);
...
...
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