Yii Framework Forum: Auto-installable extensions - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Auto-installable extensions

#1 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 27 February 2012 - 07:07 AM

Now Myii project download extensions and with a config array install them with any manual operation. I've tryied with 3 my extensions:

scrolltop,
lyiightbox,
queryii,

it work!

Yii2.0 can improve this feature and standardization of extensions. So, we'll can use phing or yiic to download and install extensions automatically. All three extensions are stored on github.

My extensions has this structure:

/EXTENSION_NAME.readme.markdown
/EXTENSION_NAME/config/main.php
/EXTENSION_NAME/* <- classes or folders ...

this is config main:

<?php

return array(
    'version' => '1.0',
    'extract' => array(
        'to' => 'protected/extensions/'
    ),
);


0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,781
  • Joined: 17-January 09
  • Location:Russia

Posted 27 February 2012 - 07:56 AM

What about dependencies?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 27 February 2012 - 08:23 AM

Can you give me more details? Are you talking about dependencies from others extensions or from different version of frameworks?
0

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,781
  • Joined: 17-January 09
  • Location:Russia

Posted 28 February 2012 - 10:16 AM

Both.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#5 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 28 February 2012 - 11:29 AM

There are a couple of approaches:

- External dependencies (Linux, FreeBSD etc. way)
- Self-contained dependencies (MacOS X way?)

Dependency hell VS Redundant code

In my opinion self-contained dependencies would be an interesting approach.
Yii user #37
0

#6 User is offline   phpnode 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 141
  • Joined: 18-April 11

Posted 28 February 2012 - 02:38 PM

I spent some time a few months ago writing a package manager for Yii, but I didn't finish it: https://github.com/p...Package-Manager

I think that rather than reinventing the wheel, we should adopt Composer: https://github.com/composer/composer as it seems to be the most active, modern php package manager.

Otherwise a significant amount of dev time will be spend dedicated to maintaining and updating our own system. Decent package management is not a trivial problem to solve, we should concentrate on the framework instead.
1

#7 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 28 February 2012 - 03:56 PM

View Postsamdark, on 28 February 2012 - 10:16 AM, said:

Both.


I want support latest 1.1.x version and latest extension version. But should be possible to set all info in the extension config file. It can tell to Myii the version supported of yii and, eventually, for each extension, the version of dependencies. But ... but is not an'issue now. If someone need this feature, I'll implement it right now!
0

#8 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,781
  • Joined: 17-January 09
  • Location:Russia

Posted 28 February 2012 - 06:18 PM

Anyway, I agree with phpnode. Composer looks OK and I think it will fit Yii2 well. sensorario, if you have some free time maybe you'll be able to evaluate Composer and tell us your opinion about what's missing and if it's OK in its current state.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#9 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 29 February 2012 - 03:41 AM

Yes!
0

#10 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 29 February 2012 - 07:57 AM

Really awesome! :D
"Less noise - more signal"
0

#11 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 29 February 2012 - 05:15 PM

Well, at the moment I am working on Myii. I am trying to do a video to show you something like ...

clone Myii (git clone git@github.com:sensorario/Myii)
move to Myii (cd Myii)
crate a new webapp (phing create)
load console (php yii/yiic shell projects/APP_NAME/protected/config/main.php)
create table products ( >>> queryii create product)
add a field "name" ( >>> queryii alter product add string name)
load gii (Myii load a /protected/views/layouts/main.php that automatically show Gii on main menu so you do not have to do anything by hand)
...
create model, crud, ...

That's it! few minutes. But I need to see composer. At the moment I have two kind of extensions:
console command (queryii)
widgets (lyiightbox and scrolltop)

This is widgets config file:
return array(
    'version' => '1.0',
    'extract' => array(
        'to' => 'protected/commands/shell'
    ),
);


And this is console command config file:
return array(
    'version' => '1.0',
    'extract' => array(
        'files' => array(
            'QueryiiCommand.php'
        ),
        'to' => 'protected/commands/shell'
    ),
);


Maybe composer can make more easy this steps ... I am thinking that Myii can work well for yii1.1.x
Maybe composer can work very well for Yii2 I want to study it!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users