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


PHP eZSys::filesystemType方法代码示例

本文整理汇总了PHP中eZSys::filesystemType方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSys::filesystemType方法的具体用法?PHP eZSys::filesystemType怎么用?PHP eZSys::filesystemType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZSys的用法示例。


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

示例1: display

 function display()
 {
     $emailInfo = array('type' => 1, 'server' => false, 'user' => false, 'password' => false, 'result' => false);
     if (isset($this->PersistenceList['email_info'])) {
         $emailInfo = array_merge($emailInfo, $this->PersistenceList['email_info']);
     }
     if ($emailInfo['server'] and $this->Ini->variable('MailSettings', 'TransportServer')) {
         $emailInfo['server'] = $this->Ini->variable('MailSettings', 'TransportServer');
     }
     if ($emailInfo['user'] and $this->Ini->variable('MailSettings', 'TransportUser')) {
         $emailInfo['user'] = $this->Ini->variable('MailSettings', 'TransportUser');
     }
     if ($emailInfo['password'] and $this->Ini->variable('MailSettings', 'TransportPassword')) {
         $emailInfo['password'] = $this->Ini->variable('MailSettings', 'TransportPassword');
     }
     $this->Tpl->setVariable('email_info', $emailInfo);
     $systemType = eZSys::filesystemType();
     $this->Tpl->setVariable('system', array('type' => $systemType));
     $result = array();
     // Display template
     $result['content'] = $this->Tpl->fetch("design:setup/init/email_settings.tpl");
     $result['path'] = array(array('text' => ezpI18n::tr('design/standard/setup/init', 'Email settings'), 'url' => false));
     return $result;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:24,代码来源:ezstep_email_settings.php

示例2: eZSetupCheckExecutable

function eZSetupCheckExecutable($type)
{
    $http = eZHTTPTool::instance();
    $filesystemType = eZSys::filesystemType();
    $envSeparator = eZSys::envSeparator();
    $programs = eZSetupConfigVariableArray($type, $filesystemType . '_Executable');
    $systemSearchPaths = explode($envSeparator, eZSys::path(true));
    $additionalSearchPaths = eZSetupConfigVariableArray($type, $filesystemType . '_SearchPaths');
    $excludePaths = eZSetupConfigVariableArray($type, $filesystemType . '_ExcludePaths');
    $imageIniPath = eZSetupImageConfigVariableArray('ShellSettings', 'ConvertPath');
    /*
    We save once entered extra path in the persistent data list
    to keep it within setup steps.
    
    This trick is needed, for example, in "registration" step,
    where user has no chance to enter extra path again
    due to missing input field for this purpose.
    */
    // compute extra path
    $extraPath = array();
    if ($http->hasPostVariable($type . '_ExtraPath')) {
        $GLOBALS['eZSetupCheckExecutable_' . $type . '_ExtraPath'] = $http->postVariable($type . '_ExtraPath');
        $extraPath = explode($envSeparator, $http->postVariable($type . '_ExtraPath'));
    } else {
        if (isset($GLOBALS['eZSetupCheckExecutable_' . $type . '_ExtraPath'])) {
            $extraPath = explode($envSeparator, $GLOBALS['eZSetupCheckExecutable_' . $type . '_ExtraPath']);
        }
    }
    // if extra path was given in any way
    if ($extraPath) {
        // remove program from path name if entered
        foreach ($extraPath as $path) {
            foreach ($programs as $program) {
                if (strpos($path, $program) == strlen($path) - strlen($program)) {
                    $extraPath[] = substr($path, strpos($path, $program));
                }
            }
        }
    }
    $searchPaths = array_merge($systemSearchPaths, $additionalSearchPaths, $extraPath, $imageIniPath);
    $result = false;
    $correctPath = false;
    $correctProgram = false;
    foreach ($programs as $program) {
        foreach ($searchPaths as $path) {
            $pathProgram = eZDir::path(array($path, $program));
            if (file_exists($pathProgram)) {
                if ($filesystemType == 'unix') {
                    $relativePath = $path;
                    if (preg_match("#^/(.+)\$#", $path, $matches)) {
                        $relativePath = $matches[1];
                    }
                    $relativePath = eZDir::cleanPath($relativePath);
                } else {
                    $relativePath = $path;
                    if (preg_match("#^[a-zA-Z]:[/\\\\](.+)\$#", $path, $matches)) {
                        $relativePath = $matches[1];
                    }
                    $relativePath = eZDir::cleanPath($relativePath);
                }
                $exclude = false;
                foreach ($excludePaths as $excludePath) {
                    $excludePath = strtolower($excludePath);
                    $match = strtolower($program . "@" . $relativePath);
                    if ($match == $excludePath) {
                        $exclude = true;
                        break;
                    } else {
                        if ($relativePath == $excludePath) {
                            $exclude = true;
                            break;
                        }
                    }
                }
                if ($exclude) {
                    continue;
                }
                if (function_exists("is_executable")) {
                    if (is_executable($pathProgram)) {
                        $result = true;
                        $correctPath = $path;
                        $correctProgram = $program;
                        break;
                    }
                } else {
                    // Windows system
                    $result = true;
                    $correctPath = $path;
                    $correctProgram = $program;
                    break;
                }
            }
        }
        if ($result) {
            break;
        }
    }
    $extraPathAsString = implode($envSeparator, $extraPath);
    return array('result' => $result, 'persistent_data' => array('path' => array('value' => $correctPath), 'program' => array('value' => $correctProgram), 'extra_path' => array('value' => $extraPathAsString, 'merge' => TRUE), 'result' => array('value' => $result)), 'env_separator' => $envSeparator, 'filesystem_type' => $filesystemType, 'extra_path' => $extraPath, 'correct_path' => $correctPath, 'system_search_path' => $systemSearchPaths, 'additional_search_path' => $additionalSearchPaths);
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:100,代码来源:ezsetuptests.php


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