Revision #4                                    has been created by  GOsha                                    on Nov 20, 2010, 9:39:08 PM with the memo:
 GOsha                                    on Nov 20, 2010, 9:39:08 PM with the memo:
                                
                                
                                    More language corrections                                
                                                                    « previous (#3)                                                                                                    next (#5) »                                                            
                            Changes
                            
    Title
    unchanged
    Directory independent extensions
    Category
    unchanged
    Tips
    Yii version
    unchanged
    
    Tags
    unchanged
    libraries, extensions, paths
    Content
    changed
    ## How to implement directory independent extensions
Many people want to use downloaded extensions in their own way. As for me 
the most of the extensions 
are require me to correct 
`Yii::import()
` instructions inside their source code. All these extensions are directory dependent. To avoid 
athe situation described
 above, I suggest to implement pseudo-anonymous aliases:
```php[...]
// create alias
Yii::setPathOfAlias($alias,$dir);
// import another classes
Yii::import($alias.'.anotherClass');
Yii::import($alias.'.andAnoTherClass');[...]
```
Using this technique you can create a *really* directory-independent extension
s.