seyyed
(Arash)
September 6, 2014, 3:02pm
1
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?
samdark
(Alexander Makarov)
September 6, 2014, 3:18pm
2
These are templates you’re starting with, not something you have to update.
seyyed
(Arash)
September 6, 2014, 7:43pm
3
So is there any solution for deployment and version management of applications?
samdark
(Alexander Makarov)
September 6, 2014, 9:57pm
4
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.
seyyed
(Arash)
September 7, 2014, 7:18am
5
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
seyyed
(Arash)
September 7, 2014, 8:15am
6
vendorPath in config solved my problem.
@samdark Thanks man,Yii2 is really flexible.
samdark
(Alexander Makarov)
September 7, 2014, 11:14am
7
Glad it helped. I’m still a bit puzzled about you case though
seyyed
(Arash)
September 7, 2014, 12:40pm
8
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'),