Yii Framework Forum: Atomic core and packages - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

Atomic core and packages

#61 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 22 March 2012 - 12:14 PM

View PostVlad V, on 22 March 2012 - 11:45 AM, said:

Thinking at where the packages would be downloaded/stored - would this be next to the framework, like official Widgets and AR classes are now or in the "extensions" folder of each Yii application? I think the answer is open to debate. While packages like AR, database drivers and widgets could sit nicely next to the framework files, packages with modules would better be in the "extensions" folder of the application.


I raised this question also, because at the moment we're having different directories for modules and extensions ... and there're also themes which could be distributed with the package manager.

I think composer uses just one (1) directory to store the files. In its case it's 'vendor', but this can be customized, so for Yii this would be 'extensions'.

At the moment we could put all modules under extensions, we'd simply have to configure the modules with a class property. I think this would be also possible for themes, if you change the basePath property - the only thing which would not work then is using the baseUrl property, because it would be inside the protected/extensions folder.

I am working on this feature for Phundament 3, but it's not ready yet. If you want to you can have a look at these two composer.json files to get an impression:
1. phundament (skeleton) --> download p3media
2. p3media --> download p3extensions


PS: Just found some slides from Nils (composer developer) http://www.slideshar...group-karlsruhe
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#62 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 07 April 2012 - 10:51 AM

Here's the proof-of-concept for Yii 1.1: https://github.com/phundament/app
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#63 User is offline   Paul Apostol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 25-March 09

Posted 19 April 2012 - 09:52 AM

Hi,
I'd vote for Composer/Packagist.
In docs they said that can be added a custom installer based on type key, which let us build a set of package types based on Yii architecture: yii-module, yii-component, yii-extension, yii-theme, etc.
Best.
0

#64 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 11 September 2012 - 02:02 AM

Twitter just released a HTML, CSS, JavaScript package manager: http://twitter.github.com/bower/
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#65 User is offline   samdark 

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

Posted 11 September 2012 - 04:34 AM

Yii2 will use composer.
Yii 1.1 Application Development Cookbook

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

#66 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 11 September 2012 - 06:41 AM

I am pretty fine with composer ;) 'bower' looked to me like a solution for client-script/assets, but these could also be handled with composer.

Btw: Did you guys also work on more conventions for Yii2 Extensions, regarding interoperability and composer package types eg. yii-extension-installer(s)?
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#67 User is offline   Haensel 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 444
  • Joined: 14-January 11
  • Location:Vienna (Austria)

Posted 11 September 2012 - 07:35 AM

It would be really nice if it would become a de facto standard to add composer support when creating an extension + Travis CI for showing the build status. I guess this would vastly improve stability.
1

#68 User is offline   mindplay 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 397
  • Joined: 03-September 09
  • Location:New York

Posted 11 September 2012 - 08:40 AM

I know I recommended Composer early on, but now that I have actually used it, I have to say: I strongly recommend that using Composer be optional - a lot of Yii users will not be able to figure out how to even get it running properly.

It has so many dependencies on so many binaries, system paths, etc. - and there is currently no "one-click" installer available for Joe User, who for the most part also will not have an easy time understanding the concepts, how to correctly create package metadata, how to deploy packages correctly to Packagist, how to set up post-commit hooks, etc. etc.

The bottom line is that there is a hefty learning-curve.

I'm not personally a fan of having this amount of complexity and dependencies, just so you can type "install" at a prompt and have it download and unpack things for you - unless we're talking dozens of packages, I can do that myself in minutes. I just don't see the value.

That said, the community at large is embracing Composer - to the point that you're considered a wash-out and a loser if you don't support it, so I support it, reluctantly, since I can't propose a better alternative...
1

#69 User is offline   samdark 

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

Posted 11 September 2012 - 05:22 PM

Installing isn't even necessary, there's a PHAR: http://getcomposer.org/composer.phar
Yii 1.1 Application Development Cookbook

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

#70 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 24 September 2012 - 08:35 AM

I just wrote this article, I think it's useful for reference: Creating Yii applications with composer
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
3

#71 User is offline   samdark 

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

Posted 24 September 2012 - 09:29 AM

Cool. Thanks!
Yii 1.1 Application Development Cookbook

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

#72 User is offline   Haensel 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 444
  • Joined: 14-January 11
  • Location:Vienna (Austria)

Posted 24 September 2012 - 09:31 AM

Nice, thanks for sharing
0

#73 User is offline   perks 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 06-September 12

Posted 27 April 2013 - 04:53 AM

View Postsamdark, on 15 October 2011 - 03:08 PM, said:

Yes, I think "extension development guide" will be helpful. Will consider writing it.

I am also looking for the same ...
Hope we will get this very soon
0

#74 User is offline   mindplay 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 397
  • Joined: 03-September 09
  • Location:New York

Posted 27 April 2013 - 09:54 PM

Wow, this topic is older than time ;-)

I finally managed to actually install and run Composer - they provide a one-click installer now that takes care of setting it up correctly. It did not work with my PHP 5.3 installation, but a second attempt with my 5.4 installation got it running.

I spent about an hour and a half trying to set up a project with one dependency, read through some blog-posts and portions of the documentation, and finally gave up. This is not the first time I've tried either. The amount of documentation is entirely overwhelming, and not much help at all.

For comparison, I installed NPM (the Node Package Manager) and had it working in 5 minutes - not knowing the first thing about Node.

Composer makes me feel like a complete idiot. Who was it that wrote recently, that good software should make you feel smarter, not dumber? Composer takes essentially simple tasks and supposedly makes them simpler. Until it actually makes things simpler, not harder, I won't personally be using it. I have limited time and real work I'd like to do.
0

#75 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 568
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 27 April 2013 - 10:46 PM

Quote

Composer takes essentially simple tasks and supposedly makes them simpler.

I don't think dependency management is a simple task and I also can't agree with your statements.
There's also a big difference in just using composer or developing packages for/with it.
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#76 User is offline   samdark 

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

Posted 28 April 2013 - 03:28 AM

You'll be able to work with Yii2 w/o Composer.
Yii 1.1 Application Development Cookbook

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

#77 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 28 April 2013 - 04:10 AM

View Postsamdark, on 28 April 2013 - 03:28 AM, said:

You'll be able to work with Yii2 w/o Composer.


Very good!

Even though schmunk really tries hard to convince me of composer in our projects i tend to agree to mindplay. It makes easy things unneccessarily complex and obfuscates what really happens in the backround. I prefer manual control. With composer you have to trust the package author that he got dependencies and all these things right. schmunk, remember the problem, when the yii-bootstrap package for some reason pulled in another copy of the full Yii framework? Yes, you may be able to fix that if you read enough about composer. But i don't want to spend time on this. I can't see, why this is easier than downloading and extracting a simple .tgz file.

So my conclusion: Composer invites you to bloat your project with 1000 extra packages. Either because you configured them as you "may need them" or they where pulled in in the background as some dependency without your notice.

It's good that Yii 2 leaves that as an optional feature to us.
0

#78 User is offline   Ben 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 270
  • Joined: 15-March 09

Posted 28 April 2013 - 08:02 AM

Come on, it all depends on how extensions are bundled. As long as each extension is self-contained, you're right. Then it's only a matter of downloading the one single .tgz and extracting it. But as soon as extensions start to reuse existing other libs, which in turn might depend on other libs again, dependency management helps a lot.

And personally, I think it's not only about the downloading and upgrading. I think as soon as people start to use a dependency management system and get used to it, it really encourages them to reuse existing packages instead of rolling their own (partial) solution for every supporting task. Having more tools at hand, they can focus more on the actual problem they're trying to solve. And this should lead to slimmer, more focused and again more reusable extensions. I think it can be well compared to the unix philosophy: "Write programs that do one thing and do it well".

That being said - I also struggled with composer, even when trying to use it for the most simple tasks. Guess I need to put some time in it, get used to it, learn more about it. Just as with every new tool (thinking about git...) ;)
Don't like ads in my sig...
0

#79 User is offline   ekerazha 

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

Posted 28 April 2013 - 08:53 AM

Dependency management is a good answer to a wrong question. Today, disk space is cheap, just use self-contained libs, leave the dependency hell.

Yii user #37
0

#80 User is offline   mindplay 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 397
  • Joined: 03-September 09
  • Location:New York

Posted 28 April 2013 - 09:28 AM

View Postschmunk, on 27 April 2013 - 10:46 PM, said:

I don't think dependency management is a simple task and I also can't agree with your statements.
There's also a big difference in just using composer or developing packages for/with it.


All I told you was the experience I had with it - whether you agree with that or not, it's the truth.

Adding the JSON metadata file to my packages is the easy part - getting Composer itself to do something useful in a reasonable timeframe is the hard part.
0

Share this topic:


  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 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