PHPackages                             lithemod/import - 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. lithemod/import

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

lithemod/import
===============

Support for facilitating the dynamic inclusion of PHP files and the management of external variables.

v1.0.0(1y ago)02901PHP

Since Oct 2Pushed 1y agoCompare

[ Source](https://github.com/lithemod/import)[ Packagist](https://packagist.org/packages/lithemod/import)[ RSS](/packages/lithemod-import/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

Import
======

[](#import)

Lithe Import is a PHP library designed to facilitate the dynamic inclusion of PHP files and the management of external variables.

Installation
------------

[](#installation)

You can install `Import` using Composer. Run the following command in your terminal:

```
composer require lithemod/import
```

Usage
-----

[](#usage)

### Including a Single File

[](#including-a-single-file)

To include a single PHP file, use the `file` method:

```
use Lithe\Support\import;

$result = import::file('path/to/your/testfile.php');
```

### Including All Files from a Directory

[](#including-all-files-from-a-directory)

To include all PHP files from a specified directory (and its subdirectories), you can set the directory and call the `get` method:

```
use Lithe\Support\import;

$importer = import::dir('path/to/directory')->exceptions(['exclude.php']);
$importer->get();
```

### Using External Variables

[](#using-external-variables)

You can specify external variables that should be available in the included files:

```
use Lithe\Support\import;

$vars = ['var1' => 'value1'];
import::with($vars)->dir('path/to/directory')->get();
```

### Excluding Files

[](#excluding-files)

To exclude specific files from being included, use the `exceptions` method:

```
$importer = import::dir('path/to/directory')->exceptions(['exclude.php']);
$importer->get();
```

Methods Overview
----------------

[](#methods-overview)

- `with(array $vars)`: Sets external variables to be available in the included files.
- `dir(string $directory)`: Sets the directory for file inclusion.
- `exceptions(array $exceptions)`: Specifies files to be excluded from inclusion.
- `file(string $file)`: Includes a single PHP file and returns its result.
- `get()`: Includes all PHP files from the specified directory, excluding specified exceptions.

License
-------

[](#license)

This project is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

593d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/56173de3a7bf7099dd8168efd730d3c2fb5df5174a123fdc37cee8c3589e2345?d=identicon)[williamhumbwavali](/maintainers/williamhumbwavali)

---

Top Contributors

[![williamhumbwavali](https://avatars.githubusercontent.com/u/127023095?v=4)](https://github.com/williamhumbwavali "williamhumbwavali (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lithemod-import/health.svg)

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

###  Alternatives

[archtechx/money

A lightweight package for handling money math in PHP.

169219.0k5](/packages/archtechx-money)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)[aidynmakhataev/laravelsurveyjs

Laravel wrapper for surveyjs library

8211.2k](/packages/aidynmakhataev-laravelsurveyjs)

PHPackages © 2026

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