APIBoost A.P.I. documentation for PHPBoost CMS
  • Packages
    • Ajax
    • Builder
    • Content
    • Core
    • Default
    • Doctrine
    • Helper
    • IO
    • MVC
    • PHPBoost
    • Util
  • Interfaces
  • Classes
  • CacheData
  • CaptchaOptions
  • CommentsExtensionPoint
  • ConfigData
  • ContentFormattingExtensionPoint
  • Controller
  • CssFilesExtensionPoint
  • DAO
  • DataStore
  • DBConnection
  • DBMSFactory
  • DBMSUtils
  • ExtendedFieldExtensionPoint
  • ExtensionPoint
  • ExternalAuthentication
  • FeedProvider
  • FileReader
  • FileWriter
  • FormattingParser
  • FormButton
  • FormConstraint
  • FormElement
  • FormField
  • FormFieldConstraint
  • FormFieldEnumOption
  • FormFieldset
  • GraphicalEnvironment
  • HomePage
  • HomePageExtensionPoint
  • HTMLElement
  • HTMLTableFilter
  • InjectQueryResult
  • MailService
  • MemberExtendedFieldType
  • MenusExtensionPoint
  • ModuleSetup
  • ModuleTreeLinksExtensionPoint
  • PropertiesMapInterface
  • QueryResult
  • Response
  • ScheduledJobExtensionPoint
  • SearchableExtensionPoint
  • SelectQueryResult
  • SQLFragmentBuilder
  • SQLQuerier
  • SQLQueryTranslator
  • Template
  • TemplateData
  • TemplateLoader
  • TemplateParser
  • TemplateRenderer
  • TemplateSyntaxElement
  • UrlMapper
  • UrlMappingsExtensionPoint
  • View
  • AbstractAdminItemController
  • AbstractCategoriesFormController
  • AbstractCategoriesManagementController
  • AbstractCommentsBuildForm
  • AbstractCommentsController
  • AbstractConfigData
  • AbstractContentFormattingExtensionPoint
  • AbstractController
  • AbstractDeleteCategoryController
  • AbstractDisplayGraphicalEnvironment
  • AbstractFormButton
  • AbstractFormField
  • AbstractFormFieldChoice
  • AbstractFormFieldConstraint
  • AbstractFormFieldEnumOption
  • AbstractFormFieldset
  • AbstractGraphicalEnvironment
  • AbstractHTMLElement
  • AbstractHTMLTableFilter
  • AbstractItemController
  • AbstractMemberExtendedField
  • AbstractParser
  • AbstractPHPMailerMailService
  • AbstractPlatform
  • AbstractQueryResult
  • AbstractResponse
  • AbstractScheduledJobExtensionPoint
  • AbstractSearchableExtensionPoint
  • AbstractSelectQueryResult
  • AbstractSQLQuerier
  • AbstractTemplate
  • AbstractTemplateParser
  • AbstractTemplateSyntaxElement
  • AbstractUrlMapper
  • ActionAuthorization
  • AddCommentBuildForm
  • AdminController
  • AdminDisplayFrameGraphicalEnvironment
  • AdminDisplayFrameResponse
  • AdminDisplayGraphicalEnvironment
  • AdminDisplayResponse
  • AdministratorAlert
  • AdministratorAlertCache
  • AdministratorAlertService
  • AdminMenuDisplayResponse
  • AdminModuleController
  • AdminModuleLink
  • AdminNodisplayGraphicalEnvironment
  • AdminNodisplayResponse
  • AjaxCommentsDisplayController
  • AjaxCommentsNotationController
  • AjaxImagePreviewController
  • AjaxKeywordsAutoCompleteController
  • AjaxRequest
  • AjaxSearchUserAutoCompleteController
  • AjaxUrlValidationController
  • AjaxUserAutoCompleteController
  • APCDataStore
  • AppContext
  • Application
  • ArrayContentTemplateSyntaxElement
  • Arrays
  • ArrayTemplateSyntaxElement
  • ArrayType
  • ATOM
  • AuthenticationMethod
  • AuthenticationService
  • Authorizations
  • AuthorizationsSettings
  • AutoConnectData
  • BBCodeHighlighter
  • Bench
  • BigIntType
  • BooleanType
  • BreadCrumb
  • BrHTMLElement
  • BufferedFileReader
  • BufferedFileWriter
  • BusinessObject
  • CacheDataNotFoundException
  • CachedMenu
  • CachedStringTemplateLoader
  • CacheManager
  • CacheService
  • Captcha
  • CaptchaProvidersService
  • CaptchaService
  • CategoriesAuthorizationsService
  • CategoriesCache
  • CategoriesItemsParameters
  • CategoriesManager
  • CategoriesService
  • CategoriesUrlBuilder
  • Category
  • CategoryNotFoundException
  • ClassLoader
  • ColumnsDisabled
  • CommentsAuthorizations
  • CommentsCache
  • CommentsConfig
  • CommentsDAO
  • CommentsManager
  • CommentsProvidersService
  • CommentsService
  • CommentsTopic
  • CommentsTopicDAO
  • CommentsTopicEvents
  • CommentsTopics
  • CommentsUrlBuilder
  • ConditionTemplateSyntaxElement
  • ConfigManager
  • ConfigNotFoundException
  • ConstantTemplateSyntaxElement
  • ContentEditor
  • ContentFormattingConfig
  • ContentFormattingParser
  • ContentFormattingProvidersService
  • ContentFormattingService
  • ContentFormattingUnparser
  • ContentManagementConfig
  • ContentMenu
  • ContentSecondParser
  • ContentSharingActionsMenuLink
  • ContentSharingActionsMenuLinksExtensionPoint
  • ContentSharingActionsMenuService
  • Contribution
  • ContributionService
  • CookieBarConfig
  • Countries
  • CSSCacheConfig
  • CSSCacheManager
  • CSSFileOptimizer
  • CurrentUser
  • CustomizationConfig
  • CustomizeInterface
  • DataStoreException
  • DataStoreFactory
  • Date
  • DateTimeType
  • DateType
  • DBConnectionException
  • DBFactory
  • DBQuerier
  • Debug
  • DecimalType
  • DefaultAdminDisplayResponse
  • DefaultAjaxDeleteItemController
  • DefaultCategoriesCache
  • DefaultCategoriesFeedProvider
  • DefaultCategoriesFormController
  • DefaultCategoriesManagementController
  • DefaultCommentsTopic
  • DefaultConfigurationController
  • DefaultDeleteCategoryController
  • DefaultDeleteItemController
  • DefaultDisplayItemController
  • DefaultHomePage
  • DefaultHomePageDisplay
  • DefaultItemsManagementController
  • DefaultMailService
  • DefaultModuleConfig
  • DefaultModuleSetup
  • DefaultRichCategoriesCache
  • DefaultRichModuleConfig
  • DefaultScheduledJobsModule
  • DefaultSearchable
  • DefaultSeveralItemsController
  • DefaultSitemapCategoriesModule
  • DefaultSitemapModule
  • DefaultTemplateData
  • DefaultTemplateRenderer
  • DefaultTreeLinks
  • DeleteLinkHTMLElement
  • Dispatcher
  • DispatcherException
  • DispatcherUrlMapping
  • DispatchManager
  • DivHTMLElement
  • DoctrineException
  • EditCommentBuildForm
  • EditLinkHTMLElement
  • Environment
  • ErrorHandler
  • Event
  • ExceptionHandler
  • ExceptionUtils
  • ExpressionContentTemplateSyntaxElement
  • ExpressionTemplateSyntaxElement
  • ExtendedField
  • ExtendedFields
  • ExtendedFieldsCache
  • ExtendedFieldsDatabaseService
  • ExtendedFieldsService
  • ExtensionPointNotFoundException
  • ExtensionPointProvider
  • ExtensionPointProviderService
  • ExternalAuthenticationsExtensionPoint
  • Feed
  • FeedData
  • FeedItem
  • FeedItemEnclosure
  • FeedMenu
  • FeedsCat
  • FeedsCategoriesModule
  • FeedsList
  • File
  • FileSystemDataStore
  • FileSystemElement
  • FileSystemHelper
  • FileTemplate
  • FileTemplateLoader
  • FileTemplateLoadingException
  • FileTemplateRenderingException
  • FileType
  • FileUploadConfig
  • FileUploadService
  • Filter
  • FloatType
  • Folder
  • FormatingHelper
  • FormBuilderDisabledFieldException
  • FormBuilderException
  • FormButtonAjax
  • FormButtonAjaxCssImg
  • FormButtonButton
  • FormButtonButtonCssImg
  • FormButtonDefaultSubmit
  • FormButtonLink
  • FormButtonLinkCssImg
  • FormButtonReset
  • FormButtonSubmit
  • FormButtonSubmitCssImg
  • FormButtonSubmitImg
  • FormConstraintFieldsDifferenceInferior
  • FormConstraintFieldsDifferenceSuperior
  • FormConstraintFieldsEquality
  • FormConstraintFieldsInequality
  • FormConstraintFieldsNotIncluded
  • FormFieldActionLink
  • FormFieldActionLinkElement
  • FormFieldActionLinkList
  • FormFieldAjaxCompleter
  • FormFieldAjaxSearchUserAutoComplete
  • FormFieldAjaxUserAutoComplete
  • FormFieldAuthorizationsSetter
  • FormFieldBooleanInformation
  • FormFieldCaptcha
  • FormFieldCategoriesSelect
  • FormFieldCheckbox
  • FormFieldColorPicker
  • FormFieldConstraintAntiFlood
  • FormFieldConstraintDate
  • FormFieldConstraintDisplayNameExists
  • FormFieldConstraintFileExtension
  • FormFieldConstraintFileMaxSize
  • FormFieldConstraintForbiddenMailDomains
  • FormFieldConstraintIntegerMax
  • FormFieldConstraintIntegerMin
  • FormFieldConstraintIntegerRange
  • FormFieldConstraintLengthMax
  • FormFieldConstraintLengthMin
  • FormFieldConstraintLengthRange
  • FormFieldConstraintMailAddress
  • FormFieldConstraintMailExist
  • FormFieldConstraintMaxLinks
  • FormFieldConstraintNotEmpty
  • FormFieldConstraintPasswordStrength
  • FormFieldConstraintPHPBoostAuthLoginExists
  • FormFieldConstraintPictureFile
  • FormFieldConstraintRegex
  • FormFieldConstraintTel
  • FormFieldConstraintUrl
  • FormFieldConstraintUrlExists
  • FormFieldConstraintUserExist
  • FormFieldCSRFToken
  • FormFieldDate
  • FormFieldDateTime
  • FormFieldDecimalNumberEditor
  • FormFieldEditors
  • FormFieldFilePicker
  • FormFieldFree
  • FormFieldGroups
  • FormFieldHidden
  • FormFieldHTML
  • FormFieldLabel
  • FormFieldLangsSelect
  • FormFieldMailEditor
  • FormFieldMemberCaution
  • FormFieldMemberSanction
  • FormFieldMenuFieldset
  • FormFieldMultiLineTextEditor
  • FormFieldMultipleAutocompleter
  • FormFieldMultipleCheckbox
  • FormFieldMultipleCheckboxOption
  • FormFieldMultipleSelectChoice
  • FormFieldMultipleValuedCheckboxOption
  • FormFieldMultitabsLink
  • FormFieldMultitabsLinkElement
  • FormFieldMultitabsLinkList
  • FormFieldNumberEditor
  • FormFieldPasswordEditor
  • FormFieldPossibleValues
  • FormFieldRadioChoice
  • FormFieldRadioChoiceOption
  • FormFieldRangeEditor
  • FormFieldRanksSelect
  • FormFieldRichTextEditor
  • FormFieldSearch
  • FormFieldSelectChoiceGroupOption
  • FormFieldSelectChoiceOption
  • FormFieldSelectSources
  • FormFieldsetAccordionControls
  • FormFieldsetHidden
  • FormFieldsetHorizontal
  • FormFieldsetHTML
  • FormFieldsetHTMLHeading
  • FormFieldsetMultitabsHTML
  • FormFieldsetSubmit
  • FormFieldsetVertical
  • FormFieldShortMultiLineTextEditor
  • FormFieldSimpleSelectChoice
  • FormFieldSpacer
  • FormFieldSubTitle
  • FormFieldTelEditor
  • FormFieldTextEditor
  • FormFieldThemesSelect
  • FormFieldThumbnail
  • FormFieldTimezone
  • FormFieldUploadFile
  • FormFieldUploadPictureFile
  • FormFieldUrlEditor
  • FunctionCallTemplateSyntaxElement
  • FunctionTemplateSyntaxElement
  • GeneralConfig
  • GraphicalEnvironmentConfig
  • GroupsCache
  • GroupsService
  • HtaccessFileCache
  • HTMLForm
  • HTMLTable
  • HTMLTableAjaxUserAutoCompleteFilter
  • HTMLTableAjaxUserAutoCompleteSQLFilter
  • HTMLTableBeginsWithTextSQLFilter
  • HTMLTableCheckboxFilter
  • HTMLTableColumn
  • HTMLTableDateComparatorSQLFilter
  • HTMLTableDateGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateLessThanOrEqualsToSQLFilter
  • HTMLTableDateTimeGreaterThanOrEqualsToSQLFilter
  • HTMLTableDateTimeLessThanOrEqualsToSQLFilter
  • HTMLTableEndsWithTextSQLFilter
  • HTMLTableEqualsFromListFilter
  • HTMLTableEqualsFromListSQLFilter
  • HTMLTableEqualsToSQLFilter
  • HTMLTableEscapedLikeTextSQLFilter
  • HTMLTableGreaterThanOrEqualsToSQLFilter
  • HTMLTableGreaterThanSQLFilter
  • HTMLTableLessThanOrEqualsToSQLFilter
  • HTMLTableLessThanSQLFilter
  • HTMLTableLikeFromListSQLFilter
  • HTMLTableLikeTextSQLFilter
  • HTMLTableModel
  • HTMLTableNumberComparatorSQLFilter
  • HTMLTableParameters
  • HTMLTableRow
  • HTMLTableRowCell
  • HTMLTableSortingRule
  • HTMLTableTextFilter
  • HTMLTableUnapprovedSQLFilter
  • HTTPCookie
  • HTTPFatalExceptionPrinter
  • HTTPRequestCustom
  • HTTPResponseCustom
  • I18NMessages
  • IdcardService
  • IllegalArgumentException
  • Image
  • ImageResizer
  • ImgHTMLElement
  • IncludeTemplateSyntaxElement
  • IntegerType
  • IntegratedErrorHandler
  • InvalidTemplateFunctionCallException
  • IOException
  • Item
  • ItemsAuthorizationsService
  • ItemsManager
  • ItemsModuleExtensionPointProvider
  • ItemsService
  • ItemsUrlBuilder
  • JoinMappingModel
  • JSONResponse
  • KeyGenerator
  • Keyword
  • KeywordsCache
  • KeywordsManager
  • KeywordsService
  • Lang
  • LangConfiguration
  • LangConfigurationManager
  • LangLoader
  • LangNotFoundException
  • LangsConfig
  • LangsManager
  • LangVarTemplateSyntaxElement
  • LastUseDateConfig
  • LinkHTMLElement
  • LinksMenu
  • LinksMenuElement
  • LinksMenuLink
  • LoopTemplateSyntaxElement
  • LoopVarTemplateSyntaxElement
  • Mail
  • MailServiceConfig
  • MailToPHPMailerConverter
  • MailUtil
  • MaintenanceConfig
  • MalformedUrlMapperRegexException
  • MappingModel
  • MappingModelField
  • MemberDateExtendedField
  • MemberDisabledActionAuthorization
  • MemberExtendedField
  • MemberExtendedFieldErrorsMessageException
  • MemberExtendedFieldsService
  • MemberHalfLongTextExtendedField
  • MemberHiddenExtendedField
  • MemberLongTextExtendedField
  • MemberMultipleChoiceExtendedField
  • MemberMultipleSelectExtendedField
  • MemberSanctionManager
  • MemberShortTextExtendedField
  • MemberSimpleChoiceExtendedField
  • MemberSimpleSelectExtendedField
  • MemberUserAvatarExtendedField
  • MemberUserBornExtendedField
  • MemberUserPMToMailExtendedField
  • MemberUserSexExtendedField
  • Menu
  • MenusCache
  • MenuService
  • MenusProvidersService
  • MenuStringFilter
  • MessageHelper
  • MiniCalendar
  • Module
  • ModuleConfiguration
  • ModuleConfigurationManager
  • ModuleController
  • ModuleCssFiles
  • ModuleDispatchManager
  • ModuleExtensionPointProvider
  • ModuleLink
  • ModuleMenus
  • ModuleMiniMenu
  • ModulePagination
  • ModulesConfig
  • ModulesCssFilesService
  • ModulesManager
  • ModulesUrlBuilder
  • ModuleTreeLinks
  • ModuleTreeLinksService
  • MySQLDBConnection
  • MySQLDBConnectionException
  • MySQLDBFactory
  • MySQLDBMSUtils
  • MySQLInjectQueryResult
  • MySqlPlatform
  • MySQLQuerier
  • MySQLQuerierException
  • MySQLQueryTranslator
  • MySQLSelectQueryResult
  • MySQLUnexistingDatabaseException
  • NginxFileCache
  • NoSuchControllerException
  • NotASingleRowFoundException
  • Notation
  • NotationService
  • Notification
  • NotYetImplementedException
  • NoUrlMatchException
  • NumberHelper
  • ObjectNotFoundException
  • ObjectType
  • Pagination
  • ParametersTemplateSyntaxElement
  • ParameterTypeMismatchException
  • Path
  • PDODBConnection
  • PDODBConnectionException
  • PDOInjectQueryResult
  • PDOMySQLDBFactory
  • PDOQuerier
  • PDOQuerierException
  • PDOSelectQueryResult
  • PersistenceContext
  • PHPBoostAuthenticationMethod
  • PHPBoostErrors
  • PHPBoostFoldersPermissions
  • PHPBoostIndexController
  • PHPBoostNotInstalledException
  • PHPTemplateSyntaxElement
  • PlainCodeHighlighter
  • PostgreSqlPlatform
  • PrivateMsg
  • PropertyNotFoundException
  • RAMDataStore
  • RawExceptionHandler
  • RegexHelper
  • RemainingStringVarException
  • Repository
  • RichCategory
  • RichItem
  • RichRootCategory
  • Robots
  • RolesAuthorizations
  • RootCategory
  • RowNotFoundException
  • RSS
  • SearchCategoryChildrensOptions
  • SearchResult
  • SecurityConfig
  • SelectQueryResultMapper
  • SEOMetaData
  • ServerConfiguration
  • ServerEnvironmentConfig
  • Session
  • SessionData
  • SessionNotFoundException
  • SessionsConfig
  • SimpleVarTemplateSyntaxElement
  • SiteDisplayFrameGraphicalEnvironment
  • SiteDisplayFrameResponse
  • SiteDisplayGraphicalEnvironment
  • SiteDisplayResponse
  • SitemapCategoriesModule
  • SiteNodisplayGraphicalEnvironment
  • SiteNodisplayResponse
  • SmallIntType
  • SmileysCache
  • SMTPConfiguration
  • SMTPMailService
  • SpanHTMLElement
  • SQLDAO
  • SQLFragment
  • SQLHTMLTableModel
  • SqlitePlatform
  • SQLQuerierException
  • SQLQueryVars
  • StatsCache
  • StringInputStream
  • StringOutputStream
  • StringTemplate
  • StringTemplateLoader
  • StringType
  • StringVars
  • TemplateFunctions
  • TemplateHighlighter
  • TemplateLoadingException
  • TemplateRenderingException
  • TemplateSyntaxParser
  • TemplateSyntaxParserContext
  • TextHelper
  • TextTemplateSyntaxElement
  • TextType
  • Theme
  • ThemeConfiguration
  • ThemeConfigurationManager
  • ThemesConfig
  • ThemesManager
  • TimeType
  • Timezone
  • Type
  • UnexistingDatabaseException
  • UnexistingExtensionPointProviderException
  • UnexistingHTTPParameterException
  • UnreadContributionsCache
  • UnsupportedOperationException
  • Updates
  • Upload
  • UploadedFile
  • UploadedFileTooLargeException
  • Uploads
  • Url
  • UrlControllerMapper
  • UrlMapping
  • UrlMappings
  • UrlRedirectMapper
  • UrlSerializedParameter
  • UrlSerializedParameterEncoder
  • UrlSerializedParameterParser
  • User
  • UserAccountsConfig
  • UserService
  • ValidationResult
  • VariableExpressionTemplateSyntaxElement
  • VariableTemplateSyntaxElement
  • VisitorDisabledActionAuthorization
  • WizardActionLinkList
  • WizardFormFieldsetSubmit
  • WizardHTMLForm
  • WritingPadConfig
Methods
  • __construct()
  • is_relative()
  • relative()
  • rel()
  • absolute()
  • root_to_local()
  • encode_rewrite()
  • check_url_validity()
  • get_url_file_size()
  • compress()
  • get_absolute_root()
  • html_convert_root_relative2absolute()
  • html_convert_absolute2root_relative()
  • html_convert_root_relative2relative()
  • get_relative()
  • get_wellformness_regex()
  • check_wellformness()
  • to_rel()
  • to_relative()
  • to_absolute()
  • is_current_url()
  • No protected methods found
  • convert_url_to_absolute()
  • convert_url_to_root_relative()
  • convert_url_to_relative()
  • build_html_match_regex()
Properties
  • No public properties found
  • No protected properties found
  • $root
  • $server
  • $url
  • $is_relative
  • $path_to_root
  • $server_url
Constants
  • FORBID_JS_REGEX
  • PROTOCOL_REGEX
  • USER_REGEX
  • DOMAIN_REGEX
  • FOLDERS_REGEX
  • FILE_REGEX
  • ARGS_REGEX
  • STATUS_OK
  • STATUS_FOUND
  1. APIBoost
  2. \Util
  3. Url

Class Url

Summary

  • File
  • Package hierarchy Util
  • Class hierarchy \Url
  • package

    Util

Methods

__construct()

__construct(string $url = '.', string $path_to_root = null,  $server_url = null) 

Build a Url object. By default, builds an Url object representing the current path.

If the url is empty, no computation is done and an empty string will be returned when asking for both relative and absolute form of the url.

Parameters
string $url

the url string relative to the current path, to the website root if beginning with a "/" or an absolute url

string $path_to_root

url context. default is PATH_TO_ROOT

$server_url
  • Inherited from \Url
Tags
None found

is_relative()

is_relative() : boolean

Returns
boolean —

true if the url is a relative one

  • Inherited from \Url
Tags
None found

relative()

relative() : string

Returns the root relative url if defined, else the absolute one

Returns
string —

the root relative url if defined, else the absolute one

  • Inherited from \Url
Tags
None found

rel()

rel() : string

Returns the relative url if defined, else the absolute one

Returns
string —

the relative url if defined, else the absolute one

  • Inherited from \Url
Tags
None found

absolute()

absolute() : string

Returns the absolute url

Returns
string —

the absolute url

  • Inherited from \Url
Tags
None found

root_to_local()

root_to_local() : string

Returns the relative path from the website root to the current path if working on a relative url

Returns
string —

the relative path from the website root to the current path if working on a relative url

  • Inherited from \Url
Tags
None found

encode_rewrite()

encode_rewrite( $url) : string

Prepares a string for it to be used in an URL (with only a-z, 0-9 and - characters).

Parameters
$url
Returns
string —

The encoded string.

static
  • Inherited from \Url
Tags
None found

check_url_validity()

check_url_validity(string $url) : integer

Checks the status of an url.

Parameters
string $url

Url to check.

Returns
integer —

The status of the url.

static
  • Inherited from \Url
Tags
None found

get_url_file_size()

get_url_file_size(string $url) : integer

Retrieves the size of a file in url.

Parameters
string $url

Url to check.

Returns
integer —

The size of the url file.

static
  • Inherited from \Url
Tags
None found

compress()

compress(string $url) : string

Compress a url by removing all "folder/.

." occurrences

Parameters
string $url

the url to compress

Returns
string —

the compressed url

static
  • Inherited from \Url
Tags
None found

get_absolute_root()

get_absolute_root() : string

Returns the absolute website root Url

Returns
string —

the absolute website root Url

static
  • Inherited from \Url
Tags
None found

html_convert_root_relative2absolute()

html_convert_root_relative2absolute(string $html_text, string $path_to_root = PATH_TO_ROOT, string $server_url = SERVER_URL) : string

Returns the HTML text with only absolutes urls

Parameters
string $html_text

The HTML text in which we gonna search for root relatives urls (only those beginning by '/') to convert into absolutes ones.

string $path_to_root

Path to root of the page to which you want to fit the URL.

string $server_url

Path from the site root of the page to which you want to fit the URL.

Returns
string —

The HTML text with only absolutes urls

static
  • Inherited from \Url
Tags
None found

html_convert_absolute2root_relative()

html_convert_absolute2root_relative(string $html_text, string $path_to_root = PATH_TO_ROOT, string $server_url = SERVER_URL) : string

Returns the HTML text with only relatives urls

Parameters
string $html_text

The HTML text in which we gonna search for absolutes urls to convert into relatives ones.

string $path_to_root

Path to root of the page to which you want to fit the URL.

string $server_url

Path from the site root of the page to which you want to fit the URL.

Returns
string —

The HTML text with only absolutes urls

static
  • Inherited from \Url
Tags
None found

html_convert_root_relative2relative()

html_convert_root_relative2relative(string $html_text, string $path_to_root = PATH_TO_ROOT, string $server_url = SERVER_URL) : string

Transforms the relative URL whose base is the site root (for instance /images/mypic.png) to the real relative path fited to the current page.

Parameters
string $html_text

The HTML text in which you want to replace the paths

string $path_to_root

Path to root of the page to which you want to fit the URL.

string $server_url

Path from the site root of the page to which you want to fit the URL.

Returns
string —

The transformed string

static
  • Inherited from \Url
Tags
None found

get_relative()

get_relative(string $url, string $path_to_root = null, string $server_url = null) : string

Parameters
string $url

the url to "relativize"

string $path_to_root

Path to root of the page to which you want to fit the URL

string $server_url

Path from the site root of the page to which you want to fit the URL.

Returns
string —

the relative url of the $url parameter

static
  • Inherited from \Url
Tags
None found

get_wellformness_regex()

get_wellformness_regex(integer $protocol = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $user = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $domain = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $folders = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $file = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $args = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, boolean $forbid_js = true) : \the

Returns the regex matching the requested url form

Parameters
integer $protocol

REGEX_MULTIPLICITY_OPTION for the protocol sub-regex

integer $user

REGEX_MULTIPLICITY_OPTION for the user:password@ sub-regex

integer $domain

REGEX_MULTIPLICITY_OPTION for the domain sub-regex

integer $folders

REGEX_MULTIPLICITY_OPTION for the folders sub-regex

integer $file

REGEX_MULTIPLICITY_OPTION for the file sub-regex

integer $args

REGEX_MULTIPLICITY_OPTION for the arguments sub-regex

boolean $forbid_js

true if you want to forbid javascript uses in urls

Returns
\the —

regex matching the requested url form

static
  • Inherited from \Url
  • See also \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL \REGEX_MULTIPLICITY_NEEDED \RegexHelper::REGEX_MULTIPLICITY_AT_LEAST_ONE \RegexHelper::REGEX_MULTIPLICITY_ALL \RegexHelper::REGEX_MULTIPLICITY_NOT_USED
Tags
None found

check_wellformness()

check_wellformness( $url, integer $protocol = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $user = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $domain = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $folders = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $file = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $args = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, integer $anchor = \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL, boolean $forbid_js = true) : true

Returns true if the url match the requested url form

Parameters
$url
integer $protocol

REGEX_MULTIPLICITY_OPTION for the protocol sub-regex

integer $user

REGEX_MULTIPLICITY_OPTION for the user:password@ sub-regex

integer $domain

REGEX_MULTIPLICITY_OPTION for the domain sub-regex

integer $folders

REGEX_MULTIPLICITY_OPTION for the folders sub-regex

integer $file

REGEX_MULTIPLICITY_OPTION for the file sub-regex

integer $args

REGEX_MULTIPLICITY_OPTION for the arguments sub-regex

integer $anchor

REGEX_MULTIPLICITY_OPTION for the anchor sub-regex

boolean $forbid_js

true if you want to forbid javascript uses in urls

Returns
true —

if the url match the requested url form

static
  • Inherited from \Url
  • See also \RegexHelper::REGEX_MULTIPLICITY_OPTIONNAL \REGEX_MULTIPLICITY_NEEDED \RegexHelper::REGEX_MULTIPLICITY_AT_LEAST_ONE \RegexHelper::REGEX_MULTIPLICITY_ALL \RegexHelper::REGEX_MULTIPLICITY_NOT_USED
Tags
None found

to_rel()

to_rel(mixed $url) : string

Returns an url relative from the server root

Parameters
mixed $url

the url representation. Could be a string or an Url object

Returns
string —

an url relative from the server root

static
  • Inherited from \Url
Tags
None found

to_relative()

to_relative(mixed $url) : string

Returns an url relative from PHPBoost root

Parameters
mixed $url

the url representation. Could be a string or an Url object

Returns
string —

an url relative from PHPBoost root

static
  • Inherited from \Url
Tags
None found

to_absolute()

to_absolute(mixed $url) : string

Returns an absolute url

Parameters
mixed $url

the url representation. Could be a string or an Url object

Returns
string —

an absolute url

static
  • Inherited from \Url
Tags
None found

is_current_url()

is_current_url(string $check_url, boolean $real_url = false) 

Returns true if $check_url is current url

Parameters
string $check_url

check url

boolean $real_url

true if check real url or false for verificate $check_url is containing in current url

static
  • Inherited from \Url
Tags
None found

convert_url_to_absolute()

convert_url_to_absolute(array<mixed,string> $url_params) : string

replace a relative url by the corresponding absolute one

Parameters
array<mixed,string> $url_params

Array containing the attributes containing the url and the url

Returns
string —

the replaced url

static
  • Inherited from \Url
Tags
None found

convert_url_to_root_relative()

convert_url_to_root_relative(array<mixed,string> $url_params) : string

replace an absolute url by the corresponding root relative one if possible

Parameters
array<mixed,string> $url_params

Array containing the attributes containing the url and the url

Returns
string —

the replaced url

static
  • Inherited from \Url
Tags
None found

convert_url_to_relative()

convert_url_to_relative(array<mixed,string> $url_params) : string

replace an absolute url by the corresponding relative one if possible

Parameters
array<mixed,string> $url_params

Array containing the attributes containing the url and the url

Returns
string —

the replaced url

static
  • Inherited from \Url
Tags
None found

build_html_match_regex()

build_html_match_regex( $only_match_relative = false) 

Parameters
$only_match_relative
static
  • Inherited from \Url
Tags
None found

Properties

$root

$root : 

Tags
None found

$server

$server : 

Tags
None found

$url

$url : 

Tags
None found

$is_relative

$is_relative : 

Tags
None found

$path_to_root

$path_to_root : 

Tags
None found

$server_url

$server_url : 

Tags
None found

Constants

FORBID_JS_REGEX

FORBID_JS_REGEX = '(?!javascript:)'

Tags
None found

PROTOCOL_REGEX

PROTOCOL_REGEX = '[a-z0-9-_]+(?::[a-z0-9-_]+)*://'

Tags
None found

USER_REGEX

USER_REGEX = '[a-z0-9-_]+(?::[a-z0-9-_]+)?@'

Tags
None found

DOMAIN_REGEX

DOMAIN_REGEX = '(?:[a-z0-9-_~]+\.)*[a-z0-9-_~]+(?::[0-9]{1,5})?/'

Tags
None found

FOLDERS_REGEX

FOLDERS_REGEX = '/*(?:[A-Za-z0-9~_\.+@,-]+/+)*'

Tags
None found

FILE_REGEX

FILE_REGEX = '[A-Za-z0-9-+_,~:/\.\%!=]+'

Tags
None found

ARGS_REGEX

ARGS_REGEX = '(/([\w/_\.#-]*(\?)?(\S+)?[^\.\s])?)?'

Tags
None found

STATUS_OK

STATUS_OK = 200

Tags
None found

STATUS_FOUND

STATUS_FOUND = 302

Tags
None found
Documentation is powered by phpDocumentor and generated on Thu, 25 Jun 2020 11:10:06 +0200.