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
65dfedf0
Commit
65dfedf0
authored
Apr 16, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #3127: added more doc [skip ci]
parent
8ac8d487
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
using-3rd-party-libraries.md
docs/guide/using-3rd-party-libraries.md
+33
-2
No files found.
docs/guide/using-3rd-party-libraries.md
View file @
65dfedf0
...
...
@@ -4,7 +4,38 @@ Using 3rd-Party Libraries
Yii is carefully designed so that third-party libraries can be
easily integrated to further extend Yii's functionalities.
TODO: namespaces and composer explanations
Using Packages Installed via Composer
-------------------------------------
Packages installed via Composer can be directly used in Yii without any special handling.
Using Downloaded Libraries
--------------------------
If a library has its own class autoloader, please follow its instruction on how to install the autoloader.
If a library does not have a class autoloader, you may face one of the following scenarios:
*
The library requires specific PHP include path configuration.
*
The library requires explicitly including one or several of its files.
*
Neither of the above.
In the last scenario, the library is not written very well, but you can still do the following
work to make it work with Yii:
*
Identify which classes the library contains.
*
List the classes and the corresponding file paths in
`Yii::$classMap`
.
For example, if none of the classes in a library is namespaced, you may register the classes with Yii
like the following in the entry script after including
`yii.php`
:
```
php
Yii
::
$classMap
[
'Class1'
]
=
'path/to/Class1.php'
;
Yii
::
$classMap
[
'Class2'
]
=
'path/to/Class2.php'
;
// ...
```
Using Yii in 3rd-Party Systems
------------------------------
...
...
@@ -77,7 +108,7 @@ Yii::$classMap = include($yii2path . '/classes.php');
Using this, defines all necessary constants and autoloader of Yii1.
Now we need to add all fields and methods from
`YiiBase`
of Yii1 to our 'Yii' class.
Unfortuna
l
ly, there is no way to do so but copy-paste:
Unfortuna
te
ly, there is no way to do so but copy-paste:
```
php
$yii2path
=
'/path/to/yii2'
;
...
...
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