-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Loïc Chardonnet
committed
Apr 29, 2015
1 parent
f92e359
commit 8e74b47
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,3 @@ | |
/composer.lock | ||
/phpunit.xml | ||
/vendor | ||
/.couscous | ||
/.puli |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace Puli; | ||
|
||
use Puli\Discovery\Api\ResourceDiscovery; | ||
use Puli\Discovery\KeyValueStoreDiscovery; | ||
use Puli\Factory\PuliFactory; | ||
use Puli\Repository\Api\ResourceRepository; | ||
use Puli\Repository\FilesystemRepository; | ||
use Webmozart\KeyValueStore\JsonFileStore; | ||
|
||
/** | ||
* Creates Puli's core services. | ||
* | ||
* This class was auto-generated by Puli. | ||
* | ||
* IMPORTANT: Before modifying the code below, set the "factory.auto-generate" | ||
* configuration key to false: | ||
* | ||
* $ puli config factory.auto-generate false | ||
* | ||
* Otherwise any modifications will be overwritten! | ||
*/ | ||
class GeneratedPuliFactory implements PuliFactory | ||
{ | ||
/** | ||
* Creates the resource repository. | ||
* | ||
* @return ResourceRepository The created resource repository. | ||
*/ | ||
public function createRepository() | ||
{ | ||
if (!file_exists(__DIR__.'/repository')) { | ||
mkdir(__DIR__.'/repository', 0777, true); | ||
} | ||
|
||
$repo = new FilesystemRepository(__DIR__.'/repository', true); | ||
|
||
return $repo; | ||
} | ||
|
||
/** | ||
* Creates the resource discovery. | ||
* | ||
* @param ResourceRepository $repo The resource repository to read from. | ||
* | ||
* @return ResourceDiscovery The created resource discovery. | ||
*/ | ||
public function createDiscovery(ResourceRepository $repo) | ||
{ | ||
$store = new JsonFileStore(__DIR__.'/bindings.json', true); | ||
$discovery = new KeyValueStoreDiscovery($repo, $store); | ||
|
||
return $discovery; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |