if (!$ptag) {
$user = User::getKV('id', $id);
- if ($user) {
+
+ if ($user instanceof User) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs when adding a user to a list.
// TRANS: %s is a username.
function defaultReturnTo()
{
$user = common_current_user();
- if ($user) {
+
+ if ($user instanceof User) {
return common_local_url('subscribers',
array('nickname' => $user->nickname));
} else {
if (!$ptag) {
$user = User::getKV('id', $this->tagged->id);
- if ($user) {
+ if ($user instanceof User) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs while delisting a user.
// TRANS: %s is a username.
{
if (!isset($this->_profile[$this->profile_id])) {
$profile = Profile::getKV('id', $this->profile_id);
+
if (!$profile instanceof Profile) {
- throw new GroupNoProfileException($this);
+
+ $profile = new Profile();
+ $profile->nickname = $this->nickname;
+ $profile->fullname = $this->fullname;
+ $profile->profileurl = $this->mainpage;
+ $profile->homepage = $this->homepage;
+ $profile->bio = $this->description;
+ $profile->location = $this->location;
+ $profile->created = common_sql_now();
+ $this->profile_id = $profile->insert();
+
+ //throw new GroupNoProfileException($this);
}
+
$this->_profile[$this->profile_id] = $profile;
}
return $this->_profile[$this->profile_id];
* @license GNU Affero General Public License http://www.gnu.org/licenses/
*/
+// Comment in if you have xdebug installed and need a detailed backtrace:
+//xdebug_start_trace();
+
$_startTime = microtime(true);
$_perfCounters = array();
// Is the recipient a remote group?
$oprofile = Ostatus_profile::ensureProfileURI($recipient);
- if ($oprofile) {
+ if ($oprofile instanceof Ostatus_profile) {
if (!$oprofile->isGroup()) {
// may be canonicalized or something
$replies[] = $oprofile->uri;
if ($id) {
$group = User_group::getKV('id', $id);
- if ($group) {
+ if ($group instanceof User_group) {
// Deliver to all members of this local group if allowed.
- $profile = $sender->localProfile();
- if ($profile->isMember($group)) {
+ $profile = Profile::getKV('id', $recipient);
+
+ if (($profile instanceof Profile) && ($profile->isMember($group))) {
$groups[] = $group->id;
} else {
common_log(LOG_INFO, "Skipping reply to local group {$group->nickname} as sender {$profile->id} is not a member");
'delete' => false,
'move' => true),
'image' =>
- array('jpegquality' => 85),
+ array('jpegquality' => 95),
'avatar' =>
array('server' => null,
'dir' => INSTALLDIR . '/avatar/',
return StatusNet::haveConfig();
}
+function common_get_temp_dir()
+{
+ // Try to get it from php.ini first
+ $temp_path = trim(ini_get('upload_tmp_dir'));
+
+ // Is it empty?
+ if (strlen($temp_path) == 0) {
+ // Then try sys_get_temp_dir()
+ $temp_path = trim(sys_get_temp_dir());
+
+ // Still empty?
+ if (strlen($temp_path) == 0) {
+ // Then set it to /tmp (ugly)
+ // @TODO Hard-coded non-Windows stuff!
+ $temp_path = '/tmp';
+ }
+ }
+
+ // Return found path
+ return $temp_path;
+}
+
function GNUsocial_class_autoload($cls)
{
if (file_exists(INSTALLDIR.'/classes/' . $cls . '.php')) {
}
}
+
// Autoload function queue, starting with our own discovery method
spl_autoload_register('GNUsocial_class_autoload');
$this->out->elementEnd('div');
- if ($user) {
+ if ($user instanceof User) {
$this->out->elementStart('div', 'entity_actions');
$this->out->elementStart('ul');
$this->out->elementStart('li', 'entity_subscribe');
$info = @getimagesize($this->filepath);
- if (!(
- ($info[2] == IMAGETYPE_GIF && function_exists('imagecreatefromgif')) ||
- ($info[2] == IMAGETYPE_JPEG && function_exists('imagecreatefromjpeg')) ||
- $info[2] == IMAGETYPE_BMP ||
- ($info[2] == IMAGETYPE_WBMP && function_exists('imagecreatefromwbmp')) ||
- ($info[2] == IMAGETYPE_XBM && function_exists('imagecreatefromxbm')) ||
- ($info[2] == IMAGETYPE_PNG && function_exists('imagecreatefrompng')))) {
+ if (
+ ($info[2] == IMAGETYPE_GIF && !function_exists('imagecreatefromgif')) ||
+ ($info[2] == IMAGETYPE_JPEG && !function_exists('imagecreatefromjpeg')) ||
+ ($info[2] == IMAGETYPE_WBMP && !function_exists('imagecreatefromwbmp')) ||
+ ($info[2] == IMAGETYPE_XBM && !function_exists('imagecreatefromxbm')) ||
+ ($info[2] == IMAGETYPE_PNG && !function_exists('imagecreatefrompng'))) {
// TRANS: Exception thrown when trying to upload an unsupported image file format.
throw new UnsupportedMediaException(_('Unsupported image format.'), $this->filepath);
function getNotices($offset, $limit, $sinceId, $maxId)
{
+ //common_debug('offset=' . $offset . ',limit=' . $limit . ',sinceId=' . $sinceId . ',maxId=' . $maxId . ' - CALLED!');
$all = array();
do {
$ids = $this->getNoticeIds($offset, $limit, $sinceId, $maxId);
+ //common_debug('ids()=' . count($ids));
$notices = Notice::pivotGet('id', $ids);
$limit -= count($notices);
}
+ //common_debug('all()=' . count($all));
} while (count($notices) < count($ids) && count($ids) > 0);
+ //common_debug('all()=' . count($all) . ' - EXIT!');
return new ArrayWrapper($all);
}
}
}
}
- if (!$conn instanceof DB_common) {
+ if (!is_object($conn)) {
+ // No object at all
+ throw new Exception('Fatal error: conn is no object.');
+ } elseif (!$conn instanceof DB_common) {
// Is not the right instance
throw new Exception('Cannot connect to database: ' . $conn->getMessage());
}
{
if (Event::handle('StartShowNoticeOptions', array($this))) {
$user = common_current_user();
- if ($user) {
+
+ if ($user instanceof User) {
$this->out->elementStart('div', 'notice-options');
if (Event::handle('StartShowNoticeOptionItems', array($this))) {
$this->showReplyLink();
}
$this->out->elementEnd('div');
}
+
Event::handle('EndShowNoticeOptions', array($this));
}
}
return false;
}
- if ($user) {
+ if ($user instanceof User) {
if (Event::handle('StartSetUser', array(&$user))) {
if (!empty($user)) {
if (!$user->hasRight(Right::WEBLOGIN)) {
if ($user === false) {
$user = common_current_user();
}
- if ($user) {
+ if ($user instanceof User) {
return crc32($user->id . ':' . $user->nickname);
} else {
return '0';
-a --all All users
END_OF_SILENCESPAMMER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function testAllUsers($filter, $minimum, $percent) {
$found = false;
-a --all All users
END_OF_TESTUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function testAllUsers($filter) {
$found = false;
END_OF_TRAINUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function trainUser($filter, $user, $category) {
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$notice = new Notice();
$notice->find();
function tag()
{
- return 'blog';
+ return 'blogentry';
}
function types()
-f --file file to read from (STDIN by default)
END_OF_IMPORTBOOKMARKS_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
/**
* Get the bookmarks file as a string
$msg->from_profile = $from;
$msg->to_profile = $to;
- if ($user) {
+
+ if ($user instanceof User) {
// Use the sender's URL shortening options.
$msg->content = $user->shortenLinks($content);
} else {
$msg->content = common_shorten_links($content);
}
+
$msg->rendered = common_render_text($msg->content);
$msg->created = common_sql_now();
$msg->source = $source;
function showJoinButton()
{
$user = $this->owner;
- if ($user) {
+ if ($user instanceof User) {
$this->out->elementStart('li', 'entity_subscribe');
// XXX: special-case for user looking at own
// subscriptions page
END_OF_INSTALLFOREMAIL_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$email = $args[0];
END_OF_SITEFORDOMAIN_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$domain = DomainStatusNetworkPlugin::toDomain($args[0]);
END_OF_SITEFORDOMAIN_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$domain = DomainStatusNetworkPlugin::toDomain($args[0]);
END_OF_REGISTEREMAILUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) == 0) {
show_help();
END_OF_REGISTEREMAILUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) == 0) {
show_help();
END_OF_SENDEMAILREMINDER_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
$quiet = have_option('q', 'quiet');
END_OF_SENDEMAILSUMMARY_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('u', 'universe')) {
$sn = new Status_network();
function onEndShowAccountProfileBlock(HTMLOutputter $out, Profile $profile) {
$user = User::getKV('id', $profile->id);
- if ($user) {
+
+ if ($user instanceof User) {
$url = common_local_url('profiledetail', array('nickname' => $user->nickname));
// TRANS: Link text on user profile page leading to extended profile page.
$out->element('a', array('href' => $url, 'class' => 'profiledetail'), _m('More details...'));
*/
public function testAddPluginThrowsExceptionWhenPluginClassNotFound()
{
- $path = sys_get_temp_dir() . '/Phergie/Plugin';
+ $path = common_get_temp_dir() . '/Phergie/Plugin';
$this->removeDirectory(dirname($path));
mkdir($path, 0777, true);
touch($path . '/TestPlugin.php');
if (! Solar_Dir::$_tmp) {
// use the system if we can
- if (function_exists('sys_get_temp_dir')) {
- $tmp = sys_get_temp_dir();
+ if (function_exists('common_get_temp_dir')) {
+ $tmp = common_get_temp_dir();
} else {
$tmp = Solar_Dir::_tmp();
}
{
if ($this->nickname) {
$user = User::getKV('nickname', $this->nickname);
- if ($user) {
+
+ if ($user instanceof User) {
return common_local_url('userbyid', array('id' => $user->id));
} else {
// TRANS: Client error.
return true;
}
if (common_config('feedsub', 'debug')) {
- $tempfile = tempnam(sys_get_temp_dir(), 'feedsub-receive');
+ $tempfile = tempnam(common_get_temp_dir(), 'feedsub-receive');
if ($tempfile) {
file_put_contents($tempfile, $post);
}
// @todo FIXME: This should be better encapsulated
// ripped from oauthstore.php (for old OMB client)
- $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// TRANS: Server exception. %s is a URL.
- throw new ServerException(sprintf(_m('Unable to fetch avatar from %s.'), $url));
+ throw new ServerException(sprintf(_m('Unable to fetch avatar from %s to %s.'), $url, $temp_filename));
}
if ($this->isGroup()) {
END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$dry = have_option('dry-run');
if (preg_match('!/group/(\d+)/id!', $oprofile->getUri(), $matches)) {
$id = intval($matches[1]);
$group = Local_group::getKV('group_id', $id);
- if ($group) {
+ if ($group instanceof Local_group) {
$nick = $group->nickname;
} else {
$nick = '<deleted>';
} else if (preg_match('!/user/(\d+)!', $uri, $matches)) {
$id = intval($matches[1]);
$user = User::getKV('id', $id);
- if ($user) {
+
+ if ($user instanceof User) {
$nick = $user->nickname;
} else {
$nick = '<deleted>';
}
+
echo "user $id ($nick) hidden by $uri";
} else {
echo "$uri matched query, but we don't recognize it.\n";
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$feedsub = new FeedSub();
$feedsub->find();
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
$sub = FeedSub::renewalCheck();
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (empty($args[0]) || !Validate::uri($args[0])) {
print "$helptext";
END_OF_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
$dry = false;
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (empty($args[0]) || !Validate::uri($args[0])) {
print "$helptext";
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function showProfileInfo(Ostatus_profile $oprofile) {
if ($oprofile->isGroup()) {
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (empty($args[0]) || !Validate::uri($args[0])) {
print "$helptext";
UPDATE_OSTATUS_PROFILES;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
/*
* Hacky class to remove some checks and get public access to
// @fixme this should be better encapsulated
// ripped from oauthstore.php (for old OMB client)
- $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// TRANS: Server exception. %s is a URL.
- throw new ServerException(sprintf(_m('Unable to fetch avatar from %s.'), $url));
+ throw new ServerException(sprintf(_m('Unable to fetch avatar from %s to %s.'), $url, $temp_filename));
}
if ($this->isGroup()) {
define('GNUSOCIAL', true);
define('STATUSNET', true); // compatibility
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require_once INSTALLDIR . '/extlib/php-gettext/gettext.inc';
common_init_locale("en_US");
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (!have_option('--notice')) {
print "$helptext";
END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$dry = have_option('dry-run');
{
// XXX: this is pretty lose-y; try another way
- $tmpdir = sys_get_temp_dir() . '/offline-backup/' . $user->nickname . '/' . common_date_iso8601(common_sql_now());
+ $tmpdir = common_get_temp_dir() . '/offline-backup/' . $user->nickname . '/' . common_date_iso8601(common_sql_now());
common_log(LOG_INFO, 'Writing backup data to ' . $tmpdir . ' for ' . $user->nickname);
$user = oid_get_user($canonical);
- if ($user) {
+ if ($user instanceof User) {
oid_set_last($display);
// XXX: commented out at @edd's request until better
// control over how data flows from OpenID provider.
// oid_update_user($user, $sreg);
common_set_user($user);
common_real_login(true);
+
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
common_rememberme($user);
}
+
unset($_SESSION['openid_rememberme']);
$this->goHome($user->nickname);
} else {
END_OF_CLEANUPCHANNELS_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function cleanupChannels()
{
END_OF_REGISTERBYEMAIL_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$email = get_option_value('e', 'email');
function onStartNoticeSearchShowResults($action, $q, $notice)
{
$user = common_current_user();
- if ($user) {
+
+ if ($user instanceof User) {
$search = $q;
$searchsub = SearchSub::pkeyGet(array('search' => $search,
'profile_id' => $user->id));
} else {
$form = new SearchSubForm($action, $search);
}
+
$action->elementStart('div', 'entity_actions');
$action->elementStart('ul');
$action->elementStart('li', 'entity_subscribe');
$action->elementEnd('ul');
$action->elementEnd('div');
}
+
return true;
}
END_OF_UPDATECOUNTS_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
// Will fill the cache
$exclude = $this->nicknamesToIds($this->excludeUsers);
if (count($include) == 1) {
- return "profile_id = " . intval($include[0]);
+ return '`profile_id` = ' . intval($include[0]);
} else if (count($include) > 1) {
- return "profile_id IN (" . implode(',', $include) . ")";
+ return '`profile_id` IN (' . implode(',', $include) . ')';
} else if (count($exclude) == 1) {
- return "profile_id != " . intval($exclude[0]);
+ return '`profile_id` != ' . intval($exclude[0]);
} else if (count($exclude) > 1) {
- return "profile_id NOT IN (" . implode(',', $exclude) . ")";
+ return '`profile_id` NOT IN (' . implode(',', $exclude) . ')';
} else {
return false;
}
foreach ($nicks as $nick) {
// not the most efficient way for a big list!
$user = User::getKV('nickname', $nick);
- if ($user) {
+
+ if ($user instanceof User) {
$ids[] = intval($user->id);
}
}
END_OF_TRIM_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require dirname(__FILE__) . '/sphinx-utils.php';
END_OF_TRIM_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require dirname(__FILE__) . '/sphinx-utils.php';
sphinx_iterate_sites('sphinx_index_update');
function showFeedForm($mirror)
{
$profile = Profile::getKV('id', $mirror->subscribed);
- if ($profile) {
+
+ if ($profile instanceof Profile) {
$form = new EditMirrorForm($this, $profile);
$form->show();
}
function onStartTagShowContent(TagAction $action)
{
$user = common_current_user();
- if ($user) {
+
+ if ($user instanceof User) {
$tag = $action->trimmed('tag');
$tagsub = TagSub::pkeyGet(array('tag' => $tag,
'profile_id' => $user->id));
$action->elementEnd('ul');
$action->elementEnd('div');
}
+
return true;
}
END_OF_TRIM_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require_once dirname(__DIR__) . '/twitter.php';
/**
END_OF_TWITTERDAEMON_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
class TwitterDaemon extends SpawningDaemon
{
END_OF_TRIM_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require_once INSTALLDIR . '/lib/common.php';
require_once INSTALLDIR . '/lib/daemon.php';
require_once dirname(__DIR__) . '/twitter.php';
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('n')) {
$nickname = get_option_value('n');
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
// We update any notices that may have come in from
// Twitter that we don't have a status_id for. Note that
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
require_once dirname(dirname(__FILE__)) . '/lib/jsonstreamreader.php';
require_once dirname(dirname(__FILE__)) . '/lib/twitterstreamreader.php';
}
// Let's save our frame to a temporary file. If we fail, remove it.
- $imgPath = tempnam(sys_get_temp_dir(), 'socialthumb');
+ $imgPath = tempnam(common_get_temp_dir(), 'socialthumb');
if (!imagejpeg($frame->toGDImage(), $imgPath)) {
@unlink($imgPath);
return true;
// @todo FIXME: This should be better encapsulated
// ripped from OStatus via oauthstore.php (for old OMB client)
- $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// TRANS: Exception thrown when fetching an avatar from a URL fails.
return Profile::getKV('id', $profileId);
} else {
$user = User::getKV('nickname', $nickname);
- if ($user) {
+
+ if ($user instanceof User) {
common_log(LOG_WARNING, "Copying Yammer profile info onto existing user $nickname");
$profile = $user->getProfile();
$this->savePropertiesOn($profile, $data['options'],
$user = User::register($data['options']);
$profile = $user->getProfile();
}
+
if ($data['avatar']) {
try {
$this->saveAvatar($data['avatar'], $profile);
// Save "likes" as favorites...
foreach ($data['faves'] as $nickname) {
$user = User::getKV('nickname', $nickname);
- if ($user) {
+
+ if ($user instanceof User) {
Fave::addNew($user->getProfile(), $notice);
}
}
// @fixme if we see a group link inline, don't add this?
$group = User_group::getKV('id', $groupId);
- if ($group) {
+ if ($group instanceof User_group) {
$content .= ' !' . $group->nickname;
}
}
// @fixme this should be better encapsulated
// ripped from oauthstore.php (for old OMB client)
- $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
try {
if (!copy($url, $temp_filename)) {
// TRANS: Server exception thrown when an avatar could not be fetched.
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function print_all_sites() {
END_OF_EXPORTACTIVITYSTREAM_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
$user = getUser();
END_OF_CHECKSCHEMA_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function tableDefs()
{
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (!have_option('y', 'yes')) {
print "About to delete locally generated thumbnails to allow regeneration. Are you sure? [y/N] ";
END_OF_DELETEUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
END_OF_CLEARCACHE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$karg = get_option_value('k', 'key');
END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function interpretCommand($user, $body)
{
+++ /dev/null
-<?php
-/*
- * StatusNet - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-// -*- mode: php -*-
-
-# Abort if called from a web server
-
-if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
- print "This script must be run from the command line\n";
- exit();
-}
-
-define('GNUSOCIAL', true);
-define('STATUSNET', true); //compatibility
-
-// Set various flags so we don't time out on long-running processes
-
-ini_set("max_execution_time", "0");
-ini_set("max_input_time", "0");
-set_time_limit(0);
-mb_internal_encoding('UTF-8');
-
-// Add extlib to our path so we can get Console_Getopt
-
-$_extra_path = array(INSTALLDIR.'/extlib/');
-
-set_include_path(implode(PATH_SEPARATOR, $_extra_path) . PATH_SEPARATOR . get_include_path());
-
-require_once 'Console/Getopt.php';
-
-// Note: $shortoptions and $longoptions should be pre-defined!
-
-$_default_shortoptions = 'qvhc:s:p:';
-
-$_default_longoptions = array('quiet', 'verbose', 'help', 'conf=', 'server=', 'path=');
-
-if (isset($shortoptions)) {
- $shortoptions .= $_default_shortoptions;
-} else {
- $shortoptions = $_default_shortoptions;
-}
-
-if (isset($longoptions)) {
- $longoptions = array_merge($longoptions, $_default_longoptions);
-} else {
- $longoptions = $_default_longoptions;
-}
-
-$parser = new Console_Getopt();
-
-$result = $parser->getopt($argv, $shortoptions, $longoptions);
-
-if (PEAR::isError($result)) {
- print $result->getMessage()."\n";
- exit(1);
-} else {
- list($options, $args) = $result;
-}
-
-function show_help()
-{
- global $helptext;
-
- $_default_help_text = <<<END_OF_DEFAULT
- General options:
-
- -q --quiet Quiet (little output)
- -v --verbose Verbose (lots of output)
- -c --conf=<filename> Use <filename> as config file
- -s --server=<name> Use <name> as server name
- -p --path=<path> Use <path> as path name
- -h --help Show this message and quit.
-
-END_OF_DEFAULT;
- if (isset($helptext)) {
- print $helptext;
- }
- print $_default_help_text;
- exit(0);
-}
-
-foreach ($options as $option) {
-
- switch ($option[0]) {
- case '--server':
- case 's':
- $server = $option[1];
- break;
-
- case '--path':
- case 'p':
- $path = $option[1];
- break;
-
- case '--conf':
- case 'c':
- $conffile = $option[1];
- break;
-
- case '--help':
- case 'h':
- show_help();
- }
-}
-
-require_once INSTALLDIR . '/lib/common.php';
-
-set_error_handler('common_error_handler');
-
-// Set up the language infrastructure so we can localize anything that
-// needs to be sent out to users, such as mail notifications.
-common_init_language();
-
-function _make_matches($opt, $alt)
-{
- $matches = array();
-
- if (strlen($opt) > 1 && 0 != strncmp($opt, '--', 2)) {
- $matches[] = '--'.$opt;
- } else {
- $matches[] = $opt;
- }
-
- if (!empty($alt)) {
- if (strlen($alt) > 1 && 0 != strncmp($alt, '--', 2)) {
- $matches[] = '--'.$alt;
- } else {
- $matches[] = $alt;
- }
- }
-
- return $matches;
-}
-
-function have_option($opt, $alt=null)
-{
- global $options;
-
- $matches = _make_matches($opt, $alt);
-
- foreach ($options as $option) {
- if (in_array($option[0], $matches)) {
- return true;
- }
- }
-
- return false;
-}
-
-function get_option_value($opt, $alt=null)
-{
- global $options;
-
- $matches = _make_matches($opt, $alt);
-
- foreach ($options as $option) {
- if (in_array($option[0], $matches)) {
- return $option[1];
- }
- }
-
- return null;
-}
-
-class NoUserArgumentException extends Exception
-{
-}
-
-function getUser()
-{
- $user = null;
-
- if (have_option('i', 'id')) {
- $id = get_option_value('i', 'id');
- $user = User::getKV('id', $id);
- if (empty($user)) {
- throw new Exception("Can't find user with id '$id'.");
- }
- } else if (have_option('n', 'nickname')) {
- $nickname = get_option_value('n', 'nickname');
- $user = User::getKV('nickname', $nickname);
- if (empty($user)) {
- throw new Exception("Can't find user with nickname '$nickname'");
- }
- } else {
- throw new NoUserArgumentException("No user argument specified.");
- }
-
- return $user;
-}
-
-/** "Printf not quiet" */
-
-function printfnq()
-{
- if (have_option('q', 'quiet')) {
- return null;
- }
-
- $cargs = func_num_args();
-
- if ($cargs == 0) {
- return 0;
- }
-
- $args = func_get_args();
- $format = array_shift($args);
-
- return vprintf($format, $args);
-}
-
-/** "Print when verbose" */
-
-function printfv()
-{
- if (!have_option('v', 'verbose')) {
- return null;
- }
-
- $cargs = func_num_args();
-
- if ($cargs == 0) {
- return 0;
- }
-
- $args = func_get_args();
- $format = array_shift($args);
-
- return vprintf($format, $args);
-}
--- /dev/null
+<?php
+/*
+ * StatusNet - a distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// -*- mode: php -*-
+
+# Abort if called from a web server
+
+if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
+ print "This script must be run from the command line\n";
+ exit();
+}
+
+define('GNUSOCIAL', true);
+define('STATUSNET', true); //compatibility
+
+// Set various flags so we don't time out on long-running processes
+
+ini_set("max_execution_time", "0");
+ini_set("max_input_time", "0");
+set_time_limit(0);
+mb_internal_encoding('UTF-8');
+error_reporting(0);
+
+// Add extlib to our path so we can get Console_Getopt
+
+$_extra_path = array(INSTALLDIR.'/extlib/');
+
+set_include_path(implode(PATH_SEPARATOR, $_extra_path) . PATH_SEPARATOR . get_include_path());
+
+require_once 'Console/Getopt.php';
+
+// Note: $shortoptions and $longoptions should be pre-defined!
+
+$_default_shortoptions = 'qvhc:s:p:';
+
+$_default_longoptions = array('quiet', 'verbose', 'help', 'conf=', 'server=', 'path=');
+
+if (isset($shortoptions)) {
+ $shortoptions .= $_default_shortoptions;
+} else {
+ $shortoptions = $_default_shortoptions;
+}
+
+if (isset($longoptions)) {
+ $longoptions = array_merge($longoptions, $_default_longoptions);
+} else {
+ $longoptions = $_default_longoptions;
+}
+
+$parser = new Console_Getopt();
+
+$result = $parser->getopt($argv, $shortoptions, $longoptions);
+
+if (PEAR::isError($result)) {
+ print $result->getMessage()."\n";
+ exit(1);
+} else {
+ list($options, $args) = $result;
+}
+
+function show_help()
+{
+ global $helptext;
+
+ $_default_help_text = <<<END_OF_DEFAULT
+ General options:
+
+ -q --quiet Quiet (little output)
+ -v --verbose Verbose (lots of output)
+ -c --conf=<filename> Use <filename> as config file
+ -s --server=<name> Use <name> as server name
+ -p --path=<path> Use <path> as path name
+ -h --help Show this message and quit.
+
+END_OF_DEFAULT;
+ if (isset($helptext)) {
+ print $helptext;
+ }
+ print $_default_help_text;
+ exit(0);
+}
+
+foreach ($options as $option) {
+
+ switch ($option[0]) {
+ case '--server':
+ case 's':
+ $server = $option[1];
+ break;
+
+ case '--path':
+ case 'p':
+ $path = $option[1];
+ break;
+
+ case '--conf':
+ case 'c':
+ $conffile = $option[1];
+ break;
+
+ case '--help':
+ case 'h':
+ show_help();
+ }
+}
+
+require_once INSTALLDIR . '/lib/common.php';
+
+set_error_handler('common_error_handler');
+
+// Set up the language infrastructure so we can localize anything that
+// needs to be sent out to users, such as mail notifications.
+common_init_language();
+
+function _make_matches($opt, $alt)
+{
+ $matches = array();
+
+ if (strlen($opt) > 1 && 0 != strncmp($opt, '--', 2)) {
+ $matches[] = '--'.$opt;
+ } else {
+ $matches[] = $opt;
+ }
+
+ if (!empty($alt)) {
+ if (strlen($alt) > 1 && 0 != strncmp($alt, '--', 2)) {
+ $matches[] = '--'.$alt;
+ } else {
+ $matches[] = $alt;
+ }
+ }
+
+ return $matches;
+}
+
+function have_option($opt, $alt=null)
+{
+ global $options;
+
+ $matches = _make_matches($opt, $alt);
+
+ foreach ($options as $option) {
+ if (in_array($option[0], $matches)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function get_option_value($opt, $alt=null)
+{
+ global $options;
+
+ $matches = _make_matches($opt, $alt);
+
+ foreach ($options as $option) {
+ if (in_array($option[0], $matches)) {
+ return $option[1];
+ }
+ }
+
+ return null;
+}
+
+class NoUserArgumentException extends Exception
+{
+}
+
+function getUser()
+{
+ $user = null;
+
+ if (have_option('i', 'id')) {
+ $id = get_option_value('i', 'id');
+ $user = User::getKV('id', $id);
+ if (empty($user)) {
+ throw new Exception("Can't find user with id '$id'.");
+ }
+ } else if (have_option('n', 'nickname')) {
+ $nickname = get_option_value('n', 'nickname');
+ $user = User::getKV('nickname', $nickname);
+ if (empty($user)) {
+ throw new Exception("Can't find user with nickname '$nickname'");
+ }
+ } else {
+ throw new NoUserArgumentException("No user argument specified.");
+ }
+
+ return $user;
+}
+
+/** "Printf not quiet" */
+
+function printfnq()
+{
+ if (have_option('q', 'quiet')) {
+ return null;
+ }
+
+ $cargs = func_num_args();
+
+ if ($cargs == 0) {
+ return 0;
+ }
+
+ $args = func_get_args();
+ $format = array_shift($args);
+
+ return vprintf($format, $args);
+}
+
+/** "Print when verbose" */
+
+function printfv()
+{
+ if (!have_option('v', 'verbose')) {
+ return null;
+ }
+
+ $cargs = func_num_args();
+
+ if ($cargs == 0) {
+ return 0;
+ }
+
+ $args = func_get_args();
+ $format = array_shift($args);
+
+ return vprintf($format, $args);
+}
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
// Assume we're on a terminal if on Windows, otherwise posix_isatty tells us.
define('CONSOLE_INTERACTIVE', !function_exists('posix_isatty') || posix_isatty(0));
END_OF_CREATESIM_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
// XXX: make these command-line options
END_OF_DELETEGROUP_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
END_OF_DELETEUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
$template = file_get_contents(dirname(__FILE__) . '/doxygen.tmpl');
$template = strtr($template, $replacements);
-$templateFile = tempnam(sys_get_temp_dir(), 'statusnet-doxygen');
+$templateFile = tempnam(common_get_temp_dir(), 'statusnet-doxygen');
file_put_contents($templateFile, $template);
$cmd = "doxygen " . escapeshellarg($templateFile);
END_OF_CHECKSCHEMA_HELP;
$longoptions = array('diff', 'all', 'create', 'update', 'raw', 'checksum');
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function indentOptions($indent)
{
}
} else {
show_help($helptext);
-}
\ No newline at end of file
+}
END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
/**
* Find the highest profile_id currently listed in the notice table;
END_OF_FLUSHROUTER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$cache = Cache::instance();
$cache->delete(Router::cacheKey());
-print "OK.\n";
\ No newline at end of file
+print "OK.\n";
END_OF_FLUSHSITE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$nickname = common_config('site', 'nickname');
print "Flushing cache for {$nickname}...";
$sn->decache();
-print "OK.\n";
\ No newline at end of file
+print "OK.\n";
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
echo common_config('daemon', 'piddir');
// No unnecessary error reporting to avoid invalid daemon names
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$daemons = array();
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
print GNUSOCIAL_VERSION."\n";
END_OF_QUEUE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) != 2) {
show_help();
END_OF_IM_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
class ImDaemon extends SpawningDaemon
{
END_OF_IMPORTTWITTERATOM_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
function getAtomFeedDocument()
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
$user = getUser();
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
$user = getUser();
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
require_once INSTALLDIR.'/lib/mailhandler.php';
if (common_config('emailpost', 'enabled')) {
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$base = INSTALLDIR;
$encBase = escapeshellarg($base);
END_OF_MAKEGROUPADMIN_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$nickname = get_option_value('n', 'nickname');
$groupname = get_option_value('g', 'group');
END_OF_MOVEUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
END_OF_QUEUECTL_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function doSendControl($message, $event, $param='')
{
END_OF_QUEUE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
require_once(INSTALLDIR.'/lib/daemon.php');
require_once(INSTALLDIR.'/classes/Queue_item.php');
END_OF_REGISTERUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$nickname = get_option_value('n', 'nickname');
$password = get_option_value('w', 'password');
END_OF_RESTOREUSER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
END_OF_USEREMAIL_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
END_OF_GC_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$maxlifetime = ini_get('session.gc_maxlifetime');
END_OF_SETCONFIG_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (empty($args)) {
if (have_option('a', 'all')) {
END_OF_PASSWORD_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) < 2) {
show_help();
END_OF_SETTAG_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) < 1) {
show_help();
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$karg = get_option_value('k');
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
foreach (StatusNet::getActivePlugins() as $plugin=>$args) {
echo "$plugin: ";
END_OF_SHOWTABLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (count($args) != 1) {
show_help();
fi
DIR=`dirname $0`
-DAEMONS=`php $DIR/getvaliddaemons.php $ARGSG`
+DAEMONS=`$DIR/getvaliddaemons.php $ARGSG`
for f in $DAEMONS; do
fi
SDIR=`dirname $0`
-DIR=`php $SDIR/getpiddir.php $SITE`
+DIR=`$SDIR/getpiddir.php $SITE`
-DAEMONS=`php $SDIR/getvaliddaemons.php`
+DAEMONS=`$SDIR/getvaliddaemons.php`
for f in $DAEMONS; do
f=$(basename $f .php)
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
ENDOFHELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$id_file = (count($args) > 1) ? $args[0] : 'ids.txt';
END_OF_UPDATELOCATION_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
try {
$user = null;
END_OF_UPDATEURLS_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function main()
{
END_OF_UPGRADE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function main()
{
END_OF_USEREMAIL_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
END_OF_USERROLE_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
if (have_option('i', 'id')) {
$id = get_option_value('i', 'id');
function setUp()
{
$user = User::getKV('nickname', 'userrightstestuser');
- if ($user) {
+
+ if ($user instanceof User) {
// Leftover from a broken test run?
$profile = $user->getProfile();
$user->delete();
$profile->delete();
}
+
$this->user = User::register(array('nickname' => 'userrightstestuser'));
+
if (!$this->user) {
throw new Exception("Couldn't register userrightstestuser");
}
END_OF_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
$user = get_option_value('n', 'nickname');
$pass = get_option_value('p', 'password');
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
require_once INSTALLDIR . '/extlib/OAuth.php';
$ini = parse_ini_file("oauth.ini");
END_OF_ETOKENS_HELP;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
$token = $secret = $verifier = null;
$token_secret = null;
$update = null;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
if (have_option('t', 'oauth_token')) {
$token = get_option_value('t', 'oauth_token');
$token = null;
$token_secret = null;
-require_once INSTALLDIR . '/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc.php';
if (have_option('t', 'oauth_token')) {
$token = get_option_value('t', 'oauth_token');