Blog. Last 5 entries

 1   2   Next ≫

New and improved Control panel

Well, I say than I'm working in the Control Panel.

Current Control panel is very simple, but lacks in some advanced features. This week, I'm developing a refresh of the Control panel.

What changes/improvements are present:

  • Redesigned Interface, tabbed.
  • New and missing features added.
  • Some updates in Scripts code
  • Minor changes in Backend code

New Control panel is available via SVN. So, you can download and test the new Control Panel:

svn checkout http://dportalcms.googlecode.com/svn snapshot

Note than the new Control panel is not terminated yet. many of the all features are present and tested.

Screenshots are available in the Image gallery.

Post comment

New version published

I announce than a new version of DPortal CMS has been published!

But, hehe, the program is still not free of bugs. Only little problems I've found.

  • Problem with Media player: Playlist will be loaded only if a slash is at the end of the URI; elsewhere, an 404 page will be displayed. This is corrected by editing the "/media_player/.htaccess" file, by using the slash as optional. [Corrected by editing "tv.php"]
  • Gallery Feed does not work: False alarm, them works ^^U [False alarm]
  • XML sitemap has incorrect date/time: I'm working on them, too. [Resolved]
  • HTML sitemap does not display the Blog entries in reverse order (latest to earliest). [Resolved]

In summary, the components of the CMS and their state:

  • Main module works correctly
  • HTML Sitemap iterates the sections properly (except for the Entries order).
  • XML Sitemap iterates correctly, but has incorrect date/time.
  • Blog works correctly. I'll test the comments system harder once I ended other important revisions.
  • Gallery displays perfectly.
  • Media Player, Showcase and Playlist works perfecty (except the slash problem).
  • Installer works correctly. I'm tested them really hard.
  • Panel, and configuration update does not have errors.
  • Memcached works on my machine (this server doesn't have installed Memcached libraries).

I'll update these buggy code soon, via SVN and publish another tarball.

Post comment

Caching Benchmark

Currently, DPortal CMS have three Smarty Cache Handler Functions: Caching-on-Files, Memcached, and Caching disabled.

Yesterday, I did some Caching benchmark, to test the performance with these modes, and the results (in nanoseconds) are the following:

1.- Normal 2.- copied
100 times
Memcached
0.0887918
0.0782518
0.0918648
0.0890250
0.0847179
----------
0.152779
0.132891
0.189441
0.178917
0.174865
---------
0,086530 0,16577
1.- Normal 2.- copied
100 times
Cache disabled
0.0694780
0.0797469
0.0685451
0.0851321
0.0830941
----------
0.163043
0.130159
0.164993
0.155334
0.143921
---------
0,077199 0,15149
1.- Normal 2.- copied
100 times
Cache on-files
0.0766510
0.0782308
0.0925061
0.0841941
0.0825970
----------
0.0878369
0.0812170
0.1022429
0.0959160
0.0917348
----------
0,082835 0,091789

In summary, Caching-on-files has been better performance than Memcache, considering than the Benchmark has been made in my PC with Linux, when I'm the only one user, and I've opened the Browser (Iceweasel), and the Desktop environment. In conclusion, this benchmark does not apply to Servers with lot of traffic. Benchmarks should be done in all scenarios and most of the Webservers.

DPortal CMS have a Benchmark mode, that write the Script executed, the Timestamp and the time of execution. These data may be used to compare the execution times of every query. Then, you can send me this file to compare them, and inquire whether if Memcached is better than Caching-on-Files in a production environment.

Post comment

Memcached support

I'm working hard lately. The project has been on hiatus for a long time (2009 and 2010), and only now "I put the batteries" and have added significant improvements to the Project.

One of these improvements is Memcached support.

Complicated?
Not, Implement Memcached support in Smarty Cache Handler Function
is easier than you think.

Following the Smarty documentation, I've created a Cache Handler Function to use Memcached, from 0, without following any other documentation or third party code.

In "config.php" will declare the Smarty Cache Handler Function depending on selected options

config.php

<?php
// :: Output ommited

 
if(!empty($memcached_server)){
    if(
class_exists('Memcached')){ // Use the Class Memcache or Memcached; see bellow
     
$memcached = new Memcached('dpcms_ '$site_id);
      if(
$memcached->addServer($memcached_server$memcached_port)){
       
$smarty->cache_handler_func 'cache_handler_memcached';
      }
    }
  }

// :: Output ommited

?>

And, in the Functions directory, the "memcached.php" script has the Function to use the Smarty Cache Handler Fucntion. As you see, is really easy to Read and Write the Cache into Memcached daemon. Of course, you can use this function to your own project using Smarty, too.

memcached.php

  <?php
  
    ################################################
    #                                              #
    #    DPortal CMS, CMS without Database engine  #
    #                                              #
    #  Memcached support module (memcached.php)    #
    #                                              #
    #  Copyright (c) Davod.                        #
    #                                              #
    #  This program is published under the         #
    #  GNU general Public License                  #
    #                                              #
    #  Please see README and LICENSE for details   #
    #                                              #
    ################################################

function cache_handler_memcached($action,
                                 &$smarty,
                                 &$cache_content,
                                 $tpl_file=null,
                                
$cache_id=null,
                                 $compile_id=null,
                                 $exp_time=null){

 
// Class Memcached previouslly constructed.
  global $memcached;
 
global $site_id;

 
$CacheID 'dcms_' $site_id '_' sha1($tpl_file.$cache_id.$compile_id);

  switch(
$action){
    case 
'read' :
       // Get the contents is easy than query a DB
      $content $memcached->get($CacheID);
            
     
if(!empty($content)) return $content;
      else return 
false;
      break;
        
    case 
'write' :
      // here is the same, but to Write
      if($memcached->set($CacheID,$cache_content)) return true;
     
else return false;        
      break;
        
    case 
'clear' :
      if(!empty(
$CacheID)){
        if(
$memcached->delete($CacheID,0)) return true;
        else return 
false;
     
}else{
        // Two alternatives to clear the Cache, using Memcached::Flush,
        // or a WHILE block to delete all the cache keys
        if(
$memcached->flush(0)) return true;
        else return 
false;        
      }

      break;
        
  default:
        
     
// error, unknown action
     
$smarty_obj->_trigger_error_msg 
      ("cache_handler: unknown action \"$action\"");
     
$return false;
      break;
  }
}

?>

Only a little dilemma in Clear cache mode: Use Memcached::flush() to invalidate all the Cache contents (and if contents of the key will be empty, Function will return FALSE and the Cache object should be recreated), or get the list of all the keys stored in memcached, filter, and use a WHILE block to delete one-to-one key.

Note: PHP has two classes to interact with the Memcached daemon: Memchace and Memcached. The two do the same, but both have few differences: Memcached is newer than Memcache (2009 and 2004 respectivelly) and Memcached is more frature rich. Also, Memcached needs the libmemcached library and Memcache not. Of course, you can use Memcache instead of Memcached by doing little changes in the code; please see the PHP Documentation about Memcache and Memcached. Note than, in order to enable Memcached, your Webserever must have installed the PECL Memcache/Memcached extension and the correspondient libraries; ask to your Hosting administrator if they can enable them.

This Sunday I'll publish the next version of DPortal CMS, with important bugfixes and Memcached included.

Post comment

New version this weekend

Dear users and developers.

I've workend in installer in this week, and I'll publish the new version of DPortal CMS this Sunday.

This version will have the following changes:

* Changes in Installer and places.

* Some bugfixes in Templates.

If you want to update, please read carefully the Documentation about them.

Post comment
 1   2   Next ≫