-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added feature flags * added circle config
- Loading branch information
Showing
12 changed files
with
2,317 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# PHP CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-php/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/php:7.1-node-browsers | ||
|
||
steps: | ||
- checkout | ||
|
||
- run: sudo apt update | ||
- run: sudo docker-php-ext-install zip | ||
|
||
- restore_cache: | ||
keys: | ||
# "composer.lock" can be used if it is committed to the repo | ||
- v1-dependencies-{{ checksum "composer.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
- run: composer install -n --prefer-dist | ||
|
||
- save_cache: | ||
key: v1-dependencies-{{ checksum "composer.json" }} | ||
paths: | ||
- ./vendor | ||
- restore_cache: | ||
keys: | ||
- node-v1-{{ checksum "package.json" }} | ||
- node-v1- | ||
- run: yarn install | ||
- save_cache: | ||
key: node-v1-{{ checksum "package.json" }} | ||
paths: | ||
- node_modules | ||
|
||
# prepare the database | ||
- run: touch storage/testing.sqlite | ||
- run: php artisan migrate --env=testing --database=sqlite_testing --force | ||
|
||
- run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php test/test.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,7 @@ | |
|
||
# Embedded web-server pid file | ||
/.web-server-pid | ||
|
||
# vendor files | ||
vendor/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
## Getting Started | ||
|
||
The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the ```composer.json``` file that comes with the SDK. | ||
To resolve these dependencies, we use the Composer package manager which requires PHP greater than 5.3.2 installed in your system. | ||
Visit [https://getcomposer.org/download/](https://getcomposer.org/download/) to download the installer file for Composer and run it in your system. | ||
Open command prompt and type ```composer --version```. This should display the current version of the Composer installed if the installation was successful. | ||
|
||
* Using command line, navigate to the directory containing the generated files (including ```composer.json```) for the SDK. | ||
* Run the command ```composer install```. This should install all the required dependencies and create the ```vendor``` directory in your project directory. | ||
|
||
![Building SDK - Step 1](https://apidocs.io/illustration/php?step=installDependencies&workspaceFolder=Taplytics-PHP) | ||
|
||
### [For Windows Users Only] Configuring CURL Certificate Path in php.ini | ||
|
||
CURL used to include a list of accepted CAs, but no longer bundles ANY CA certs. So by default it will reject all SSL certificates as unverifiable. You will have to get your CA's cert and point curl at it. The steps are as follows: | ||
|
||
1. Download the certificate bundle (.pem file) from [https://curl.haxx.se/docs/caextract.html](https://curl.haxx.se/docs/caextract.html) on to your system. | ||
2. Add curl.cainfo = "PATH_TO/cacert.pem" to your php.ini file located in your php installation. “PATH_TO” must be an absolute path containing the .pem file. | ||
|
||
```ini | ||
[curl] | ||
; A default value for the CURLOPT_CAINFO option. This is required to be an | ||
; absolute path. | ||
;curl.cainfo = | ||
``` | ||
|
||
## How to Use | ||
|
||
The following section explains how to use the Taplytics library in a new project. | ||
|
||
### 1. Open Project in an IDE | ||
|
||
Open an IDE for PHP like PhpStorm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE. | ||
|
||
![Open project in PHPStorm - Step 1](https://apidocs.io/illustration/php?step=openIDE&workspaceFolder=Taplytics-PHP) | ||
|
||
Click on ```Open``` in PhpStorm to browse to your generated SDK directory and then click ```OK```. | ||
|
||
![Open project in PHPStorm - Step 2](https://apidocs.io/illustration/php?step=openProject0&workspaceFolder=Taplytics-PHP) | ||
|
||
### 2. Add a new Test Project | ||
|
||
Create a new directory by right clicking on the solution name as shown below: | ||
|
||
![Add a new project in PHPStorm - Step 1](https://apidocs.io/illustration/php?step=createDirectory&workspaceFolder=Taplytics-PHP) | ||
|
||
Name the directory as "test" | ||
|
||
![Add a new project in PHPStorm - Step 2](https://apidocs.io/illustration/php?step=nameDirectory&workspaceFolder=Taplytics-PHP) | ||
|
||
Add a PHP file to this project | ||
|
||
![Add a new project in PHPStorm - Step 3](https://apidocs.io/illustration/php?step=createFile&workspaceFolder=Taplytics-PHP) | ||
|
||
Name it "testSDK" | ||
|
||
![Add a new project in PHPStorm - Step 4](https://apidocs.io/illustration/php?step=nameFile&workspaceFolder=Taplytics-PHP) | ||
|
||
Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes. | ||
|
||
```PHP | ||
require_once "../vendor/autoload.php"; | ||
``` | ||
|
||
It is important that the path inside require_once correctly points to the file ```autoload.php``` inside the vendor directory created during dependency installations. | ||
|
||
![Add a new project in PHPStorm - Step 4](https://apidocs.io/illustration/php?step=projectFiles&workspaceFolder=Taplytics-PHP) | ||
|
||
After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and using controller methods is given in the subsequent sections. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.