Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
a9688954
Commit
a9688954
authored
May 21, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added composer extension.
parent
b24d04ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
0 deletions
+80
-0
composer.json
extensions/composer/composer.json
+27
-0
InstallHandler.php
extensions/composer/yii/composer/InstallHandler.php
+53
-0
No files found.
extensions/composer/composer.json
0 → 100644
View file @
a9688954
{
"name"
:
"yiisoft/yii2-composer"
,
"description"
:
"The composer integration for the Yii framework"
,
"keywords"
:
[
"yii"
,
"composer"
,
"install"
,
"update"
],
"type"
:
"library"
,
"license"
:
"BSD-3-Clause"
,
"support"
:
{
"issues"
:
"https://github.com/yiisoft/yii2/issues?state=open"
,
"forum"
:
"http://www.yiiframework.com/forum/"
,
"wiki"
:
"http://www.yiiframework.com/wiki/"
,
"irc"
:
"irc://irc.freenode.net/yii"
,
"source"
:
"https://github.com/yiisoft/yii2"
},
"authors"
:
[
{
"name"
:
"Qiang Xue"
,
"email"
:
"qiang.xue@gmail.com"
}
],
"minimum-stability"
:
"dev"
,
"require"
:
{
"yiisoft/yii2"
:
"dev-master"
},
"autoload"
:
{
"psr-0"
:
{
"yii
\\
composer"
:
""
}
}
}
extensions/composer/yii/composer/InstallHandler.php
0 → 100644
View file @
a9688954
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\composer
;
use
Composer\Script\CommandEvent
;
/**
* InstallHandler is called by Composer after it installs/updates the current package.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
InstallHandler
{
/**
* Sets the correct permissions of files and directories.
* @param CommandEvent $event
*/
public
static
function
setPermissions
(
$event
)
{
$options
=
array_merge
(
array
(
'writable'
=>
array
(),
'executable'
=>
array
(),
),
$event
->
getComposer
()
->
getPackage
()
->
getExtra
());
foreach
((
array
)
$options
[
'writable'
]
as
$path
)
{
echo
"Setting writable:
$path
..."
;
if
(
is_dir
(
$path
))
{
chmod
(
$path
,
0777
);
echo
"done
\n
"
;
}
else
{
echo
"The directory was not found: "
.
getcwd
()
.
DIRECTORY_SEPARATOR
.
$path
;
return
;
}
}
foreach
((
array
)
$options
[
'executable'
]
as
$path
)
{
echo
"Setting executable:
$path
..."
;
if
(
is_dir
(
$path
))
{
chmod
(
$path
,
0755
);
echo
"done
\n
"
;
}
else
{
echo
"The file was not found: "
.
getcwd
()
.
DIRECTORY_SEPARATOR
.
$path
;
return
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment