Answer the question
In order to leave comments, you need to log in
How to organize code delivery with CI?
Good afternoon.
I'm setting up jenkins to deploy a php application, and I ran into a problem with delivering code to all web servers, I couldn't bind capistrano 3 because it refuses to work with local files, only with the repository (and everything has already been taken from the turnip, and everything we need has been collected ).
And accordingly the question arose, how to deliver the code to the servers?
Answer the question
In order to leave comments, you need to log in
1) Why are functions and variables with normal naming, and the class as "Otschit"?) No f - call everything by its proper name.
2) Model of the form - taken out in a separate class. Field validation in form models. And the view is also in a separate file.
3) The use of super global variables POST GET is not allowed, the data must be thrown / injected into the class, and not used internally. As a rule, they are used in controllers within MVC.
4) Translations and inscriptions are also placed in a separate i18n file. Imagine the situation, they called you tomorrow and said that you need to do it in German. Do you climb into every class to fix it all? And if there are 100 classes?)
5) The Save method can be turned into an update at the same time. If Id is added to the method, then you update the record, if not, then create it.
6) I would also add exceptions, but that's already it, everyone does where it is convenient for him.
Why is there a setter on the boss, but add on the director Although this is also a setter?)
What does this method do?
public function replaceBoss($name)
{
if(!empty($boss))
{
$this->boss = $boss;
}
}
public function setBoss($name)
{
$this->boss = $name;
}
if (...)
{
//
}
if (...) {
//
}
if(file_put_contents($filename, $content))
{
return 'Отчет сохранен';
}
else
{
return 'Ошибка сохранения';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question