Skip to content

Latest commit

 

History

History
83 lines (40 loc) · 4.06 KB

windows-installation-2.md

File metadata and controls

83 lines (40 loc) · 4.06 KB

Steps to install Pepipost PHP Code Library on Windows/Linux with IDE

Installing SDK on windows Server with Integrated Development Enviroment(IDE)

These steps are dedicated to those who ❤️ to code on IDE.

Optional Note: This library will be sending HTTP calls to Pepipost server and hence if you're running any firewalls on your machine, then please whitelist the API base URL api.pepipost.com with port 443/80

Installation Steps

  1. Please Follow first 3 Steps of installation same as Windows without IDE

  2. Install any IDE you Love to work with.

    we will be using PHPstorm which is easily available on https://www.jetbrains.com/phpstorm/download/

  3. The following section explains how to use the PepipostAPI library in a new project.

    3.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

    Click on Open in PhpStorm to browse to your generated SDK directory and then click OK.

    Open project in PHPStorm - Step 2

3.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

Name the directory as "test"

Add a new project in PHPStorm - Step 2

Add a PHP file to this project

Add a new project in PHPStorm - Step 3

Name it "testSDK"

Add a new project in PHPStorm - Step 4

Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes.

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

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.

3.3. Run the Test Project: To run your project you must set the Interpreter for your project. Interpreter is the PHP engine installed on your computer.

Open Settings from File menu. Run Test Project - Step 1

Select PHP from within Languages & Frameworks

Run Test Project - Step 2

Browse for Interpreters near the Interpreter option and choose your interpreter.

Run Test Project - Step 3

Once the interpreter is selected, click OK

Run Test Project - Step 4

Copy/Paste sample example from simpleUsage.md to the testSDK.php file and Save.

To run your project, right click on your PHP file inside your Test project and click on Run

Run Test Project - Step 5