Commit Graph

18 Commits

Author SHA1 Message Date
Ben Ramsey 8d621488c4 Check whether passthru() is disabled
If passthru() is disabled in php.ini, this will force the
SystemNodeProvider to return `false` for the node. Using the default
FallbackNodeProvider, ramsey/uuid will default to the
RandomNodeProvider, in these cases.

Closes #114
2018-07-19 16:53:00 -05:00
Ben Ramsey b8cac9278c Merge branch 'SystemNodeProvider-FreeBSD-support' of https://github.com/kalifg/uuid into kalifg-SystemNodeProvider-FreeBSD-support 2018-07-19 15:08:45 -05:00
Ben Peachey 62628862df Improvements to the SystemNodeProviderTest class (#211)
* Changes location of providers in the SystemNodeProviderTest

  They are now grouped at the bottom of the class.

* Adds logic to SystemNodeProviderTest.

* Changes call to `file_get_contents` SystemNodeProvider so it can be
  mocked.

* Changes SystemNodeProviderTest so native PHP functions are mocked
  instead of the class under test.

* Changes SystemNodeProviderTest so "\n" is used instead of PHP_EOL

  As the (input or output) of the tests is not system dependant it does
  not make sense to use PHP_EOL. All of these instance have been
  replaced for the sake of readability and stating intent more clearly.

* Adds dataprovider to SystemNodeProvider main test for input
  variations.

* Adds OS to SystemNodeProviderTest dataprovider for Linux fail
  scenario.

* Adds test for SystemNodeProvider to ensure invalid values are not
  accepted.

* Changes names of dataproviders in SystemNodeProviderTest for
  consistency.

* Changes SystemNodeProviderTest by grouping dataproviders together.

* Changes method in SystemNodeProviderTest to use the provided mock
  functions.

* Fixes PSR-2 coding conventions in SystemNodeProviderTest.

* Minor change to SystemNodeProviderTest based on review.
2018-02-07 17:28:02 -06:00
kalifg a7492800e2 Add support for determining MAC address on FreeBSD systems 2018-02-07 15:15:49 -06:00
Ben Ramsey 89c3c1777e Fix capitalization of the getSysfs() method 2018-01-16 14:14:34 -06:00
Ben Ramsey 901c3e540d Handle cases where glob() returns false
Fixes #203
2018-01-16 14:11:58 -06:00
Robbert Müller 10e022c05c bug fixes
- add missing default value
- invert logic, because it was doing it the wrong way around
2017-10-18 10:32:45 +02:00
Robbert Müller cfafc97fc0 Add sysfs option for linux system
Linux offers a sysfs interface to the macaddresses of the system network
interfaces without calling exec.

This enables stable system based UUID generation even on docker images
like php:7
2017-10-06 19:57:30 +02:00
Ben Ramsey e865a0e2ff Merge branch '107_cache_system_node_provider' of https://github.com/MLoureiro/uuid into MLoureiro-107_cache_system_node_provider 2016-06-24 23:58:19 +02:00
Marcos ab81ad278a Remove duplicated call to str_replace() 2016-06-24 20:46:51 +02:00
Marcos 5dbd993b4b Execute system call only once even if the node is not found 2016-06-23 21:03:07 +02:00
Ben Ramsey d975f0f143 Add docblocks for classes and interfaces in Ramsey\Uuid\Provider namespace 2015-09-27 13:02:30 -05:00
Ben Ramsey e006f669ad Adding common docblock file header 2015-07-15 13:59:52 -05:00
Yves Berkholz 505b2ac498 Migrating changes made by @yberkholz in c90233d6e2 into 3.0 2015-06-16 10:26:40 -05:00
Ben Ramsey 2053cd3633 Coding standards fix 2015-06-16 10:23:29 -05:00
Jesper Pedersen 7fe43508a4 Added caching of system node information
Applied optimization found in 2.8 for caching of system node information
2015-06-16 10:22:48 -05:00
Ben Ramsey d67c3490a8 Change namespace to "Ramsey"; closes #48 2015-04-25 12:11:37 -05:00
Ben Ramsey 958643e7b6 Introduce Provider namespace and move Node and Time classes into it 2014-11-08 16:16:44 -05:00