cross-solution / YAWIK

YAWIK is a web application. It can be used as an ATS applicant tracking system or as a jobboard.
https://yawik.org
MIT License
125 stars 67 forks source link

PHP 7 Integration #465

Closed kilip closed 6 years ago

kilip commented 6 years ago

I have php 7.0 in my local machine (installed with phpbrew), when I run phpunit and behat tests I see that I can fix this failed tests. So I start PHP 7 integration which now can be found in my own yawik repo:


MongoDB Extension (PHP 7 Environment)

In order to connect mongo we need to use MongoDB extension, and add alcaeus/mongo-php-adapter dependency into composer. Here's a sample how to do fresh new yawik installation on php 7:

$ cd path/to/yawik
$ pecl install mongodb
# composer --ignore-platform-reqs option will ignore platform rules such as
# ext-mongo during installation/update
$ composer require alcaeus/mongo-php-adapter ^1.0.0 --ignore-platform-reqs
$ composer install --ignore-platform-reqs

I have remove ext-mongo dependency from composer.json because it will cause an error in php 7.

Travis Build

Travis build will contain matrix:

To get faster build, xdebug will be removed except for travis with env COVERAGE=yes. All build will perform phpunit and behat tests except for COVERAGE=yes env which will only perform phpunit tests to collecting code coverage.

Summary

I think it's time for yawik to change installation method, because requirements like alcaeus/mongo-php-adapter will contain breaking changes. We need to separate modules so every modules can be installed with composer (including Core, Auth, Jobs, etc). This can be done by using git subsplit command.

We also need to make a new project to be used as a skeleton for yawik installation. By using this skeleton we can easily modify yawik requirements for every yawik installation. Here's a sample of modified composer.json from skeleton project:

require: {
    "php": "^7.0",
    "ext-mongodb": "*",
    "alcaeus/mongo-php-adapter": "^1.0.0",
    "yawik/module-core": "1.0",
    "yawik/module-auth": "1.0",
    "yawik/module-jobs": "1.0"
}

By using this method we can easily update every yawik installation by simply using composer update command. I will create another issue for this new installation method.

cbleek commented 6 years ago

you are awesome, I never would have expected, that we can migrate to php7 that fast. I've setup a demo on

http://php7.yawik.org

cbleek commented 6 years ago

I did not know that mongodb also runs under php 5.6.

I have now merged your changes into one branch.

The Behat tests are not running, can you see that? Please use your upwork budget.

cbleek commented 6 years ago

https://travis-ci.org/cross-solution/YAWIK/builds/439324721

kilip commented 6 years ago

@cbleek I will try to fix this behat tests today

kilip commented 6 years ago

@cbleek @TiSiE

In this PHP7 branch we will using only mongodb extension for all php version. I want to notice to all user/developer that this changes will require us to have mongodb installed.

I suggest this changes should be implemented in next major version (0.32.*).