Yii Framework Forum: Yiic Depreciation - Yii Framework Forum

Jump to content

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

Yiic Depreciation Reasoning on why yiic code generation should not be deprecated. Rate Topic: ***** 1 Votes

#1 User is offline   Kefah 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-April 10
  • Location:Amman, Jordan

Posted 11 July 2010 - 08:20 AM

Hello,

I came across a note on the Yii guide 1.1.3 stating that the use of yiic tool for code generation is deprecated since 1.1.2 in favor of Gii.

Two questions:

1. Why should it be so? any reason why we can't maintain code generation on both? why kind of limits does the command line approach impose?

2. Does that in any way, mean that yiic might be deprecated altogether in the future?

I rely on yiic as my primary interaction shell with the yii framework, i use it to inspect and try things, so for me it goes far more than just code generation.

but even for code generation, I would much rather keep using yiic as opposed to the graphical web-based Gii.

Its interesting also to hear the Yii developer community insight on this.

Regards,
0

#2 User is offline   samdark 

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

Posted 11 July 2010 - 08:53 AM

1. Maintaining both takes time. We'll try to do it but can't promise anything.
2. No, yiic itself is not deprecated. Only yiic shell.
Yii 1.1 Application Development Cookbook

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

#3 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 11 July 2010 - 09:01 AM

I believe Gii is easier to use than yiic code generator by people new to the framework. I don't see the point in maintaining two code bases that does exactly the same thing. yiic will still be a part of yii i think as it generates the webapp and message translations and i do not see those functionalities in yiic code generator.

However, I don't think it would be bad idea to phase yiic code generator out all together in favour of gii and keep all code generation in one place. Yii framework could then be distributed with a skeleton application instead of generating one.

Gii offers things that yiic cannot like side by side comparison of files when you are about to overwrite a file, code preview etc...

May i ask what kind of things you inspect and try with gii?
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#4 User is offline   sova 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 24-February 10

Posted 11 July 2010 - 10:47 AM

In my project I have a custom URL Manager which makes it very difficult to use Gii. In order to do it I have to temporarily disable the custom URL Manager and turn on Gii-specific URL rules. Therefore for me yiic shell is very helpful.
0

#5 User is offline   Kefah 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-April 10
  • Location:Amman, Jordan

Posted 11 July 2010 - 01:51 PM

Hello,

I am sad to hear that the intention is to drop yiic shell. As I thought the idea was only to deprecate code-generation in yiic shell, but not yiic shell altogether.

Granted that many people who would prefer Graphical UI; However, for me, along with like-minded individuals, yiic shell is so useful, and far superior.

For example, in yiic shell I can run arbitrary php code, within Yii framework, where I have full access to Yii functionality and data. I can create objects, do adhoc database insertions/updates/..etc, test all functionality, like url creation, message translation, and many others.

From the technical point of view, there is no strict need to develop two independent pieces of code. The common functionality of yiic shell can be isolated in a library/classes which can be used by both Gii and yiic shell.

Last and not least, I come from RoR background, I can't imagine living without ./script/console . Which does essentially what yiic shell do.

I wish Yii developers reconsider that direction.

Yii is by far one of the best frameworks ever, yiic shell represents an important element in Yii awesomeness.

Regards,
- Kefah.
0

#6 User is offline   samdark 

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

Posted 11 July 2010 - 02:10 PM

Kefah

Quote

From the technical point of view, there is no strict need to develop two independent pieces of code. The common functionality of yiic shell can be isolated in a library/classes which can be used by both Gii and yiic shell.

Good suggestion. Will think about it.
Yii 1.1 Application Development Cookbook

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

#7 User is offline   GodFather 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 19-July 09

Posted 11 July 2010 - 02:46 PM

I agree with Kefah, yiic is vital to some applications to make tests, inserts on database, etc, to some users a write a word on a terminal seems more natural that do alot of clicks, and he did a great propose to isolate the yiic classes to be used on both applications.
0

#8 User is offline   tydeas_dr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 158
  • Joined: 16-April 10
  • Location:Greece

Posted 27 July 2010 - 04:47 PM

Think i will agree with yiic shell should not be deprecated.
Follow me on twitter @dmtrsslvdr
Check my *new* blog @ tumblr
0

#9 User is offline   samdark 

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

Posted 28 July 2010 - 03:33 AM

GodFather, tydeas_dr
yiic shell!=yiic. We are not going to deprecate yiic itself for sure.
Yii 1.1 Application Development Cookbook

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

#10 User is offline   GodFather 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 91
  • Joined: 19-July 09

Posted 28 July 2010 - 06:06 AM

samdark, I understood, we're talking about yiic code generation tool, that can't be completely deprecated for gii.
0

#11 User is offline   Kefah 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 20-April 10
  • Location:Amman, Jordan

Posted 31 July 2010 - 02:32 AM

View PostGodFather, on 28 July 2010 - 06:06 AM, said:

samdark, I understood, we're talking about yiic code generation tool, that can't be completely deprecated for gii.


Yes, the code generation part should remain to have 1st grade support on the yiic shell.
But, in addition to that, all yiic shell should also enjoy 1st grade care.

I am not stating that in a *demand* attitude, as Yii is a free software and every one is invited to help; including myself. I mainly stressing the importance (strategic-wise) of keeping and maintaining a fully capable yii interactive shell.
0

#12 User is offline   Aziz Light 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 23-January 10
  • Location:Paris

Posted 02 August 2010 - 01:42 AM

I got back to learning the Yii Framework a couple weeks ago. The reason I started using it in the first place was because it had yiic shell, it's an amazing tool. Imho, deprecating it would be like deprecating Terminal.app on OS X, or the Unix command-line on Ubuntu.

I also agree with Kefah:

Quote

From the technical point of view, there is no strict need to develop two independent pieces of code. The common functionality of yiic shell can be isolated in a library/classes which can be used by both Gii and yiic shell.


I would go even further than that by saying that yiic shell should be the main script to maintain and Gii only a GUI front-end for yiic shell.

One last thing: Imho, the greatest advantage of a command-line tool over a GUI tool is speed. It's much faster to work on the command-line. The way I see it, yii is the most lightweight PHP RAD framework and deprecating its command line tool would take away its RAD aspect.
0

#13 User is offline   Junior - df9 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 416
  • Joined: 24-May 09
  • Location:Brazil

Posted 02 August 2010 - 06:46 AM

I think that generating CRUD for composite keys is more useful than rewriting the way of generating code. Sincerely, don't understand why Qiang and Yii team don't include support for CRUD in tables with composite keys, because this kind of table is present in all professional applications and it is what the ER modeling states.
Till now, we have to declare a fake autoincrement pk instead of a composite primary key and create an unnecessary index in the table just to keep the integrity. I'm sorry, but this is workaround that real database professionals shouldn't agree with and certainly avoid. However, to write all the CRUD code manually is a pain in the neck.

So, imho, the way you generate code is not so important, the generated code is the most important thing. And the generated code in Yii has been improved so much with CGridView, why not implementing the composite key support instead of rewriting all the generation code structure?

It's not my intention to create a flameware, neither to make ofensive comments, so, please, consider my post as a simple point of view that i have been stating for some time to make even better a framework that is one of the best.

thanks for reading!

:)

regards!!
______________________________________
Junior
df9.com.br
Linux Registered User #364954
GNU/Linux: together we're ready!
1

#14 User is offline   mauricioschneider 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 16-August 10
  • Location:Santiago, Chile

Posted 04 October 2010 - 07:27 AM

Any updates regarding this issue? I also prefer yiic over gii :rolleyes:.
0

#15 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 26 October 2010 - 05:51 AM

+1 to previous two posts.
0

#16 User is offline   jorge 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 04-December 10
  • Location:Spain

Posted 04 December 2010 - 08:39 AM

View Postsamdark, on 11 July 2010 - 08:53 AM, said:

1. Maintaining both takes time. We'll try to do it but can't promise anything.
2. No, yiic itself is not deprecated. Only yiic shell.


Sorry about my ignorance... could you explain how yiic != yiic shell ?

I understood yiic is a command line tool to generate code and to be used in a terminal window. :huh:

I'm just beginning with the tutorials and confused about if I should learn this tool as indicated in all the tutorials.

Thanx
0

#17 User is offline   jorge 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 04-December 10
  • Location:Spain

Posted 04 December 2010 - 03:47 PM

View Postjorge, on 04 December 2010 - 08:39 AM, said:

Sorry about my ignorance... could you explain how yiic != yiic shell ?

I understood yiic is a command line tool to generate code and to be used in a terminal window. :huh:

I'm just beginning with the tutorials and confused about if I should learn this tool as indicated in all the tutorials.

Thanx


Ok... let me answer myself. I think I got it..

yiic is an executable that internally calls php yiic.php. That would be the shell.

and yiic.php are the classes called by the executable or just invoked by using php yiic.

As another member told me, you still use yiic to create the basic skeleton.

Hope I'm right. ::)
0

#18 User is online   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,353
  • Joined: 12-October 09
  • Location:Croatia

Posted 04 December 2010 - 04:56 PM

@jorge

before Gii for creating model and crud we used "yiic shell"... that is now deprecated... but yiic is still there with other commands...

To create a new app skeleton we use "yiic webapp"
Find more about me.... btw. Do you know your WAN IP?
0

#19 User is offline   samdark 

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

Posted 04 December 2010 - 07:01 PM

btw., deprecation is not about a possibility to create a shell-like command but about yiic shell code generator itself.
Yii 1.1 Application Development Cookbook

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

#20 User is offline   jorge 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 04-December 10
  • Location:Spain

Posted 04 December 2010 - 08:38 PM

View Postmdomba, on 04 December 2010 - 04:56 PM, said:

@jorge

before Gii for creating model and crud we used "yiic shell"... that is now deprecated... but yiic is still there with other commands...

To create a new app skeleton we use "yiic webapp"



Ok, I understand now. Thanks so much.
0

Share this topic:


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