Files needed for production - the framework directory

Hello, framewrok the folder has about 15MB, but would like to know which files are needed folder yii/framework for the application running in production?

Thank you!

15MB is a really big problem? :) Yii doesn’t include files which you don’t use in applications.

My goal of course is not for performance, but occupying the space of the folder on the server, you know if there is a folder for the unnecessary production beyond the gii?

Thank you!

There is a wiki article shrink-yii

But please read the comments there.

Thanks, I’ll take a look.

I’m working on generating applications, such as the gii, but instead of generating the crud, I generate the entire application, I would like to know the opinion of you on the best and fastest way to generate a new skeleton of the application (preferably by web interface, as done in gii). My great concern is the timeout when copying large folders such as the framework.

Thank you!

I am using one framework folder for many projects. I have folders “yii-1.1.6”, “yii-1.1.7”, “yii-1.1.8” and include the desired version in index.php. So I don’t have a copy of Yii for each project, means no problem with disk space :)

Ok, is that in my case I generate applications for different customers thus different servers, so the replication folder.

The problem is not well in disk space, but the performance when copying (replication) of the basic structure for the new application generated.

yii/framework/cli/views/webapp contains the files needed to create a webapp, as used by the webapp yiic command.

It is 157KB.

You can call a yiic command directly from the browser and let it generate an app.

It’s really that simple. ;)

I do not use fully the structure of yii, do not use it to view for example, so I have my custom framework.

But you said the folder yii can stay at 157kb? I saw that the file is included yii.php. What classes framewrok will not be included?

How do I use this yiic the browser?

Thank you!

Now I am confused. :)

Could you please describe your workflow / requirements in detail?

Not following you.

What did you say 157 kb?

I made an application generator and I want to replicate the folder of the framework created in each project, I would like to know the best way to improve the performance of this (removing some unnecessary files from the framework for the production, making the zip package, etc.). It’s taking too long to replicate the 15 MB file yii (I refer to the framework, not a project structure that it creates).

Thank you!

Fabio Jr. Policeno

Additionally to what was in the wiki article you can remove all code comments using regexp like


Then you can remove cli/commands/shell, cli/views, vendors/TextHighlighter.

157kb was about the application yii webapp produces.

And this is where I am asking:

Why replicate the Yii directory for each project?

That sounds really inefficient.

Unless it’s for download?

Why not - if you are distributing a ready-to-go package - prepare an archive of Yii framework. Put in a directory.

Then generate your Yii app (157KB) and package up the Yii archive and the app archive into a package.

When the user downloads the package and runs the installer script the archives are inflated and that’s it.

Would save a lot of activity on the server.

If you know what you are going to do, do it beforehand (once).

The big difference is that I created an application generator, it can generate several different projects for multiple clients, thus on different servers, so each generation, the package will include the yii in each of these projects, and deliver to the customer completely.

Thank you;)

Very good, following their suggestion, and the wiki and also deleting the folder gii (since only my project generator will use it), was approximately 5MB.

But I have not applied the regex, tell me how or what tool to use?

Thank you!

Either IDE or some kind of tool like wildreplace.