Use of undefined constant STDIN - assumed 'STDIN'
<?php
echo "Hello there. So I hear you're learning to be a PHP programmer!\n";
echo "Why don't you type in your name for me:\n";
$stdin = fopen('php://stdin', 'r');
$name=trim(fgets($stdin));
echo "\nThanks, " . $name . ", it's really nice to meet you.\n\n";
fclose($file);
?>
Use of undefined constant STDIN - assumed 'STDIN' in C:\wamp\www\study\sayHello.php on line 5
Just define STDIN
constant at top of your file,
define('STDIN',fopen("php://stdin","r"));
Google OAuth 2.0 PHP API Authentication fails: Use of undefined constant STDIN
Thanks, @sean-bright for pointing out the existing question. While it didn't not answer my question, it got me closer to the solution.
It turns out Google's sample is designed to be run from a CLI and my browser-based implementation was not providing a means of prompting the user for input that is called for by that STDIN
line.
Since the auth code is provided as a parameter in the $authUrl
variable that gets printed to the screen the first time the script is run, I was able to resolve my issue by replacing
$authCode = trim(fgets(STDIN));
with:
$authCode = $_GET['code'];
Artisan::call('migrate') not working after upgrading Laravel to 4.2
Yes, there is a problem actually with the last version,all previous sources are not working, should use :
Artisan::call('migrate', array('--force' => true));
Tested and working fine.
Related Topics
Moving from MySQL to MySQLi or Pdo
Passing and Parse Paypal Ipn Custom Field
Nginx Subdirectory Root with PHP
Upload File with PHP and Save Path to SQL
How to Remove Empty Values from Multidimensional Array in PHP
Get Specific Device Information
Using a Variable as an Operator
$_Server['Remote_Addr'] Not Giving the Right Ip Address
Add Custom Columns to Admin Products List in Woocommerce 3
Php/MySQL Prevent Duplicate Entries Over Multiple Columns
Simplexml: Append One Tree to Another
Woocommerce: Display Also Product Variation Description on Cart Items
Adding User Custom Field Value to Order Items Details
How to Replace Some Characters with Asterisks
Find a Percentage Value in a String Using Preg_Match
How to Access MySQLi Connection in Another Class on Another Page
How to Load the Requested Language File: Language/En/Form_Validation_Lang.Php