The following was adapted from:
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 tracked_persistable.php | |
object(MongoDB\Examples\User)#29 (3) { | |
["name"]=> | |
string(7) "alcaeus" | |
["emails"]=> | |
object(MongoDB\Examples\TrackedBSONArray)#24 (0) { | |
} | |
["_id"]=> | |
object(MongoDB\BSON\ObjectId)#15 (1) { | |
["oid"]=> |
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 | |
enum TimeUnit : string | |
{ | |
case Nanos = 'ns'; | |
case Micros = 'μs'; | |
case Millis = 'ms'; | |
} | |
class TimeUnitString |
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
make_php () { | |
# Directory for PHP git repo (for git-new-workdir) | |
phpsrcdir="/home/jmikola/workspace/php/php-src" | |
# Git branch for this build (for git-new-workdir) | |
phpbranch="PHP-$1" | |
# Where compiled builds should be installed | |
installdir="/home/jmikola/bin/php" |
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 | |
$m = new Mongo(); | |
$c = $m->test->foo; | |
$c->drop(); | |
$a = microtime(true); | |
foreach (range(1,1000000) as $i) { | |
$c->insert(array('x' => $i)); | |
} |
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 OpenSky\Bundle\MainBundle\DependencyInjection\Compiler; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Reference; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
class AggregatedTaggedServicesPass implements CompilerPassInterface | |
{ |
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 Acme\FooBundle\Command; | |
use Doctrine\Common\Persistence\ManagerRegistry; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class FindInvalidReferencesCommand extends ContainerAwareCommand |
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 | |
require_once 'vendor/autoload.php'; | |
$client = new MongoDB\Client; | |
$collection = $client->selectCollection('test', 'mr_example'); | |
$collection->drop(); | |
$collection->insertMany([ | |
['x' => 1, 'y' => 1], |
NewerOlder