You are here

function _fckeditor_requirements_getinstalledversion in FCKeditor - WYSIWYG HTML editor 6.2

Fetches the version of the installed FCKeditor sources

It tries to locate the version of the FCKeditor sources in fckeditor.js

Releases have a version number such as "2.6.4.1" SVN nightly releases have a minor version number with SVN appended: "2.6 SVN" SVN check outs have the string "[Development]"

This function is used by fckeditor_requirements()

Return value

string Version number (eg. 2.6.2) of FCKeditor. Null if not found in fckeditor.js

1 call to _fckeditor_requirements_getinstalledversion()
fckeditor_requirements in ./fckeditor.install
Implementation of hook_requirements().

File

./fckeditor.install, line 298

Code

function _fckeditor_requirements_getinstalledversion() {
  module_load_include('module', 'fckeditor');
  $editor_path = fckeditor_path(TRUE);
  $jspath = $editor_path . '/fckeditor.js';
  $configcontents = file_get_contents($jspath);
  $matches = array();
  if (preg_match('#FCKeditor\\.prototype\\.Version\\s*=\\s*\'([\\d\\.]+(?: SVN)?|\\[Development\\])\'\\s*;#', $configcontents, $matches)) {
    return $matches[1];
  }
  return NULL;
}