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


PHP Routing\SimplifiedRequest类代码示例

本文整理汇总了PHP中eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest的典型用法代码示例。如果您正苦于以下问题:PHP SimplifiedRequest类的具体用法?PHP SimplifiedRequest怎么用?PHP SimplifiedRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testAnalyseLink

 public function testAnalyseLink()
 {
     $siteAccessURI = '/footestbar';
     $semanticURI = '/something/hoho';
     $matcher = new URITextMatcher(array('prefix' => 'foo', 'suffix' => 'bar'));
     $matcher->setRequest(SimplifiedRequest::fromUrl('http://phoenix-rises.fm/footestbar/blabla'));
     $this->assertSame($siteAccessURI . $semanticURI, $matcher->analyseLink($semanticURI));
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:8,代码来源:RouterURITextTest.php

示例2: matchProvider

 public function matchProvider()
 {
     return array(array(SimplifiedRequest::fromUrl('http://example.com'), 'default_sa'), array(SimplifiedRequest::fromUrl('https://example.com'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/'), 'default_sa'), array(SimplifiedRequest::fromUrl('https://example.com/'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com//'), 'default_sa'), array(SimplifiedRequest::fromUrl('https://example.com//'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com:8080/'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/first_siteaccess/'), 'first_siteaccess'), array(SimplifiedRequest::fromUrl('http://example.com/?first_siteaccess'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/?first_sa'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/first_salt'), 'first_salt'), array(SimplifiedRequest::fromUrl('http://example.com/first_sa.foo'), 'first_sa.foo'), array(SimplifiedRequest::fromUrl('http://example.com/test'), 'test'), array(SimplifiedRequest::fromUrl('http://example.com/test/foo/'), 'test'), array(SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/'), 'test'), array(SimplifiedRequest::fromUrl('http://example.com/test/foo/bar/first_sa'), 'test'), array(SimplifiedRequest::fromUrl('http://example.com/default_sa'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/first_sa'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://example.com/first_sa/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://example.com//first_sa//'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com///first_sa///test'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com//first_sa//foo/bar'), 'default_sa'), array(SimplifiedRequest::fromUrl('http://example.com/first_sa/foo'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://example.com:82/first_sa/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://third_siteaccess/first_sa/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_sa/'), 'first_sa'), array(SimplifiedRequest::fromUrl('https://first_sa/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_sa:81/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:82/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:83/'), 'first_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess/foo/'), 'foo'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:82/foo/'), 'foo'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:83/foo/'), 'foo'), array(SimplifiedRequest::fromUrl('http://example.com/second_sa'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://example.com/second_sa/'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://example.com/second_sa?param1=foo'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://example.com/second_sa/foo/'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://example.com:82/second_sa/'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://example.com:83/second_sa/'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:82/second_sa/'), 'second_sa'), array(SimplifiedRequest::fromUrl('http://first_siteaccess:83/second_sa/'), 'second_sa'));
 }
开发者ID:Pixy,项目名称:ezpublish-kernel,代码行数:4,代码来源:RouterURIElementTest.php

示例3: matchProvider

 public function matchProvider()
 {
     return array(array(SimplifiedRequest::fromUrl('http://fr.ezpublish.dev/eng'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://ezpublish.dev/eng'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://fr.ezpublish.dev/fre'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://fr.ezpublish.dev/'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://us.ezpublish.dev/eng'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://us.ezpublish.dev/foo'), false), array(SimplifiedRequest::fromUrl('http://us.ezpublish.dev/fre'), 'fr_jp'), array(SimplifiedRequest::fromUrl('http://jp.ezpublish.dev/foo'), 'fr_jp'), array(SimplifiedRequest::fromUrl('http://ezpublish.dev/fr'), false));
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:4,代码来源:CompoundOrTest.php

示例4: matchProvider

 public function matchProvider()
 {
     return array(array(SimplifiedRequest::fromUrl("http://example.com"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com//"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com//"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com:8080/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_siteaccess/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/?first_siteaccess"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/?first_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_salt"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa.foo"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/bar/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/bar/first_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/default_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa//"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com//first_sa//"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa///test"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa/foo"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa/foo/bar"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com:82/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://third_siteaccess/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("https://first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_sa:81/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:82/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:83/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess/foo/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:82/foo/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:83/foo/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa?param1=foo"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa/foo/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com:82/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com:83/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:82/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:83/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com:81/"), "third_sa"), array(SimplifiedRequest::fromUrl("https://example.com:81/"), "third_sa"), array(SimplifiedRequest::fromUrl("http://example.com:81/foo"), "third_sa"), array(SimplifiedRequest::fromUrl("http://example.com:81/foo/bar"), "third_sa"), array(SimplifiedRequest::fromUrl("http://example.com:82/"), "fourth_sa"), array(SimplifiedRequest::fromUrl("https://example.com:82/"), "fourth_sa"), array(SimplifiedRequest::fromUrl("https://example.com:82/foo"), "fourth_sa"), array(SimplifiedRequest::fromUrl('http://fr.ezpublish.dev/eng'), 'fr_eng'), array(SimplifiedRequest::fromUrl('http://us.ezpublish.dev/fre'), 'fr_us'));
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:4,代码来源:RouterTest.php

示例5: testFromUrl

 /**
  * @param string $url
  * @param \eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest $expectedRequest
  *
  * @dataProvider fromUrlProvider
  * @covers \eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest::fromUrl
  */
 public function testFromUrl($url, $expectedRequest)
 {
     self::assertEquals($expectedRequest, SimplifiedRequest::fromUrl($url));
 }
开发者ID:Heyfara,项目名称:ezpublish-kernel,代码行数:11,代码来源:SimplifiedRequestTest.php

示例6: matchProvider

 public function matchProvider()
 {
     return array(array(SimplifiedRequest::fromUrl("http://example.com"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com//"), "default_sa"), array(SimplifiedRequest::fromUrl("https://example.com//"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com:8080/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_siteaccess/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/?first_siteaccess"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/?first_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_salt"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa.foo"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/bar/"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/test/foo/bar/first_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/default_sa"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com//first_sa//"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com///first_sa///test"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com//first_sa//foo/bar"), "default_sa"), array(SimplifiedRequest::fromUrl("http://example.com/first_sa/foo"), "first_sa"), array(SimplifiedRequest::fromUrl("http://example.com:82/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://third_siteaccess/first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("https://first_sa/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_sa:81/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:82/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:83/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess/foo/"), "first_sa"), array(SimplifiedRequest::fromUrl("http://www.example.com/"), "example"), array(SimplifiedRequest::fromUrl("https://www.example.com/"), "example"), array(SimplifiedRequest::fromUrl("http://www.example.com:81/"), "example"), array(SimplifiedRequest::fromUrl("http://www.example.com/"), "example"), array(SimplifiedRequest::fromUrl("http://www.example.com:82/"), "example"), array(SimplifiedRequest::fromUrl("https://www.example.com:83/"), "example"), array(SimplifiedRequest::fromUrl("http://www.example.com/foo/"), "example"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa?param1=foo"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com/second_sa/foo/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com:82/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://example.com:83/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:82/second_sa/"), "second_sa"), array(SimplifiedRequest::fromUrl("http://first_siteaccess:83/second_sa/"), "second_sa"));
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:4,代码来源:RouterHostTextTest.php

示例7: matchProvider

    public function matchProvider()
    {
        return array(
            array( SimplifiedRequest::fromUrl( "http://example.com" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "https://example.com" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "https://example.com/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com//" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "https://example.com//" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com:8080/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/first_siteaccess/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/?first_siteaccess" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/?first_sa" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/first_salt" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/first_sa.foo" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/test" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/test/foo/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/test/foo/bar/" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/test/foo/bar/first_sa" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/default_sa" ), "default_sa" ),

            array( SimplifiedRequest::fromUrl( "http://example.com/first_sa" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/first_sa/" ), "first_sa" ),
            // Double slashes shouldn't be considered as one
            array( SimplifiedRequest::fromUrl( "http://example.com//first_sa//" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com///first_sa///test" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com//first_sa//foo/bar" ), "default_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/first_sa/foo" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com:82/first_sa/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://third_siteaccess/first_sa/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_sa/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "https://first_sa/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_sa:81/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:82/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:83/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess/foo/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:82/foo/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:83/foo/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess/foobar/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess//foobar/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess//footestbar/" ), "first_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess/footestbar/" ), "test" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess/footestbar/foobazbar/" ), "test" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:82/footestbar/" ), "test" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:83/footestbar/" ), "test" ),

            array( SimplifiedRequest::fromUrl( "http://example.com/second_sa" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/second_sa/" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/second_sa?param1=foo" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com/second_sa/foo/" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com:82/second_sa/" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://example.com:83/second_sa/" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:82/second_sa/" ), "second_sa" ),
            array( SimplifiedRequest::fromUrl( "http://first_siteaccess:83/second_sa/" ), "second_sa" ),
        );
    }
开发者ID:ataxel,项目名称:tp,代码行数:57,代码来源:RouterURIRegexTest.php

示例8: reverseMatchProvider

 public function reverseMatchProvider()
 {
     return array(array('foo', 1, SimplifiedRequest::fromUrl('http://bar.example.com/'), 'foo.example.com'), array('ezdemo_site', 1, SimplifiedRequest::fromUrl('http://ezflow_site.ez.no/'), 'ezdemo_site.ez.no'), array('metalfrance', 2, SimplifiedRequest::fromUrl('http://www.lolart.net/'), 'www.metalfrance.net'), array('fm', 3, SimplifiedRequest::fromUrl('http://www.phoenix-rises.fr/'), 'www.phoenix-rises.fm'));
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:4,代码来源:RouterHostElementTest.php

示例9: reverseMatch

 public function reverseMatch($siteAccessName)
 {
     $hostElements = explode('.', $this->request->host);
     $elementNumber = $this->elementNumber - 1;
     if (!isset($hostElements[$elementNumber])) {
         return null;
     }
     $hostElements[$elementNumber] = $siteAccessName;
     $this->request->setHost(implode('.', $hostElements));
     return $this;
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:11,代码来源:HostElement.php

示例10: reverseMatch

 /**
  * Returns matcher object corresponding to $siteAccessName or null if non applicable.
  *
  * Limitation: If the element number is > 1, we cannot predict how URI segments are expected to be built.
  * So we expect "_" will be reversed to "/"
  * e.g. foo_bar => foo/bar with elementNumber == 2
  * Hence if number of elements is different than the element number, we report as non matched.
  *
  * @param string $siteAccessName
  *
  * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement|null
  */
 public function reverseMatch($siteAccessName)
 {
     $elements = $this->elementNumber > 1 ? explode('_', $siteAccessName) : array($siteAccessName);
     if (count($elements) !== $this->elementNumber) {
         return null;
     }
     $pathinfo = '/' . implode('/', $elements) . '/' . ltrim($this->request->pathinfo, '/');
     $this->request->setPathinfo($pathinfo);
     return $this;
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:22,代码来源:URIElement.php


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