Skip to content

Commit

Permalink
Added install script and updated Composer
Browse files Browse the repository at this point in the history
  • Loading branch information
cedwardsmedia committed May 23, 2017
1 parent 46d5a8f commit d56fa29
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 53 deletions.
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
# CNAM-CLI v2.0.0
# CNAM-CLI v2.0.1

[![Source](https://img.shields.io/badge/source-cedwardsmedia/cnam--cli-blue.svg?style=flat-square "Source")](https://www.github.com/cedwardsmedia/cnam-cli)
![Version](https://img.shields.io/badge/version-2.0.0-brightgreen.svg?style=flat-square)
![Version](https://img.shields.io/badge/version-2.0.1-brightgreen.svg?style=flat-square)
[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat-square "License")](./LICENSE)
[![Gratipay](https://img.shields.io/gratipay/cedwardsmedia.svg?style=flat-square "License")](https://gratipay.com/~cedwardsmedia/)

_CNAM-CLI_ is a command-line client for [EveryoneAPI](https://www.everyoneapi.com/) written in PHP. In order to use CNAM, you must have an [EveryoneAPI account](https://www.everyoneapi.com/sign-up) with [available funds](https://www.everyoneapi.com/pricing).

## Installation

1. Clone the repo.
2. Run `php composer.phar install`
3. Ensure cnam.php is executable by running `chmod +x /path/to/cnam.php`.
4. Run `cnam setup` to set your EveryoneAPI credentials
1. Download and unpack the [latest release](https://github.com/cedwardsmedia/cnam-cli/releases).
2. Run `install.sh` as root or use `sudo`
3. Run `cnam setup` to set your EveryoneAPI credentials

To perform a lookup of a phone number: `php /path/to/cnam.php [phonenumber] [--name]`

**Note:** for easier usage, you may wish to create a symlink to cnam.php. To do this, simply execute `sudo ln -s /path/to/cnam.php /usr/local/cnam`. Now, you can execute cnam by simply running `cnam [phone number]` without including the path to cnam.php.
To perform a lookup of a phone number: `cnam [phonenumber] [--data-point]`

### Data Point Flags

Expand All @@ -37,10 +34,7 @@ Providing one or more data point flags will cause CNAM to return ONLY the select
- Use the `--linetype` flag to query for the *linetype* data point.

## Manual Page
__CNAM-CLI__ comes with a UNIX man page located in `./share/man/man1`. You can view the man page using the `man` command or any graphical man page viewer.

## Web-based client
The web-based client has been split off into a [separate project](https://github.com/cedwardsmedia/webcnam).
__CNAM-CLI__ comes with a UNIX man page `cnam`. You can view the man page using the `man` command or any graphical man page viewer.

## Contributing

Expand All @@ -61,3 +55,4 @@ _CNAM-CLI_ is licensed under the **MIT License**. See LICENSE for more.

---
**Disclaimer**: _CNAM-CLI_ is not endorsed by, sponsored by, or otherwise associated with [OpenCNAM](http://www.opencnam.com), [EveryoneAPI](http://www.everyoneapi.com), or [Telo USA, Inc](http://www.telo.com).

10 changes: 10 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/usr/bin/php src/composer.phar self-update
/usr/bin/php src/composer.phar install -d src
echo "Installing CNAM"
mkdir /usr/local/share/cnam-cli/
cp -R . /usr/local/share/cnam-cli/
chmod +x /usr/local/share/cnam-cli/cnam.php
ln -s /usr/local/share/cnam-cli/cnam.php /usr/local/bin/cnam
cp share/man/man1/cnam.1 /usr/share/man/man1/cnam.1
echo "Installation Complete"
echo "Run 'cnam setup' to set your EveryoneAPI credentials"
2 changes: 1 addition & 1 deletion src/cnam.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// Define our constants
define('APPNAME', 'CNAM');
define('VERSION', '2.0.0');
define('VERSION', '2.0.1');
define('APIVersion', '1');
define('DEVGITHUB', 'https://www.github.com/cedwardsmedia/cnam');
define('DEVELOPER', 'Corey Edwards');
Expand Down
85 changes: 46 additions & 39 deletions src/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/composer.phar
Binary file not shown.
5 changes: 5 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "Removing CNAM"
rm -rf /usr/local/share/cnam-cli/
rm /usr/local/bin/cnam
rm /usr/share/man/man1/cnam.1
echo "CNAM uninstalled."

0 comments on commit d56fa29

Please sign in to comment.