-
Notifications
You must be signed in to change notification settings - Fork 0
/
46a27649.1324256c.js
1 lines (1 loc) · 29.5 KB
/
46a27649.1324256c.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{143:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return b})),n.d(t,"rightToc",(function(){return s})),n.d(t,"default",(function(){return u}));var a=n(2),r=n(6),o=(n(0),n(250)),i=n(257),l=n(258),c={id:"php",title:"PHP",hide_title:!0,sidebar_label:"PHP"},b={id:"Instalacao/php",isDocsHomePage:!1,title:"PHP",description:"PHP",source:"@site/docs\\Instalacao\\PHP.md",permalink:"/documentation/docs/Instalacao/php",sidebar_label:"PHP",sidebar:"someSidebar",previous:{title:"Introdu\xe7\xe3o",permalink:"/documentation/docs/Instalacao/introducao"},next:{title:"NodeJS",permalink:"/documentation/docs/Instalacao/node"}},s=[{value:"Installing via Packagist with Composer",id:"installing-via-packagist-with-composer",children:[]},{value:"Installing Latest Version via GitHub with Git",id:"installing-latest-version-via-github-with-git",children:[]},{value:"1. Requirements",id:"1-requirements",children:[]},{value:"2. Installing Composer on Windows",id:"2-installing-composer-on-windows",children:[{value:"Downloading dependencies",id:"downloading-dependencies",children:[]}]},{value:"3. Installing Composer on Linux",id:"3-installing-composer-on-linux",children:[{value:"File "composer.json"",id:"file-composerjson",children:[]},{value:"Summary:",id:"summary",children:[]}]},{value:"4. Installing Gerencianet's PHP library without Composer",id:"4-installing-gerencianets-php-library-without-composer",children:[]},{value:"5. Common errors (cURL error 60 or cURL error 77)",id:"5-common-errors-curl-error-60-or-curl-error-77",children:[]},{value:"6. Video: Installing Composer (Windows and Linux)",id:"6-video-installing-composer-windows-and-linux",children:[{value:"Installing Composer on Windows",id:"installing-composer-on-windows",children:[]},{value:"Installing Composer on Linux",id:"installing-composer-on-linux",children:[]}]},{value:"7. Extra: timeout option",id:"7-extra-timeout-option",children:[]}],p={rightToc:s};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h1",{className:"titulo"},"PHP"),Object(o.b)("div",{className:"subtitulo"},Object(o.b)("p",null,"In addition to our API being fully ",Object(o.b)("a",{href:"https://en.wikipedia.org/wiki/Representational_state_transfer"},"RESTful")," with ",Object(o.b)("a",{href:"https://www.json.org/json-en.html"},"JSON")," responses, we offer the convenience you need through our PHP SDK. It is already prepared to do your authentication automatically and has functions to generate your charges among many other features."),Object(o.b)("p",null,"Below, check out the procedures for installing the ",Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php",target:"_blank",title:"Link Externo"},"Gerencianet's SDK in PHP"),":"),Object(o.b)("br",null),Object(o.b)("h3",{id:"installing-via-packagist-with-composer"},"Installing via Packagist with Composer"),Object(o.b)(i.a,{defaultValue:"php4",values:[{label:"Branch 4.x",value:"php4"},{label:"Branch 3.x",value:"php3"},{label:"Branch 2.x",value:"php2"},{label:"Branch 1.x",value:"php1"}],mdxType:"Tabs"},Object(o.b)(l.a,{value:"php4",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php\n"))),Object(o.b)(l.a,{value:"php3",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:3.1.0\n"))),Object(o.b)(l.a,{value:"php2",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:2.4.1\n"))),Object(o.b)(l.a,{value:"php1",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:1.0.17\n")))),Object(o.b)("br",null),Object(o.b)("h3",{id:"installing-latest-version-via-github-with-git"},"Installing Latest Version via GitHub with Git"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{}),"git clone https://github.com/gerencianet/gn-api-sdk-php.git\ncd gn-api-sdk-php/\ncomposer install\n")),Object(o.b)("p",null,"It is important to note that the ",Object(o.b)("inlineCode",{parentName:"p"},"cURL"),", ",Object(o.b)("inlineCode",{parentName:"p"},"json"),", ",Object(o.b)("inlineCode",{parentName:"p"},"ext-simplexml")," & ",Object(o.b)("inlineCode",{parentName:"p"},"openssl")," extensions must be enabled."),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"caution")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"We currently make four versions of the SDK available. Version 1.x and 2.x is compatible with PHP versions higher than version 5.4 and lower than 7.0, also having some outdated components, such as Guzzle. If you have a PHP version higher than 5.5 and lower than 7.0, we suggest using version 3.x of our SDK. For PHP versions greater than or equal to 7.2, we suggest you install SDK version 4.x."))),Object(o.b)("br",null),Object(o.b)("br",null),Object(o.b)("h2",{id:"1-requirements"},"1. Requirements"),Object(o.b)("p",null,"The following requirements must be considered, depending on the branch used:"),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Vers\xe3o da SDK"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Status"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Pacote no Packagist"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Compatibilidade com PHP"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php/tree/1.x"},"1.x")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Sustained"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"gerencianet/gerencianet-sdk-php:1.0.17")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),">= 5.4 (not compatible with PHP 7.x)")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php/tree/2.x"},"2.x")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Sustained"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"gerencianet/gerencianet-sdk-php:2.4.1")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),">= 5.5 (not compatible with PHP 7.x)")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php/tree/3.x"},"3.x")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Sustained"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"gerencianet/gerencianet-sdk-php:3.1.0")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"> = 5.6 (not compatible with PHP 7.x e Guzzle <= 6.5.2)")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php"},"4.x")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Sustained"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"gerencianet/gerencianet-sdk-php")),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"> = 7.2")))),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"To use the library in PHP, we recommend installing it through ",Object(o.b)("a",{href:"https://getcomposer.org/",target:"_blank",title:"Link Externo"},"Composer")," (dependency manager)."),Object(o.b)("p",{parentName:"div"},"If you prefer to proceed without Composer, just follow the procedures described in the title ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#4-installing-gerencianets-php-library-without-composer"}),"4. Installing Gerencianet's PHP library without Composer"),"."))),Object(o.b)("br",null),Object(o.b)("br",null),Object(o.b)("h2",{id:"2-installing-composer-on-windows"},"2. Installing Composer on Windows"),Object(o.b)("p",null,"We will install Composer on Windows to download our libraries. If you prefer, you can follow the tutorial on Composer's official website on ",Object(o.b)("a",{href:"https://getcomposer.org/doc/00-intro.md#installation-windows",target:"_blank",title:"[link externo]"},"this link"),"."),Object(o.b)("p",null,"a) First, let's download the Composer installer for Windows from ",Object(o.b)("a",{href:"https://getcomposer.org/Composer-Setup.exe",target:"_blank",title:"[link externo]"},"this link")," and once the download is finished, run it;"),Object(o.b)("p",null,'b) You will need to provide your PHP installation path. If you are using a Wamp server, for example, and during installation you get a message related to the "openssl" file, you will need to inform your PHP ',Object(o.b)("inlineCode",{parentName:"p"},"*.exe")," file contained in the Wamp root directory (generally in ",Object(o.b)("inlineCode",{parentName:"p"},"\\wamp\\bin\\php\\ php.7.2\\"),"). It should be noted that the ",Object(o.b)("inlineCode",{parentName:"p"},"php.7.2")," folder refers to the PHP version that is being used in the preparation of these instructions, therefore, this directory may have another name, according to your PHP version;"),Object(o.b)("p",null,"c) During installation, after specifying your PHP directory, click on ",Object(o.b)("inlineCode",{parentName:"p"},"next"),'. The installation may return an alert message regarding the "openssl" configuration. This is a common message that means "openssl" is disabled, however, let\'s fix it quickly and easily.'),Object(o.b)("br",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},'If no message about "openssl" is returned, just proceed to the subheading ',Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#downloading-dependencies"}),"Downloading dependencies"),", located below."))),Object(o.b)("p",null,'To enable your "openssl", you will need to change the ',Object(o.b)("code",null,"php.ini"),"."),Object(o.b)("p",null,"a) Open your php installation directory and locate the file ",Object(o.b)("code",null,"php.ini"),";"),Object(o.b)("p",null,"b) Open the ",Object(o.b)("code",null,"php.ini")," file in a text editor (eg notepad++, sublime, etc) and press ",Object(o.b)("code",null,"CTRL + F")," and search for the word \u201copenssl\u201d (without the quotes);"),Object(o.b)("p",null,"c) The semicolon ( ; ) disables the ",Object(o.b)("code",null,"php_openssl.dll"),". Clear this sign and it will enable the file:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"It is like this: ",Object(o.b)("code",null,";extension=php_openssl.dll"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"It should look like this: ",Object(o.b)("code",null,"extension=php_openssl.dll")))),Object(o.b)("p",null,"Now save the document (press ",Object(o.b)("code",null,"CTRL + S"),") and close the file."),Object(o.b)("p",null,"d) The extension will be enabled and you will be able to continue with the installation. In order for the installation to update relative to the procedure, it is important that you return to a screen and then proceed with the installation normally."),Object(o.b)("br",null),Object(o.b)("h3",{id:"downloading-dependencies"},"Downloading dependencies"),Object(o.b)("p",null,"a) Create a folder called ",Object(o.b)("code",null,"composer")," in your Wamp directory, inside the ",Object(o.b)("code",null,"www")," folder, so that it has this structure: ",Object(o.b)("code",null,"\\wamp\\www\\composer")),Object(o.b)("p",null,"b) Now, let's install the dependencies. Open the Windows Command ",Object(o.b)("em",{parentName:"p"},"Prompt")," (cmd) and navigate to the root directory unde ",Object(o.b)("code",null,"\\wamp\\www\\composer")),Object(o.b)("p",null,"c) Let's run the dependency installation command (Gerencianet PHP SDK) inside that directory. To do this, run the command below:"),Object(o.b)(i.a,{defaultValue:"php4",values:[{label:"Branch 4.x",value:"php4"},{label:"Branch 3.x",value:"php3"},{label:"Branch 2.x",value:"php2"},{label:"Branch 1.x",value:"php1"}],mdxType:"Tabs"},Object(o.b)(l.a,{value:"php4",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php\n"))),Object(o.b)(l.a,{value:"php3",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:3.1.0\n"))),Object(o.b)(l.a,{value:"php2",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:2.4.1\n"))),Object(o.b)(l.a,{value:"php1",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"composer require gerencianet/gerencianet-sdk-php:1.0.17\n")))),Object(o.b)("p",null,"d) After running the command, all dependencies will be installed in your directory, including the ",Object(o.b)("code",null,"vendor")," folder with the ",Object(o.b)("code",null,"autoload.php")," file."),Object(o.b)("h2",{id:"3-installing-composer-on-linux"},"3. Installing Composer on Linux"),Object(o.b)("p",null,"You can install Composer in each project (local installation) or have access to it from any part of the system (global installation). If you prefer, you can follow the tutorial on Composer's official website on ",Object(o.b)("a",{href:"https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx",target:"_blank",title:"[link externo]"},"this link")," Here, we are going to perform the global installation. To do so, run the following command in Terminal:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"$ curl -sS https://getcomposer.org/installer | php\n$ sudo mv composer.phar /usr/local/bin/composer\n")),Object(o.b)("h3",{id:"file-composerjson"},'File "composer.json"'),Object(o.b)("p",null,"One of the main files to work with Composer is ",Object(o.b)("inlineCode",{parentName:"p"},"composer.json"),". This is where the instructions about the packages that will be used in the project are contained. This is a common ",Object(o.b)("inlineCode",{parentName:"p"},".json")," file that should be at the root of your project."),Object(o.b)("p",null,"The ",Object(o.b)("inlineCode",{parentName:"p"},"require")," directive in the ",Object(o.b)("inlineCode",{parentName:"p"},"composer.json")," file tells Composer which packages are needed by the project - in this case, the central repository is Packagist."),Object(o.b)("p",null,"Now, let's inform Composer that Gerencianet will be part of the dependency management by inserting the content below at the end of the ",Object(o.b)("inlineCode",{parentName:"p"},"composer.json")," file (which should be at the root of the project):"),Object(o.b)(i.a,{defaultValue:"php4",values:[{label:"Branch 4.x",value:"php4"},{label:"Branch 3.x",value:"php3"},{label:"Branch 2.x",value:"php2"},{label:"Branch 1.x",value:"php1"}],mdxType:"Tabs"},Object(o.b)(l.a,{value:"php4",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),'{"require": \n {\n "gerencianet/gerencianet-sdk-php": "^4.*"\n }\n}\n'))),Object(o.b)(l.a,{value:"php3",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),'{"require": \n {\n "gerencianet/gerencianet-sdk-php": "3.*"\n }\n}\n'))),Object(o.b)(l.a,{value:"php2",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),'{"require": \n {\n "gerencianet/gerencianet-sdk-php": "2.*"\n }\n}\n'))),Object(o.b)(l.a,{value:"php1",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),'{"require": \n {\n "gerencianet/gerencianet-sdk-php": "1.*"\n }\n}\n')))),Object(o.b)("p",null,"It's time to install the packages. Go to the directory where your project is in Terminal and run:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"$ composer install\n")),Object(o.b)("br",null),Object(o.b)("p",null,"And ready! Dependencies will download automatically, they will be stored in their respective folders and Composer will continue with the rest of the work by generating the ",Object(o.b)("code",null,"composer.lock")," file."),Object(o.b)("p",null,"It should be noted that, if you need, for example, to delete a package, just delete its reference from the ",Object(o.b)("code",null,"composer.json")," file and update Composer using the following command:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-php"}),"$ composer update\n")),Object(o.b)("br",null),Object(o.b)("p",null,"This way Composer will be updated and since the package is no longer present in the ",Object(o.b)("code",null,"require"),' directive, it will immediately be "uninstalled".'),Object(o.b)("h3",{id:"summary"},"Summary:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Install Compose;"),Object(o.b)("li",{parentName:"ul"},"Inform, in the ",Object(o.b)("inlineCode",{parentName:"li"},"composer.json")," file, the Gerencianet SDK that will be installed;;"),Object(o.b)("li",{parentName:"ul"},"Run the install command in the project directory: ",Object(o.b)("code",null,"$ composer install"),";"),Object(o.b)("li",{parentName:"ul"},"Ready!")),Object(o.b)("br",null),Object(o.b)("h2",{id:"4-installing-gerencianets-php-library-without-composer"},"4. Installing Gerencianet's PHP library without Composer"),Object(o.b)("p",null,"The use of Composer (dependency manager) is recommended, but not mandatory. If you are interested in proceeding without using it, you can directly download one of our ",Object(o.b)("em",null,"branches"),', unzip and upload the folder (including the "autoload.php" file) to your project directory.'),Object(o.b)("p",null,"We currently offer four ",Object(o.b)("em",null,"branches"),", entitled ",Object(o.b)("code",null,"master"),", ",Object(o.b)("code",null,"3.x"),", ",Object(o.b)("code",null,"2.x"),", and ",Object(o.b)("code",null,"1. x"),", being:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("code",null,"master"),": uses recent version of guzzle (^7.0.0) and is compatible with recent versions of PHP above 7.2. This is the default version when downloaded from Composer and is suitable for all projects. ",Object(o.b)("a",{href:"https://packagist.org/packages/gerencianet/gerencianet-sdk-php",target:"_blank",title:"Link Externo"},"Access the Packagist"),"."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("code",null,"3.x"),": uses up to guzzle version (6.0.0) and is compatible with PHP versions (5.5, 5.6, 7.x). ",Object(o.b)("a",{href:"https://packagist.org/packages/gerencianet/gerencianet-sdk-php#2.4.1",target:"_blank",title:"Link Externo"},"Access the Packagist"),"."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("code",null,"2.x"),": uses up to guzzle version (6.0.0) and is compatible with PHP versions (5.5, 5.6, 7.0 and 7.1). ",Object(o.b)("a",{href:"https://packagist.org/packages/gerencianet/gerencianet-sdk-php#3.1.0",target:"_blank",title:"Link Externo"},"Access the Packagist"),"."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("code",null,"1.x"),": previous version of the SDK, compatible with PHP 5.4 and 5.5 and uses guzzle 5.3.0. ",Object(o.b)("a",{href:"https://gerencianet.com.br/material/api/php/api_v1.zip",target:"_blank",title:"Link Externo"},"Download at this link"),".")),Object(o.b)("p",null,"The ",Object(o.b)("code",null,"master")," branch is the ",Object(o.b)("em",null,"default")," branch, however you can install the ",Object(o.b)("code",null,"1.x")," branch. Throughout this page you will find guidelines for both versions."),Object(o.b)("p",null,"It is important to reinforce that the content present in this .zip is just a requirement for you to start using Gerencianet's PHP SDK. This folder by itself is not a \"ready example\" of using the Gerencianet's API, but the Gerencianet's PHP SDK that allows the use of the API."),Object(o.b)("br",null),Object(o.b)("h2",{id:"5-common-errors-curl-error-60-or-curl-error-77"},"5. Common errors (cURL error 60 or cURL error 77)"),Object(o.b)("p",null,"The following errors are not from the Gerencianet's API, but related to your server components. Check below the most common errors during the installation of our API and see the solutions:"),Object(o.b)("a",{href:"https://gerencianet.com.br/artigo/curl-error-60-ou-curl-error-77-como-resolver/",target:"_blank",title:"Link Externo"},Object(o.b)("h2",null,"cURL error 60")),Object(o.b)("a",{href:"https://gerencianet.com.br/artigo/curl-error-60-ou-curl-error-77-como-resolver/",target:"_blank",title:"Link Externo"},Object(o.b)("h2",null,"cURL error 77")),Object(o.b)("br",null),Object(o.b)("h2",{id:"6-video-installing-composer-windows-and-linux"},"6. Video: Installing Composer (Windows and Linux)"),Object(o.b)("p",null,"Thinking about offering new ways of transmitting information, Gerencianet makes the following videos available in order to explain, in a clear and objective way, how to install Composer in the Windows and Linux operating system."),Object(o.b)("h3",{id:"installing-composer-on-windows"},"Installing Composer on Windows"),Object(o.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/bu9tUI3dHwI",frameborder:"0",allowfullscreen:!0}),Object(o.b)("br",null),Object(o.b)("br",null),Object(o.b)("h3",{id:"installing-composer-on-linux"},"Installing Composer on Linux"),Object(o.b)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/uQFhNJhbzdg",frameborder:"0",allowfullscreen:!0}),Object(o.b)("br",null),Object(o.b)("br",null),Object(o.b)("h2",{id:"7-extra-timeout-option"},"7. Extra: timeout option"),Object(o.b)("p",null,"This attribute is present in the PHP SDK and allows you to define in the Guzzle ",Object(o.b)("em",{parentName:"p"},"request")," how long you want the response to be returned. For details on how to use, see ",Object(o.b)("a",{href:"https://github.com/gerencianet/gn-api-sdk-php#getting-started",target:"_blank",title:"Link Externo"},"our Github repository"),".")))}u.isMDXComponent=!0},250:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),s=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=s(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),p=s(n),d=a,h=p["".concat(i,".").concat(d)]||p[d]||u[d]||o;return n?r.a.createElement(h,l(l({ref:t},b),{},{components:n})):r.a.createElement(h,l({ref:t},b))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var b=2;b<o;b++)i[b]=n[b];return r.a.createElement.apply(null,i)}return r.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},254:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}t.a=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r}},255:function(e,t,n){"use strict";var a=n(0);const r=Object(a.createContext)({tabGroupChoices:{},setTabGroupChoices:()=>{},isAnnouncementBarClosed:!1,closeAnnouncementBar:()=>{}});t.a=r},256:function(e,t,n){"use strict";var a=n(0),r=n(255);t.a=function(){return Object(a.useContext)(r.a)}},257:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(256),i=n(254),l=n(92),c=n.n(l);const b=37,s=39;t.a=function(e){const{block:t,children:n,defaultValue:l,values:p,groupId:u}=e,{tabGroupChoices:d,setTabGroupChoices:h}=Object(o.a)(),[m,j]=Object(a.useState)(l);if(null!=u){const e=d[u];null!=e&&e!==m&&p.some(t=>t.value===e)&&j(e)}const O=e=>{j(e),null!=u&&h(u,e)},g=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":t})},p.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:"0","aria-selected":m===e,className:Object(i.a)("tabs__item",c.a.tabItem,{"tabs__item--active":m===e}),key:e,ref:e=>g.push(e),onKeyDown:e=>((e,t,n)=>{switch(n.keyCode){case s:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case b:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(g,e.target,e),onFocus:()=>O(e),onClick:()=>O(e)},t))),r.a.createElement("div",{role:"tabpanel",className:"margin-vert--md"},a.Children.toArray(n).filter(e=>e.props.value===m)[0]))}},258:function(e,t,n){"use strict";var a=n(0),r=n.n(a);t.a=function(e){return r.a.createElement("div",null,e.children)}}}]);