Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

prefix_filter.php
Go to the documentation of this file.
1 <?php
12 abstract class ezpRestPrefixFilterInterface
13 {
14 protected $request;
18 protected $versionToken;
19
23 protected $apiProviderToken;
24
28 protected static $version = null;
29
33 protected static $apiProvider = null;
34
38 protected static $apiPrefix = null;
39
48 abstract public function __construct( ezcMvcRequest $request, $apiPrefix );
49
56 abstract protected function parseVersionValue();
57
74 abstract public function filter();
75
83 public static function getApiVersion()
84 {
85 if ( self::$version === null )
86 {
87 return 1;
88 }
89 return self::$version;
90 }
91
98 public static function getApiProviderName()
99 {
100 if ( self::$apiProvider === null )
101 {
102 return false;
103 }
104 return self::$apiProvider;
105 }
106
113 public static function getApiPrefix()
114 {
115 if ( self::$apiPrefix === null )
116 {
117 return false;
118 }
119 return self::$apiPrefix;
120 }
121
128 public function filterRequestUri()
129 {
130 if ( !empty( $this->versionToken ) )
131 {
132 // Remove the first occurrence of version token
133 $versionSearch = '/' . $this->versionToken;
134 $versionPos = strpos( $this->request->uri, $versionSearch );
135 if ( $versionPos !== false )
136 {
137 $this->request->uri = substr_replace( $this->request->uri, '', $versionPos, strlen( $versionSearch ) );
138 }
139 }
140 if ( !empty( $this->apiProviderToken ) )
141 {
142 // Remove the first occurrence of API provider token
143 $providerSearch = '/' . $this->apiProviderToken;
144 $providerPos = strpos( $this->request->uri, $providerSearch );
145 if ( $providerPos !== false )
146 {
147 $this->request->uri = substr_replace( $this->request->uri, '', $providerPos, strlen( $providerSearch ) );
148 }
149 }
150 }
151 }
ezpRestPrefixFilterInterface
Definition: prefix_filter.php:13
ezpRestPrefixFilterInterface\filterRequestUri
filterRequestUri()
Definition: prefix_filter.php:128
ezpRestPrefixFilterInterface\$apiPrefix
static $apiPrefix
Definition: prefix_filter.php:38
ezpRestPrefixFilterInterface\parseVersionValue
parseVersionValue()
ezpRestPrefixFilterInterface\$versionToken
$versionToken
Definition: prefix_filter.php:18
ezpRestPrefixFilterInterface\filter
filter()
ezpRestPrefixFilterInterface\$apiProviderToken
$apiProviderToken
Definition: prefix_filter.php:23
ezpRestPrefixFilterInterface\__construct
__construct(ezcMvcRequest $request, $apiPrefix)
ezpRestPrefixFilterInterface\getApiVersion
static getApiVersion()
Definition: prefix_filter.php:83
ezpRestPrefixFilterInterface\getApiProviderName
static getApiProviderName()
Definition: prefix_filter.php:98
ezpRestPrefixFilterInterface\$request
$request
Definition: prefix_filter.php:14
ezpRestPrefixFilterInterface\$version
static $version
Definition: prefix_filter.php:28
ezpRestPrefixFilterInterface\getApiPrefix
static getApiPrefix()
Definition: prefix_filter.php:113
ezpRestPrefixFilterInterface\$apiProvider
static $apiProvider
Definition: prefix_filter.php:33
$version
$version
Definition: ezabout/user/datasupplier.php:29
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.