Created
February 17, 2018 08:40
-
-
Save toleabivol/7017c266003a6cd96ecf5f194549193c to your computer and use it in GitHub Desktop.
try catch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
file_put_contents( 'orderProcessLog', @file_get_contents( 'orderProcessLog' ) . implode( "\n", $lineWithoutDebugInfo ?? [ $result ] ) ); | |
if ( $order->isValid() ) { | |
file_put_contents( 'result', @file_get_contents( 'result' ) . $order->getOrderId() . '-' . implode( ',', $order->getItems() ) . '-' . $order->getDeliveryDetails() . '-' . ( $order->isManual() ? 1 : 0 ) . '-' . $order->getTotalAmount() . '-' . $order->getName() . "\n" ); | |
} | |
} catch ( \Exception $e ) { | |
echo "Error writing to file. Please check permissions."; | |
echo "Error Message:" . $e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment