#1226: Suport for multiple public directory
-------------------------------+--------------------------------------------
 Reporter:  mug...@…           |        Owner:  impl    
     Type:  enhancement        |       Status:  reopened
 Priority:  normal             |    Milestone:  2.0     
Component:  build              |      Version:  1.0.2   
 Severity:  normal             |   Resolution:          
 Keywords:                     |    Has_patch:  0       
-------------------------------+--------------------------------------------

Comment(by felix):

 I'm sorry to to disagree on that decision. Just for the record: The
 original request asked for multiple pub directories that are configurable.
 Phing or not, that is not an easy task to solve generically while it is a
 simple task to solve for each special case. Questions that arise are

  - how to configure that? That's especially complex in phing, since
 properties are string values only
  - Which public directory gets which environment and which files should be
 copied there?
  - Maybe a pattern for the environment name would be useful, such as
 "production-web", "production-mobile", etc.
  - Should we create yet another config? How do we keep the complexity
 manageable for the user?

 An option would be to ask for all that information at runtime, but that
 reduces the usefulness of an "env-create" task massively. Having the
 public-create task ask for "which directory is source, which is target" is
 a completely different feature and I still doubt it's usefulness. I'm
 sorry to say that I still regard this as something that should be handled
 by the projects deployment script and not generically in agavi.

 On the other hand, handling all of that in the special case where
 directory names and naming patterns for the environments are know is as
 simple as adding the following code to your projects build.xml:

 (Code not tested)
 {{{
 <target name="environment-create" depends="project-locate" >
                 <agavi.input property="agavi.environment"
                    message="Name of the environment to bootstrap in
 scripts"
                    default="development" promptCharacter=":"
                    failIfEmpty="true" ignoreIfSet="true" />

                 <phingcall target="public-create">
                     <property name="project.directory.pub" value="pub-web"
 />
                         <property name="public.environment"
 value="${agavi.environment}-web" />
                 </phingcall>

                 <phingcall target="public-create">
                         <property name="project.directory.dev.pub" value
 ="pub-mobile" />
                     <property name="project.directory.pub" value="pub-
 mobile" />
                         <property name="public.environment"
 value="${agavi.environment}-mobile" />
                 </phingcall>
 </target>
 }}}

 Please note that you still need to have a directory named "pub" or the
 build system breaks.

 All in all, given the complexity of the requested feature and the relative
 ease of solving it on a per-project base, my vote still goes to "wontfix".
 I agree that flexibility is desirable but there's only a limited amount of
 time we can spend on agavi and there's better places where we gain more.
 However, if someone would be willing to step forward and contribute a
 working solution that addresses all concerns for the generic case, I'd not
 be opposed to accepting a patch.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1226#comment:10>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to