Last active
May 24, 2016 09:46
-
-
Save connordavison/2f34daa9a26a7c5a1798bc138300fc14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/symfony/ $ # Ensure COMPOSER_HOME='~/.composer/' | |
~/symfony/ $ composer global require psy/psysh | |
~/symfony/ $ # Obtain sysh script | |
~/symfony/ $ chmod +x sysh | |
~/symfony/ $ mkdir -p ~/.composer/bin/ | |
~/symfony/ $ mv sysh ~/.composer/bin/ | |
~/symfony/ $ # Add ~/.composer/bin to path if necessary | |
~/symfony/ $ sysh | |
Psy Shell v0.7.2 (PHP 5.6.20-1+deb.sury.org~precise+1 — cli) by Justin Hileman | |
>>> ls | |
Variables: $container, $doctrine, $em, $kernel | |
>>> $container->get('mailer') | |
=> Swift_Mailer {#156} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
$root = getcwd(); | |
require_once $root . '/app/bootstrap.php.cache'; | |
require_once $root . '/app/AppKernel.php'; | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
use Psy\Shell; | |
$kernel = new AppKernel('dev', true); | |
$kernel->loadClassCache(); | |
$kernel->boot(); | |
$container = $kernel->getContainer(); | |
$container->get('cache_clearer')->clear($kernel->getCacheDir()); | |
$doctrine = $container->get('doctrine'); | |
$em = $doctrine->getManager(); | |
extract(Shell::debug([ | |
'kernel' => $kernel, | |
'container' => $container, | |
'doctrine' => $doctrine, | |
'em' => $em | |
])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment