PHPackages                             diverproject/diamond-lang - 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. diverproject/diamond-lang

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

diverproject/diamond-lang
=========================

Basic library for any project and dependence library for anothers diamond projects.

038

Since Mar 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/diverproject/diamond-lang)[ Packagist](https://packagist.org/packages/diverproject/diamond-lang)[ RSS](/packages/diverproject-diamond-lang/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Diamond Lang
============

[](#diamond-lang)

Basic library for any project and dependence library for anothers diamond projects.

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

[](#prerequisites)

You need have [Composer](https://getcomposer.org/) to install Diamond.

```
$ composer require diverproject/diamond-lang "^3.0"

```

### Installing

[](#installing)

To execute all test cases (or suite) you need `PHP Unit`

```
$ phpunit

```

1. Set system environment, this can apply different reactions, see wiki classes affected by this setting or classes documentation. For example, when running PHP Unit, enable `ENVIRONMENT_TEST_CASE` and using `diamond\test\lang\AbstractDiamondTest`

```
Diamond::setEnvironment(Diamond::ENVIRONMENT_HOMOLOG); // Options: ENVIRONMENT_HOMOLOG, ENVIRONMENT_TEST_CASE or ENVIRONMENT_PRODUCTION

```

2. Set throws exceptions from parsing methods into different classes, see wiki methods affected by this setting or methods documentation. When enabled, parsing failures will throws a Exception otherwise will return `NULL` or a default value if it's possible. Some cases a default value don't help treat the problem them will return `NULL`.

```
Diamond::setEnabledParseThrows(TRUE); // Options: TRUE or FALSE

```

That's it, don't forget `include` library when use composer like `include 'vendor/autoload.php` (will depend of your system file structure)

Running the tests
-----------------

[](#running-the-tests)

The test scripts are located on `test` root folder.

### Composer update

[](#composer-update)

First all update dependences libraries and generate `vendor autoload` of composer:

```
$ composer update

or if you are in Windows execute 'composer-update.bat' (it's more easy) - it's same think as above

```

Now you can execute `PHP Unit` and check tests results, there are 2 ways:

The first way and more easy is execute `phpunit.bat`; check the content file to understand and if you didn't know `PHP Unit` check this link [here](https://phpunit.de/).

The second way is work only if you open the project into `Eclipse PHP`, setting `PHP Unit Preferences` and running individual scripts or selecting one or more and running.

### Observation

[](#observation)

Some classes will not have a tests scripts because need something else to work, like `Cookie`, `Get`, `Post` and `Session` classes into `diamond\lang\http`.

And if you see some problemns or classes without tests scripts tell us.

Deployment
----------

[](#deployment)

**DON'T FORGET** change setting your environment system running type to

```
Diamond::setEnvironment(Diamond::ENVIRONMENT_PRODUCTION);

```

Built With
----------

[](#built-with)

- [Composer](https://getcomposer.org/) - Dependency Manager Framework

Versioning
----------

[](#versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/diverproject/diamond-lang/tags).

*The revision log have somethings different because it's used developers found more easy changes made and make github commit messages more **clean***.

Authors
-------

[](#authors)

- **Andrew Mello da Silva** - *Developer* - [Driw](https://github.com/Driw)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

Acknowledgments
---------------

[](#acknowledgments)

- **Billie Thompson** - *[Readme template](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)* - [PurpleBooth](https://github.com/PurpleBooth)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9ef30b69ccbd8d4f5bf5e70482ac22cb3ae8ef122cbd5099689faf4b926a3b2?d=identicon)[Driw](/maintainers/Driw)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/diverproject-diamond-lang/health.svg)

```
[![Health](https://phpackages.com/badges/diverproject-diamond-lang/health.svg)](https://phpackages.com/packages/diverproject-diamond-lang)
```

###  Alternatives

[fidry/cpu-core-counter

Tiny utility to get the number of CPU cores.

238148.2M23](/packages/fidry-cpu-core-counter)[kiboit/phast

A toolbox for optimizing web page performance

3615.4k1](/packages/kiboit-phast)

PHPackages © 2026

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