M
M
Matvey Mamonov2015-06-15 21:32:09
Composer
Matvey Mamonov, 2015-06-15 21:32:09

PHP development. How to upgrade?

Hello.
I've been doing web development for quite some time now, experimenting with both the front-end and the back-end, but lately I've been focusing more on the backend.
Recently, I stumbled upon an interesting post on Habré and concluded for myself that it is, of course, good to be able to write everything yourself, but it’s better not to cycle, but to use what has its own large community and in general what is popular .
It turns out that I already used all these (mostly) techniques and tools, I just created them myself, which, of course, took a lot of time, sometimes discouraging me from doing a specific project. But now there is a bias towards using ready-made tools with a decent community.
So I decided to "modernize".
First, I made a list for myself (I copied it from the above article).
Now I try to follow this list.
First of all, I decided to abandon self-written frameworks and give preference to Laravel. I ask my choice not to condemn, since the essence of this issue is not breeding holivar about which framework is better. Especially since I'm still experimenting about it.
As it turned out, Laravel requires a PHP version of at least 5.6 to work. No, this did not stop me and did not deprive me of the desire to use this particular framework. Vice versa.
The thing is, I've never worked with local PHP before. I started and for several years now I have been working (creating, testing my applications) on one free hosting. But here's the problem: the required version of PHP to work with Laravel did not appear with it.
This became the starting point for me.
I installed nginx (I decided to abandon Apache, they write that it is already obsolete and slower). Installed the latest version of PHP (I have Ubuntu). I decided to deal with Composer, because

...if you don't have a composer.json file in your project, they won't even greet you.

This is where the leapfrog began (no, it started, of course, earlier, but it became most unbearable here. Yes, Google helped before too)
First, I don’t understand why. Second, I don't understand how. Example: installed this Composer, answered all his questions (I didn’t understand a good part at all (and didn’t google it)), indicated that Laravel was needed, so this beast threw some kind of goblin there for me and yii, and symfony, and laravel ( installer, with which I don’t understand what to do at all) and much, much more.
Question:
Is it really necessary? And is it really necessary to know everything and be sure to be able to use everything? And besides being easy to know, is it also easy to use?
I somehow get the feeling that it will take me longer than it took me to start coding my current level. It's horrible.
PS From the list I have in my pocket only the first and fourth.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Denis, 2015-06-15
@eucalipt

<?php

// Постарался упорядочить в порядке уменьшения силы вырывания 
// волос на голове

$power  = null;
$power .= '1. Перейти на PHP 5.6';
$power .= '2. Composer';

// level up

// Пароли? Да... А так не стоит. Вычёркивай.
$power .= '3. Отказаться от md5';

// Да прибудет с тобой ООП.
$power .= '4. Фреймворки!';

// Буквально 5 команд выучишь, ничего сложного
$power .= '5. Разобраться с VCS ';

// level up

$power .= '6. Никогда не лазить в БД на продакшн, использовать миграции';

$power .= '7. Внешние ключи, триггеры и процедуры';

// Про ключики и связи надо раньше узнать, чем о существовании новомодной базы.
$power .= '8. Базы данных (посмотреть другие)';

// Опечатался надеюсь? 
// Точку на 2 слова левее.
$power .= '9. Трейты вместо Array. Генераторы';

// Панацея?
$power .= '10. PHPStorm';

// Это пригодится в командной разработке.
// По началу ты будешь гуглить, как откатить последний коммит
// и будешь пушить только в мастер.
$power .= '11. Начать работать по git workflow
        * Всегда есть стабильная ветка, чьё состояние точно соответствует состоянию продакшна
        * Каждой задаче — своя ветка
        * Ветки могут быть разных типов, в зависимости от типа задачи
        * Любая ветка рано или поздно будет влита в стабильную (тем или иным путём) и/или удалена
';

// level up

// Для следующих перечисленных надо будет уже знать, как писать тесты,
// понимать как работает система контроля версий.
// Осознанно к ним придёшь уже обматерив не один фреймворк.
$power .= '12. Teamcity, Jenkins, Bamboo (инструменты для выкладки релизов)';
$power .= '13. Phing, Capistrano, Ant (сценарии сборки)';

// Если линуха, не вздумай сделать после сборки "make install"
$power .= '14. Поиграться с PHP 7';

$fullPower = (100 * ('0.' . mb_strlen($power, 'UTF-8'))) . '%';

// В $fullPower содержится число характеризующее довольно хорошего разработчика.

H
He11ion, 2015-06-16
@He11ion

Don't learn anything. The "current level" will quite allow you to write your noodle code for a bowl of the same noodles and beyond, what's the problem?
In the middle of 2015, not knowing anything about vcs is harsh.
And yes, suddenly you can (and sometimes you need to) live without migrations, with backups.

D
D', 2015-06-15
@Denormalization

Specifically for Laravel:
General:
Each technology has a lot of documentation and examples. If you cannot find them, let alone master them, you are a useless programmer, quit and go to work at a McDuck.

S
Sergey Vushnyakov, 2015-06-15
@leto2015

At the end of the text of that article there is a postscript "PS Do not take the test seriously, it's Friday!".
You should use Krylov's instructions to read ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question