} /* Example: Get true/false if the pad is password protected and include some logic -- This only works for group pads*/ try { $isPasswordProtected = $instance->isPasswordProtected('testPad'); if ($isPasswordProtected->isPasswordprotected === false) { echo "Pad is not password protected\n\n"; } else { echo "Pad is password protected\n\n"; } } catch (Exception $e) { // the pad already exists or something else went wrong echo "\n\nisPasswordProtected Failed with message " . $e->getMessage(); } /* Example: Get revisions Count of a pad */ try { $revisionCount = $instance->getRevisionsCount('testPad'); $revisionCount = $revisionCount->revisions; echo "Pad has {$revisionCount} revisions\n\n"; } catch (Exception $e) { // the pad already exists or something else went wrong echo "\n\ngetRevisionsCount Failed with message " . $e->getMessage(); } /* Example: Get Pad Contents and echo to screen */ try { $padContents = $instance->getText('testPad'); echo "Pad text is: <br/><ul>{$padContents->text}\n\n</ul>"; echo "End of Pad Text\n\n<hr>"; } catch (Exception $e) { // the pad already exists or something else went wrong echo "\n\ngetText Failed with message " . $e->getMessage(); }