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
d3c707da
Commit
d3c707da
authored
Oct 20, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'native-export' of github.com:fex-team/kityminder into native-export
parents
02cfffd3
356cc4a7
Changes
3
Show 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 @
d3c707da
<?php
return
array
(
'savepath'
=>
dirname
(
__FILE__
)
.
'/upload/'
);
\ No newline at end of file
native-support/archive/src/Parser.freemind.class.php
View file @
d3c707da
...
@@ -27,7 +27,9 @@ class FreeMindParser {
...
@@ -27,7 +27,9 @@ class FreeMindParser {
'topic'
=>
$data
'topic'
=>
$data
)
);
)
);
$filepath
=
getcwd
()
.
'/upload/'
.
$data
[
'meta'
][
'id'
]
.
'.mm'
;
$savepath
=
self
::
getSavePath
();
$filepath
=
$savepath
.
'/'
.
$data
[
'meta'
][
'id'
]
.
'.mm'
;
file_put_contents
(
$filepath
,
$content
);
file_put_contents
(
$filepath
,
$content
);
return
$filepath
;
return
$filepath
;
...
@@ -72,6 +74,19 @@ class FreeMindParser {
...
@@ -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
()
{
private
static
function
getTimeAndId
()
{
$timestamp
=
intval
(
microtime
(
true
)
*
1000
);
$timestamp
=
intval
(
microtime
(
true
)
*
1000
);
...
...
native-support/archive/src/Parser.xmind.class.php
View file @
d3c707da
...
@@ -163,9 +163,7 @@ class XMindParser {
...
@@ -163,9 +163,7 @@ class XMindParser {
$info
=
self
::
getTimeAndId
();
$info
=
self
::
getTimeAndId
();
$imagePath
=
getcwd
()
.
'/tmp/'
.
$info
[
'id'
]
.
$image
[
'suffix'
];
$imagePath
=
$image
[
'filepath'
];
rename
(
$image
[
'filepath'
],
$imagePath
);
$source
[
'data'
][
'image'
]
=
array
(
$source
[
'data'
][
'image'
]
=
array
(
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
...
@@ -173,12 +171,12 @@ class XMindParser {
...
@@ -173,12 +171,12 @@ class XMindParser {
);
);
array_push
(
$attachments
,
array
(
$attachments
[]
=
array
(
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
'filepath'
=>
'attachments/'
.
$info
[
'id'
]
.
$image
[
'suffix'
],
'origin'
=>
$imagePath
,
'origin'
=>
$imagePath
,
'type'
=>
$image
[
'mime'
],
'type'
=>
$image
[
'mime'
],
'meta'
=>
$info
'meta'
=>
$info
)
)
;
);
}
}
...
@@ -200,7 +198,16 @@ class XMindParser {
...
@@ -200,7 +198,16 @@ class XMindParser {
private
static
function
move
(
$meta
,
$path
)
{
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
);
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