In http://auraphp.com/manuals/v1/en/package-organization/:
First, create the package structure (just the parts we need):
...
Let us create our controller. Open your favourite editor and save the code below
... >
<?php | |
$pdo = new PDO('mysql:host=hostname;dbname=defaultDbName', 'username', 'p@55w0rd'); | |
$sql = 'INSERT INTO author (first_name, last_name, date_of_birth, email) VALUES (?, ?, ?, ?)'; | |
$stmt = $pdo->prepare($sql); | |
$faker = \Faker\Factory::create(); | |
$insertedPKs = array(); | |
for ($i=0; $i < 100; $i++) { | |
$stmt->bindValue(1, $faker->firstName, PDO::PARAM_STR); | |
$stmt->bindValue(2, $faker->lastName, PDO::PARAM_STR); | |
$stmt->bindValue(1, $faker->date, PDO::PARAM_STR); |
<?php | |
$faker = \Faker\Factory::create(); | |
$insertedPKs = array(); | |
for ($i=0; $i < 100; $i++) { | |
$author = new Author(); | |
$author->setFirstName($faker->firstName); | |
$author->setLastName($faker->lastName); | |
$author->setDateOfBirth($faker->date); | |
$author->setEmail($faker->email); | |
$author->save(); |
<?php | |
$faker = \Faker\Factory::create(); | |
$populator = new \Faker\ORM\Propel\Populator($faker); | |
$populator->addEntity('Author', 100); | |
$insertedPKs = $populator->execute(); |
<?php | |
$faker = \Faker\Factory::create(); | |
$populator = new \Faker\ORM\Propel\Populator($faker); | |
$populator->addEntity('Author', 10000); | |
$populator->addEntity('Book', 100000); | |
$populator->addEntity('Review', 1000000); | |
$insertedPKs = $populator->execute(); |
<?php | |
$faker = \Faker\Factory::create(); | |
$populator = new \Faker\ORM\Propel\Populator($faker); | |
$populator->addEntity('Author', 10000); | |
$populator->addEntity('Book', 100000, $customColumnFormatters = array( | |
'ISBN' => function () use ($generator) { return $generator->randomNumber(13); }, | |
)); | |
$populator->addEntity('Review', 1000000); | |
$insertedPKs = $populator->execute(); |
<?php | |
interface Bar {} | |
class Foo extends Exception implements Bar {} | |
try | |
{ | |
throw new Foo(); | |
} catch (Bar $e) { |
var fs = require('fs'); | |
var request = require('request'); | |
var async = require('async'); | |
var apiUrl = 'http://api.flickr.com/services/upload/'; | |
var filenames = fs.readdirSync(path); | |
async.forEach(filenames, function(filename, callback) { | |
// open a file stream on the local image | |
var fileStream = fs.createReadStream(path + filename); | |
// read from the file and write to the HTTP request |
<?php | |
sleep(10); | |
header('Content-Type: text/css'); | |
echo 'h1 { color: red; }'; |
In http://auraphp.com/manuals/v1/en/package-organization/:
First, create the package structure (just the parts we need):
...
Let us create our controller. Open your favourite editor and save the code below
... >
# Ruby / Bundler / Diaspora | |
# Fork https://github.com/diaspora/diaspora | |
# Repeat 5 times | |
time sh -c 'git clone https://github.com/fzaninotto/diaspora.git;cd sandbox;bundle install --deployment' | |
rm -Rf diaspora | |
# commit dependencies | |
git clone https://github.com/fzaninotto/diaspora.git |