line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PSGI::Hector::Utils; |
2
|
|
|
|
|
|
|
=pod |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
PSGI::Hector::Utils - Helper methods |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 DESCRIPTION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Various methods used by several of the Hector classes. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 METHODS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
5
|
|
|
5
|
|
1371
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
123
|
|
18
|
5
|
|
|
5
|
|
17
|
use warnings; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
366
|
|
19
|
|
|
|
|
|
|
######################################################### |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=pod |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 getThisUrl() |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
DEPRECATED please use getSiteUrl() instead. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
########################################################### |
30
|
|
|
|
|
|
|
sub getThisUrl{ |
31
|
1
|
|
|
1
|
1
|
5274
|
shift->getSiteUrl(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
######################################################### |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 getSiteUrl() |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $url = $m->getSiteUrl(); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Returns the full site URL for the current script. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
########################################################### |
46
|
|
|
|
|
|
|
sub getSiteUrl{ |
47
|
3
|
|
|
3
|
1
|
206
|
my $request = shift->getRequest(); |
48
|
3
|
|
|
|
|
11
|
$request->base->as_string; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
############################################################################################################# |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 Notes |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 Author |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
MacGyveR |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Development questions, bug reports, and patches are welcome to the above address. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 See Also |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 Copyright |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Copyright (c) 2017 MacGyveR. All rights reserved. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
########################################################### |
71
|
|
|
|
|
|
|
return 1; |