OCS future plans

Hi @Hembo_Pagi,

The latest on OCS is still this blog post from 2018, I’m afraid.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for your respond. As the code is so old and requires PHP 5.2 we need to rethink the whole situation. Any recommendations or patches to make it work with newer PHP versions?

Hi @Hembo_Pagi,

The current stable branch in github (ocs-stable-2_3_6) has been updated to support PHP7.

Regards,
Alec Smecher
Public Knowledge Project Team

Is this still in the works, or have there been any new developments in a new version of OCS? We have a faculty member asking for a conference platform, but I’m not sure we want to use the old version.

Hi @John_Martin,

I’m afraid not. At this point, I would not recommend starting a new installation of OCS.

Regards,
Alec Smecher
Public Knowledge Project Team

any update regarding the OCS update. we have been using it actively and we need new version.

Hi,

I installed the current stable branch in github - ocs-stable-2_3_6, fot PHP7, on my localhost with PHP 7.3.6.
But OCS not worked. Write error:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in D:\xampp736\htdocs\ocs_test_php7\classes\core\Application.inc.php on line 30

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PKPApplication has a deprecated constructor in D:\xampp736\htdocs\ocs_test_php7\lib\pkp\classes\core\PKPApplication.inc.php on line 24

Fatal error: Cannot use ‘String’ as class name as it is reserved in D:\xampp736\htdocs\ocs_test_php7\lib\pkp\classes\core\String.inc.php on line 57

My question:
Do you plan to continue fixing ocs-stable-2_3_6 to PHP 7?
Will you create a new version of OCS for PHP 7 and higher?

Thanks

Petr

Hi @pvalen,

The ocs-stable-2_3_6 branch is already fixed up for PHP7; make sure you’ve got that branch checked out in your lib/pkp submodule as well.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
thanks from your answer.
I download zip file “ocs-ocs-stable-2_3_6.zip” from “ocs-stable-2_3_6”

When i open it, then is “lib/pkp” empty

Hi,
When I see “classes\core\Application.inc.php”, there is writing:

class Application extends PKPApplication {
function Application() {
parent::PKPApplication();
}

Therefore write error:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in D:\xampp736\htdocs\ocs_test_php7\classes\core\Application.inc.php on line 30

Hi @pvalen,

The Deprecated message is just a warning, and shouldn’t prevent the software from working (for now).

If the lib/pkp subdirectory is empty and you’re using git to run the checkout, then you probably haven’t updated your git submodules. Check the git documentation, but generally you can do this by running

git submodule update --init --recursive

Regards,
Alec Smecher
Public Knowledge Project Team

I’m sorry, but I can’t install OCS under PHP7.
The older version works for me without any problems.

I maked new installation.
I download zip file “ocs-ocs-stable-2_3_6.zip” from “ocs-stable-2_3_6”. I copy file from zip file to my localhost.
I download zip file “pkp-lib-master.zip” from “pkp/pkp-lib”. I copy file from zip file to my localhost to “lib/pkp”.
I changed file “config.inc.php” (base_url, Database Settings) .

I run in a browser and only see these three errors:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in D:\xampp736\htdocs\ocs_test_php7_org\classes\core\Application.inc.php on line 30

Warning: require_once(D:\xampp736\htdocs\ocs_test_php7_org/core/PKPApplication.inc.php): failed to open stream: No such file or directory in D:\xampp736\htdocs\ocs_test_php7_org\lib\pkp\includes\functions.inc.php on line 25

Fatal error: require_once(): Failed opening required ‘D:\xampp736\htdocs\ocs_test_php7_org/core/PKPApplication.inc.php’ (include_path=‘D:\xampp736\php\PEAR’) in D:\xampp736\htdocs\ocs_test_php7_org\lib\pkp\includes\functions.inc.php on line 25

Hi @pvalen,

The steps you’re describing will mix code from OCS 2.3.6 with code from the unreleased ocs-stable-2_3_6 branch; that won’t work.

The best way to work with code from github is to use the git tool on the machine you’re installing OCS onto, and let it manage the details. There is good introductory documentation on working with git here: Git Clone - How To Use Git Clone | W3Docs Git Online Tutorial

You’ll also have to learn a little about submodules, which are documented here: How to Clone Including Git Submodules

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,

I tried:

d:\xampp736\htdocs\ocs_test_php7_git>git clone --branch ocs-stable-2_3_6 https://github.com/pkp/ocs.git
Cloning into 'ocs'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 65884 (delta 0), reused 0 (delta 0), pack-reused 65883
Receiving objects: 100% (65884/65884), 25.60 MiB | 8.66 MiB/s, done.
Resolving deltas: 100% (42871/42871), done.

d:\xampp736\htdocs\ocs_test_php7_git>cd osc\lib\pkp

d:\xampp736\htdocs\ocs_test_php7_git\ocs\lib\pkp>git submodule update --init --recursive
Submodule 'lib/pkp' (git://github.com/pkp/pkp-lib) registered for path './'
Cloning into 'D:/xampp736/htdocs/ocs_test_php7_git/ocs/lib/pkp'...
Submodule path './': checked out '78f8120d8ec51616305ea8621c9e0146845a0e71'

d:\xampp736\htdocs\ocs_test_php7_git\ocs\lib\pkp>

I changed file “config.inc.php” (base_url, Database Settings) .

Once started again full of errors. See file 1

So I put “error_reporting (0);” in the “index.php” file, but again full of errors. See file 2

Can you please advise me how to well install the correct version for PHP7? Thank you.

Hi asmecher,

Can you please advise me how to properly install a modified version of OCS to work with PHP 7?
As I wrote on May 13, 2020, it constantly makes mistakes.

Thanks

Petr

Hi @pvalen,

Configure your PHP to send errors/warnings to the PHP log, rather than the browser.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher,

Configuring PHP to store errors in the PHP log, does not remove these errors and does not run the application.

When I debug an application, I prefer to make error on the screen so that I don’t miss one.

I installed OCS with modification for PHP7 according to your instructions, but it still reports errors and does not work. Only mistakes and nothing else are listed.

I quite doubt that such an errors, for example
Declaration of Plugin::getSetting($conferenceId, $schedConfId, $name) should be compatible with PKPPlugin::getSetting($context, $name)
or
Declaration of Plugin::updateSetting($conferenceId, $schedConfId, $name, $value, $type = NULL) should be compatible with PKPPlugin::updateSetting($context, $name, $value, $type = NULL)
etc.
will not cause an error in the running of the application

I asked for advice on what to do to make the application work. Not advice on not showing errors.

Petr

Hi @pvalen,

Those are warnings, not failures, and the software will continue to run regardless. However, when the messages are sent to the browser, they interrupt OCS’s attempts to send headers (e.g. session management) and cause problems. Directing them to the log instead will resolve this.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher,

thank you, if I log all errors to a file, then OCS works, but in a moment I have a full log file, even if I set error_reporting(E_ERROR); :frowning:
Is it possible to fix those errors (warnings)? This way, OCS cannot be used.

Petr

Hi @pvalen,

We’re not actively developing OCS at the moment, but would review and accept pull requests to resolve the warnings.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like