$files, 'images' => $images ); deleteDirectory($tempPath); deleteDirectory($tempPathNewFiles); return serialize($data); } else { deleteDirectory($tempPath); deleteDirectory($tempPathNewFiles); return false; } } /** * @param $directoryPath * @return bool */ function deleteDirectory($directoryPath) { $files = array_diff(scandir($directoryPath), array('.','..')); foreach ($files as $file) { if (is_dir("$directoryPath/$file")) { deleteDirectory("$directoryPath/$file"); } else { unlink("$directoryPath/$file"); } } return rmdir($directoryPath); } $webPath = api_get_path(WEB_PATH); $webCodePath = api_get_path(WEB_CODE_PATH); $options = array( 'uri' => $webPath, 'location' => $webCodePath . 'webservices/additional_webservices.php' ); $soapServer = new SoapServer(NULL, $options); $soapServer->addFunction('wsConvertPpt'); $soapServer->handle();