From 615e9b88077380f138e415ea75535bc1d14b52fa Mon Sep 17 00:00:00 2001 From: Justin Rainbow Date: Sat, 10 Dec 2011 15:49:29 -0700 Subject: [PATCH] Updating docs to include basic data from the README --- README.md | 2 ++ composer.json | 3 +++ docs/index.rst | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/README.md b/README.md index 3b59c1c..4699de9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # JSON Schema for PHP +Documentation can be found at http://jsonschema.readthedocs.org/ + ## Usage ```php diff --git a/composer.json b/composer.json index b120616..4616d1d 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,9 @@ "email": "justin.rainbow@gmail.com" } ], + "require": { + "php": ">=5.3.0" + }, "autoload": { "psr-0": { "JsonSchema": "src/" } } diff --git a/docs/index.rst b/docs/index.rst index e6f36fe..95671ad 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,6 +12,32 @@ Contents: :maxdepth: 2 +Installation +------------ + +.. code-block:: console + + git clone --recursive https://github.com/justinrainbow/json-schema.git + + +Usage +----- + +.. code-block:: php + + validate(json_decode($json), json_decode($schema)); + + if ($result->valid) { + echo "The supplied JSON validates against the schema.\n"; + } else { + echo "JSON does not validate. Violations:\n"; + foreach ($result->errors as $error) { + echo "[{$error['property']}] {$error['message']}\n"; + } + } + Indices and tables ==================