PHPackages                             skocic/server-farm - 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. skocic/server-farm

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

skocic/server-farm
==================

Simulation of allocation of servers and virtual machines in a server farm

v1.0(9y ago)0101MITPHPPHP &gt;=7.0CI failing

Since Apr 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sasakocic/server-farm)[ Packagist](https://packagist.org/packages/skocic/server-farm)[ RSS](/packages/skocic-server-farm/feed)WikiDiscussions master Synced 2mo ago

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

Server Farm
===========

[](#server-farm)

Simulation of allocation of servers and virtual machines in a server farm

[![Build Status](https://camo.githubusercontent.com/5505032593335183fea5a520d296bf275ad0d7397c6ea5cf7ebd8481f967749e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f66616365626f6f6b2f7068702d67726170682d73646b2f352e342e737667)](https://travis-ci.org/sasakocic/server-farm)[![Code Style Status](https://camo.githubusercontent.com/cc2af7182feeba1155f3006bdde716b281e88d47f12975002c54273877b08995/68747470733a2f2f7374796c6563692e696f2f7265706f732f38333035393134392f736869656c64)](https://styleci.io/repos/87685511)[![CodeCov](https://camo.githubusercontent.com/d27c9b044680bb9e06a2612079a209f6e5db4828c5af5035507fef9796b881a4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f736173616b6f6369632f7365727665722d6661726d2e737667)](https://codecov.io/gh/sasakocic/server-farm)[![CodeClimate](https://camo.githubusercontent.com/3c3ef401aad87152122c7d2b903e03c234fbd05ad0b816470fd1163cd3c13e3f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6769746875622f736173616b6f6369632f7365727665722d6661726d2e737667)](https://codeclimate.com/github/sasakocic/server-farm)[![Issue Count](https://camo.githubusercontent.com/08daf80c301fbe5e5cb28af4d7e7cae50aeac99673f97122e8c35c0f68acc094/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f736173616b6f6369632f7365727665722d6661726d2f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/sasakocic/server-farm)[![Issue Count](https://camo.githubusercontent.com/488520586d84199367002984050885d897c8fbd40d4ba47e558688205d60032a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736173616b6f6369632f7365727665722d6661726d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sasakocic/server-farm/?branch=master)

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

[](#installation)

Installed with [Composer](https://getcomposer.org/). Run this command:

```
composer install
```

Usage
-----

[](#usage)

Usage can be seen from tests.

In essence we create a ServerFarm object by specifying `maximum` server specs(cpu, ram and hdd size). We create an array of Virtual machines and store them (bigger than `maximum` are skipped) with `storeVmachines`, and then we:

- read the array of allocated machines with `getServers()`
- get the count with `count()`
- see detailed allocation list with `toString()`

```
$vmArray = [
    new VmachineModel(1, 1, 2),
    new VmachineModel(2, 2, 1),
    new VmachineModel(3, 4, 3),
    new VmachineModel(2, 1, 2),
];
$sf = new ServerFarmModel(ServerModel::create(5, 6, 7));
$sf->storeVmachines($vmArray);
$actual = $sf->toString();
$expected = "Server list\n"
    . "1. VM(1 MHz, 1 GB, 2 GB) VM(2 MHz, 2 GB, 1 GB) remains VM(1 MHz, 3 GB, 4 GB)\n"
    . "2. VM(3 MHz, 4 GB, 3 GB) remains VM(1 MHz, 2 GB, 4 GB)\n"
    . "3. VM(2 MHz, 1 GB, 2 GB) remains VM(2 MHz, 5 GB, 5 GB)\n";
$this->assertSame($expected, $actual);
$n = $sf->count();
$this->assertSame(3, $n);
```

Tests
-----

[](#tests)

1. [Composer](https://getcomposer.org/) is a prerequisite for running the tests. Install composer globally, then run `composer install` to install required files.
2. The tests can be executed by running this command from the root directory:

```
$ ./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

Please see the [license file](LICENSE) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3323d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/881312?v=4)[Saša Kocić](/maintainers/sasakocic)[@sasakocic](https://github.com/sasakocic)

---

Top Contributors

[![sasakocic](https://avatars.githubusercontent.com/u/881312?v=4)](https://github.com/sasakocic "sasakocic (42 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/skocic-server-farm/health.svg)

```
[![Health](https://phpackages.com/badges/skocic-server-farm/health.svg)](https://phpackages.com/packages/skocic-server-farm)
```

PHPackages © 2026

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