Download the PHP package spresnac/laravel-url-helper without Composer

On this page you can find all versions of the php package spresnac/laravel-url-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-url-helper

URL Helper Package

PHP from Packagist codecov CI Status


Content:


Installation

First things first, so require the package:


Usage

Content Helper

Every time you need to get URLs from some kind of Text or HTML, this class is a helping hand for you.

  1. Make an instance of the class
  2. Use the constructor or the setContent method to put in your content as string.
  3. Get your URLs by using one of the following methods.

getContent(): string

This will just the content you put in via constructor or setContent method.


getHrefs(): Collection

You will retrieve a Collection with only the URLs inside a href


getHrefsAsArray(): array

You will retrieve an array with only the URLs inside a href


getSrcUrls(): Collection

You will retrieve a collection of urls from src sources.


getLinksFromPlaintext(): Collection

This method will try to find all the urls in a plaintext string.


getAllTheLinks(): Collection

This will execute getHrefs, getSrcUrls and getLinksFromPlaintext and will return a uniqueified collection of all the urls.


URL Helper

Some useful helper functions to handle URL related manipulating or info-gatherings.


normalize_url(string $url): string|false

Normalizes URL with .. in it and leaves the all oher URL "as is".

Returns false in case of error


build_url(array $parsed_url): string

This is the missing opposite of parse_url to rebuild a url from its parts.


getMainDomainPart(string $url): string

This will return the "Main Domain" part of an URL. The "Main Domain" is like the SLD + TLD domain part.


getSubdomainPart(string $url): string

This will return the Subdomain part of an URL.


Sitemap Helper

Handling with web-sitemaps can be handy with some helpers at your side.


process_input_from_string(string $input_string): Collection

Will return all the urls inside a sitemap as Collection


process_input_from_url(string $input_url): Collection (0.5+)

Returns the urls in a sitemap url as Collection


Tests

Simply run

or


Finally

Be productive 😉


All versions of laravel-url-helper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-simplexml Version *
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spresnac/laravel-url-helper contains the following files

Loading the files please wait ....