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?
@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…
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
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.