Skip to content

Commit e055f94

Browse files
committed
Add output of message
1 parent 9e7fcf2 commit e055f94

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"scripts" : {
2626
"post-install-cmd": [
2727
"Kenjis\\CodeIgniter\\Installer::postInstall",
28-
"composer update"
28+
"composer update",
29+
"Kenjis\\CodeIgniter\\Installer::showMessage"
2930
]
3031
},
3132
"extra": {

src/Installer.php

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class Installer
1616
{
1717
const DOCROOT = 'public';
18-
18+
1919
/**
2020
* Composer post install script
2121
*
@@ -55,8 +55,34 @@ public static function postInstall(Event $event = null)
5555
file_put_contents($file, $contents);
5656

5757
copy('composer.json.dist', 'composer.json');
58-
59-
// delete self
58+
}
59+
60+
/**
61+
* Composer post install script
62+
*
63+
* @param Event $event
64+
*/
65+
public static function showMessage(Event $event = null)
66+
{
67+
$io = $event->getIO();
68+
$io->write('==================================================');
69+
$io->write(
70+
'<info>`public/.htaccess` was installed. If you don\'t need it, please remove it.</info>'
71+
);
72+
$io->write(
73+
'<info>If you want to install translations for system messages or some third party libraries,</info>'
74+
);
75+
$io->write('$ cd <codeigniter_project_folder>');
76+
$io->write('$ php bin/install.php');
77+
$io->write('<info>Above command will show help message.</info>');
78+
$io->write('See https://github.com/kenjis/codeigniter-composer-installer');
79+
$io->write('==================================================');
80+
81+
self::deleteSelf();
82+
}
83+
84+
private static function deleteSelf()
85+
{
6086
unlink(__FILE__);
6187
rmdir('src');
6288
unlink('composer.json.dist');

0 commit comments

Comments
 (0)