Example #1
0
 /**
  * Check if version of upgrade/extension is acceptable to current version of EspoCRM
  *
  * @param  string  $version
  * @return boolean
  */
 protected function isAcceptable()
 {
     $manifest = $this->getManifest();
     $res = $this->checkPackageType();
     //check php version
     if (isset($manifest['php'])) {
         $res &= $this->checkVersions($manifest['php'], System::getPhpVersion(), 'Your PHP version does not support this installation package.');
     }
     //check acceptableVersions
     if (isset($manifest['acceptableVersions'])) {
         $res &= $this->checkVersions($manifest['acceptableVersions'], $this->getConfig()->get('version'), 'Your EspoCRM version doesn\'t match for this installation package.');
     }
     //check dependencies
     if (!empty($manifest['dependencies'])) {
         $res &= $this->checkDependencies($manifest['dependencies']);
     }
     return (bool) $res;
 }
Example #2
0
 public function testGetPhpVersion()
 {
     $this->assertTrue((bool) preg_match('/^[0-9\\.]+$/', System::getPhpVersion()));
 }