Require pagekit & PHP version

  • Hey


    How can I require in a extension a version of Pagekit & PHP? I need at least Pagekit v1.0.15 & PHP v7.1, otherwise the extension & a dependencies will not work. Is there also a way to show a message considering the requirements.


    Thanks,

    SAB

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

    • Helpful
    PHP
    1. if ( !version_compare(PHP_VERSION, '5.0.0', '<') ) {
    2. return App::abort(400 , 'Php Version: '.PHP_VERSION);
    3. }
    4. if ( !version_compare($app['version'], '1.0.15', '<')) {
    5. return App::abort(400 , 'Pagekit Version: '.$app['version']);
    6. }