Ticket #148 (assigned defect)

Opened 5 months ago

Last modified 4 months ago

About MakeVendor

Reported by: Khaoz Owned by: pmjones
Priority: minor Component: code
Keywords: Cc:

Description

I was talking with Paul Jones about some possible problems with MakeVendor?. MakeVendor? seems to expect some configuration file or at last a "system" parameter (Solar_Cli_MakeVendor, line 116). So:

1) make-vendor really need a configuration file or it's possible to pass a getcwd to the $system ? 2) make-vendor seems to create two vendor dirs, Example:

source/vendor/Vendor/App

instead of:

source/Vendor/App.....

Is that right ?

After read solar source code a bit, i have a few suggestions on the cli tools:

Create a Solar_Cli_InitProject. Usage:

solar init-project myproject

myproject/
    source/
    include/
    public/
    config/
    solar <- binary

from now, every command is executed inside myproject:

./solar make-vendor Vendor1 // based on getcwd

myproject/
    source/
        Vendor1/App/Public/images/
                           scripts/
                           styles/
    include/
        Vendor1 -> ../source/Vendor1/
    public/Vendor1 -> ../Vendor1/App/Public
    config/Vendor1.config.php
    vendor1.docroot/
    solar

./solar make-app Vendor1 MyApp

    source/
        Vendor1/App/Public/images/
                           scripts/
                           styles/
                    MyApp.php
                    MyApp/Helper
                         /Layout
                         /Locale
                         /View/index.php            
    include/
    public/Vendor1 -> ../Vendor1/App/Public
    config/Vendor1.config.php
    vendor1.docroot/
    solar

./solar make-model Vendor1 MyModel // adapter (yes or no ? ) plus some parameters if you want to get definitions from a existing table ?

    source/
        Vendor1/App/Public/images/
                           scripts/
                           styles/
                    MyApp.php
                    MyApp/Helper
                         /Layout
                         /Locale
                         /View/index.php
        Vendor1/Model/MyModel.php
                     /MyModel/Collection.php
                             /Record.php
                             /Setup/table_cols.php
                                   /table_name.php
    include/
    public/Vendor1 -> ../Vendor1/App/Public
    config/Vendor1.config.php
    vendor1.docroot/
    solar

With this, solar command line become more simple (--target, --config, --include will be used only for customized structures). Solar_Cli_InitProject seems to be simple and i can code it if you want.

Attachments

Change History

Changed 5 months ago by Khaoz

I have made some mistakes on my examples...

Change

../Vendor1

to

../source/Vendor1

Changed 4 months ago by pmjones

  • status changed from new to assigned

Hi Khaoz -- although using a downloaded Solar system (http://svn.solarphp.com/system/trunk) would replace an "InitProject?" command, there might still be cases of people using Solar only as a library, or in a non-standard setup, and we would need to allow for that.

If we added the --target option that you mention, e.g. "--target=/path/to/dir", as the target for writing the vendor files to, do you think that would solve the problem related to non-standard setups? Or is there more to it than that?

Changed 4 months ago by pmjones

Oh, and regarding 'source/vendor/Vendor/...' -- yes, that's right. The idea is that you will have docs, tests, and maybe other support files in the 'vendor' directory, in addition to the 'Vendor/' library class files. (Hope that makes sense.)

Add/Change #148 (About MakeVendor)

Author



Action
as assigned
 
Note: See TracTickets for help on using tickets.