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


PHP Router::reload方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     Configure::write('Routing.prefixes', ['admin']);
     Router::reload();
     $this->Html = new HtmlExtHelper(new View(null));
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:7,代码来源:HtmlExtHelperTest.php

示例2: testIs

 public function testIs()
 {
     $result = Reveal::is('App.online');
     $expected = !in_array(gethostbyname('google.com'), array('google.com', false));
     $this->assertEqual($result, $expected);
     $result = Reveal::is('DebugKit.loaded');
     $expected = CakePlugin::loaded('DebugKit');
     $this->assertEqual($result, $expected);
     $result = Reveal::is(array('OR' => array('DebugKit.enabled', 'DebugKit.automated')));
     $expected = Configure::read('debug') || Configure::read('DebugKit.forceEnable') || Configure::read('DebugKit.autoRun');
     $this->assertEqual($result, $expected);
     $_GET['debug'] = 'true';
     $this->assertTrue(Reveal::is('DebugKit.requested'));
     $result = Reveal::is('DebugKit.loaded', array('OR' => array('DebugKit.enabled', array('AND' => array('DebugKit.automated', 'DebugKit.requested')))));
     $expected = CakePlugin::loaded('DebugKit') || Configure::read('debug') || Configure::read('DebugKit.forceEnable') || Configure::read('DebugKit.autoRun') && isset($_GET['debug']) && 'true' == $_GET['debug'];
     $this->assertEqual($result, $expected);
     $this->assertEqual(Reveal::is('DebugKit.running'), $expected);
     $request = new CakeRequest();
     Router::setRequestInfo($request->addParams(array('controller' => 'pages', 'action' => 'display', 'pass' => array('home'))));
     $result = Reveal::is('Page.front');
     $this->assertTrue($result);
     Router::reload();
     $request = new CakeRequest();
     Router::setRequestInfo($request->addParams(array('prefix' => 'admin', 'admin' => true)));
     $result = Reveal::is('Page.prefixed');
     $this->assertTrue($result);
     Router::reload();
     $request = new CakeRequest();
     Router::setRequestInfo($request->addParams(array('controller' => 'users', 'action' => 'login')));
     $result = Reveal::is('Page.login');
     $this->assertTrue($result);
     $this->assertTrue(Reveal::is('Page.test'));
 }
开发者ID:gourmet,项目名称:common,代码行数:33,代码来源:RevealTest.php

示例3: _getRequest

 /**
  * 指定されたURLに対応しRouterパース済のCakeRequestのインスタンスを返す
  *
  * @param string $url URL
  * @return CakeRequest
  */
 protected function _getRequest($url)
 {
     Router::reload();
     $request = new CakeRequest($url);
     // コンソールからのテストの場合、requestのパラメーターが想定外のものとなってしまうので調整
     if (isConsole()) {
         $baseUrl = Configure::read('App.baseUrl');
         if ($request->url === false) {
             $request->here = $baseUrl . '/';
         } elseif (preg_match('/^' . preg_quote($request->webroot, '/') . '/', $request->here)) {
             $request->here = $baseUrl . '/' . preg_replace('/^' . preg_quote($request->webroot, '/') . '/', '', $request->here);
         }
         if ($baseUrl) {
             if (preg_match('/^\\//', $baseUrl)) {
                 $request->base = $baseUrl;
             } else {
                 $request->base = '/' . $baseUrl;
             }
             $request->webroot = $baseUrl;
         } else {
             $request->base = '';
             $request->webroot = '/';
         }
     }
     Router::setRequestInfo($request);
     $params = Router::parse($request->url);
     $request->addParams($params);
     return $request;
 }
开发者ID:naow9y,项目名称:basercms,代码行数:35,代码来源:BaserTestCase.php

示例4: setUp

/**
 * start a test
 *
 * @return void
 */
	public function setUp() {
		parent::setUp();
		$this->_pluginPath = App::pluginPath('AssetCompress');
		$this->_testFiles = $this->_pluginPath . 'Test' . DS . 'test_files' . DS;
		$testFile = $this->_testFiles . 'Config' . DS . 'config.ini';

		AssetConfig::clearAllCachedKeys();

		Cache::drop(AssetConfig::CACHE_CONFIG);
		Cache::config(AssetConfig::CACHE_CONFIG, array(
			'path' => TMP,
			'prefix' => 'asset_compress_test_',
			'engine' => 'File'
		));

		$controller = null;
		$request = new CakeRequest(null, false);
		$request->webroot = '';
		$view = new View($controller);
		$view->request = $request;
		$this->Helper = new AssetCompressHelper($view, array('noconfig' => true));
		$Config = AssetConfig::buildFromIniFile($testFile);
		$this->Helper->config($Config);
		$this->Helper->Html = new HtmlHelper($view);

		Router::reload();
		Configure::write('debug', 2);
	}
开发者ID:renan,项目名称:asset_compress,代码行数:33,代码来源:AssetCompressHelperTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     Router::reload();
     $this->View = new View();
     $this->Flash = new FlashHelper($this->View);
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:7,代码来源:FlashHelperTest.php

示例6: tearDown

 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->BlogBaser);
     unset($this->BlogContent);
     Router::reload();
     parent::tearDown();
 }
开发者ID:baserproject,项目名称:basercms,代码行数:12,代码来源:BlogBaserHelperTest.php

示例7: _loadRoutes

 /**
  * Loads routes and resets if the test case dictates it should
  *
  * @return void
  */
 protected function _loadRoutes()
 {
     parent::_loadRoutes();
     if (!$this->loadRoutes) {
         Router::reload();
     }
 }
开发者ID:jgera,项目名称:orangescrum,代码行数:12,代码来源:ControllerTestCase.php

示例8: setUp

 function setUp()
 {
     Router::reload();
     $this->PostsController = new PostsController();
     $this->PostsController->index();
     $this->view = new View($this->PostsController);
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:7,代码来源:view.test.php

示例9: tearDown

 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Toolbar, $this->Controller);
     ClassRegistry::flush();
     Router::reload();
     TestFireCake::reset();
 }
开发者ID:vsanth,项目名称:cakeforum,代码行数:12,代码来源:FirePhpToolbarHelperTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     Router::reload();
     $View = new View(null);
     $this->Common = new CommonHelper($View);
     $this->Html = new CommonHelper($View);
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:8,代码来源:CommonHelperTest.php

示例11: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Configure::write('Security', $this->_initialState['Security']);
     Configure::write('Opauth', $this->_initialState['Opauth']);
     Router::reload();
     unset($this->Controller);
 }
开发者ID:gourmet,项目名称:common,代码行数:8,代码来源:OpauthComponentTest.php

示例12: startTest

 /**
  * start a test
  *
  * @return void
  **/
 function startTest()
 {
     $this->_pluginPath = App::pluginPath('AssetCompress');
     $testFile = $this->_pluginPath . 'tests' . DS . 'test_files' . DS . 'config' . DS . 'config.ini';
     $this->Helper = new AssetCompressHelper(array('iniFile' => $testFile));
     $this->Helper->Html = new HtmlHelper();
     Router::reload();
     Configure::write('debug', 2);
 }
开发者ID:rchavik,项目名称:asset_compress,代码行数:14,代码来源:asset_compress.test.php

示例13: setUp

 function setUp()
 {
     Router::reload();
     $this->Controller = new Controller();
     $this->PostsController = new ThemePostsController();
     $this->PostsController->viewPath = 'posts';
     $this->PostsController->index();
     $this->ThemeView = new ThemeView($this->PostsController);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:9,代码来源:theme.test.php

示例14: setUp

 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     Configure::write('App.linkMap', array('blogSlug' => array('preset' => array('controller' => 'blog_posts', 'action' => 'view'), 'alias' => 'BlogPost', 'fieldMap' => array('id' => '{alias}.id', 'slug' => '{alias}.slug', 'categorySlug' => 'Category.slug'), 'titleField' => 'BlogPost.title')));
     $null = null;
     $this->View = new View(null);
     $this->View->Helpers->load('Html');
     $this->Link = new LinkHelper($this->View);
     Router::reload();
     Router::connect('/article/:categorySlug/:slug-:id', array('controller' => 'blog_posts', 'action' => 'view'));
 }
开发者ID:burzum,项目名称:cakephp-bz-utils,代码行数:15,代码来源:LinkHelperTest.php

示例15: startTest

 /**
  * startTest method
  *
  * @return void
  * @access public
  */
 public function startTest()
 {
     Router::reload();
     $this->Controller = new Controller();
     $this->View = new View($this->Controller);
     $this->Controller->here = $this->View->here = '/';
     $this->Controller->params = $this->View->params = array('base' => '/', 'here' => '/', 'webroot' => '/', 'passedArgs' => array(), 'namedArgs' => array());
     $this->Menu = new TestMenuHelper();
     $this->Menu->Html = new HtmlHelper();
 }
开发者ID:razzman,项目名称:mi,代码行数:16,代码来源:menu.test.php


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