11
Predator
Re: PersistableObjectHandler with Cache
  • 2007/10/12 19:08

  • Predator

  • Just popping in

  • Posts: 35

  • Since: 2005/5/20


The Lite.php is an external Lib under GPL and the rest is also on GPL so no prob here, as it must be modified to get work with XOOPS.
Predator

- Time is a created thing. To say, "I don't have time" is like saying "I don't want to."
- Lao-Tzu......

12
Catzwolf
Re: PersistableObjectHandler with Cache
  • 2007/10/12 19:27

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

Predator wrote:
The Lite.php is an external Lib under GPL and the rest is also on GPL so no prob here, as it must be modified to get work with XOOPS.


Really? No wonder $mosConfig_absolute_path was returning a null value all the time. #OOPS#. :-p

ok, I must admit, I stole the mosTab class and I am going to use it

Actually I am about to add this functionality to the xoopsform class shortly. Would be good to have those forms cut into different sections without having to revert back to static html.

Catz

13
hervet
Re: PersistableObjectHandler with Cache
  • 2007/10/13 12:34

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


In this class (the one you can download) there is a method I choose to remove because it is not useful for everybody but who knows ... may be someone will need it one day.

A client asked me the possibility to see every difference made to a record, he wanted to see what was made before and after.

This is what this method is used for :

/**
     * Compare two objects and returns, in an array, the differences
     *
     * @param XoopsObject $old_object     The first object to compare
     * @param XoopsObject $new_object    The new object
     * @return array differences    key = fieldname, value = array('old_value', 'new_value')
     */
    
function compareObjects($old_object$new_object)
    {
        
$ret = array();
        
$vars_name array_keys($old_object->getVars());
        foreach(
$vars_name as $one_var) {
            if( 
$old_object->getVar($one_var'f') == $new_object->getVar($one_var'f')) {

            } else {
                
$ret[$one_var] = array($old_object->getVar($one_var), $new_object->getVar($one_var));
            }
        }
        return 
$ret;
    }

14
Garrath
Re: PersistableObjectHandler with Cache
  • 2007/10/25 10:00

  • Garrath

  • Just popping in

  • Posts: 23

  • Since: 2007/6/11


Sorry for my english...

I think XOOPS make lot of SQL request for make a page.
I think is due to an Object view againts a Relational view... Is not a XOOPS problem is a general problem.
I don't say is a good way or not it's just a fact i see all days in my work too...

In a long time ago (lol) we may make just one sql requete to have a user, his groups and permissions for example. Now with object view we make one for user, one for his groups and one for his permissions...
The two ways have good purpose (and bad too).

In a general ways, i think it's very 'bizarre' to make cached file (an a long time we use file, after we have database (hierarchique etc... and after relationnal) and now we use relational like flat file and we put data on file for cache. I think computer science is a cycle )

We have risk for synchronize data with that way... in a website with lot of access, you can have problem on file system etc... etc... on some system, you have a limit on number of file under folder: in windows, but in Linux (or Unix system) , i don't remember if you have this limit, but i know you have limit on shell (an 'ls' command on a great folder with lot of file can give you special result, and the result is not the same on sh, or ksh)
If you have lot of file on folder, i think you can have a bad surprise.

For another way, you can have your database in an other computer... then database access don't use CPU but use time on discuss between the two computers. etc...

I think you can make an optimisation on database before.
You have this one way :
http://www.howtogeek.com/howto/programming/speed-up-your-web-site-with-mysql-query-caching/

http://www.mysqlperformanceblog.com/

We can use MEMORY table on MySQL to optimize access too
http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html
(in fr)
http://dev.mysql.com/doc/refman/5.0/fr/memory-storage-engine.html
(we can put in memory table data from XOOPS we use a lot... block, permission, etc...)
(ok we have the same problem with synchronisation...)

For a choice between flat file vs dbb there is lot of subjet on internet... don't forget that dbb is specialize in access... ok it's work finally with file, but they make lot optimisation with cached etc... php i don't think it is specialize into.

15
trabis
Re: PersistableObjectHandler with Cache
  • 2009/7/10 18:46

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I would like to see us discussing code often. This is for sure an object of study. I hope we can make dev.xoops.org a good place to share ideas. Meanwhile, I advise developers to read the developer forum on sourceforge starting from back to forth.
2004/2005 threads have a lot of good ideas still pending discussion/implementation!
https://sourceforge.net/forum/forum.php?forum_id=347994

Login

Who's Online

191 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits