예제 #1
0
파일: Base.php 프로젝트: naushrambo/espocrm
 /**
  * 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;
 }
예제 #2
0
 public function testGetPhpVersion()
 {
     $this->assertTrue((bool) preg_match('/^[0-9\\.]+$/', System::getPhpVersion()));
 }