anvc / scalar

Born-digital, open source, media-rich scholarly publishing that’s as easy as blogging.
Other
231 stars 73 forks source link

Upgrading to Code Igniter 3? #77

Closed dperzanowski closed 6 years ago

dperzanowski commented 6 years ago

Are there any plans to upgrade Scalar to use CodeIgniter 3.x in the near future?

craigdietrich commented 6 years ago

Not right now. We upgraded to CI 2 in 2016 which was a pretty big conversion so we're going to sit on it for a while before making plans for 3. Is there something in particular in 3 that you needed?

dperzanowski commented 6 years ago

Hey Craig, thanks for you quick response.

The biggest issue is I'm trying to get this set up on one of our servers, but it only has PHP 7.1 on it. Then there is the issue of CI2 no longer being supported and PHP 5.6 having little over a years worth of security updates left.

craigdietrich commented 6 years ago

When we first ran the update I tested Scalar pretty extensively on PHP7 (I'm not sure what sub-version). Have you tried it; is there anything in particular PHP7 is balking at?

I have access to PHP7 on my Dreamhost account, I could do another round of testing if that would be helpful.

dperzanowski commented 6 years ago

I wouldn't be surprised if I'm missing things from the install instructions, but I'm unable to create books. I get the following error when I try to create a book while on the dashboard (/system/dashboard).

Could not create the directory for this new book on the filesystem

I also get the attached deprecation warnings from libraries/Encrypt.php.

screen shot 2017-10-31 at 2 29 59 pm

craigdietrich commented 6 years ago

First things first, you need to allow PHP to write folders inside the Scalar root folder, this would explain why you can't create books; Scalar creates a folder for each book in the Scalar root. Go to the directory that contains the Scalar root folder and:

chmod 0775 ./(scalar root folder)

As far as the deprecation warnings, I suppose this makes sense. I thought I had removed them for PHP7 but it looks like PHP7.1 has deprecated more things like mcrypt. Can you suppress warnings? Is the ENVIRONMENT in codeigniter.php set to 'production'?

dperzanowski commented 6 years ago

Suppressing warnings isn't an issue. I set the environment to DEVELOPMENT so I could see some errors in an attempt to get the book creation working

Updating permissions on the webroot fixed the book creation issue. Are there other places where permissions need to be changed?

craigdietrich commented 6 years ago

When it creates the book folders Scalar should chmod the newly created folders to 0775 (or whatever is set in system/application/config/local_settings.php), so that should cover any uploaded files that are supposed to write into those folders. I think that's it.

Is Scalar otherwise working correctly?

dperzanowski commented 6 years ago

So far it appears to be working. Thanks for the help!

craigdietrich commented 6 years ago

Great! Let us know if you run into any problems.

It'll be a while before we upgrade CodeIgniter so hopefully PHP won't get rid of those mcrypt functions anytime soon!