Composer Update Application Template

Guys,

I have created my own application template based on basic application template.

I have put it to a repository and packages created.

I’m able to create new project with


php composer.phar create-project --prefer-dist --stability=dev vendor/template newProject

but how can I keep it update using composer?

These are templates you’re starting with, not something you have to update.

So is there any solution for deployment and version management of applications?

Well, you can make it a true package and publish it into your own self-hosted repository but I can’t imagine a reson for doing it.

I have to install this on several servers,several times.

It’s under development so we must be able to update installed apps.

I setup my application to install with composer,it does solve my problem for version management but the problem is composer install it under vendor directory

vendorPath in config solved my problem.

@samdark Thanks man,Yii2 is really flexible.

Glad it helped. I’m still a bit puzzled about you case though :)

I built a CMS, based on basic application template.

Now I’m able to install and update it with composer in production env.

with these changes:

@web/index.php




if(CMS_ENV === 'dev'){

    require(__DIR__ . '/../vendor/autoload.php');

    require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

}else{

    require(__DIR__ . '/../../../autoload.php');

    require(__DIR__ . '/../../../yiisoft/yii2/Yii.php');

}



@app/config/web.php





'vendorPath' => (CMS_ENV === 'dev') ? dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor' : dirname(dirname(dirname(__DIR__))),

'extensions' => (CMS_ENV === 'dev') ? require(__DIR__ . '/../vendor/yiisoft/extensions.php') : require(__DIR__ . '/../../../yiisoft/extensions.php'),