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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
59f09863
Commit
59f09863
authored
Nov 02, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved extension list under yiisoft.
updated read me.
parent
e5d5ab56
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
36 deletions
+57
-36
Installer.php
extensions/composer/Installer.php
+2
-2
README.md
extensions/composer/README.md
+55
-34
No files found.
extensions/composer/Installer.php
View file @
59f09863
...
@@ -85,13 +85,13 @@ class Installer extends LibraryInstaller
...
@@ -85,13 +85,13 @@ class Installer extends LibraryInstaller
protected
function
loadExtensions
()
protected
function
loadExtensions
()
{
{
$file
=
$this
->
vendorDir
.
'/yii
-
extensions.php'
;
$file
=
$this
->
vendorDir
.
'/yii
soft/
extensions.php'
;
return
is_file
(
$file
)
?
require
(
$file
)
:
[];
return
is_file
(
$file
)
?
require
(
$file
)
:
[];
}
}
protected
function
saveExtensions
(
array
$extensions
)
protected
function
saveExtensions
(
array
$extensions
)
{
{
$file
=
$this
->
vendorDir
.
'/yii
-
extensions.php'
;
$file
=
$this
->
vendorDir
.
'/yii
soft/
extensions.php'
;
file_put_contents
(
$file
,
"<?php
\n
return "
.
var_export
(
$extensions
,
true
)
.
";
\n
"
);
file_put_contents
(
$file
,
"<?php
\n
return "
.
var_export
(
$extensions
,
true
)
.
";
\n
"
);
}
}
...
...
extensions/composer/README.md
View file @
59f09863
Yii 2.0 Public Preview - Composer Installer
Yii 2 Composer Installer
===========================================
========================
Thank you for choosing Yii - a high-performance component-based PHP framework.
If you are looking for a production-ready PHP framework, please use
[
Yii v1.1
](
https://github.com/yiisoft/yii
)
.
Yii 2.0 is still under heavy development. We may make significant changes
without prior notices.
**Yii 2.0 is not ready for production use yet.**
[
![Build Status
](
https://secure.travis-ci.org/yiisoft/yii2.png
)
](http://travis-ci.org/yiisoft/yii2)
[
![Build Status
](
https://secure.travis-ci.org/yiisoft/yii2.png
)
](http://travis-ci.org/yiisoft/yii2)
This is the yii2 composer installer.
This is the composer installer for Yii 2 extensions. It implements a new composer package type named
`yii2-extension`
,
which should be used by all Yii 2 extensions if they are distributed as composer packages.
Installation
Usage
-----
-------
-----
This extension offers you enhanced Composer handling for your yii2-project. It will therefore require you to use Composer.
To use Yii 2 composer installer, simply set
`type`
to be
`yii2-extension`
in your
`composer.json`
,
like the following:
```
json
{
"type"
:
"yii2-extension"
,
"require"
:
{
"yiisoft/yii2"
:
"*"
},
...
}
```
```
php composer.phar require yiisoft/yii2-composer "*"
```
*Note: You might have to run `php composer.phar selfupdate` before using this extension.*
Usage & Documentation
---------------------
This extension allows you to hook to certain composer events and automate preparing your Yii2 application for further usage.
You may specify a bootstrap class in the
`extra`
section. The class will be executed each time
the Yii 2 application is responding to a request. For example,
After the package is installed, the
`composer.json`
file has to be modified to enable this extension.
```
json
To see it in action take a look at the example apps in the repository:
{
"type"
:
"yii2-extension"
,
-
[
Basic
](
https://github.com/suralc/yii2/blob/master/apps/basic/composer.json#L27
)
...
,
-
[
Advanced
](
https://github.com/suralc/yii2/blob/extensions-readme/apps/advanced/composer.json
)
"extra"
:
{
"bootstrap"
:
"yii
\\
jui
\\
Extension"
However it might be useful to read through the official composer
[
documentation
](
http://getcomposer.org/doc/articles/scripts.md
)
}
to understand what this extension can do for you and what it can't.
}
```
You can also use this as a template to create your own composer additions to ease development and deployment of your app.
The
`Installer`
class also implements a static method
`setPermission()`
that can be called after
a Yii 2 projected is installed, through the
`post-create-project-cmd`
composer script.
The method will set specified directories or files to be writable or executable, depending on
the corresponding parameters set in the
`extra`
section of the
`composer.json`
file.
For example,
```
json
{
"name"
:
"yiisoft/yii2-app-basic"
,
"type"
:
"project"
,
...
"scripts"
:
{
"post-create-project-cmd"
:
[
"yii
\\
composer
\\
Installer::setPermission"
]
},
"extra"
:
{
"writable"
:
[
"runtime"
,
"web/assets"
],
"executable"
:
[
"yii"
]
}
}
```
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