2016-02-26 51 views
0

我正在編寫一個API,我需要從webhook(Shopify)獲取一些數據。從webservice獲取任何內容

昨天它正在工作,但它突然停止,即使我的.htaccess文件看起來與我正在處理的另一個副本相同。

http://mywebsite/API-NEW/insertOrder.service

下面是從.htaccess某些片斷:

## default index file 

    DirectoryIndex index.php 

## rewrite everything else to API.php 

    RewriteCond %{REQUEST_URI} /([^/]+)(?:/API-NEW) 
    RewriteRule ([a-zA-Z0-9_-]*)\.(service|test)$ index.php?action=$1&debug=$2&shop=%1&%{QUERY_STRING} [nc,qsa,L] 

這裏是我的index.php

爲網絡掛接是針對

<?php 

require_once 'configs.php'; 
require_once 'helpers/helpers.php'; 
require_once 'helpers/io_helpers.php'; 

$date = date(DATE_RFC2822); 

file_put_contents('debug/debug_info.txt', 'Request started', FILE_APPEND); 

if (in_array($_GET['action'],array('insertOrder','updateOrder'))){ 
    writeToDebug($date . " --> New: " . $_GET['action']); 

    getRequest(); 
} 

它不寫什麼debug/debug_info.txt所以我有點失去我的心。

請幫忙嗎?

+0

你檢查文件夾/文件的權限?看看錯誤報告是否有任何東西出來http://php.net/manual/en/function.error-reporting.php並檢查你的日誌。另外,你如何執行'getRequest()'和'writeToDebug()'函數? –

+0

*「Webhook的地址爲:http:// Mywebsite」* - 您的意思是'http:// Mywebsite' *正確?* –

+0

它沒有達到那個部分..我檢查它是否工作,如果它打印調試文件的東西,但它不是 – Onilol

回答

0

顯然在其中一個必需的文件中有一個輸入錯誤。

事實證明,這是給了一個錯誤:

function getProductsTable($csvFile = __DIR__ . '/../products.csv', $delimiter = ',') 
#Somehow assigning csvFile like that doesn't work 

誰會已經猜到......