@yii2ru

Страница 1453 из 1721
Максим
04.07.2018
11:25:58
Но будет вроде проблема у тех кто на Yii2. Не получится воспользоваться.

Там у модели только виртуальные атрибуты остались. Если конечно ничего не путаю.

У моделей ActiveRecord, если быть точным.

У просто моделей можно будет.

Google
Like
04.07.2018
11:27:27
Вот ты и пиздишь не по делу



Не благодари

Vladimir
04.07.2018
11:28:16
Не благодари
Не благодарю

Максим
04.07.2018
11:28:54
В целом, type hinting для языков с нестрогой динамической типизацией - одно из лучших что появляется в мэйнстриме современной разработки.

Осталось покрыть им свойства объектов классов, реализовать AOP и, пожалуй, всё. На Java так тянуть уже не будет. )

Максим
04.07.2018
11:30:47
Ну вот... Да. Надо strict_types хотя бы в глобальный конфиг вытащить. Но, наверное, ещё ни один проект для этого не созрел, потому и не спешат.

Ну и снова менять концепцию ActiveRecord, что бы за бортом не остаться. Пожалуй, отказ от физических атрибутов классов моделей - одно из самых опрометчивых манёвров было. ИМХО, конечно.

Но когда принималось решение уже было ясно что type hinting свойств будет в обозримом будущем

То есть были основания сделать правильно.

Ну и надо уже дополнением к get_object_vars запилить на сях и set_object_vars и обоим добавить опцию фильтрующую по видимости устанавливаемые свойства. И нехило ускориться.

Google
Dmitriy
04.07.2018
11:35:41
надо его еще обязательным сделать) тогда будет норм
вот обязательно не надо. путь лучше strict_types работает в 2 вариантов 1 на файл. 2й и на файлы все что ниже

Максим
04.07.2018
11:36:17
Максим
04.07.2018
11:36:19
"на файл, и на файлы все что ниже" это парадоксы плодить будет.

Максим
04.07.2018
11:37:09
https://habr.com/company/otus/blog/415713/ Вот тебе АОП.
Это не AOP, а курам на смех.

как ?
Сложно будет правильно определить критерии для "файлы, что ниже". Вот ты что понимаешь под этим? Иеархию вызовов или физическое расположение?

Максим
04.07.2018
11:39:58
Первый вариант сложен так как типизация конкретного файла будет зависима от контекста. То есть будет разной в разных случаях. Второй вариант сложен тем, что для понимания какая конкретная типизация должна быть у файла - нужно перебирать дерево проекта вверх, разбирая каждый файл.

То есть или "кто в лес, кто в подрова", или "капец тормознём".

Простой вариант - почти всегда самый лучший. Или вообще для всех файлов через глобальную опцию, или для каждого конкретно.

Максим
04.07.2018
11:42:49
Я - никто. Ничто. Просто чувак, который тут бывает крайне редко. ?

Ну ещё и создатель группы. Потому не могу от неё избавиться. ?

Максим
04.07.2018
11:43:11
я Дэцл, рыцарь BadB альянса?

Dmitriy
04.07.2018
11:43:25
Простой вариант - почти всегда самый лучший. Или вообще для всех файлов через глобальную опцию, или для каждого конкретно.
так глобальная опция и заставить strict_types работать глобально для тек. проекта. в целом интентичны подходы

Максим
04.07.2018
11:43:42
Ну да.

Like
04.07.2018
11:45:18
Ну ещё и создатель группы. Потому не могу от неё избавиться. ?
Дай админку, я всех перебаню и ты избавишься от чатика

Google
Vladimir
04.07.2018
11:45:23
Я тут чёт немного пропустил когда АОП в тренды и мастхэв выбился?

Максим
04.07.2018
11:46:21
Без AOP нет нормального OOP. Он давно в трендах. Просто мало где доступен без больших накладных расходов.

Задача о логировании без ООP решается немного костыльно.

Максим
04.07.2018
11:47:18
Ух, накидывать ты умеешь)
Хлебом не корми. ?

Максим
04.07.2018
11:47:36
Хлебом не корми. ?
можешь публикуешься где-то? почитал бы)

Максим
04.07.2018
11:48:08
можешь публикуешься где-то? почитал бы)
Только на кухнях под пенный раз в пару месяцев. В остальное время пишу код. ¯\_(ツ)_/¯

Максим
04.07.2018
11:48:45
даже под пивко разговоры о коде) страшный человек

Максим
04.07.2018
11:49:25
Ну вот какой есть. ?

Dmitriy
04.07.2018
11:49:48
Дай админку, я всех перебаню и ты избавишься от чатика
если тебе дадут админку все сами с чата уйдут. даже те кто ходить не умеет

Максим
04.07.2018
11:52:38
Что такое AOP можно прикинуть по тому, как сейчас работает событийная модель в Yii + представить что обработчики событий, будучи определёнными где-то и когда-то, вызываются самостоятельно когда надо при нужном стечении обстоятельств, получая при этом доступ к контексту вызова метода.

Ну то есть можно сказать, что вот этот метод вызывется перед или после вызова этого метода этого класса при таких-то условиях и может повлиять на контекст его вызова, а может и нет.

Vladimir
04.07.2018
11:55:26
С одной стороны это конечно здорово, с другой это магия (поддержка/отладка может привратиться в кошмар). И кодогенерация на лету = издержкам производительности

Максим
04.07.2018
11:56:02
Однозначно. Любая власть обременяет.

Возможности пропорциональны ответственности.

Ну и так далее. )

Но я видел код из тысячи AOP классов в котором никто не блуждал. То есть со всем можно справиться.

Но вероятнее всего, не справиться. ?

Вот прямо загорелся я set_object_vars написать. Как раз последний месяц с С++ сижу. ?

Расширение запилить + кастомный AR класс для него. Посмотреть как оно будет.

Google
Максим
04.07.2018
12:18:12
Хотя, это концептуально неверный путь. Расширять язык для решения очень узкоспециализированных задач. Так можно дойти до того, что Yii будет поставляться с расширением ext-yii и постепенно станет phalcon со всеми его плюсами и минусами. Потеряет уникальность.

И кстати была уже попытка давно. Кто-то пилил расширение, заменяющее часть ядра.

Максим
04.07.2018
12:23:06
Зефир не выстрелил. Да и не должен был.

Golang вовремя появился.

Farhodjon
04.07.2018
13:08:39
yii frameworkning yaratuvchilaridan biri Pavel Klimovni framework kelajagi haqida fikri: It is sad to realize, but indeed Yii is dying. But it has nothing to do to the number of the latest commits or outdated milestones. It also has nothing to do with the Qiang leaving the project. For the fully non-commercial open-source project such things are common enough and happens from time to time. The real problem is Yii is very outdated technology, which does not keep up with the modern trends. The team refuses to acknowledge the fact that requirements for the modern web application has changed over latest years. They stick to the BC-keep policy too much since 2.0 release, which make Yii2 lacking of many modern approaches and features. It is ridiculous to keep support for PHP 5.4, while even 5.5 is completely dead by now and any indifferent developer switch to PHP >=7.0 for the better performance. The team states supporting of PHP 5.4 is crucial for existing Yii-based application, while I can not see why, while installing of PHP 5.4 from regular code repository is already impossible. While it is common requirement of the modern web project to provide "single page application" based on modern JS frameworks like ReactJS, EmberJS, VueJS and so on, Yii keeps enforcing JQuery, facilitating its usage and requiring its installation. I have spent many efforts to persuade the team to finally move forward and make new major release. I have committed the changesets supporting PSR-3 "Logger", PSR-16 "Simple Cache" and PSR-7 "HTTP Message". I have provided solution for JQuery separation via dedicated optional extension. See the changelog for the full picture: https://github.com/.../yii2/blob/3.0/framework/CHANGELOG.md I have spent much efforts to bring new major version to life, but they were in vein... At the begging of this year the *whole* team finally agreed on the online Slack meeting to stop support of the 2.0.x and switch forces to 2.1.x (now 3.x) release. So the latest 2.0 version have to be 2.0.14. However, this agreement has been broken. The team refused to switch course. As you can see 2 minor versions were released instead: "2.0.15" and "2.0.16", while there were no progress at "2.1" ("3.0"). I have updated main repository code as main extensions code to make it possible to have early access to the major version. See my post about it: https://yiifeed.com/news/366/yii-21-early-access This work has been complete at the March 3rd. At that time I was sure we can make at least "beta" release at the end of the May. But the team has started full scale "holy wars" around DI specification and PSR-11 interpretation. See discussion at: https://github.com/yiisoft/di/issues/23 So in the end all the efforts spent on "yiisoft/di" were actually thrown away and latest "Yii developments note" claim it will not be integrated with the 3.0. See: https://www.patreon.com/posts/yii-development-19759260 Even if Yii 3.0 to be released, the course, which team has take around DI and PSR-11, suggests dropping the Yii base core principle of usage array as an universal object configuration in the favor of PSR-11 DI approach, which requires constant creation of the "factory" classes, which are absolutely redundant around Yii1 or Yii2. So when the time comes for the Yii 4.0 release, it will have nothing in common with the current Yii2 architecture, and any developer using Yii will have to completely rewrite his application.

The main reason of the current state of things, to be said briefly, is the fact that the most members of the core team have no personal interest in Yii development. For example, Alexander Makarov (aka samdark) does not use Yii at his current commercial work for several years already; Carsten Brandt (aka cebe) has his own company, which operates many technologies and have many projects, but only some of them are written on Yii; Boudewijn Vahrmeijer (aka dynasource) is fully consumed with his commercial project, having no time for the framework development and so on. Only 2 members of the core team have a Yii framework as a codebase for their professional commercial projects: me (aka klimov-paul) and Dmitry Naumenko (aka Silverfire). Despite it is a sad thing it is a normal situation. Yii is NON COMMERCIAL project. Each its core team member DOES NOT earn a single dollar for their work. Thus no one can demand them doing anything. You can not enforce people to spend their free time, gaining nothing in return. Personally I stick to this project as I use it as core base for my commercial work, so I have indirect benefit from its development. But this statement does not apply for every member of the team. Team also relies highly on the community, expecting its member to solve own problems themselves. While having active community of the developers is priceless and huge benefit, it unfortunately can not make major release possible. Particular community member is unlikely will spend huge amount of time, which is required for the dramatic changes of the major release, risking this time will be lost in vein as the core team will not accept his pull request. The core team should make a course for the major release, create a skeleton, so community can fill the blanks around it. But it is hopeless to wait for the community to build this skeleton on its own. You may be surprised to hear this from one of the YiiSoft core memeber, but DO NOT recommend to start new project on Yii2 or migrate project from other framework to Yii2. It would be much more reliable for you to use Laravel. It is relatively close to Yii by its architecture and approaches, while it has a commercial background and support, which make its future reliable. But the final choice is always up to you.

Что вы думаете об этом?

Максим
04.07.2018
13:10:17
а обязательно это читать, чтобы высказать свое мнение?

Никита
04.07.2018
13:10:35
Admin
ERROR: S client not available

Санжар
04.07.2018
13:13:28
yii frameworkning yaratuvchilaridan biri Pavel Klimovni framework kelajagi haqida fikri: It is sad to realize, but indeed Yii is dying. But it has nothing to do to the number of the latest commits or outdated milestones. It also has nothing to do with the Qiang leaving the project. For the fully non-commercial open-source project such things are common enough and happens from time to time. The real problem is Yii is very outdated technology, which does not keep up with the modern trends. The team refuses to acknowledge the fact that requirements for the modern web application has changed over latest years. They stick to the BC-keep policy too much since 2.0 release, which make Yii2 lacking of many modern approaches and features. It is ridiculous to keep support for PHP 5.4, while even 5.5 is completely dead by now and any indifferent developer switch to PHP >=7.0 for the better performance. The team states supporting of PHP 5.4 is crucial for existing Yii-based application, while I can not see why, while installing of PHP 5.4 from regular code repository is already impossible. While it is common requirement of the modern web project to provide "single page application" based on modern JS frameworks like ReactJS, EmberJS, VueJS and so on, Yii keeps enforcing JQuery, facilitating its usage and requiring its installation. I have spent many efforts to persuade the team to finally move forward and make new major release. I have committed the changesets supporting PSR-3 "Logger", PSR-16 "Simple Cache" and PSR-7 "HTTP Message". I have provided solution for JQuery separation via dedicated optional extension. See the changelog for the full picture: https://github.com/.../yii2/blob/3.0/framework/CHANGELOG.md I have spent much efforts to bring new major version to life, but they were in vein... At the begging of this year the *whole* team finally agreed on the online Slack meeting to stop support of the 2.0.x and switch forces to 2.1.x (now 3.x) release. So the latest 2.0 version have to be 2.0.14. However, this agreement has been broken. The team refused to switch course. As you can see 2 minor versions were released instead: "2.0.15" and "2.0.16", while there were no progress at "2.1" ("3.0"). I have updated main repository code as main extensions code to make it possible to have early access to the major version. See my post about it: https://yiifeed.com/news/366/yii-21-early-access This work has been complete at the March 3rd. At that time I was sure we can make at least "beta" release at the end of the May. But the team has started full scale "holy wars" around DI specification and PSR-11 interpretation. See discussion at: https://github.com/yiisoft/di/issues/23 So in the end all the efforts spent on "yiisoft/di" were actually thrown away and latest "Yii developments note" claim it will not be integrated with the 3.0. See: https://www.patreon.com/posts/yii-development-19759260 Even if Yii 3.0 to be released, the course, which team has take around DI and PSR-11, suggests dropping the Yii base core principle of usage array as an universal object configuration in the favor of PSR-11 DI approach, which requires constant creation of the "factory" classes, which are absolutely redundant around Yii1 or Yii2. So when the time comes for the Yii 4.0 release, it will have nothing in common with the current Yii2 architecture, and any developer using Yii will have to completely rewrite his application.
Я сначала подумал, что там все будет на узбекском, как начал читать

Максим
04.07.2018
13:14:47
Что вы думаете об этом?
Правильно пишет, уходят разрабы, потому что фрейм развивается не так быстро, как сопутствующие технологии. Все хотят постоянно совершенствоваться. Но в целом пост выглядит как некролог.

Максим
04.07.2018
13:16:42
https://www.youtube.com/watch?v=NMjA5N7kbEQ нравится этот видос) может кто еще не видел

Nuriddin
04.07.2018
13:16:43
Не давно начал изучать yii, что теперь нужен другой выбрать?

?

Google
Максим
04.07.2018
13:19:59
я уже думал тут на испанском чуваки говорят)

Farhodjon
04.07.2018
13:20:12
:))

Gleb
04.07.2018
13:23:34
https://habr.com/post/333398/
Конечная цель разработки: создание качественного программного продукта для конечного потребителя. Если этот продукт удовлетворяет всем требованиям, предъявляемым к его дальнейшему функционированию, совпровождению и развитию — то, КАК этот продукт реализован — с точки зрения конечного пользователя или бизнеса — неинтересно.

Неплохой пост. Частично верный, частично нет

Константин
04.07.2018
13:27:57


Сессию не создает

Максим
04.07.2018
13:28:33
в конфиге про сессию есть что то?

Константин
04.07.2018
13:29:26
Вкладка Configuration?

Максим
04.07.2018
13:29:50
нет, конфиг приложения

Константин
04.07.2018
13:29:50
Или же в request?

Максим
04.07.2018
13:29:57
в файле php

Константин
04.07.2018
13:30:10
'session' => [ // this is the name of the session cookie used for login on the frontend 'name' => 'session-frontend', ],

Максим
04.07.2018
13:30:34
а как стартуешь сессию?

Константин
04.07.2018
13:30:56
$model->login()

Тобишь Yii::$app->user->login($this->getUser())

Максим
04.07.2018
13:31:28
$model->login()
какая версия фреймворка?

Константин
04.07.2018
13:31:35
Валидацию проходит

12

Максим
04.07.2018
13:33:19
Валидацию проходит
в инкогнито пробовал?

Константин
04.07.2018
13:33:32
Что это значит?

Максим
04.07.2018
13:33:44
режим инкогнито в браузере

Страница 1453 из 1721