jenkins-bot has submitted this change and it was merged. Change subject: readme: Use the "use" statement in the usage example ......................................................................
readme: Use the "use" statement in the usage example Make the example easier to read by using the "use" statement. Also makes it less repatative and matches the general conventations for how this would be by other Wikimedia projects. Also remove superfluous backticks from link labels which are not supported by Doxygen's Markdown parser. Change-Id: I5fd73582ab22a3e5cc59e85564026f680e430c83 --- M README.md 1 file changed, 12 insertions(+), 9 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 6a7f69e..ca1d0ba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ====================== php-session-serializer is a PHP library that provides methods that work like -PHP's [`session_encode`][phpencode] and [`session_decode`][phpdecode] +PHP's [session_encode][phpencode] and [session_decode][phpdecode] functions, but don't mess with the `$_SESSION` superglobal. It supports the `php`, `php_binary`, and `php_serialize` serialize handlers. @@ -14,18 +14,21 @@ Usage ----- - // (optional) Send logs to a PSR-3 logger - \Wikimedia\PhpSesssionSerializer::setLogger( $logger ) +<pre lang="php"> +use Wikimedia\PhpSesssionSerializer; - // (optional) Ensure that session.serialize_handler is set to a usable value - \Wikimedia\PhpSesssionSerializer::setSerializeHandler(); +// (optional) Send logs to a PSR-3 logger +PhpSesssionSerializer::setLogger( $logger ) - // Encode session data - $string = \Wikimedia\PhpSesssionSerializer::encode( $array ); +// (optional) Ensure that session.serialize_handler is set to a usable value +PhpSesssionSerializer::setSerializeHandler(); - // Decode session data - $array = \Wikimedia\PhpSesssionSerializer::decode( $string ); +// Encode session data +$string = PhpSesssionSerializer::encode( $array ); +// Decode session data +$array = PhpSesssionSerializer::decode( $string ); +</pre> Running tests ------------- -- To view, visit https://gerrit.wikimedia.org/r/247504 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fd73582ab22a3e5cc59e85564026f680e430c83 Gerrit-PatchSet: 1 Gerrit-Project: php-session-serializer Gerrit-Branch: master Gerrit-Owner: Krinkle <[email protected]> Gerrit-Reviewer: Legoktm <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
