Closed ajansdog2121 closed 12 months ago
Would you be so kind as to fix the formatting on your question.
@ajansdog2121 I tried formatting the code to understand but the code itself is incomplete. Can you please provide a repro case so than I can replicate this on my end?
Moreover, there has been a new release on 18th May 2023 v.2.15.0
(link). Can you please check if you encounter the same with this?
Closing this issue due to inactivity.
"Fatal error: Uncaught Error: Call to undefined method Google\Service\Indexing\UrlNotificationMetadata::getMetadata() in"
I am getting an error like this. The php version I am using is 7.4 and I have downloaded the appropriate library for this version. I have prepared PHP build. I have created a Google Api. But I am encountering this error. The content of my php file is as follows; <?php error_reporting(E_ALL); ini_set('display_errors', 1);
require_once DIR . '/path/vendor/autoload.php';
use Google\Client; use Google\Service\Indexing; use Google\Service\Indexing\UrlNotification; try { // Google API Credentials $google_api_key_file = './path/googleapi.json';
} catch (Google\ApiCore\ApiException $e) { $errorMessage = $e->getMessage(); if (strpos($errorMessage, "RATE_LIMIT_EXCEEDED") !== false) { echo "You have exceeded your daily limit. Please try another day."; } else { echo "Hata: " . $errorMessage; } }
// Get date and time information $currentDateTime = date("Y-m-d H:i");
// Print date and time information to the screen echo "
"; echo "Last run date: " . $currentDateTime;
// Save date and time to file $file = 'googleapi-log.txt'; $current = file_get_contents($file); $current .= "date: " . $currentDateTime . "\n"; file_put_contents($file, $current);
?>