} else { if (strcmp($request['cmd'], 'createPreview') == 0) { $data = $projects->createPreview($request['data']); if (is_array($data)) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); echo json_encode($data); exit; } } else { if (strcmp($request['cmd'], 'publishProject') == 0) { $republish = array_key_exists('republish', $request) ? $request['republish'] : false; if (array_key_exists('serverpath', $request)) { $data = $projects->publishLocal($request['data'], $request['serverpath'], $republish); } else { $data = $projects->publishViaFTP($request['data'], $republish); } if (is_array($data)) { header("HTTP/1.1 200 OK"); header("Content-Type: text/html"); echo json_encode($data); exit; } } else { if (strcmp($request['cmd'], 'unpublishProject') == 0) { if (array_key_exists('serverpath', $request)) { $data = $projects->unpublishLocal($request['data'], $request['serverpath']); } else { $data = $projects->unpublishViaFTP($request['data']); } if (is_array($data)) {