Api

Version

mediamosa-30

Class

mediamosa_rest_call_mediamosa_version

Code

File: /sites/all/modules/mediamosa/mediamosa.rest.class.inc
<?php?php
// $Id$

/**
 * MediaMosa is Open Source Software to build a Full Featured, Webservice
 * Oriented Media Management and Distribution platform (http://mediamosa.org)
 *
 * Copyright (C) 2011 SURFnet BV (http://www.surfnet.nl) and Kennisnet
 * (http://www.kennisnet.nl)
 *
 * MediaMosa is based on the open source Drupal platform and
 * was originally developed by Madcap BV (http://www.madcap.nl)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, you can find it at:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

/**
 * @file
 * Contains the global MediaMosa Rest calls.
 */

/**
 * URI: /version
 * Get the current version number.
 */
class mediamosa_rest_call_mediamosa_version extends mediamosa_rest_call {

  public function 
get_var_setup() {
    
$var_setup = array();

    
// Enrich with required REST vars.
    
return self::get_var_setup_default($var_setupFALSE);
  }

  public function 
do_call() {
    
$mediamosa mediamosa::get();

    
// Get version array.
    
$version mediamosa_version::get_current_version(TRUE);

    
$mediamosa->add_item(
      array(
        
'version' => mediamosa_version::get_current_version_str(FALSE),
        
'build' => $version[mediamosa_version::BUILD],
        
'info' => $version[mediamosa_version::INFO],
      )
    );
  }
}