kalenjordan / magerun-addons

MageRun Addons
116 stars 30 forks source link

Update n98-magerun.yaml #4

Closed cmuench closed 11 years ago

cmuench commented 11 years ago

@kalenjordan The phar file makes it easy to start with n98-magerun. One problem of the vendor folder is that every package can provide a deep folder stucture. So we must scan many levels inside the vendor folder. I think it could be possible to check if we are running the phar version. If not we can inject a config loader which checks the vendor folder. The "Application" class has a method "isPharMode".

kalenjordan commented 11 years ago

Oh okay, cool. Ya for phar mode we don't even need to check for it. People who are using the phar aren't going to care about this anyways.

Actually I just ran across this symfony component yesterday: https://github.com/symfony/Finder#finder-component

We could do:

$iterator = $finder
    ->files()
    ->name('n98-magerun.yaml')
    ->depth(2)
    ->in(__DIR__ . '/vendor');

Bam :)

cmuench commented 11 years ago

Yes, we are actually using the compontent to scan for various files. It a depth of 2 always enough? If yes, i will implement it in the next n98-magerun release. So everyone can use composer to provide n98-magerun commands.

kalenjordan commented 11 years ago

Yes, because the module will always be under this. So I guess it's a depth of 3. Although I'm pretty sure that component will look for all files up to and including that depth. It would be even faster for us because we only need to search at the specific depth of 3.

vendor/
    namespace/
        modulename/
            n98-magerun.yaml
cmuench commented 11 years ago

It's running. Added support for that.

Please try develop branch version.

kalenjordan commented 11 years ago

Worked perfectly. Now I can remove the manual command config steps from my install readme!

Thanks!!!