PHP References

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

PHP References

Post by sjg »

Wow. So I've upgraded my development box to PHP 5.0.5, which has the new, more restrictive references model (as does PHP 4.4.0). It turns out that a lot of things I thought were acceptable are no longer permitted. For example, immediate functions are restricted:

For Example, the following is now forbidden:

Code: Select all

$var = array_pop(explode('/',$path));
Instead, you have to store the output of the explode in an intermediate variable. You may be able to get away with:

Code: Select all

$var = array_pop(@explode('/',$path));
as well.

Another thing that's breaking a bunch of my modules is smarty references. I do a lot of things like:

Code: Select all

$this->smarty->assign_by_ref('localized_string', $this->Lang('my_string'));
which, as far as I know, have to be changed to

Code: Select all

$this->smarty->assign('localized_string', $this->Lang('my_string'));
I'll be updating all of my modules as time permits. First will be the Skeleton, so my bad coding practices don't screw anyone who's working on writing their own modules.
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
seliger

Re: PHP References

Post by seliger »

Neat finds. That might explain some strangeness I've seen too. Though most things work fine under PHP 5 on any environments I have control over. My hosting company, that's the screwball. :-)

Keep us posted on the Skeleton. I want to build a module that will help me be lazy with integrating Paypal into my site. The skeleton is going to be my first stop.


Corey
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: PHP References

Post by sjg »

I've currently got BrowserStyler, RadioRoster, and Skeleton updated to work correctly.

FeedbackForm doesn't use most of the things that break other modules, so it should be OK, although it's slated for update anyway. I think Ell-Nav and SectionImages also fit into this category.

ContentAliases and PunBB/ProtectedPages still need to be updated.
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
trick

Re: PHP References

Post by trick »

This is prettry OT, but I was wondering if anybody knew of any PHP5 hosters, preferably free ones or for a pretty low price.
Post Reply

Return to “Developers Discussion”