Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Adding a configurable timeout to PHP Toolkit
Here is a suggested patch to add configurable timeouts to the PHP Toolkit. It would be great to include it in the library.
[CODE]diff PHPToolkit/NSPHPClient.php PHPToolkit new/NSPHPClient.php
182c182
< global $nsaccount, $nsemail, $nsrole, $nspassword;
---
> global $nsaccount, $nsemail, $nsrole, $nspassword, $nstimeout;
215c215,217
< $options['connection_timeout'] = 5;
---
> if (!isset($options['connection_timeout'])) {
> $options['connection_timeout'] = isset($nstimeout) ? $nstimeout : 5;
> }
diff PHPToolkit/NSconfig.php PHPToolkit new/NSconfig.php
8a9
> $nstimeout = 5;[/CODE]
[CODE]diff PHPToolkit/NSPHPClient.php PHPToolkit new/NSPHPClient.php
182c182
< global $nsaccount, $nsemail, $nsrole, $nspassword;
---
> global $nsaccount, $nsemail, $nsrole, $nspassword, $nstimeout;
215c215,217
< $options['connection_timeout'] = 5;
---
> if (!isset($options['connection_timeout'])) {
> $options['connection_timeout'] = isset($nstimeout) ? $nstimeout : 5;
> }
diff PHPToolkit/NSconfig.php PHPToolkit new/NSconfig.php
8a9
> $nstimeout = 5;[/CODE]
0