Skip to content

Commit e43f06a

Browse files
committed
Index is now the front end controller
1 parent 6bf29c1 commit e43f06a

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

event/listener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function show_page_links()
133133
public function viewonline_page($event)
134134
{
135135
// Are any users on app.php?
136-
if ($event['on_page'][1] === 'app')
136+
if ($event['on_page'][1] === 'index')
137137
{
138138
// Load our language file
139139
$this->lang->add_lang('pages_common', 'phpbb/pages');
@@ -144,7 +144,7 @@ public function viewonline_page($event)
144144
// If any of our pages are being viewed, update the event vars with our routes and titles
145145
foreach ($page_routes as $page_id => $page_data)
146146
{
147-
if ($event['row']['session_page'] === 'app.' . $this->php_ext . '/' . $page_data['route'])
147+
if ($event['row']['session_page'] === 'index.' . $this->php_ext . '/' . $page_data['route'])
148148
{
149149
$event['location'] = $this->lang->lang('PAGES_VIEWONLINE', $page_data['title']);
150150
$event['location_url'] = $this->helper->route('phpbb_pages_dynamic_route_' . $page_id);

tests/event/event_listener_viewonline_test.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,39 +57,39 @@ public static function viewonline_page_data()
5757
'$location_url',
5858
'$location',
5959
),
60-
// test when on_page is app and session_page is NOT for pages
60+
// test when on_page is index and session_page is NOT for pages
6161
array(
6262
array(
63-
1 => 'app',
63+
1 => 'index',
6464
),
6565
array(
66-
'session_page' => 'app.' . $phpEx . '/help/faq'
66+
'session_page' => 'index.' . $phpEx . '/help/faq'
6767
),
6868
'$location_url',
6969
'$location',
7070
'$location_url',
7171
'$location',
7272
),
73-
// test when on_page is app and session_page is for pages
73+
// test when on_page is index and session_page is for pages
7474
array(
7575
array(
76-
1 => 'app',
76+
1 => 'index',
7777
),
7878
array(
79-
'session_page' => 'app.' . $phpEx . '/test'
79+
'session_page' => 'index.' . $phpEx . '/test'
8080
),
8181
'$location_url',
8282
'$location',
8383
'phpbb_pages_dynamic_route_1#a:0:{}',
8484
$lang->lang('PAGES_VIEWONLINE', '$location'),
8585
),
86-
// test when on_page is app and session_page is for non-existent pages
86+
// test when on_page is index and session_page is for non-existent pages
8787
array(
8888
array(
89-
1 => 'app',
89+
1 => 'index',
9090
),
9191
array(
92-
'session_page' => 'app.' . $phpEx . '/foobar'
92+
'session_page' => 'index.' . $phpEx . '/foobar'
9393
),
9494
'$location_url',
9595
'$location',

tests/functional/cron_reparser_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public function test_cron_reparser()
3333
$route = $this->create_page($page_title, $page_content);
3434

3535
// Go to the test page
36-
$crawler = self::request('GET', "app.php/$route?sid=$this->sid");
36+
$crawler = self::request('GET', "index.php/$route?sid=$this->sid");
3737
$this->assertStringContainsString($page_title, $crawler->filter('h2')->text());
3838

3939
// Assert no reparsers have run yet
4040
$this->assertEmpty($this->get_reparser_resume());
4141

4242
// Run the cron task to reparse pages
43-
self::request('GET', "app.php/cron/cron.task.text_reparser.phpbb_pages", [], false);
43+
self::request('GET', "index.php/cron/cron.task.text_reparser.phpbb_pages", [], false);
4444

4545
// Try to ensure that the cron can actually run before we start to wait for it
4646
sleep(1);

tests/functional/main_controller_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function test_display()
3737
]);
3838

3939
// Load the page
40-
$crawler = self::request('GET', "app.php/{$route}?sid={$this->sid}");
40+
$crawler = self::request('GET', "index.php/{$route}?sid={$this->sid}");
4141

4242
// Assert the expected page exists
4343
self::assertStringContainsString($page_title, $crawler->filter('#page-body')->text());
@@ -78,7 +78,7 @@ public function test_display()
7878
public function test_display_legacy($route)
7979
{
8080
// Load the page
81-
$crawler = self::request('GET', "app.php/page/{$route}?sid={$this->sid}");
81+
$crawler = self::request('GET', "index.php/page/{$route}?sid={$this->sid}");
8282

8383
// Assert the expected page exists
8484
self::assertStringContainsString('Front End Test Page', $crawler->filter('#page-body')->text());

tests/functional/viewonline_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function test_viewonline_setup()
3131
$route = $this->create_page($page_title, $page_content);
3232

3333
// Send the admin to the test page
34-
$crawler = self::request('GET', "app.php/{$route}?sid={$this->sid}");
34+
$crawler = self::request('GET', "index.php/{$route}?sid={$this->sid}");
3535
self::assertStringContainsString($page_title, $crawler->filter('h2')->text());
3636

3737
return $page_title;

0 commit comments

Comments
 (0)