Skip to content

Commit 7fc86de

Browse files
committed
migrate component
1 parent 2f02920 commit 7fc86de

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"phpixie/validate": "~3.0",
3838
"phpixie/social": "~3.0",
3939
"phpixie/cli": "~3.0",
40-
"phpixie/console": "~3.0"
40+
"phpixie/console": "~3.0",
41+
"phpixie/migrate": "~3.0"
4142
},
4243
"require-dev": {
4344
"phpixie/test": "~3.0"

src/PHPixie/Framework/Components.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,15 @@ public function console()
214214
return $this->instance('console');
215215
}
216216

217+
/**
218+
* Migrate
219+
* @return \PHPixie\Migrate
220+
*/
221+
public function migrate()
222+
{
223+
return $this->instance('migrate');
224+
}
225+
217226
/**
218227
* @param string $name
219228
* @return mixed
@@ -440,6 +449,20 @@ protected function buildConsole()
440449
$this->configuration()->consoleProvider()
441450
);
442451
}
452+
453+
/**
454+
* @return \PHPixie\Migrate
455+
*/
456+
protected function buildMigrate()
457+
{
458+
$configuration = $this->configuration();
459+
460+
return new \PHPixie\Migrate(
461+
$this->database(),
462+
$configuration->migrateRoot(),
463+
$configuration->migrateConfig()
464+
);
465+
}
443466

444467
/**
445468
* @return Configuration

src/PHPixie/Framework/Configuration.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,16 @@ public function socialConfig();
9696
* @return \PHPixie\Console\Registry\Provider
9797
*/
9898
public function consoleProvider();
99+
100+
/**
101+
* Migrations configuration
102+
* @return Data
103+
*/
104+
public function migrateConfig();
105+
106+
/**
107+
* Migrations root
108+
* @return Root
109+
*/
110+
public function migrateRoot();
99111
}

0 commit comments

Comments
 (0)