Upgrading Webpoints to PHP v7.2

Download koseven-3.3.7, copy to cgi-bin

Change html/index_kohana.php to load new kohana version

Download latest v2 smarty (v2.6.31), copy to cgi-bin

Change html/header.inc to refer to this version of smarty

Update cgi-bin/koseven/application/bootstrap.php

Download latest kohana modules (formo 3.1.9)

Copy over mixu user module (https://github.com/mixu/useradmin)

Copy old files to

  • koseven-3.3.7/application/config
  • koseven-3.3.7/application/views
  • koseven-3.3.7/application/classes/Controller
  • koseven-3.3.7/application/classes/Model

ERROR 1: Call to undefined method Kohana::config()
edit MODPATH\user\classes\useradmin\auth.php
Change Kohana::config(..) to Kohana::$config->load(…)

ERROR 2: Call to undefined method Request::redirect()
edit MODPATH\user\classes\controller\useradmin\app.php
Change $this->request->redirect(…) to HTTP::redirect(…)
Change Request->current()->redirect(…) to HTTP::redirect(…)

ERROR 3: Untrusted host webpoints-3. If you trust webpoints-3, add it to the trusted hosts in the `url` config file.
Add APPPATH/config/url.php with ‘webpoints’ and ‘localhost’ entries

ERROR 3: Call to undefined method Kohana::config()
edit APPPATH\classes\Controller\user.php
Change Kohana::config(..) to Kohana::$config->load(…)

ERROR 4: [ Fatal Error ]: Method View::__toString() must not throw an exception, caught Error: Call to undefined method Kohana::config()
edit APPPATH\views\user\login.php
Change Kohana::config(..) to Kohana::$config->load(…)

ERROR 5: Class ‘Database_Mysql’ not found
edit APPPATH\config\datatbase.php
Change mysql to mysqli

ERROR 6: [ Warning ]: count(): Parameter must be an array or an object that implements Countable
edit MODPATH\orm\classes\Kohana\ORM.php
Change return $count === count($far_keys) to return $count === ((is_int($far_keys) || is_string($far_keys)) || (is_object($far_keys))) ? 1 : count($far_keys));

ERROR 7: Call to undefined method Request::redirect()
edit MODPATH\user\classes\controller\useradmin\user.php
Change $this->request->redirect(…) to HTTP::redirect(…)
Change Request->current()->redirect(…) to HTTP::redirect(…)

ERROR 8: Can’t edit entries – e.g. admin/editentry.php?e=56420
In html/header.inc, set display_errors to 1

ERROR 8(a): Deprecated: The each() function is deprecated. This message will be suppressed on further calls in D:\www\03 Development\Webpoints\v01.1\html\admin\editentry.php on line 85

ERROR 8(b): Fatal error: Smarty error: [in admin/editentry.tpl line 9]: [plugin] unknown tag – ‘form_start’ (core.load_plugins.php, line 118) in D:\www\03 Development\Webpoints\v01.1\cgi-bin\smarty-2.6.31\libs\Smarty.class.php on line 1100

OK, install composer….. (need to remove track_errors and php_mysql from php.ini)
Go to koseven-3.3.7
run composer require “bmidget/kohana-formo” “>=3.1”
Change bootstrap to load “kohana-formo”

BUT THIS WASN’T THE PROBLEM YOU TIT

Needed to copy from installed 2.6.22 to cgi-bin\smarty-2.6.31\libs\plugins\…
function.form_element.php, function.form_finish.php, function.form_start.php

THEN GOT A STEP CLOSER….

ERROR 8(c): PHP Fatal error: Uncaught Error: Call to undefined function ereg() in D:\\www\\03 Development\\Webpoints\\v01.1\\cgi-bin\\phplib\\php\\oohforms.inc:262
Downloaded bevhost/phplib and copied oohforms.inc into phplib\php

ERROR 8(d): some problem with OpenSSL encrypt called from oohforms….
Copy libeay32.dll (v1.0.2.14) from Synergy install to Apache\bin

ERROR 9: Get rid of some warnings…
Change php\PEAR\Benchmark\Timer.php constructor to __construct(…)
Change misc_series.inc each function for foreach
Change index.php each function for foreach
Change series_entrants.php each function for foreach
Change team_results.php each function for foreach
Change team_by_placing.php each function for foreach
Change admin\event\CheckEntries.php each function for foreach
Change admin\race\check.php each function for foreach

Change to __construct(…) on following files….
cgi-bin\phplib\php\of_text.inc
cgi-bin\phplib\php\of_select.inc
cgi-bin\phplib\php\of_radio.inc
cgi-bin\phplib\php\of_checkbox.inc
cgi-bin\phplib\php\of_textarea.inc
cgi-bin\phplib\php\of_file.inc

and a whole lot of other small edits… lost my way… but still not sure how editevent ever worked???!!!