title: php json-schema - Fatal Error: Class not found
body: <p>New to PHP!</p>
  
  <p>I have /var/www/html/index.php requiring json-schema from <a href="https://github.com/justinrainbow/json-schema" rel="nofollow">https://github.com/justinrainbow/json-schema</a></p>
  
  <p>downloaded from git and moved JsonSchema folder to /var/www/html</p>
  
  <p>the following in index.php gives Fatal error: Class 'JsonSchema\Constraints\Constraint' not found </p>
  
  <pre><code>require "JsonSchema/Validator.php";
  use JsonSchema\Validator;
  $validator = new JsonSchema\Validator();
  $validator-&gt;check(json_decode($data), json_decode($schema));
  </code></pre>
  
  <p>if I include Constraint.php, it throws out another error. am missing some basics here. what is the proper way to use an external library?</p>
  
  <p>thanks!</p>