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


PHP eZHTTPTool::createRedirectURL方法代码示例

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


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

示例1: generateRegistration

    /**
     * @param \eZTemplate $mailTpl
     * @param array $userData
     *
     * @return array|null|string
     */
    function generateRegistration( eZTemplate $mailTpl, array $userData )
    {
        $databaseMap = eZSetupDatabaseMap();
        $databaseInfo = $this->PersistenceList['database_info'];
        $databaseInfo['info'] = $databaseMap[$databaseInfo['type']];
        $regionalInfo = $this->PersistenceList['regional_info'];
        if ( !isset( $regionalInfo['languages'] ) )
            $regionalInfo['languages'] = array();

        $emailInfo = $this->PersistenceList['email_info'];

        $siteType = $this->chosenSiteType();


        $url = $siteType['url'];
        if ( !preg_match( "#^[a-zA-Z0-9]+://(.*)$#", $url ) )
        {
            $url = 'http://' . $url;
        }
        $currentURL = $url;
        $adminURL = $url;
        if ( $siteType['access_type'] == 'url' )
        {
            $url .= '/' . $siteType['access_type_value'];
            $adminURL .= '/' . $siteType['admin_access_type_value'];
        }
        else if ( $siteType['access_type'] == 'hostname' )
        {
            $url = eZHTTPTool::createRedirectURL( 'http://' . $siteType['access_type_value'] );
            $adminURL = eZHTTPTool::createRedirectURL( 'http://' . $siteType['admin_access_type_value'] );
        }
        else if ( $siteType['access_type'] == 'port' )
        {
            $url = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['access_type_value'] ) );
            $adminURL = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['admin_access_type_value'] ) );
        }
        $siteType['url'] = $url;
        $siteType['admin_url'] = $adminURL;


        $testsRun = $this->PersistenceList['tests_run'];
        $imageMagickProgram = $this->PersistenceList['imagemagick_program'];
        $imageGDExtension = $this->PersistenceList['imagegd_extension'];
        $phpVersion = $this->PersistenceList['phpversion'];
        $phpVersion['sapi'] = PHP_SAPI;

        $webserverInfo = false;
        if ( function_exists( 'apache_get_version' ) )
        {
            $webserverInfo = array( 'version' => apache_get_version() );
        }
        else if ( !empty( $_SERVER['SERVER_SOFTWARE'] ) )
        {
            $webserverInfo = array( 'version' => $_SERVER['SERVER_SOFTWARE'] );
        }

        $systemInfo = new eZSysInfo();
        $systemInfo->scan();

        $optionalTests = eZSetupOptionalTests();
        $runResult = eZSetupRunTests( $optionalTests, 'eZSetup:init:send_registration', $this->PersistenceList );
        $testResults = $runResult['results'];

        // Generate email body e-mail
        $mailTpl->setVariable( 'user_data', $userData );
        $mailTpl->setVariable( 'database_info', $databaseInfo );
        $mailTpl->setVariable( 'regional_info', $regionalInfo );
        $mailTpl->setVariable( 'email_info', $emailInfo );
        $mailTpl->setVariable( 'site_type', $siteType );
        $mailTpl->setVariable( 'tests_run', $testsRun );
        $mailTpl->setVariable( 'imagemagick_program', $imageMagickProgram );
        $mailTpl->setVariable( 'imagegd_extension', $imageGDExtension );
        $mailTpl->setVariable( 'phpversion', $phpVersion );
        $mailTpl->setVariable( 'webserver', $webserverInfo );
        $mailTpl->setVariable( 'system', $systemInfo );
        $mailTpl->setVariable( 'os', array( 'name' => php_uname() ) );
        $mailTpl->setVariable( 'optional_tests', $testResults );
        $mailTpl->setVariable( "version", array( "text" => eZPublishSDK::version(),
                                                 "major" => eZPublishSDK::majorVersion(),
                                                 "minor" => eZPublishSDK::minorVersion(),
                                                 "release" => eZPublishSDK::release() ) );

        return $mailTpl->fetch( 'design:setup/registration_email.tpl' );
    }
开发者ID:nottavi,项目名称:ezpublish,代码行数:90,代码来源:ezstep_registration.php

示例2: siteaccessURLs

 /**
  * @return array Urls to access user and admin siteaccesses
  */
 function siteaccessURLs()
 {
     $siteType = $this->chosenSiteType();
     $url = $siteType['url'];
     if (!preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $url)) {
         $url = 'http://' . $url;
     }
     $currentURL = $url;
     $adminURL = $url;
     if ($siteType['access_type'] == 'url') {
         $ini = eZINI::instance();
         if ($ini->hasVariable('SiteSettings', 'DefaultAccess')) {
             $siteType['access_type_value'] = $ini->variable('SiteSettings', 'DefaultAccess');
         }
         $url .= '/' . $siteType['access_type_value'];
         $adminURL .= '/' . $siteType['admin_access_type_value'];
     } else {
         if ($siteType['access_type'] == 'hostname') {
             $url = $siteType['access_type_value'];
             $adminURL = $siteType['admin_access_type_value'];
             if (!preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $url)) {
                 $url = 'http://' . $url;
             }
             if (!preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $adminURL)) {
                 $adminURL = 'http://' . $adminURL;
             }
             $url .= eZSys::indexDir(false);
             $adminURL .= eZSys::indexDir(false);
         } else {
             if ($siteType['access_type'] == 'port') {
                 $url = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['access_type_value']));
                 $adminURL = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['admin_access_type_value']));
             }
         }
     }
     $siteaccessURL = array('url' => $url, 'admin_url' => $adminURL);
     return $siteaccessURL;
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:41,代码来源:ezstep_installer.php

示例3: generateRegistration

 function generateRegistration($mailTpl, $comments)
 {
     $databaseMap = eZSetupDatabaseMap();
     $databaseInfo = $this->PersistenceList['database_info'];
     $databaseInfo['info'] = $databaseMap[$databaseInfo['type']];
     $regionalInfo = $this->PersistenceList['regional_info'];
     if (!isset($regionalInfo['languages'])) {
         $regionalInfo['languages'] = array();
     }
     //        $demoData = $this->PersistenceList['demo_data'];
     $emailInfo = $this->PersistenceList['email_info'];
     $siteTemplates = array();
     $siteType = $this->chosenSiteType();
     /* $typeFunctionality = eZSetupFunctionality( $siteType['identifier'] );
        $additionalPackages = array();
        if ( isset( $this->PersistenceList['additional_packages'] ) )
            $additionalPackages = $this->PersistenceList['additional_packages'];
        $extraFunctionality = array_merge( $additionalPackages,
                                           $typeFunctionality['required'] );
        $extraFunctionality = array_unique( $extraFunctionality );*/
     $url = $siteType['url'];
     if (!preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $url)) {
         $url = 'http://' . $url;
     }
     $currentURL = $url;
     $adminURL = $url;
     if ($siteType['access_type'] == 'url') {
         $url .= '/' . $siteType['access_type_value'];
         $adminURL .= '/' . $siteType['admin_access_type_value'];
     } else {
         if ($siteType['access_type'] == 'hostname') {
             $url = eZHTTPTool::createRedirectURL('http://' . $siteType['access_type_value']);
             $adminURL = eZHTTPTool::createRedirectURL('http://' . $siteType['admin_access_type_value']);
         } else {
             if ($siteType['access_type'] == 'port') {
                 $url = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['access_type_value']));
                 $adminURL = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['admin_access_type_value']));
             }
         }
     }
     $siteType['url'] = $url;
     $siteType['admin_url'] = $adminURL;
     //$siteType['extra_functionality'] = $extraFunctionality;
     $testsRun = $this->PersistenceList['tests_run'];
     $imageMagickProgram = $this->PersistenceList['imagemagick_program'];
     $imageGDExtension = $this->PersistenceList['imagegd_extension'];
     $phpVersion = $this->PersistenceList['phpversion'];
     $webserverInfo = false;
     if (function_exists('apache_get_version')) {
         $webserverInfo = array('version' => apache_get_version());
     }
     $systemInfo = new eZSysInfo();
     $systemInfo->scan();
     $optionalTests = eZSetupOptionalTests();
     $testTable = eZSetupTestTable();
     $runResult = eZSetupRunTests($optionalTests, 'eZSetup:init:send_registration', $this->PersistenceList);
     $testResults = $runResult['results'];
     $testResult = $runResult['result'];
     $successCount = $runResult['success_count'];
     $persistenceData = $runResult['persistence_list'];
     // Send e-mail
     $mailTpl->setVariable('comments', $comments);
     $mailTpl->setVariable('database_info', $databaseInfo);
     $mailTpl->setVariable('regional_info', $regionalInfo);
     //        $mailTpl->setVariable( 'demo_data', $demoData );
     $mailTpl->setVariable('email_info', $emailInfo);
     $mailTpl->setVariable('site_type', $siteType);
     $mailTpl->setVariable('tests_run', $testsRun);
     $mailTpl->setVariable('imagemagick_program', $imageMagickProgram);
     $mailTpl->setVariable('imagegd_extension', $imageGDExtension);
     $mailTpl->setVariable('phpversion', $phpVersion);
     $mailTpl->setVariable('webserver', $webserverInfo);
     $mailTpl->setVariable('system', $systemInfo);
     $mailTpl->setVariable('os', array('name' => php_uname()));
     $mailTpl->setVariable('optional_tests', $testResults);
     $mailTpl->setVariable("version", array("text" => eZPublishSDK::version(), "major" => eZPublishSDK::majorVersion(), "minor" => eZPublishSDK::minorVersion(), "release" => eZPublishSDK::release()));
     return $mailTpl->fetch('design:setup/registration_email.tpl');
 }
开发者ID:nlenardou,项目名称:ezpublish,代码行数:78,代码来源:ezstep_registration.php


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