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 | |
public function release() { | |
$collection = $this->collectionBuilder(); | |
$collection->addCode([$this, 'mvCssFiles']); | |
$collection->addCode([$this, 'changeRefs']); | |
return $collection; | |
} |
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 | |
class RoboFile extends \Robo\Tasks | |
{ | |
public function mvCssFiles() { | |
$this->taskCopyDir(["css" => "css-0.1"])->run(); | |
$this->taskDeleteDir("css")->run(); | |
} | |
public function changeRefs() { | |
$this->taskReplaceInFile("index.html") |
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 | |
public function change() | |
{ | |
$table = $this->table('photographers'); | |
$table->addColumn('created-at', 'timestamp', [ | |
'default' => 'CURRENT_TIMESTAMP', | |
'after' => 'portfolio-url']) | |
->addColumn('updated-at', 'timestamp', [ | |
'update' => 'CURRENT_TIMESTAMP', | |
'default' => 'CURRENT_TIMESTAMP', |
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 | |
public function change() | |
{ | |
$table = $this->table('cameras'); | |
$table->addColumn('name', 'string', ['length' => 200]) | |
->addColumn('photographer-id', 'integer') | |
->addForeignKey('photographer-id', 'photographers', 'id') | |
->create(); | |
} |
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 | |
public function change() | |
{ | |
$table = $this->table('photographers'); | |
$table->addIndex(['name', 'phone'], ['unique' => true]) | |
->update(); | |
} |
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 | |
public function change() | |
{ | |
$table = $this->table('photographers'); | |
$table->addColumn('portfolio-url', 'text', ['after' => 'phone']) | |
->update(); | |
} |
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 | |
public function change() | |
{ | |
$table = $this->table('photographers'); | |
$table->addColumn('name', 'string', ['length' => 200]) | |
->addColumn('phone', 'string', ['length' => 10]) | |
->create(); | |
} |
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
paths: | |
migrations: %%PHINX_CONFIG_DIR%%/db/migrations | |
seeds: %%PHINX_CONFIG_DIR%%/db/seeds | |
environments: | |
default_migration_table: phinxlog | |
default_database: development | |
production: | |
adapter: mysql | |
host: localhost |
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 | |
public function run() { | |
while ($this->mWorker->work()) { | |
if ($this->mWorker->returnCode() != GEARMAN_SUCCESS) { | |
throw new \Exception("Fatal Error"); | |
} | |
} | |
} | |
public function report(\GearmanJob $job) { | |
//simulate long running task |
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 __construct() { | |
# Create our worker object. | |
$this->mWorker = new \GearmanWorker(); | |
# Add default server (localhost). | |
$this->mWorker->addServer(); | |
$this->mWorker->addFunction(Client::JOB_TYPE_REPORT, [$this, "report"]); | |
} |
NewerOlder