I would just fix it :-).

On 04/18/2014 11:36 AM, Maciej Lasyk wrote:
> Hi huys,
>
> I'm trying to set up MySQL as the backend for Events in Ganglia-Web. I
> have proper PEAR libs installed (MDB2, DB) via `pear install` on this
> Debian 7 box.
>
> Afterwards I pushed:
>
> $conf['overlay_events_provider'] = "mdb2";
> $conf['overlay_events_dsn'] = "mysql://ganglia:pwd@localhost/ganglia";
>
> To the conf.php and after restarting Apache I got in error-logs:
>
> PHP Fatal error:  Call to undefined method MDB2_Error::quote() in
> /somewhere/ganglia-web-3.7.0/lib/Events/Driver_Mdb2.php on line 54
>
> What's weird - I checked and there is this method in /usr/share/php/MDB2.php
> in the MDB2 class:
>
>      function quote($value, $type = null, $quote = true, $escape_wildcards = 
> false)
>      {
>          $result = $this->loadModule('Datatype', null, true);
>          if (PEAR::isError($result)) {
>              return $result;
>          }
>
>          return $this->datatype->quote($value, $type, $quote, 
> $escape_wildcards);
>      }
>
> And the calling part in lib/Events/Driver_Mdb2.php:
>
> function ganglia_events_get( $start = NULL, $end = NULL ) {
>    global $conf;
>    $db =& MDB2::factory( $conf['overlay_events_dsn'] );
>    if (DB::isError($db)) { api_return_error($db->getMessage()); }
>
>    $sql = "SELECT * FROM overlay_events ";
>    if ( $start != NULL || $end != NULL ) {
>      $sql .= " WHERE ";
>      $clauses = array();
>      if ( $start != NULL ) {
>        $clauses[] = "start_time >= " . $db->quote( $start, 'integer' ); # <<< 
> this line
>      }
>      if ( $end != NULL ) {
>
> Do you have any clue, or should I rather clone / fix and create pull request? 
> ;)
>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to