samdark blog ☕️ (Alexander Makarov)
1.62K subscribers
137 photos
2 videos
209 links
Notes taken by Alexander Makarov, lead of Yii framework, CTO of Twindo.ai and a long term IT engineering manager.

- Official Yii updates: www.yiiframework.com
- Consulting: asapirl.com
Download Telegram
🚀 Ищем волонтеров на крупнейшие IT-конференции в Москве!

HighLoad++
— это конференция в России и СНГ, посвящённая разработке высоконагруженных систем, архитектуре, инфраструктуре и масштабированию.
TeamLead Conf — единственная профессиональная конференция для тимлидов и руководителей не только из IT.

Если тебе интересно увидеть закулисье одного из самых масштабных IT-событий страны, получить опыт организации конференции и стать частью сильной команды — присоединяйся к волонтёрам 💪

🗓 Даты участия: 4–11 ноября (можно выбрать 4 дня или один из дней)
📍 Место проведения: Технопарк «Сколково»

Что тебя ждёт:
– уникальный опыт работы на ведущих конференциях в России
– общение с экспертами и профессионалами из крупнейших IT-компаний
– понятные задачи и поддержка координаторов
– доступ к записям выступлений и атмосфера закулисья
– полноценное питание в дни работы
– и, конечно, участие в легендарном afterparty HighLoad++ 🎉

Задачи волонтёров: работа в залах, помощь в логистике на площадке, регистрация участников, помощь в зоне выставки.

Участие предполагает присутствие в день до конференции, чтобы познакомиться с командой, подготовиться к работе и пройти инструктаж, и два дня самого события.

📩 Чтобы присоединиться, заполни анкету волонтёра — мы свяжемся с тобой после рассмотрения заявки.

Расскажи о наборе друзьям, приходите вместе — давайте создавать легендарную атмосферу🔥
👍122👎2🔥2
GitHub OpenSource stats 2025

GitHub released a report about developers landscape.

PHP is number 6 in the top surpassing C, C++, Go by the number of developers using it.

Docker usage got +120%.

LLMs got to general adoption stage. 80% of developers using them now.

#statistics #php #github
👍214🔥3👀2
Инженерная зрелость. Исследование практик и триггеров

Итак, исследование завершилось. Вот что вышло.

https://habr.com/ru/articles/963202/
👍19🤣9😁32🔥2
HighLoad++ 2025

The program team of the conference. Glad to be among them selecting the talks for many years.

For me conferences are part of the industry and community. The place where you can get connections and ideas regardless of your role, stack and language. Every time after the conference I note some of the ideas to try and something to apply to Yii and other projects.

Do you think conferences are necessary? What do you get from them? What do you enjoy? What do you think is bad?

#events
👍16🔥5👏54
🟡Inside Yii3 | Внутри Yii3

I gave a talk about Yii3 internals at Пых.конф’25. The language is Russian. English subtitles are available at YouTube. Enjoy!

- https://youtu.be/S9gpnjFaZY8
- https://vkvideo.ru/video-228746873_456239112?list=ln-2ROaUS3I93reBZdhuf

Если будут вопросы — задавайте тут в комментариях.

#yii #yii3
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥49👍17🍾82👏21
🎁 PHP 8.5

New PHP version released. I personally like:

- "Clone With"
- Callables in constant expressions
- array_first() and array_last()
- Backtrace for fatal errors
- php --ini=diff

// expect Yii2 release soon

#php
👍33🔥16🍾96
Новый сезон онлайн-конференции Podlodka PHP Crew (1–5 декабря) посвящён тому, как делать больше за то же время — без стресса и овертаймов.

📌 В программе:

⚙️ Background-агенты в разработке — Пётр Мязин («Пятиминутка PHP») покажет, как построить процесс вокруг ИИ-инструментов.

🚦Светофоры для разработчиков — Ярослав Тарасов (Skyeng) расскажет, как ускорить обратную связь от коммита до продакшена.

🔥Баланс фич и техдолга — Дмитрий Кириллов поделится холиварным кейсом «100% фичи, 0% техдолг».

🧩 От промпта к продакшену — Павел Бучнев (Spiral Scout) объяснит, почему пора мыслить контекстами, а не только промптами.

⚡️Практика, кейсы и новые подходы, которые экономят часы и силы.

🔗 Подключайтесь с 1 декабря: https://podlodka.io/phpcrew

Скидка 500 р по промокоду: samdark_blog_7
👍65🔥4
Channel name was changed to «samdark blog ☕️ (Alexander Makarov)»
Forwarded from Yii3 Chronicles
#yiisoftDb #yiisoftDbMssql #yiisoftDbMysql #yiisoftDbPgsql #yiisoftDbSqlite #yiisoftDbOracle #MajorRelease #Release

🎁
Yii Database 2.0
🎁
Yii DB MSSQL Server 2.0
🎁
Yii DB MySQL 2.0
🎁
Yii DB PostgreSQL 2.0
🎁
Yii DB SQLite 2.0
🎁
Yii DB Oracle 2.0

We're excited to announce Yii Database 2.0, a major release modernizing the database abstraction layer with PHP 8.1+ features, enhanced type safety, and powerful new capabilities. The drivers have been released as well.

New Features

- Implement ColumnInterface classes according to the data type of database table columns
for type casting performance
- ConnectionProvider for connection management
- ColumnBuilder for column creation
- CaseX expression for CASE-WHEN-THEN-ELSE statements
- New conditions: All, None, ArrayOverlaps, JsonOverlaps
- PHP backed enums support
- User-defined type casting
- ServerInfoInterface and its implementation

Enhancements

- Optimized SQL generation and query building
- Improved type safety with psalm annotations
- Method chaining for column classes
- Better exception messages
- Refactored core components for better maintainability
- PHP 8.5 support

There have also been many refactorings and bug fixes. See CHANGELOG.md for more information.

See upgrading instructions with notes about upgrading package in your application to this major version.
👍23🔥22🎉8👏42
🎉 Accepting birthday gifts

Tomorrow is my birthday. I'd gladly accept pull request to Yii repositories as a gift. Thanks!
🎉88😁35👍7🔥1
🤔 DDD Aggregates: The ID Problem

When I was learning DDD concepts, I had trouble implementing aggregates: a set of objects that are saved together in a single transaction. The theory made sense, but the practice felt wrong.

The problem was auto-increment IDs from the database. When the database creates IDs, you must save your object first to get an ID. This means your aggregate isn't complete until after you save it. This breaks the DDD concept—aggregates should be complete, valid objects before touching the database.

Transactions became messy. Do I save the parent first, then the children? How do I connect child objects before they have IDs?

The solution is to generate UUIDs in PHP instead. Once I've started using these instead of auto-increment, I was able to create aggregates in memory with all relationships before saving anything. In this case child objects have IDs immediately. Transactions are simple—save everything at once. The database is just storage, not something that controls my code structure.

This one change made DDD aggregates finally work for me. If you have similar problems, try generating IDs in your code instead of using database auto-increment.

#ddd #uuid #autoincrement #aggregate
👍42🔥8
Forwarded from Yii3 Chronicles
#yiisoftActiveRecord #FirstRelease #MajorRelease #Release

🎁
Yii Active Record 1.0

We are pleased to present the first stable release of Yii Active Record — an implementation of the Active Record pattern for PHP.

The package is built on top of Yii DB, which means it comes with out-of-the-box support for major relational databases: PostgreSQL, MySQL, MSSQL, Oracle, SQLite.

⭐️ Flexible Model Property Handling

• Dynamic properties — fast prototyping with #[\AllowDynamicProperties]
• Public properties
• Protected properties — encapsulation via getters/setters
• Private properties
• Magic properties

⭐️ Powerful Relation System

• One-to-one
• One-to-many
• Many-to-one
• Many-to-many — three implementation approaches (junction table, junction model, key array)
• Deep relations — access to related records through intermediate relations
• Inverse relations
• Eager loading — solves the N+1 problem

⭐️ Extensibility via Traits

ArrayableTrait — convert a model to an array
ArrayAccessTrait — array-style access to properties
ArrayIteratorTrait — iterate over model properties
CustomConnectionTrait — custom database connection
EventsTrait — event/handler system
FactoryTraitYii Factory integration for DI
MagicPropertiesTrait and MagicRelationsTrait — magic accessors
RepositoryTrait — repository pattern

⭐️ Additional Features

• Optimistic Locking — concurrency control using record versioning
• Dependency Injection — support for constructor-based injection
• Flexible configuration — multiple ways to define the database connection

🖼 Example

Example AR class:

/**
* Entity User
*
* Database fields:
* @property int $id
* @property string $username
* @property string $email
**/
#[\AllowDynamicProperties]
final class User extends \Yiisoft\ActiveRecord\ActiveRecord
{
public function tableName(): string
{
return '{{%user}}';
}
}


And its usage:

// Creating a new record
$user = new User();
$user->set('username', 'alexander-pushkin');
$user->set('email', 'pushkin@example.com');
$user->save();

// Retrieving a record
$user = User::query()->findByPk(1);

// Read properties
$username = $user->get('username');
$email = $user->get('email');
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥38👍1710🎉3
Forwarded from Yii3 Chronicles
#yiisoftData #MajorRelease #Release

🎁 Yii Data 2.0

Yii Data 2 is now available, bringing major improvements and modernization to this package that provides generic data abstractions for reading, writing, and processing.

• PHP 8.1+ required: modernized codebase with readonly properties and improved type safety.

• Enhanced filtering: added Stringable support, nested value filtering, case-sensitive Like filter with matching modes, and new All/None filters.

• Improved pagination: new LimitableDataInterface, nextPage()/previousPage() methods, PageToken class, and better limit handling in paginators.

• Better developer experience: comprehensive Psalm annotations, PageNotFoundException for clearer error handling, and OrderHelper for low-level order operations.

For a complete list of changes, see the CHANGELOG.md.
👍14🔥84
Forwarded from Yii3 Chronicles
#yiisoftDataDb #FirstRelease #MajorRelease #Release

🎁 Yii Data DB 1.0

Yii Data DB, a database query adapter for Yii Data, is now available.

This package provides a data reader implementation that bridges Yii DB with the Yii Data reading interface, making it easy to work with database queries in a flexible and consistent way.

QueryDataReader
Wraps database queries to provide pagination, sorting, and filtering capabilities.

Field Mapping
Map data reader field names to database columns for clean API design.

Batch Processing
Process large datasets efficiently with configurable batch sizes.

Multi-Database Support
Tested with SQLite, MySQL, PostgreSQL, Microsoft SQL Server, and Oracle.
👍9🔥73
Forwarded from Yii3 Chronicles
#yiisoftYiiDataview #FirstRelease #MajorRelease #Release

🎁 Yii DataView 1.0

The first stable release of a powerful set of data displaying widgets is now available.

Yii DataView provides three flexible widgets for presenting data in web applications:

ListView — display data as a customizable list.

GridView — present data in a feature-rich grid with sorting, filtering, and pagination.

DetailView — show detailed information about a single record.

Data Source Independence
Works seamlessly with database, CSV, REST API, or any data source through the Yii Data package.

Built-in Pagination
Handle large datasets efficiently with integrated pagination controls.

Internationalization
Full translation support for multilingual applications.

Theming Support
Customize appearance to match your application design.

Flexible Column Types
DataColumn with custom value presenters, ActionColumn, etc.

Modern PHP
Built for PHP 8.1 - 8.5 with type safety and modern best practices.
👍16🔥106
Forwarded from PHP Russia Channel
Друзья, у нас есть важная новость.

Ранее мы говорили о том, что конференция PHP Russia пройдет в мае 2026 года. Однако сейчас наши планы изменились, и следующую конференцию в запланированные сроки мы проводить не будем.

Хотим поблагодарить вас за поддержку и интерес к PHP Russia! Оставайтесь с нами, следите за анонсами — еще увидимся 😉

P.S. Здесь вы можете посмотреть календарь наших мероприятий на следующий год. Возможно, вам или вашим коллегам будет актуально событие из списка.

С уважением, команда Онтико
😭36🤷‍♀2👍1👎1
🤔 Yii is in CloudFlare radar 2025

Likely that's a detection mistake that other PHP frameworks except Yii and Nette aren't there but still the usage is significantly more than Spring and Django.

Overall, radar data is nice to look at but isn't as surprising:

1. PHP dominates the web.
2. Wordpress and Drupal are CMS of choice.
3. Mobile devices are primary way to access the web now.

https://radar.cloudflare.com/year-in-review/2025

#yii
👍18🎉11🔥7👀4
Merry Christmas! 🎄
🎄6016🥴10🎉6👎1💩1
🎙Updated my talks list for 2025 and 2024

I'm maintaining a list of talks and other materials I'm doing. In mid 2024 I stopped updating it because I was too busy (or lazy?).

Did it now. Seems I've totally forgot I gave some of these and restored the facts from my pile of notes 😂

https://slides.rmcreative.ru/

#talks #slides #php #yii #video
🔥11👍106
🔩 PHP Psalm types support in IDEs

Maksim Spirkov who joined Yii team recently, raised a question whether it is a good idea to use Psalm/PhpStan types without specific prefixes right in @property or @var in Yii.

I've tested for the most basic and useful things:

1. Generics.
2. Array shapes.
3. Whether it works without prefix.

And searched about support in general.

<?php  
class Post
{
public function getName(): string
{
return 'test';
}
}

/**
* @template Type
*/
class Container
{
/**
* @param Type $value
*/
public function __construct(private $value)
{
}

/**
* @return Type
*/
public function getValue()
{
return $this->value;
}
}

/** @var array<Post> $postArray */
foreach ($postArray as $post) {
$post->
}

$container = new Container(new Post());
$container->getValue()->

/**
* @var array{name: string, age: int} $shapedArray
*/
$shapedArray = [];
$shapedArray['


Findings:

1. PhpStorm has a very good support for many annotations.
2. Visual Studio Code and its numerous forks, Zed, Sublime Text, Vim and its variations — they all use language servers for PHP typing and auto-complete and language servers, such as Intelephense, Phpactor, Psalm language server etc., have decent support.
3. Eclipse PDT, NetBeans do not support any advanced types at all.

Overall, worth using advanced types directly except for users of Eclipse PDT or NetBeans.

#php #ide #types #psalm #phpstan
8👍7🔥2😱1