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
<?php | |
//... | |
$server->post('/login', function ($username, $password) use ($server) { | |
$auth = $server->getContainder()->getHttpAuthService(); | |
$response = new Symfony\Components\HttpKernel\Response(); | |
$session = $server->getContainder()->getSessionService(); | |
try { | |
$auth->login($username, $password); | |
$response->setStatusCode(HTTPStatus::Accepted); | |
} catch (HttpAuthException $e) { |
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
<?php | |
$field = new ChoiceField('name', array( | |
'multiple' => false, | |
'expanded' => true, | |
'choices' => array( | |
1 => 'Track inventory', | |
0 => 'Do not track inventory', | |
) | |
)); |
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
You could specify multiple document managers | |
doctrine_odm.mongodb: | |
default_document_manager: default | |
default_connection: default | |
document_managers: | |
default: | |
connection: default | |
db: somedatabase | |
connections: |
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
PASS #1 - SMALL FILE | |
============================================= | |
HTMLPurifier Pass #1 - Small File: | |
---------------------------------------------------- | |
marker time index ex time perct | |
---------------------------------------------------- | |
Start 1278614890.25844500 - 0.00% | |
---------------------------------------------------- | |
Stop 1278614893.65603000 3.397585 100.00% |
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
use Documents\Functional\AlsoLoad | |
, Documents\Functional\EmbeddedTestLevel0 | |
, Documents\Functional\EmbeddedTestLevel1 | |
, Documents\Functional\EmbeddedTestLevel2 | |
, Documents\Functional\FavoritesUser | |
, Documents\Functional\NotAnnotatedDocument | |
, Documents\Functional\NotSaved | |
, Documents\Functional\NullFieldValues | |
, Documents\Functional\PreUpdateTestProduct |
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
<?php | |
function fitzify ($input) { | |
return implode(\PHP_EOL, array_map(function($line) { | |
return $line . (rand(1, 4) == 1 ? str_repeat("\t", rand(1, 4)) : ''); | |
}, explode(\PHP_EOL, $input))); | |
} | |
function fitzify_file($path) { | |
if ( ! is_file($path)) { |
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
<?php | |
namespace Application\HelloBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
/** @Service(id="hello_controller") */ | |
class HelloController extends Controller | |
{ | |
protected $userRepository; | |
protected $logger; |
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
// http package is used to create http servers | |
var http = require('http'); | |
// create server that will write string 'Hello World' with a new line on every request to ip 127.0.0.1, port 8124 | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(8124, "127.0.0.1"); | |
// Log message after createServer is successfully sent | |
console.log('Server running at //127.0.0.1:8124/'); |
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
<?php | |
namespace Company\ApplicationBundle; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | |
class ApplicationBundle extends Bundle { | |
public function registerExtensions(ContainerBuilder $container) { |
OlderNewer