Relatively Large Change

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
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Relatively Large Change

Post by Ted »

Well, without really consulting anyone, I've decided to make a rather drastic change.  (isn't being in charge fun?)

I've decided that CMSMS should work off of an adodb lite or adodb install downloaded without any tweaks.  This is on that "things I should've done a year ago" list.

So, tonight I've modified the entire core and "core" modules to work with things that only come in a stock ADODB Lite install.  It only comes down basically to 3 things...

1. Use RecordCount instead of RowCount.  This is an adodb lite change.  Not totally sure why they don't support it, but oh well.
2. DBTimeStamp() now returns time stamps with the single quotes around them.  This is a huge deal, because you have to modify each SQL query that uses this thing accordingly.  If you're using it in your Execute statement, then you have to either move it in the query string itself, or trim out the single quotes.
3. Datetime fields in your Install/Upgrade calls now have to be DT instead of T.

After i did all this work, I downloaded a stock adodb 4.90 from the net and changed config.php to use it.  It didn't flinch, so I think I did an ok job.

I mainly did this for the people who are trying to marry other applications (namely gallery2) into CMSMS but have conflicts with a stock version and hacked version of the adodb libs.  This should solve the problem from here on out.

I hope I didn't mess too many module devs up.  This change WILL be in 1.0, so modify your modules accordingly.

Thanks!
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Relatively Large Change

Post by Russ »

Someone has been very busy ;-)

Makes sense to me to use the standard version and it will save a whole heap of headaches down the line. So Ted pat yourself on the back and have a well earned beer....

Do we have a definative list for what it is in the next version and when? Will it be "1,0" or perhaps an RC!?? Perhaps with all these changes it might be better to do another beta?

1. I'm thinking about optimistic locking as we talked about earlier - to stop two people editing the same page, there was some code which needed to be re-worked.

2.  A change to news to allow setting the source page for clean URL's. I know Elijah has been reworking the Album module to this effect, but I've yet to have a look at the his latest version,(I've been away.) but I hope to take a look tomorrow. (When I was palying with the piSearch module - I found it easiest to place this in the tag - but Elijah has gone for a much more sophisticated route.)

There were a few other things, but my time away from CMS has made me forget... I'm sure it will come back to me...

Russ
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Re: Relatively Large Change

Post by lemkepf »

Can you do a mass query through subversion to see what modules use any of the offending techniques?
rllqph

Re: Relatively Large Change

Post by rllqph »

I'm not really sure what is the use of adopting AdodB lite. I think the current version of CMS MS is ok now.

But if Ted really wants to push on this project, maybe I should start reading more topics about adodb lite too. ^^

btw, are you also planning to use pear framework for this changes?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Relatively Large Change

Post by calguy1000 »

lemkepf wrote: Can you do a mass query through subversion to see what modules use any of the offending techniques?
In essence, pretty much every module does, some more, some less... HitCounter took me less than 10 minutes to convert.... others too up to an hour.  but it wasn't a hard process.

In essence, most modules will need to be converted to be compatible with 1.0.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm
Location: the Netherlands

Re: Relatively Large Change

Post by Dee »

To ensure timestamps work well on all CMSMS versions, from my modules I do:

Code: Select all

$db = &$this->cms->GetDb();
$timestamp = $db->DBTimeStamp(time());
// add the single quotes if neccesary
$timestamp = (($timestamp[0] != "'") ? $timestamp : "'$timestamp'");
Also note that DT only exists in the adodb_lite datadict, not in full/original adodb.
So, to ensure your module install/upgrade creates a DATETIME field on a CMSMS installation that uses config['use_adodb_lite'] = false; you'd have to do something like:

Code: Select all

$datetime = $gCms->config['use_adodb_lite'] ? 'DT' : 'T';
$flds = '
    id I KEY,
    date ' . $datetime . ' NOTNULL
';
Last edited by Anonymous on Wed Aug 16, 2006 3:29 am, edited 1 time in total.
Post Reply

Return to “Developers Discussion”