#StackBounty: #magento-1.9 #php #api #sales-order Magento 1.9 API Performance – Retrieving All Sales Order Info

Bounty: 50

I’m creating a page that shows order sales data such as sales revenue, total quantity of orders and also best sellers which consist of products from all sales orders.

The problem is that this takes 20 minutes to run for a database with only 1200 orders. I’m certain this is because an API call needs to be made for each order separately to retrieve the item information:

$orderDetails[] = array($client->salesOrderInfo($sessionId, $orderNumbers[$d]));

Here’s an example of my code:

    // API Connection.
    $client = new SoapClient('htps://www.mysite.com/api/v2_soap/?wsdl');
    $sessionId = $client->login('API Username', 'API Password');

    // Filter orders for this year only.
    $filter = array('complex_filter' => array(
           array('key' => 'created_at', 'value' => array('key' => 'gt', 'value' => $currentYear . '2017-01-01 00:00:00'))
       )
    );

    // Call the API and retrieve the orders.
    $orders = $client->salesOrderList($sessionId, $filter);

    // Loop through orders and store order numbers against the $orderNumbers array.
    $orderNumbers = array();
    for ($i = 0; $i < count($orders); $i++) {
        $orderNumbers[] = $orders[$i]->increment_id;
    }

   // Loop through order numbers and store the order details against the $orderDetails array (this seems to be the problem area).
   $orderDetails = array();
   for ($d = 0; $d < count($orderNumbers); $d++) {
      $orderDetails[] = array($client->salesOrderInfo($sessionId, $orderNumbers[$d]));
   }

Is there a way of improving my script so that it performs much better? I cannot find a way of retrieving sales order info for more than one order at a time.

Thanks so much for any help.


Get this bounty!!!

#StackBounty: #php #mongodb #osx #laravel-5.3 dyld: lazy symbol binding failed: Symbol not found: _clock_gettime – in mongodb laravel

Bounty: 50

I am using Laravel 5.4 version to implement mongodb CRUD operation using link. I am using Mac OS El Captain 10.11. I have installed mongodb.so extension with php version 7.1.16

While i am trying getting eloquent connection it throws me ERR_EMPTY_RESPONSE

I have digg in details an found following error log in Apache during restart the MAMP server

 Mon Aug 28 10:22:14 2017] [notice] Graceful restart requested, doing restart
[Mon Aug 28 10:22:15 2017] [notice] Digest: generating secret for digest authentication ...
[Mon Aug 28 10:22:15 2017] [notice] Digest: done
[Mon Aug 28 10:22:15 2017] [notice] Apache/2.2.31 (Unix) mod_wsgi/3.5 
 Python/2.7.13 PHP/7.1.1 mod_ssl/2.2.31 OpenSSL/1.0.2j DAV/2 
mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.24.0 configured -- resuming normal operations
[Mon Aug 28 10:22:15 2017] [notice] FastCGI: process manager initialized (pid 4233)
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: 
/Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
Referenced from: 
/Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
Expected in: /usr/lib/libSystem.B.dylib

dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: 
 /Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
 Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
Referenced from: 
/Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/mongodb.so
 Expected in: /usr/lib/libSystem.B.dylib

This screenshot shows the details of mongodb extension
enter image description here
I have searched online for error dyld: lazy symbol binding failed: Symbol not found: _clock_gettime and found this answer. I have applied all steps which i mentioned, but unable to fix the issue.

Please someone help me to get rid of this.


Get this bounty!!!

#StackBounty: #php #php7 #source-packages #id3 Install id3_tag in PHP Ubuntu

Bounty: 50

How can I Install and configure id3_tag package installed from PECL? I already have the package but I don’t know how to configure it and where to put it in the file system.


Get this bounty!!!

#StackBounty: #php #pdf #github #drawing Drawing in pdf file

Bounty: 50

I want to drawing in pdf file. Example. open pdf file and such drawing tools like circle, square , text etc using this tools draw shape on the pdf file.

I was searched on google and find such option like pdf.js. but it’s not implement in core php or normal MVC structure. it’s implement in js.

Any Alternative for pdf.js. to draw the shape in pdf file.

I found same as below example link pls. show below link video.

http://tech.chitgoks.com/2016/03/06/annotationeer-my-web-application-that-can-create-annotations-in-pdf-js/

Any response will be appreciated.

Thank you


Get this bounty!!!

#StackBounty: #php #cloud #google-cloud-storage #google-api-php-client Signing URLs with JWT for Google Cloud Storage using PHP

Bounty: 50

I’ve just started to upgrade my Google Cloud Storage code from API version 1.0 to version 2.0 and I’m having some troubles.

With version 1.0 I used Signed URLs with great success, using .p12 files. However that’s deprecated in the new version and I have to use Firebase/php-jwt instead, using JSON files.

The problem is that it’s just not working, I get the error:

<?xml version='1.0' encoding='UTF-8'?><Error><Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message>
<StringToSign>PUT

image/png
1483626991
/myBucket/folder/test.PNG</StringToSign></Error>

This is the simplified code used to sign it.

$string = ($method . "n" .
          $contentMd5 . "n" .
          $contentType . "n" .
          $expiration . "n" .
          $file);

$signedURL = base64_encode(FirebaseJWTJWT::encode($string,
        file_get_contents($credentialsFilePath)));

After the signedURL is received I build an URL with the correct data. The only part I’ve changed from 1.0 and 2.0 is the part where you sign the URL. Furthermore I’ve checked that the string in “StringToSign”-field of the response is exactly the same as the one I’m signing.

In version 1.0 I signed the URL like this:

$signedURL = base64_encode((new Google_Signer_P12(
        file_get_contents($p12FilePath),
        'notasecret'
      ))->sign($string));

All of this leads me to believe that I’m singing the correct contents but using the JWT function the wrong way. Has anyone else done this? How did yo do it?

In case it’s interesting this is the URL I build (works with 1.0):

$returnArr['url'] = "https://{$bucket}.commondatastorage.googleapis.com/"
    . $prefix . '/' . rawurlencode($file)
    . "?GoogleAccessId=" . rawurlencode($serviceEmail)
    . "&Expires={$expiration}"
    . "&Signature=" . rawurlencode($signature);


Get this bounty!!!

#StackBounty: #php #codeigniter #mysqli #transactions Codeigniter returning code 0 db errors without message

Bounty: 100

I have a query that is supposed to return an error message like this:

Error Number: 1451    
Cannot delete or update a parent row: a foreign key constraint fails (`sservice_dev_mercury`.`agent_accounts`, CONSTRAINT `agent_role_fk` FOREIGN KEY (`role`) REFERENCES `roles` (`id`))    
DELETE FROM `roles` WHERE `id` = '3'

This is when db_debug is true. When I turned it false and used

$error = $this->db->error();
return $error;

I get error 0 with an empty message. Is there something I am missing when trying to get the errors? This is the query:

public function delete($id){
     $this->db->trans_begin();
     $this->db->where('id',$id);
     $this->db->delete($this->table);
     $this->db->trans_complete();
     if($this->db->trans_status()===false){
        $this->db->trans_rollback();
        $error = $this->db->error();
        return $error;
     }else{
        $this->db->trans_commit();
        return true;
     }
}

Can someone take a look and see if something went wrong?


Get this bounty!!!

#StackBounty: #php #translation #gettext how to translate using gettext on xampp server on OS X El Capitan version 10.11.6

Bounty: 50

I am working on a website that is using gettext for translation. The website is translating properly on servers of other machines but not on mine (OS X El Capitan version 10.11.6).
I have follow the following tutorial to install gettext on mac:

link to the tutorial I followed

After the installation, gettext is not still working.
Can someone help me here??


Get this bounty!!!

#StackBounty: #php #wordpress #woocommerce How to show different sizes on select of particular PRODUCT in Woocommerce

Bounty: 50

In Woocommerce, Single product page I have used the 2 different sizes, one for top and other for pant. If the user wants to select pant only pant size select box will show and if the user selects the top size only top size will show and if the user wants to buy the full product both pant and top size will show. Select item has 3 options: Pant, Top, Full.

https://drive.google.com/open?id=17_lJZ1dMnITvW3gQY1ZLNigzZcVMrWDvUA


Get this bounty!!!

#StackBounty: #php #apache #http-status-code-403 #fpm Random 403 errors with apache+php-fpm

Bounty: 100

On a server of mine, running Ubuntu 14.04.5 with Apache 2.4.23 and php-fpm 7.0.11, I’m getting random 403 errors.

I say “random” because the page I see in logs with 403 are running fine when I try them. Also, I experienced directly (I mean by visiting a site on the server with my browser) that I got a 403 error, then retried (just refreshing) and I got a 200.

The server is running some websites (about a dozen), with various kind of solutions (a couple of WordPress, a few old spaghetti php apps, mostly modern apps based on Symfony framework).

I’d also be happy if someone can point me to some way to increase the verbosity of some logs, to try resolving this issue on myself. Currently I see the 403 errors in the apache logs of vhosts.


Get this bounty!!!

#StackBounty: #php #iis #log-files Having PHP Error Log in IIS Log – One for each site

Bounty: 50

I am currently trying to do as I was doing in apache: setting a different PHP Error Log for every application. I read a few tutorial so far and none seems to explain exactly what I want and I cannot believe IIS administrator are not using it since it is a basic and very useful feature.

First of all, I did set these specification in my php.ini file:

log_errors = On
error_log = syslog
error_reporting = E_ALL

Then, in IIS, in the «Logs» option of my Website, I selected the W3C Format, selected the option «One file per site», select «LOG File and ETW Events» and set the task to create a new file every day. I created a bug (by purpose) on my website (causing a 500 error) but it doesn’t seem to keep it in the log. I can see in the log that a user went on the page and had an error 500, but the error is not reported…

Is this even possible using IIS? If so, how?

PS: I do not care to have a separate log for every website containing only the PHP Error(s), or every error linked in one site (that wouldn’t bother me either).

PPS: I know error_log could be a path to one file, but I’d really want each site to have their individual error log…

Thank you, a lot and have a good day.


Get this bounty!!!