-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDir.php
More file actions
36 lines (31 loc) · 760 Bytes
/
Dir.php
File metadata and controls
36 lines (31 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace Solire\Install;
use Composer\Script\Event;
/**
* Manage directories.
*
* @author thansen
*/
class Dir
{
/**
* Set the writing right for all on twig cache directory.
*
* @param Event $event The composer event
*
* @return void
*/
public static function allowPermissions(Event $event)
{
$extra = $event->getComposer()->getPackage()->getExtra();
$dirs = $extra['solire']['allowPermissions'];
foreach ($dirs as $dir) {
chmod(realpath($dir), 0777);
$msg = sprintf(
'<info>Toutes permissions données sur le dossier "%s"</info>',
realpath($dir)
);
$event->getIO()->write($msg);
}
}
}