当前位置: 首页>>代码示例>>PHP>>正文


PHP getInstallType函数代码示例

本文整理汇总了PHP中getInstallType函数的典型用法代码示例。如果您正苦于以下问题:PHP getInstallType函数的具体用法?PHP getInstallType怎么用?PHP getInstallType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getInstallType函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

if (!isset($_REQUEST['version'])) {
    die($mod_strings['ERR_UW_NO_MODE']);
}
$version = $_REQUEST['version'];
if (!isset($_REQUEST['copy_count']) || $_REQUEST['copy_count'] == "") {
    die($mod_strings['ERR_UW_NO_FILES']);
}
if (!isset($_REQUEST['unzip_dir']) || $_REQUEST['unzip_dir'] == "") {
    die($mod_strings['ERR_UW_NO_TEMP_DIR']);
}
$unzip_dir = $_REQUEST['unzip_dir'];
if (empty($_REQUEST['install_file'])) {
    die($mod_strings['ERR_UW_NO_INSTALL_FILE']);
}
$install_file = hashToFile($_REQUEST['install_file']);
$install_type = getInstallType($install_file);
$id_name = '';
if (isset($_REQUEST['id_name'])) {
    $id_name = $_REQUEST['id_name'];
}
$s_manifest = '';
if (isset($_REQUEST['s_manifest'])) {
    $s_manifest = $_REQUEST['s_manifest'];
}
$previous_version = '';
if (isset($_REQUEST['previous_version'])) {
    $previous_version = $_REQUEST['previous_version'];
}
$previous_id = '';
if (isset($_REQUEST['previous_id'])) {
    $previous_id = $_REQUEST['previous_id'];
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:UpgradeWizard_commit.php

示例2: validate_manifest

function validate_manifest($manifest)
{
    // takes a manifest.php manifest array and validates contents
    global $subdirs;
    global $sugar_version;
    global $sugar_flavor;
    global $mod_strings;
    if (!isset($manifest['type'])) {
        die($mod_strings['ERROR_MANIFEST_TYPE']);
    }
    $type = $manifest['type'];
    if (getInstallType("/{$type}/") == "") {
        die($mod_strings['ERROR_PACKAGE_TYPE'] . ": '" . $type . "'.");
    }
    if (isset($manifest['acceptable_sugar_versions'])) {
        $version_ok = false;
        $matches_empty = true;
        if (isset($manifest['acceptable_sugar_versions']['exact_matches'])) {
            $matches_empty = false;
            foreach ($manifest['acceptable_sugar_versions']['exact_matches'] as $match) {
                if ($match == $sugar_version) {
                    $version_ok = true;
                }
            }
        }
        if (!$version_ok && isset($manifest['acceptable_sugar_versions']['regex_matches'])) {
            $matches_empty = false;
            foreach ($manifest['acceptable_sugar_versions']['regex_matches'] as $match) {
                if (preg_match("/{$match}/", $sugar_version)) {
                    $version_ok = true;
                }
            }
        }
        if (!$matches_empty && !$version_ok) {
            die($mod_strings['ERROR_VERSION_INCOMPATIBLE'] . $sugar_version);
        }
    }
    if (isset($manifest['acceptable_sugar_flavors']) && sizeof($manifest['acceptable_sugar_flavors']) > 0) {
        $flavor_ok = false;
        foreach ($manifest['acceptable_sugar_flavors'] as $match) {
            if ($match == $sugar_flavor) {
                $flavor_ok = true;
            }
        }
        if (!$flavor_ok) {
            die($mod_strings['ERROR_FLAVOR_INCOMPATIBLE'] . $sugar_flavor);
        }
    }
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:49,代码来源:UpgradeWizardCommon.php

示例3: validate_manifest

 /**
  * Verifies a manifest from a patch or module to be compatible with the current Sugar version and flavor
  * @param array manifest Standard manifest array
  * @return string Error message, blank on success
  */
 function validate_manifest($manifest)
 {
     logThis('validating manifest.php file');
     // takes a manifest.php manifest array and validates contents
     global $subdirs;
     global $sugar_version;
     global $sugar_config;
     global $sugar_flavor;
     global $mod_strings;
     include_once 'suitecrm_version.php';
     if (!isset($manifest['type'])) {
         return $mod_strings['ERROR_MANIFEST_TYPE'];
     }
     $type = $manifest['type'];
     if (getInstallType("/{$type}/") == "") {
         return $mod_strings['ERROR_PACKAGE_TYPE'] . ": '" . $type . "'.";
     }
     if (isset($manifest['acceptable_php_versions'])) {
         $version_ok = false;
         $matches_empty = true;
         if (isset($manifest['acceptable_php_versions']['exact_matches'])) {
             $matches_empty = false;
             foreach ($manifest['acceptable_php_versions']['exact_matches'] as $match) {
                 if ($match == PHP_VERSION) {
                     $version_ok = true;
                 }
             }
         }
         if (!$version_ok && isset($manifest['acceptable_php_versions']['regex_matches'])) {
             $matches_empty = false;
             foreach ($manifest['acceptable_php_versions']['regex_matches'] as $match) {
                 if (preg_match("/{$match}/", PHP_VERSION)) {
                     $version_ok = true;
                 }
             }
         }
         if (!$matches_empty && !$version_ok) {
             return $mod_strings['ERROR_PHP_VERSION_INCOMPATIBLE'] . "<br />" . $mod_strings['ERR_UW_PHP_VERSION'] . PHP_VERSION;
         }
     }
     if (!isset($manifest['acceptable_suitecrm_versions'])) {
         // If sugarcrm version set 'acceptable_sugar_versions', and acceptable_suitecrm_versions not set check on sugar version.
         if (isset($manifest['acceptable_sugar_versions'])) {
             $version_ok = false;
             $matches_empty = true;
             if (isset($manifest['acceptable_sugar_versions']['exact_matches'])) {
                 $matches_empty = false;
                 foreach ($manifest['acceptable_sugar_versions']['exact_matches'] as $match) {
                     if ($match == $sugar_version) {
                         $version_ok = true;
                     }
                 }
             }
             if (!$version_ok && isset($manifest['acceptable_sugar_versions']['regex_matches'])) {
                 $matches_empty = false;
                 foreach ($manifest['acceptable_sugar_versions']['regex_matches'] as $match) {
                     if (preg_match("/{$match}/", $sugar_version)) {
                         $version_ok = true;
                     }
                 }
             }
             if (!$matches_empty && !$version_ok) {
                 return $mod_strings['ERROR_VERSION_INCOMPATIBLE'] . "<br />" . $mod_strings['ERR_UW_VERSION'] . $sugar_version;
             }
         } else {
             // if neither set reject
             return $mod_strings['ERROR_NO_VERSION_SET'];
         }
     } else {
         // If sugarcrm version set 'acceptable_sugar_versions', and acceptable_suitecrm_versions set check only on suitecrm version
         // If sugarcrm version not set 'acceptable_sugar_versions', and acceptable_suitecrm_versions set check only on suitecrm version
         $version_ok = false;
         $matches_empty = true;
         if (isset($manifest['acceptable_suitecrm_versions']['exact_matches'])) {
             $matches_empty = false;
             foreach ($manifest['acceptable_suitecrm_versions']['exact_matches'] as $match) {
                 if ($match == $suitecrm_version) {
                     $version_ok = true;
                 }
             }
         }
         if (!$version_ok && isset($manifest['acceptable_suitecrm_versions']['regex_matches'])) {
             $matches_empty = false;
             foreach ($manifest['acceptable_suitecrm_versions']['regex_matches'] as $match) {
                 if (preg_match("/{$match}/", $suitecrm_version)) {
                     $version_ok = true;
                 }
             }
         }
         if (!$matches_empty && !$version_ok) {
             return $mod_strings['ERROR_SUITECRM_VERSION_INCOMPATIBLE'] . "<br />" . $mod_strings['ERR_UW_SUITECRM_VERSION'] . $suitecrm_version;
         }
     }
     if (isset($manifest['acceptable_sugar_flavors']) && sizeof($manifest['acceptable_sugar_flavors']) > 0) {
         $flavor_ok = false;
//.........这里部分代码省略.........
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:101,代码来源:uw_utils.php


注:本文中的getInstallType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。