Download the PHP package ocolin/maclookup without Composer

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

Packagist Version PHP Version License Downloads

MacLookup

Table of Contents


What is it?

This is a small tool for looking up MAC vendor information of a give MAC address or group of MAC addresses.


How does it work?

Upon first instantiation it downloads the library of MAC vendors from IEEE from which it can then do local lookups directly rather than connecting to an external server.


Note from Author

This version is not compatible with previous versions. The reason for this is that the previous versions were part of testing and it was not expected that they would get used by anyone. Apologies for the incompatibility but they were done in a hurry and not written for a userbase. Any further versions will be done so in a more compatible way.


Requirements


Installation


Instantiation

MacLookup has 3 static functions for instantiation depending on the intended use. Keep in mind that upon first use, this plugin will download the IEEE database which may take a few seconds. Once downloaded it will read from the local copy.

Arguments

Each instantiation can take two optional arguments. It was designed to not be used with these options, but they exist for special circumstances.

Name Type Default Description
dataPath string System temp files dir or project dir Allows you so specify a folder to store the Vendor data
autoUpdate boolean true If the vendor data is not found on instantiation, aotumatically download new data

File Driver

This instantiation stores the data in a local file and does lookups by parsing through that file. This is the slowest method, but also the most memory efficient. Use this method if saving memory is your biggest concern.

Basic Example

Advanced Example

Memory Driver

This instantiation stores all the vendor data in memory. This driver is the fastest, but uses the most memory. Use this version if you don't care about memory usage.

Basic Example

Advanced Example

Database Driver

This instantiation stores the vendor data in an SQLite database. It's a compromise between two methods. It gives you the low memory usage of the file driver, and close to the same speed as the memory driver. However, it requires that you have the SQLite extension installed in PHP.

Basic Example

Advanced Example


Lookups

There are two methods of looking up mac addresses. One for looking up an individual mac addres, and another for doing bulk lookups.

Lookup

This function allows you to look up a single mac address.

Example:

BulkLookup

This method allows you to look up an array of MAC addresses. When searching for multiple addresses you can send them in a single request rather than make repeated single requests. This speeds up lookups when you know you have multiple lookups to make.

The output is an array using the MAC address as an array index so you can lookup a particular MAC address by array index name.

Example:


Special cases

Sometimes as MAC address may be invalid, private, or not found in the IEEE database. In these cases the registry value of the returned vendor object will inform you of the status if not something in an IEEE registry.

Invalid MAC

MacLookup will detect any invalid mac addresses and return an invalid address to save time from a long lookup.

Private MAC

MAC addresses in the reserved private space will also be spared a long lookup and returned indicating they are private.

Not Found

Some MAC addresses are valid, public, but not registered with IEEE. These will have a "Not Found" indication for the resigstry.


Formatting

MacLookup will accept MAC addresses that are coma separated or dash separated, dot separated or raw Hex. Leader zeros for will also be automatically added if needed.


Updating

Each driver has an update function for manually updating. This is not intended to be used much, however it is available should anyone want to refresh the vendor list from IEEE. The same can also be done by deleting the existing vendor file.


Benchmarks

There is a benchmark utility that can be used to compare times of lookups if needed. You can provide a MAC address for an argument and it will use all 3 drivers and compare the memory usage and speed.


All versions of maclookup with dependencies

PHP Build Version
Package Version
Requires ext-pdo Version *
php Version ^8.2
ext-ctype 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 ocolin/maclookup contains the following files

Loading the files please wait ...