Skip to content
PHP port of CowSay because, oh, hell, I don't know why...
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
src
tests
.gitignore
.travis.yml
LICENSE.txt
Makefile
README.md
composer.json
demo.php

README.md

PHP CowSay

Release Version Packagist Version Build Status Moo, Cow

An extensible PHP port of the Linux Cowsay utility. This library is not designed for command line use. You should install the original Cowsay for that.

Requirements

  • PHP 5.4+

Install

$ composer require Gipetto/CowSay

Quickstart

$bessie = new Cow('Hello, Farm!');
echo $bessie;

Displays:

  ------------
< Hello, Farm! >
  ------------
          \   ^__^
           \  (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||

Run php demo.php to see all the included cows and their traits.

Traits

Cows support a few traits. You can specify the Eyes, Tongue, Udder and, yes, you can specify Poop.

$bessie = new Cow('Hello, Farm!');
$bessie->setEyes('oO')
    ->setTongue('U')
    ->setPoop('@@@')
    ->setUdder('W');
echo $bessie;

Displays:

  ------------
< Hello, Farm! >
  ------------
          \   ^__^
           \  (oO)\_______
              (__)\       )\/\
               U  ||----W |
                  ||     || @@@

Adding new Carcases

CowSay is easily extended to add new carcases for your custom needs. See the Carcasses tutorial for more information.

License

CowSay is licenced under The MIT License (MIT).

You can’t perform that action at this time.