Is requirements checker helpful?


(Alexander Makarov) #1

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?


(Softark) #2

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

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


(Bizley) #3

Yes, not needed anymore.


(soldierm) #4

Actually, I never used it in Yii2


(Mehdi Achour) #5

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


(Stefano Mtangoo) #6

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


(Serban Cristian) #7

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


(Alexander Makarov) #8

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.


(Serban Cristian) #9

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:


(Alexander Makarov) #10

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


(Schmunk) #11

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


(Yusup hambali) #12

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


(Alexander Makarov) #13