Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP 7 compatibility (Merge pull request #44 from steverhoades/fixes-43)
Might need some additional testing/work after, but it looks like this fixes the PHP 7 issues with the skeleton. (Fixes #43)
- Loading branch information
Showing
7 changed files
with
2,970 additions
and
342 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
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,39 @@ | ||
<?php | ||
namespace ComponentManager; | ||
|
||
use Composer\Script\Event; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
|
||
class ComponentManager | ||
{ | ||
public static function postComposerInstall(Event $event) | ||
{ | ||
$config = $event->getComposer()->getConfig(); | ||
$componentDir = $config->get('component-dir'); | ||
$components = $config->get('components'); | ||
$vendorDir = $config->get('vendor-dir'); | ||
|
||
// if either configuration is empty it's a noop | ||
if (empty($componentDir) || empty($components)) { | ||
return; | ||
} | ||
|
||
$componentDir = __DIR__ .'/'. $componentDir; | ||
|
||
if (!is_dir($componentDir)) { | ||
mkdir($componentDir); | ||
} | ||
|
||
$filesystem = new Filesystem(); | ||
|
||
foreach ($components as $component) { | ||
$componentSource = $vendorDir .'/'. $component; | ||
|
||
if (!is_dir($componentSource)) { | ||
continue; | ||
} | ||
|
||
$filesystem->mirror($componentSource, $componentDir .'/'. basename($component)); | ||
} | ||
} | ||
} |
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,42 @@ | ||
{ | ||
"name": "sculpin/blog-skeleton", | ||
"description": "A Skeleton for a Sculpin Based Blog", | ||
"type": "sculpin-skeleton", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Dragonfly Development Inc.", | ||
"email": "info@dflydev.com", | ||
"homepage": "http://dflydev.com" | ||
}, | ||
{ | ||
"name": "Beau Simensen", | ||
"email": "beau@dflydev.com", | ||
"homepage": "http://beausimensen.com" | ||
} | ||
], | ||
"require": { | ||
"sculpin/sculpin": "^2.1@dev", | ||
"dflydev/embedded-composer": "^1.0@dev", | ||
"kriswallsmith/assetic": "1.1.2", | ||
"components/bootstrap": "^3.3", | ||
"components/jquery": "^3.1", | ||
"components/highlightjs": "^9.7" | ||
}, | ||
"config": { | ||
"component-dir": "source/components", | ||
"components": [ | ||
"components/bootstrap", | ||
"components/jquery", | ||
"components/highlightjs" | ||
] | ||
}, | ||
"scripts": { | ||
"post-install-cmd": [ | ||
"ComponentManager\\ComponentManager::postComposerInstall" | ||
] | ||
}, | ||
"autoload": { | ||
"classmap": ["component-manager.php"] | ||
} | ||
} |
Oops, something went wrong.