https://github.com/cgdsoftware/php-dna
A library for reading and writing DNA test kit files in PHP.
https://github.com/cgdsoftware/php-dna
dna dna-processing library php php-library php8
Last synced: about 1 year ago
JSON representation
A library for reading and writing DNA test kit files in PHP.
- Host: GitHub
- URL: https://github.com/cgdsoftware/php-dna
- Owner: cgdsoftware
- License: mit
- Created: 2021-08-26T15:58:29.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-08T09:41:44.000Z (over 4 years ago)
- Last Synced: 2025-01-12T11:34:12.848Z (over 1 year ago)
- Topics: dna, dna-processing, library, php, php-library, php8
- Language: PHP
- Homepage: https://www.facebook.com/familytree365
- Size: 20.5 KB
- Stars: 4
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-dna
## Requirements
* php-dna 1.0+ requires PHP 8.0 (or later).
## Installation
There are two ways of installing php-dna.
### Composer
To install php-dna in your project using composer, simply add the following require line to your project's `composer.json` file:
{
"require": {
"familytree365/php-dna": "1.0.*"
}
}
### Download and __autoload
If you are not using composer, you can download an archive of the source from GitHub and extract it into your project. You'll need to setup an autoloader for the files, unless you go through the painstaking process if requiring all the needed files one-by-one. Something like the following should suffice:
```php
spl_autoload_register(function ($class) {
$pathToDna = __DIR__ . '/library/'; // TODO FIXME
if (!substr(ltrim($class, '\\'), 0, 7) == 'Dna\\') {
return;
}
$class = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
if (file_exists($pathToDna . $class)) {
require_once($pathToDna . $class);
}
});
```