Skip to content

Commit

Permalink
code cleanup and bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-graute committed May 5, 2021
1 parent a631035 commit 0a6d0e7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/Pressmind/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,8 @@ public function importMediaObject($id_media_object, $import_linked_objects = tru

if (is_array($response) && count($response) > 0) {

$old_object = null;
$current_object = new ORM\Object\MediaObject();
$current_object->setReadRelations(true);
if($current_object->read($id_media_object)) {
$old_object = clone $current_object;
$current_object->delete(true);
}
$current_object = new ORM\Object\MediaObject($id_media_object, true, true);
$current_object->delete(true);

$this->_start_time = microtime(true);
$this->_log[] = Writer::write($this->_getElapsedTimeAndHeap() . ' Importer::importMediaObject(' . $id_media_object . '): parsing data', Writer::OUTPUT_FILE, 'import', Writer::TYPE_INFO);
Expand Down Expand Up @@ -348,7 +343,6 @@ public function importMediaObject($id_media_object, $import_linked_objects = tru
}

unset($response);
unset($old_object);

$this->_log[] = Writer::write($this->_getElapsedTimeAndHeap() . ' Importer::importMediaObject(' . $id_media_object . '): Objects removed from heap', Writer::OUTPUT_BOTH, 'import', Writer::TYPE_INFO);
$this->_log[] = Writer::write($this->_getElapsedTimeAndHeap() . '--------------------------------------------------------------------------------', Writer::OUTPUT_BOTH, 'import', Writer::TYPE_INFO);
Expand Down Expand Up @@ -471,6 +465,7 @@ public function postImport($id_media_object = null)
*/
private function checkRunFile($path)
{
return false;
if(strtolower(PHP_OS) == 'linux') { //ps -C will only work on Linux this way
$outputPS = array();
exec('ps -C php -f', $outputPS);
Expand Down

0 comments on commit 0a6d0e7

Please sign in to comment.