Consolibyte Quickbooks use of an unknown class - php

I use quickbooks-php. If I want to get a Quickbooks tax rate (not in the online US account). I'm looking for error
QuickBooks_Loader::load(): Failed opening required '/var/www/project/addons/quickbooks/vendor/consolibyte/quickbooks/QuickBooks/IPP/Object/EffectiveTaxRate.php'
I use 3.2 version in composer
"consolibyte/quickbooks": "3.2",
As I understand this file there are only in dev version.
When I switch to the development version everything is fine.
In 3.3 version the same error.
Waiting for reply. Thank you.
Code what i use
$service = new QuickBooks_IPP_Service_TaxCode();
return $service->query(self::getQB()->getContext(), self::getQB()->getRealm(), "SELECT * FROM TaxCode");
When I added it file (from dev version EffectiveTaxRate.php) to the vendor/consolibyte/quickbooks/QuickBooks/IPP/Object/, all is well but it is not a solution to the problem, after the composer update the problem will come back.

You noted the solution in your post:
As I understand this file there are only in dev version. When I switch to the development version everything is fine.
Use the development version until a new release is made which contains the file you need.

Related

Problem with configuration of LiveQuery in Parseplatform

Hello i have installed Parse server and parse sdk for php on my Linux Centos Server.
Parse Dashboard: 1.3.3,
Server version: 4.3.0
I'm managing those db's using php code. This parser was installed by someone else. The thing is I'm not sure how to install LiveQuery for my server. I don't know if my version of server is good for this kind of operations. I found some solutions how to enable this feature, but there was something like "index.js" - in my file system it's app.js. Screen of file system
In app.js i added lines:
liveQuery: {
classNames: ["Test"] //List of classes to support for query subscritions
}
I've created class in my db named "Test", then i found solution i need to add
this line
liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
I don't really know how to get this key.
How can i check if LiveQuery works? It will be used by flutter code, but i'd like to check it first in PHP.
My problem has been solved in my other extended topic here.

How to fix "Invalid header value: must be a string or array of strings" in Laravel

I have an issue on a prod server that I don't have in local. Laravel send me an error which says that there is a header issue. I think this is an Apache issue.
I work on my local machine with Mamp. Laravel is using OAuth with Laravel Passport. I've tried on my local machine and it's working. I'm running on a Apache server too.
On my production server, as soon as I want to login on my application, I have this error :
ERROR 500 : InvalidArgumentException, Invalid header value: must be a
string or array of strings; cannot be an empty array.
And it's in MessageTrait.php line 389 from Laravel Zendframwork vendor.
Maybe it's just a module on the server ?
Thanks
I was having the same problem, my solution was to downgrade the next packages to that specific version because that was the version that was working in my project:
composer require symfony/http-kernel:3.4.20
composer require symfony/http-foundation:3.4.20
composer require symfony/psr-http-message-bridge:1.1.0
I hope it works for you.

PHP code working locally but not on Azure

I've implemented a mail delivery service using SparkPost for a website. The code looks like this:
require '/vendor/autoload.php';
use SparkPost\SparkPost; use GuzzleHttp\Client;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;
$httpAdapter = new Guzzle6HttpAdapter(new Client());
$sparky = new SparkPost($httpAdapter, ['key'=>'...']);
[...]
[...]
$results = $sparky->transmission->send($mailarray);
It works just fine locally on WampServer, however when I deploy it to Azure it does not. I don't have access to Azure logs, but I managed to narrow down the problem to one line:
$sparky = new SparkPost($httpAdapter, ['key'=>'...']);
I simply get a 500 error without any other explanation. The weird thing is when I wrap it around a try/catch, I still don't get anything other than a blank screen and a 500 on the console. I suspect it has to do something with /autoload.php not being able to load something.
Any thoughts?
According the requirement of SparkPost lib on Github repo at https://github.com/SparkPost/php-sparkpost/blob/master/composer.json#L18, it need PHP version higher than 5.5. So you can modify the PHP version of your Azure Web Apps, please refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-version for detail steps.

CakePHP 3.0 not running on other machines

I've developed a small project on a machine, using CakePHP 3.0, and I need it to run on another machine. I've tried to install it on several other machines.
If I run the composer to install the CakePHP 3.0, then I copy my stuff to overwrite it, the project works. I've tried this on two machines and had no problem so far. If I don't run the composer, and just copy the stuff to the target machine, it gives me the following error. I've tried this on 3 machines, and every machine gives me this:
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
Fatal error: Class 'Locale' not found in /home/u113681897/public_html/vendor/cakephp/cakephp/src/I18n/I18n.php on line 229
I've copied the whole project to this server to test.
I told you this because I thought it has something to do with my problem. The point is that I have to run this on a machine that is not mine, and I can't install composer on it. The /public_html/vendor/cakephp/cakephp/src/I18n/ has files related to internationalization and localization, but my project will never be translated, so a workaround to make the project ignore those files would be enough to solve my problem.
The following code is an excerpt from the (...)/I18n/I18n.php that might be relevant:
<?php
namespace Cake\I18n;
use Aura\Intl\FormatterLocator;
use Aura\Intl\PackageLocator;
use Aura\Intl\TranslatorFactory;
use Cake\I18n\Formatter\IcuFormatter;
use Cake\I18n\Formatter\SprintfFormatter;
use Locale;
class I18n {
// lots of code here
public static function defaultLocale() {
if (static::$_defaultLocale === null) {
static::$_defaultLocale = Locale::getDefault() ?: 'en_US';
// the line above is the Line 229
}
return static::$_defaultLocale;
}
// many code here too
}
I've checked that another file also tries to access this Locale class, but I don't know if there are other files trying to access it as well. Many files from everywhere inside the project tries to access methods from I18n.php. I need it running but I can't figure out how to make it run.
Any help will be greatly appreciated.
As I just found out, prior to CakePHP 3.0, the installation must be done by composer, as stated in the 3.0 migration guide:
CakePHP should be installed with Composer
Since CakePHP can no longer easily be installed via PEAR, or in a shared
directory, those options are no longer supported. Instead you should use
Composer to install CakePHP into your application.
So it won't run on regular free web hosting services.

Unable to query RoleEnvironment with Windows Azure SDK for PHP

I have an issue with obtaining data from Windows Azure's runtime using the newest (at the time of writing) PHP SDK from Github. Here is a test I am running on one of our hosted services:
<?php
include 'WindowsAzure/WindowsAzure.php';
use \WindowsAzure\ServiceRuntime\RoleEnvironment;
use \WindowsAzure\ServiceRuntime\Internal\RoleEnvironmentNotAvailableException;
try {
echo RoleEnvironment::getDeploymentId();
}
catch (RoleEnvironmentNotAvailableException $Exception) {
die('Failed to find deployment id');
}
RoleEnvironmentNotAvailableException is always thrown. Looking at the source, it seems to try sending commands through a named pipe (\.\pipe\WindowsAzureRuntime). Do I need to specify something within my ServiceConfiguration.csdef/cscfg in order to have access to this named pipe?
Any advice would be most welcome!
Got confirmation from MS EMEA Developer Support that current SDK does not support this function. They suggested similar workaround to jonnu above - use the previous SDK's functionality for role environment / configuration settings.
The ServiceRuntime APIs run only on Cloud so if this code snippet runs on local machine it'll throw an exception as you've pointed out. Further, if you want to debug your ServiceRuntime code you've to deploy your service to WA then use remote desktop connection to access the cloud machine and debug your code.

Categories