PHPackages                             arikin/crimeflare - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arikin/crimeflare

ActiveProject[Utility &amp; Helpers](/categories/utility)

arikin/crimeflare
=================

Download and decompress data files from www.crimeflare.us

v0.1.0(8y ago)13352MITPHP

Since Oct 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/arikin/crimeflare)[ Packagist](https://packagist.org/packages/arikin/crimeflare)[ RSS](/packages/arikin-crimeflare/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (1)Versions (2)Used By (0)

Crimeflare imports
==================

[](#crimeflare-imports)

This keeps the crimeflare data current in a database. The download page for the data file zips: This has its own search form:

### Overview

[](#overview)

It downloads the data zips and then extracts them. Those extracted files are then parsed into variables. That data is then inserted into a database with a table for each data file.

The settings file, crimeflare.json, lets you set the database credentials, the files to download, and the table sql information.

This is meant to run as a cronjob once every three weeks. Crimeflare only updates once every three weeks anyway. If you attempt to do it hourly for example they will ban your IP for abuse. **So don't abuse the resources they spent their time building.**

### Installation

[](#installation)

This is a simple composer require.

```
php composer.phar require arikin/crimeflare
```

Protect the **crimeflare.json** file by carefully setting permissions on it. You could also move it to another path if you need. Just pass the setting into Crimeflare:

```
$crime = new Crimeflare(array(
    'settings_file' => "[full path to file]"
));
```

### Usage

[](#usage)

Update the **crimeflare.json** file with real DB credentials.
Initiate the Crimeflare class and call the **update** method.

```
use Arikin\Crimeflare;

$crime = new Crimeflare();
$crime->update();
```

Please note that the Crimeflare data files are rather large. Each file is handled one at a time and line by line, but creating the sql INSERT statements does take up memory. So be sure to set the memory limit for the script.

```
ini_set('memory_limit', '2G');
```

### crimeflare.json

[](#crimeflarejson)

JSON formated settings file. Below is a description of settings:

- **base\_dir** - Full path to base directory. No trailing slash. In here the download/ and extract/ directories are created. **Important** the data files are not deleted after finishing. Please do this in your script to save space.
- **base\_url** - Base url to files. No trailing slash. Default is:
- **curl\_timeout** - Timeout for fetching each file.
- **pdo** - Array of PDO object settings

    - **pdo: host** - IP or domain of mysql server
    - **pdo: db** - Database name
    - **pdo: user** - Username for mysql user
    - **pdo: pass** - Password for that user
    - **pdo: charset** - Character set to use in connecting to the database
    - **pdo: timeout** - PDO timeout in seconds.
- **crimeflare** - Array of values for each Crimeflare data file. See below for an example of **ipout.zip**.

The keys are the filename without any prefixes or suffixes. Here is a sample of one:

- **ipout** - Array of options for this file
    - **ipout: file** - filename without any prefixes or suffixes. Important to identifying and creating files and tables.
    - **ipout: uri** - URL to the files without actual file name. No trailing slashes.
        - **ipout: sql** - Array of settings for the SQL and parsing the data file
        - **ipout: sql: table** - Name for table used for this file's data. A prefix is suggested as the tables will be Dropped and Created.
        - **ipout: sql: fields** - Array of fields. Each line is split on the space character. Order here is important. Index 0 is the data on the far left of the line.
            - **ipout: sql: fields: updated\_at** - First column name to use with datatype to use in table creation
            - **ipout: sql: fields: domain** - Second column name to use with datatype to use in table creation
            - **ipout: sql: fields: ip\_address** - Third column name to use with datatype to use in table creation

### Notes

[](#notes)

The inserts per table are done in groups of 20,000 records by default. If your DB can handle more parameter binds then set a new integer limit based on this formula before using the update method: DB bind limit / Number of fields

```
$crime->setBindingLimit(50000);
$crime->update();
```

The PDO was separated out so you could provide your own if needed. Change the use statement inside **src/Crimeflare.php**.

```
use \DbUpdate;
```

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3216d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9474052?v=4)[Bryan](/maintainers/arikin)[@arikin](https://github.com/arikin)

---

Top Contributors

[![arikin](https://avatars.githubusercontent.com/u/9474052?v=4)](https://github.com/arikin "arikin (7 commits)")

### Embed Badge

![Health badge](/badges/arikin-crimeflare/health.svg)

```
[![Health](https://phpackages.com/badges/arikin-crimeflare/health.svg)](https://phpackages.com/packages/arikin-crimeflare)
```

###  Alternatives

[greenter/greenter

Facturacion Electrónica SUNAT en Perú

34739.9k1](/packages/greenter-greenter)[fresns/fresns

Cross-platform general-purpose multiple content forms social network service software.

4871.5k](/packages/fresns-fresns)[karsonzhang/fastadmin-addons

addons package for fastadmin

29189.7k](/packages/karsonzhang-fastadmin-addons)[fresns/plugin-manager

Enhance Laravel Apps: Organized &amp; Scalable

513.3k2](/packages/fresns-plugin-manager)[flarum/gdpr

Features for GDPR, PII management

1344.5k24](/packages/flarum-gdpr)[fastadminnet/fastadmin-addons

addons package for fastadmin

2826.6k](/packages/fastadminnet-fastadmin-addons)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
