Skip to content

Instantly share code, notes, and snippets.

@benglass
Created September 3, 2015 19:24
Show Gist options
  • Save benglass/0c55514b67e96b9bcb5e to your computer and use it in GitHub Desktop.
Save benglass/0c55514b67e96b9bcb5e to your computer and use it in GitHub Desktop.
<?php
$loader = require_once __DIR__.'/app/bootstrap.php.cache';
require_once __DIR__.'/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$kernel->boot();
$container = $kernel->getContainer();
$validator = $container->get('validator');
$url = 'http://www.rilin.state.ri.us/representatives/Messier';
$result = $validator->validate($url, new \Symfony\Component\Validator\Constraints\Url());
var_dump($result); // No violations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment