3 if (php_sapi_name() != 'cli') {
7 define('INSTALLDIR', dirname(dirname(dirname(dirname(__FILE__)))));
9 require INSTALLDIR . "/scripts/commandline.inc";
11 $runner = YammerRunner::init();
13 switch ($runner->state())
16 $url = $runner->requestAuth();
17 echo "Log in to Yammer at the following URL and confirm permissions:\n";
21 echo "Pass the resulting code back by running:\n"
23 echo " php yammer-import.php --auth=####\n";
27 case 'requesting-auth':
28 if (empty($options['auth'])) {
29 echo "Please finish authenticating!\n";
32 $runner->saveAuthToken($options['auth']);
37 echo "... {$runner->state->state}\n";
38 if (!$runner->iterate()) {