Is requirements checker helpful?

In Yii 1.1 and Yii 2 there is requirements checker. In Yii 1 it was added long before composer was created and it went into Yii 2 without much re-thinking.

Nowadays most dependencies could be expressed via composer require section so the question is do we need separate requirements checker?

No, I think we don’t need it anymore.

I used it for Yii 1.1, but I never used it for Yii 2.

2 Likes

Yes, not needed anymore.

Actually, I never used it in Yii2

1 Like

Never used it well, composer handles all the checking I need

1 Like

Used it few times in Yii1, and 2 but I think it have served its purpose. It can be removed then!

1 Like

@samdark - Here’s the thing, people do create software for others, installable software, which must run a requirements checker before allowing people to install, or even in the installer.

For example, in our products installer, we’re using it like:

require_once INSTALLER_PATH . '/inc/RequirementChecker.php';
$checker = new RequirementChecker();
$result  = $checker->checkYii()->check([
    [
        'name'      => 'BCMath or GMP',
        'mandatory' => true,
        'condition' => extension_loaded('bcmath') || extension_loaded('gmp'),
        'by'        => '<a href="http://www.yiiframework.com">Application</a>',
        'memo'      => 'BCMath or GMP is required.',
    ]
])->getResult();

So it helps us since it checks the requirements by the framework but also allows us to add our own requirements depending on our products.

P.S: Formatting code in this forum is terrible difficult…

I think you should keep it.

1 Like

How about keeping it as a separate component?

P.S: Formatting code in this forum is terrible difficult…

It’s markdown. Same as at GitHub.

1 Like

Sure, whatever gives us access to it. It’d be a shame to waste so much good code.

I know. This doesn’t make it easier. I had to space the previous code too much, this is why i said it’s difficult. But got it working finally, no worries :wink:

Formatting is easier than you think. Check https://guides.github.com/features/mastering-markdown/, “Syntax highlighting” part.

I use it for testing the Docker builds, IMO composer does not handle all the checks, eg. imagemagick, pdo, …

1 Like

Maybe, separate, pack into yii module and access by route. eg: r=setup/check

4 Likes

I had once the task to get a Yii project working in an IIS server to which I only had FTP access. I deployed and sent the link of the requirements checker to the system admin asking him to get them green. He really liked the tool, probably because he also avoided lots of the human talk, but requirements checker was definitely a helpful tool. Thanks for the repo.

1 Like