Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Allow a "minimal" option #17

Closed
bakura10 opened this issue Nov 7, 2015 · 7 comments
Closed

Allow a "minimal" option #17

bakura10 opened this issue Nov 7, 2015 · 7 comments
Assignees
Milestone

Comments

@bakura10
Copy link

bakura10 commented Nov 7, 2015

Hi,

The installer is really nice and actually is really handy for newcomers to have directly a thing that work. However I've started to end up always removing the .ico, the pre-generated actions, the ZF image... it would be nice if we could have a "minimal" option that would remove everything and only keep the creation of boilerplate config files.

@geerteltink
Copy link
Member

I was thinking about this myself. I noticed a site I launched yesterday which still had the zf favicon.

So basically add another option to either add code examples or a minimal version without actions, templates and the icon and image? Or you still want the homepage?

What we can do is just link to the image and favicon somewhere online so they are not physically there anymore.

@bakura10
Copy link
Author

bakura10 commented Nov 7, 2015

Nope, I basically just want the installer that will install the depenencies and create the config, but will basically leave the src folder empty (and ideally remove the entries from the dependencies).

@geerteltink
Copy link
Member

I'm not sure if we should keep at least 1 page, you always need it anyway. Maybe we could rename the HomePageAction to something more generally used like IndexAction?

@weierophinney
Copy link
Member

@xtreamwayz One reason to omit the home page is because it may not be used. As an example, if you're writing something that you might compose into another application, or if you'll be doing only an API (and won't need a landing page, or at least not an HTML version). In this case, I'd expect the minimal installation to omit any classes and/or templates.

I we go that route (and I like the idea), then we should likely have some alternate config files for the minimal versions to omit those entries. I can likely start on this this week.

@geerteltink
Copy link
Member

@weierophinney Ok, I understand the reason behind it now. The only downside is that it gets a bit complicated this way.

Just wondering if there is a way to output an array and comments to a file? So something that would create a config file with this:

return [
    // comment
    'vendor' => [
        'package' => [
            // Some more comments
            // And here as well
            'DefaultAction' => App\Action\DefaultAction:class
        ]
    ]
];

Without the comments and the :class suffix it's easy. Just wondering if it can be done with those.

@weierophinney
Copy link
Member

@xtreamwayz No easy way that I know of, unfortunately. Zend\Config\Writer has some facilities around translating constant values to constant signifiers, but it requires explicit mapping, IIRC; it won't work with class-level constants, regardless. Zend\Code\Generator will allow us to generate comments, but not at the fine-grained level of within an array (only for the top-level array assignment itself).

As such, we only have two options:

  • Do full-on code generation, omit any comments, and use fully-expanded class strings.
  • Have hand-crafted files we selectively drop-in.

The former allows for easier automation, while the latter is more user-friendly, as it guides users in usage of the files. Considering the primary purpose of the skeleton is to exactly that (guide users), that seems the more appropriate path, even if it's more tedious to create and maintain.

FWIW, I'm starting work on this right now.

@geerteltink
Copy link
Member

@weierophinney I've got a proof of concept to generate a config file including proper ::class references and comments. It does need some more work. Once I've got something working I'll let you know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants