Download the PHP package rattfieldnz/safe-urls without Composer

On this page you can find all versions of the php package rattfieldnz/safe-urls. 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 safe-urls

safe-urls

PHP Version PHP Version License: MIT Latest Version on Packagist Total Downloads Build Status StyleCI Scrutinizer Code Quality codecov

A Laravel package to check URLs with Google's Safe Browsing API (look up).

Inspired by another similar package @ https://github.com/snipe/Safebrowsing.

Take a look at contributing.md to see a to do list.



Please Note:

This package requires that you have an active Google Safebrowsing API key. It absolutely will not work without one. It's free to create an API key .

Google also throttles API usage, so if you have a high-traffic site, you may want to build in a caching layer or something so you don't burn through your requests too quickly. You can keep an eye on your usage through the Google API console.

This project is not ready for use in production yet. When it is, there will be first major release (i.e. 1.0.0).

A Note About Google Safebrowsing API Results

During testing, there were a few times when the API showed some malware sites as 'safe', whereas in reality they weren't.

For example, running PHPUnit tests showed the Postman produced expected results. I have not found a solution yet; however, any feedback / suggestions are welcome, as are pull requests etc. Below are links which I have read about this issue further:

Installation

Via Composer

Update Your Config

For applications using Laravel =< 5.4

Open config/app.php and add:

to your providers array in config/app.php, and:

to your aliases array in config/app.php.

Publish the config

This will add a safe-urls.php config file into your project's config folder.

Set Your Google Safebrowsing API Key

In your .env, add:

There are additional options in the config file that relate to what specific types of threats you want to check for, and what platforms you want to check on, but you only really need to worry about that if you want to check fewer things, as it's pretty inclusive already.

Usage

Using Blade Syntax

Where $urls could be an array of URLs to check, perhaps passed through your Controller to a view.

Where true will return the results as an associative array.

false (or not having the second parameter) will return the results as a JSON-encoded string.

Using Facades

Example with input and output

If the value of $urls was:

SafeUrls::check($urls, true) Would return the following associative array:

SafeUrls::check($urls) (or SafeUrls::check($urls, false)) Would return the following JSON-encoded string:

Both outputs will depend on what options you have set in your config/safe-urls.php file.

Test URLs

Here are some handy test urls you can use while you're experimenting with this Laravel package.

Change log

Please see the changelog for more information on what has changed recently.

Testing

From inside the root folder of this package:

Replace YOUR_GOOGLE_API_KEY with your key. Get one by visiting https://developers.google.com/safe-browsing/v4/get-started.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

Please see the license file for more information.


All versions of safe-urls with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-curl Version *
ext-json Version *
illuminate/support Version ~5
curl/curl Version ^2.2
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 rattfieldnz/safe-urls contains the following files

Loading the files please wait ....