PHPackages                             visithor/visithor - 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. visithor/visithor

ActiveLibrary

visithor/visithor
=================

Visithor for PHP

v0.2.0(10y ago)4120.9k1[4 issues](https://github.com/Visithor/visithor/issues)[2 PRs](https://github.com/Visithor/visithor/pulls)1MITPHPPHP ^5.4|^7.0

Since May 4Pushed 10y ago3 watchersCompare

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

READMEChangelog (9)Dependencies (7)Versions (10)Used By (1)

Visithor
========

[](#visithor)

[![Build Status](https://camo.githubusercontent.com/d386d7204da2cb6a55f79ab7476009f649d39aaf599034a12cd1d8b037940fa5/68747470733a2f2f7472617669732d63692e6f72672f5669736974686f722f7669736974686f722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Visithor/visithor)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/81d16ba4351c3bf36591eff0ce0a7e448b3bb7f0b02d5c22ac9d3c6507e216b5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7669736974686f722f7669736974686f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/visithor/visithor/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/0e177770f82bd37bbafc50511c2ff60ef769cf6a08baba3494573e838a4732c6/68747470733a2f2f706f7365722e707567782e6f72672f7669736974686f722f7669736974686f722f762f737461626c652e706e67)](https://packagist.org/packages/visithor/visithor)[![Latest Unstable Version](https://camo.githubusercontent.com/bf639ce4a8a497da946525a3ed4b90770cafbf9552fc35cb7a87d3d6a934adad/68747470733a2f2f706f7365722e707567782e6f72672f7669736974686f722f7669736974686f722f762f756e737461626c652e706e67)](https://packagist.org/packages/visithor/visithor)

Visithor is a PHP library that provides you a simple and painless way of testing your application routes with expected HTTP Codes.

Of course this project not pretends to avoid the need of unit, functional or behavioral tests, it is only a fast and easy way of ensuring that your routes are still available over the time.

Frameworks
----------

[](#frameworks)

You can find some packages that will provide you some integration between Visithor and them. Check these repositories in order to use specific features.

- [VisithorBundle for Symfony](http://github.com/visithor/VisithorBundle)

Tags
----

[](#tags)

- Use last unstable version ( alias of `dev-master` ) to stay in last commit
- Use last stable version tag to stay in a stable release.
- [![Latest Unstable Version](https://camo.githubusercontent.com/bf639ce4a8a497da946525a3ed4b90770cafbf9552fc35cb7a87d3d6a934adad/68747470733a2f2f706f7365722e707567782e6f72672f7669736974686f722f7669736974686f722f762f756e737461626c652e706e67)](https://packagist.org/packages/visithor/visithor)[![Latest Stable Version](https://camo.githubusercontent.com/0e177770f82bd37bbafc50511c2ff60ef769cf6a08baba3494573e838a4732c6/68747470733a2f2f706f7365722e707567782e6f72672f7669736974686f722f7669736974686f722f762f737461626c652e706e67)](https://packagist.org/packages/visithor/visithor)

Install
-------

[](#install)

Install Visithor in this way:

```
$ composer global require visithor/visithor=dev-master
```

If it is the first time you globally install a dependency then make sure you include `~/.composer/vendor/bin` in $PATH as shown [here](http://getcomposer.org/doc/03-cli.md#global).

### Always keep your Visithor installation up to date:

[](#always-keep-your-visithor-installation-up-to-date)

```
$ composer global update visithor/visithor
```

### .phar file

[](#phar-file)

You can also use already last built `.phar`.

```
$ git clone git@github.com:visithor/visithor.git
$ cd visithor
$ php build/visithor.phar
```

You can copy the `.phar` file as a global script

```
$ cp build/visithor.phar /usr/local/bin/visithor
```

### Compile

[](#compile)

Finally you can also compile your own version of the package. ( You need set `phar.readonly = Off` in your php.ini ).

```
$ git clone git@github.com:visithor/visithor.git
$ cd visithor
$ composer update
$ php bin/compile
$ sudo chmod +x build/visithor.phar
$ build/visithor.phar
```

You can copy the `.phar` file as a global script

```
$ cp build/visithor.phar /usr/local/bin/visithor
```

Config
------

[](#config)

Visithor uses the yml configuration format for your url definitions. This is the master document with all possible configurations.

```
defaults:
    #
    # This value can be a simple HTTP Code or an array of acceptable HTTP Codes
    # - 200
    # - [200, 301]
    #
    http_codes: [200, 302]
    options:
        verb: GET

urls:
    #
    # By default, is there is no specified HTTP Code, then default one is used
    # as the valid one
    #
    - http://google.es
    - http://elcodi.io

    #
    # There are some other formats available as well
    #
    - [http://shopery.com, 200]
    - [http://shopery.com, 200, {verb: POST}]
    - [http://shopery.com, [200, 302]]
```

Your config file can be named `visithor.yml` or `visithor.yml.dist`, being this last one the preferred one.

Options
-------

[](#options)

You can define a set of options per each url. Each option will be usable for the implementations on top of this library

```
urls:
    - [http://shopery.com, 200, {option1: value1, option2: value2}]
```

You can define these options as well in a global way using the default:options path

```
defaults:
    options:
        option3: value3
urls:
    - [http://shopery.com, 200, {option1: value1, option2: value2}]
```

In this example, Visithor will use the default options array as the base set of options for the url, and finally will merge with them the specific set of options defined in each url.

> Merge means that if an option is defined in both places, then the one specifically defined in the url will overwrite the one defined globally

Profiles
--------

[](#profiles)

You can group a set of options just creating profiles. A profile is a set of options to be used in a set of urls.

```
profiles:
    admin:
        option1: value1
        option2: value2
urls:
    - [http://shopery.com, 200, {profile: admin}]
    - [http://elcodi.io, 200, {profile: admin}]
```

In this example, Visithor will add all every option inside given profile and will append it in the url definition. So, last example is equivalent to this one

```
urls:
    - [http://shopery.com, 200, {option1: value1, option2: value2}]
    - [http://elcodi.io, 200, {option1: value1, option2: value2}]
```

You can assign by default a profile as well, adding it as a global option. Last example is equivalent to this one

```
defaults:
    options:
        profile: admin
profiles:
    admin:
        option1: value1
        option2: value2
urls:
    - [http://shopery.com, 200]
    - [http://elcodi.io, 200]
```

Verbs
-----

[](#verbs)

You can define the preferred verb in the default options block. This value will be used as the default verb in all your urls, but you can overwrite this value just adding the new verb in the specific url line,

```
defaults:
    options:
        verb: GET

urls:
    - [http://shopery.com, 200, {verb: POST}]
```

Command
-------

[](#command)

To execute the visithor you need to use a pre-built command called `visithor:go`.

```
visithor.phar visithor:go [--format|-f] [--config|-c]
```

Executing it you will receive this output (with last example) and `0` as the final result of the execution.

```
Visithor by Marc Morera and contributors.

Configuration read from /var/www/visithor/visithor

[200] http://google.es --  OK
[200] http://elcodi.io --  OK
[200] http://shopery.com --  OK
[200] http://shopery.com --  OK

Time: 1221 ms, Memory: 4Mb

```

### Dots

[](#dots)

You can use a non-explicit format called `dots` using the `--format|-f` option. This format is useful for non-debug environments like travis or similars.

```
visithor.phar visithor:go --format=dots
```

Executing it you will receive this output (with last example) and `0` as the final result of the execution.

```
Visithor by Marc Morera and contributors.

Configuration read from /var/www/visithor/visithor

....
Time: 1118 ms, Memory: 4Mb

```

### Config

[](#config-1)

You can choose where your visithor config is located with the `--config|-c`option.

```
visithor.phar visithor:go --config=/var/www/another/folder
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% 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

Every ~25 days

Recently: every ~49 days

Total

9

Last Release

3834d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.4

v0.2.0PHP ^5.4|^7.0

### Community

Maintainers

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

---

Top Contributors

[![mmoreram](https://avatars.githubusercontent.com/u/521409?v=4)](https://github.com/mmoreram "mmoreram (15 commits)")[![eljam](https://avatars.githubusercontent.com/u/121432?v=4)](https://github.com/eljam "eljam (1 commits)")[![jontorrado](https://avatars.githubusercontent.com/u/6916591?v=4)](https://github.com/jontorrado "jontorrado (1 commits)")

---

Tags

phpvisithor

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[wsdltophp/packagegenerator

Generate hierarchical PHP classes based on a WSDL

4351.9M19](/packages/wsdltophp-packagegenerator)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

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