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

Jump to content

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

Atomic core and packages

#41 User is offline   mindplay 

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

Posted 13 January 2012 - 11:01 PM

It doesn't hurt to keep in mind though, some application developers are going to need that kind of functionality, and it would be good if they could easily build it on top of the low-level architecture.
0

#42 User is offline   schmunk 

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

Posted 17 January 2012 - 04:44 PM

I took a bit closer look at composer and it looks really nice now.

But some problems with the current Yii structure arise, when thinking about package management.
Usually a package manager deploys the files into a single directory, in case of composer it's 'vendor' by default.

Currently components, modules, commands, themes and widgets reside in different places across your application, I think with the current config options you'd not be able to customize an app in a way, that it would be able to handle modules, widgets and themes from a common parent directory.

But in general, where should Yii's package manager place the files?

... when thinking about it, can modules be configured to run from outside 'modules'? But nevertheless the issue still applies for themes and commands.
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

#43 User is offline   mindplay 

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

Posted 17 January 2012 - 05:00 PM

Personally, I'd prefer having a single "vendors" folder, mainly because with PSR-0 autoloading conventions, it simplifies autoloading. It's quickly becoming the de-facto standard in the "high end" of the PHP community.
0

#44 User is offline   schmunk 

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

Posted 19 January 2012 - 03:51 AM

Quote

Are you tired of managing the deps and deps.lock files? Want to install BehatBundle without editing 3 files simultaneously and reading a long list of Mink dependencies that you need to place in deps? Composer to rescue!

Composer is a shiny new tool from the Symfony community, which aims to fix the dependency hell that we have right now in Symfony2. Also, Composer will become the core dependency manager for Symfony 2.1 when it's released. But you don't need to wait until then - you can use it for your Symfony 2.0 projects too. And today we'll show you how.


A detailed blog posting about composer and Symfony2
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

#45 User is offline   sensorario 

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

Posted 20 February 2012 - 07:02 AM

And what if we just put some information inside actual extensions? Like...

<extension>
<url value="http://blablabla" />
<type value="widget" />
<copy todir="ext.blabla" />
</extension>

Well ... If yii users start to use phing we can do something like that (this is my build.xml for Myii project):

<target name="extensions">
<echo msg="clean extensions directory" />
<exec command="rm -rf dist/app/protected/extensions/*" />
<foreach list="lyiightbox, queryii, scrolltop" param="module" target="install-module">
<property name="module-name" value="${module}" />
</foreach>
</target>

<target name="install-module">
<exec command="wget https://github.com/s.../zipball/master --directory-prefix=dist/app/protected/extensions/"/>
<unzip file="dist/app/protected/extensions/master" todir="dist/app/protected/extensions/">
<fileset dir=".">
<include name="master"/>
</fileset>
</unzip>
<exec command="rm -rf dist/app/protected/extensions/master" />
</target>


And phing automatically can download extensions from yii site and then install them inside our application.
0

#46 User is offline   sensorario 

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

Posted 20 February 2012 - 07:07 AM

An'installer file can also download a particular version of a packacge or extension if exists a standard way to store this informations
0

#47 User is offline   sensorario 

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

Posted 27 February 2012 - 07:01 AM

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

scrolltop,
lyiightbox,
queryii,

it work!
0

#48 User is offline   jacmoe 

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

Posted 29 February 2012 - 07:58 AM

Wtf is Phing?

Can't it be done using regular Yaml or JSON ?
"Less noise - more signal"
0

#49 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 29 February 2012 - 08:22 AM

Phing is a PHP-port of Apache Ant.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#50 User is offline   sensorario 

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

Posted 29 February 2012 - 08:25 AM

jacmoe, phing is that tool that qiang use to deploy yii, code or documentation ... Is a tool for php to automate some operations that now you do by hand like upload or download of file, ftp operations, git operations, ...

All your application use some extensions? Every time you download them? Well..: you can schedule all task, and create a phing file (build.xml) that will do all the task in one single command. Is like yiic. But yiic stay to yii like phing stay to php.

I have a phing command the rewrite database permission. So, if i need to install my application in a database called "dbjacmoe" with user "jac" and password "moe" i do this:

$ phing database
Database name [dbtest]?
Database username [dbuser]?
Database password [dbpassword]?

I do not open any file. Phing do this for me.
1

#51 User is offline   jacmoe 

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

Posted 29 February 2012 - 08:41 AM

That sounds really cool. Thanks Sensario and Da:Sourcerer. :)

Does Phing require shell access?
That could be a problem on some hosts.

How will it handle upgrades?

And migrations?
"Less noise - more signal"
0

#52 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 29 February 2012 - 08:52 AM

last time I checked, phing ran on the shell only. There might be little incentive to create a web GUI ... think of the fate of the PEAR web installer.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#53 User is offline   sensorario 

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

Posted 29 February 2012 - 08:59 AM

$ pear install php-pear
$ pear channel-discover pear.phing.org
$ pear install phing/phing
0

#54 User is offline   jacmoe 

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

Posted 29 February 2012 - 09:08 AM

Phing would be a lot cooler if it had a Pyrus (PEAR2) package.
That way, you don't need to mess around with a PEAR repository in a central location.

<edit>
Doesn't seem to have a Pyrus package, but it can be installed as stand-alone, so it's great.
</edit>
"Less noise - more signal"
0

#55 User is offline   schmunk 

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

Posted 02 March 2012 - 04:18 AM

Just FYI: Packagist is now a available as a github Service Hook: https://github.com/g...rvices/pull/253
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

#56 User is offline   jacmoe 

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

Posted 02 March 2012 - 04:27 AM

I figured out that Packagist is a package manager interface for composer, right? :)

But what is a Github service hook, and why would you want to make use of it?
"Less noise - more signal"
0

#57 User is offline   schmunk 

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

Posted 02 March 2012 - 05:13 AM

Well, I haven't looked into that in detail, but as composer/packagist is a package archive dependency manager, it looks like you can automatically submit your changes made via github to your composer repo. For sure you'll have to take care about version numbers and so on.

See also: http://groups.google...8f86aea57?hl=en
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
1

#58 User is offline   mindplay 

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

Posted 06 March 2012 - 10:02 PM

Great post about Composer/Packagist here:

http://philsturgeon....forward-for-php
1

#59 User is offline   Ben 

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

Posted 07 March 2012 - 05:47 PM

Thanks for that link. Does anyone have experice with travis ci? Like the idea...

////////////////
// EDIT:

Needed to test this. :)

Just a plain skeleton app with one dead simple unit test taken from the first yii book. Took me a while to figure out how to configure dependencies, but now it works and they run unit tests for me whenever I commit something (using different php and different yii versions).

http://travis-ci.org...r/yiiTravisTest

As a side note, looks like symfony is already using this service:
http://travis-ci.org...symfony/symfony
Don't like ads in my sig...
0

#60 User is offline   Vlad V 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 15-August 10
  • Location:România

Posted 22 March 2012 - 11:45 AM

Using packages in Yii is just great. It will ease the work of downloading extensions or just using the main core of the framework.

I also like the idea of separating the core code from other, somehow secondary, parts like AR or Zii. Maybe one just needs to build a JSON API thus a widget like Zii would be useless there. I know that, just being there, does not affect the performance in any way but it is nicer and cleaner to have only what you need.

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 agree with @samdark that it would be helpful if the framework would also come in a "core only" package. A feature of the download page allowing users to get what packages they need at the download time, just like JQuery UI does, would be great.
- Vlad.
0

Share this topic:


  • (5 Pages)
  • +
  • 1
  • 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