Jump to content
MakeWebGames

MC CODES PHP7-PHP8


jedigunz

Recommended Posts

It is something I'd play around with, however I decided to just convert it and implement an MVC approach using a basic MVC model from codeshack. It is working on PHP8 on MWG hosting.

When adding a mod, some variables are renamed and file is stripped to follow MVC model. At the moment, it's being built as a game but I will surely look into making it into a game engine itself.

 

Link to comment
Share on other sites

I was attempting to use a library called Rector but had no luck getting composer recognised by an IDE to actually run rector and convert the engine automatically. 

https://github.com/rectorphp/rector

Also I have seen another library that could work but also needs composer PHPCodeSniffer

https://github.com/squizlabs/PHP_CodeSniffer

Composer 

https://getcomposer.org


I have a subdomain running php8 and the main domain running php7 , 7 works but 8 doesn't and I get a Critical Error when logging in
(A critical error has occurred, and this page cannot be displayed. Please try again later.)
Change it back to PHP7 and no problems again.

NOT WORKING (PHP8)
http://phpupdate.deadlycountry.com/login.php

WORKS (PHP7)
https://deadlycountry.com/login.php 

If anyone uses composer and knows how to get it running on an IDE on Windows that would be great !
if anyone or yourself Ishraq have any other conversion suggestions for the base engine let me know.
 

Edited by jedigunz
Link to comment
Share on other sites

PHP 8.2 McCodes v1

Here is a repo of the v1 version modified to run PHP 8.2, be careful using it as there is a few bugs and runs a shim to enable MySQL connection, if you want any advise on how to upgrade the PHP version, give me a message and I will be able to show you how to get things going, including getting your composer to work on you IDE

Link to comment
Share on other sites

3 hours ago, AdamHull said:

PHP 8.2 McCodes v1

Here is a repo of the v1 version modified to run PHP 8.2, be careful using it as there is a few bugs and runs a shim to enable MySQL connection, if you want any advise on how to upgrade the PHP version, give me a message and I will be able to show you how to get things going, including getting your composer to work on you IDE

Your link is 404 dead

Link to comment
Share on other sites

I'm using php 8.2 on my xampp and mccodes works no problems.

Things I've needed to change was removing the magic quotes from globals.php switched to my_sqli, not planning on switching to prepared queries just yet.
the most common problem i've found is having to change if($_POST['some var']) to if(isset($_POST['some var']) in most pages that I've looked at sofar. haven't come across any game or script breaking code or errors.

Link to comment
Share on other sites

Thanks for that @AdamHull I will have a look at your V1 conversion when I get a chance

@skalman I removed magic quotes since PHP 7, might be some of the modification I have either added or coded which is affecting it then,

I will look more closely and see what else could be the issue

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...