Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
8241aca4
Commit
8241aca4
authored
Feb 25, 2010
by
Penny Leach
Browse files
leap import: fix a few oddities with import filenames (maybe a php 5.3 problem)
Signed-off-by:
Penny Leach
<
penny@mjollnir.org
>
parent
24f12a18
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/import/leap/lib.php
View file @
8241aca4
...
...
@@ -218,8 +218,7 @@ class LeapImportFile extends LeapImportArtefactPlugin {
// UTF8 characters
$pathname
=
urldecode
((
string
)
$entry
->
content
[
'src'
]);
// TODO: might want to make it easier to get at the directory where the import files are
$data
=
$importer
->
get
(
'data'
);
$dir
=
dirname
(
$data
[
'filename'
]);
$dir
=
dirname
(
$importer
->
get
(
'filename'
));
// Note: this data is passed (eventually) to ArtefactType->__construct,
// which calls strtotime on the dates for us
...
...
htdocs/import/leap/lib.php
View file @
8241aca4
...
...
@@ -41,6 +41,7 @@ class PluginImportLeap extends PluginImport {
private
$loadmapping
=
array
();
private
$coreloadmapping
=
array
();
private
$artefactids
=
array
();
protected
$filename
;
protected
$persondataid
=
null
;
...
...
@@ -97,16 +98,16 @@ class PluginImportLeap extends PluginImport {
public
function
process
()
{
db_begin
();
$filename
=
self
::
find_file
(
$this
->
get
(
'importertransport'
)
->
files_info
());
$this
->
logfile
=
dirname
(
$filename
)
.
'/import.log'
;
$this
->
trace
(
'Loading import from '
.
$filename
);
$
this
->
filename
=
self
::
find_file
(
$this
->
get
(
'importertransport'
)
->
files_info
());
$this
->
logfile
=
dirname
(
$
this
->
filename
)
.
'/import.log'
;
$this
->
trace
(
'Loading import from '
.
$
this
->
filename
);
$this
->
snapshot
(
'begin'
);
$options
=
LIBXML_COMPACT
|
// Reported to greatly speed XML parsing
LIBXML_NONET
// Disable network access - security check
;
if
(
!
$this
->
xml
=
simplexml_load_file
(
$filename
,
'SimpleXMLElement'
,
$options
))
{
if
(
!
$this
->
xml
=
simplexml_load_file
(
$
this
->
filename
,
'SimpleXMLElement'
,
$options
))
{
// TODO: bail out in a much nicer way...
throw
new
ImportException
(
$this
,
"FATAL: XML file is not well formed! Please consult Mahara's error log for more information"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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