public function fire()
{
// get plugin info
$plugin = $this->getPlugin();
$pluginClass = new ReflectionClass($plugin->getClass());
$namespace = $pluginClass->getNamespaceName();
// get skin info
$path = $this->getPath();
$skinClass = studly_case(basename($path)) . 'Skin';
$skinFile = $this->getSkinFile($plugin, $path, $skinClass);
// path_to_skin_dir/Skin.php
$skinTarget = $this->getSkinTarget();
$skinId = $this->getSkinId($plugin, $skinClass, $skinTarget);
// myplugin@skin
$skinTitle = $this->getSkinTitle();
$description = $this->getSkinDescription($skinId, $plugin);
$this->attr = compact('plugin', 'path', 'pluginClass', 'namespace', 'skinClass', 'skinTarget', 'skinFile', 'skinId', 'skinTitle', 'description');
// print and confirm the information of skin
if ($this->confirmInfo() === false) {
return false;
}
try {
$this->copySkinDirectory();
$this->makeSkinClass();
// composer.json 파일 수정
if ($this->registerSkin() === false) {
throw new \Exception('Writing to composer.json file was failed.');
}
$this->runComposerDump($plugin->getPath());
} catch (\Exception $e) {
$this->clean();
throw $e;
}
$this->info("Skin is created successfully.");
//$this->info("See ./plugins/$name directory. And open $url in your browser.");
//$this->info("Input and modify your plugin information in ./plugins/$name/composer.json file.");
}