We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3b14b790 authored by Evan Prodromou's avatar Evan Prodromou

fixes to make it all lint

Ran everything through php -l, found out that it didn't compile.

So: fixed the am-I-running-in-Laconica check at the top of each file.
Some syntax fixes in shownotice, showstream, common.

darcs-hash:20080517154701-84dde-8d38da89c5b9cb3b40704adb04a4de880c204181.gz
parent ffc72945
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class AllAction extends ShowstreamAction { class AllAction extends ShowstreamAction {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class AvatarAction extends SettingsAction { class AvatarAction extends SettingsAction {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class LoginAction extends Action { class LoginAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class LogoutAction extends Action { class LogoutAction extends Action {
function handle($args) { function handle($args) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class NewnoticeAction extends Action { class NewnoticeAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class PasswordAction extends SettingsAction { class PasswordAction extends SettingsAction {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class ProfilesettingsAction extends SettingsAction { class ProfilesettingsAction extends SettingsAction {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class PublicAction extends StreamAction { class PublicAction extends StreamAction {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class RegisterAction extends Action { class RegisterAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class ShownoticeAction extends Action { class ShownoticeAction extends Action {
...@@ -64,8 +64,8 @@ class ShownoticeAction extends Action { ...@@ -64,8 +64,8 @@ class ShownoticeAction extends Action {
common_start_element('a', array('href' => $profile->profileurl, common_start_element('a', array('href' => $profile->profileurl,
'class' => 'nickname', 'class' => 'nickname',
'title' => 'title' =>
($profile->fullname) ? $profile->fullname : ($profile->fullname) ? $profile->fullname :
$profile->nickname)), $profile->nickname),
$profile->nickname); $profile->nickname);
# FIXME: URL, image, video, audio # FIXME: URL, image, video, audio
common_element('span', array('class' => 'content'), common_element('span', array('class' => 'content'),
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
define('SUBSCRIPTIONS_PER_ROW', 5); define('SUBSCRIPTIONS_PER_ROW', 5);
define('SUBSCRIPTIONS', 80); define('SUBSCRIPTIONS', 80);
...@@ -169,7 +169,7 @@ class ShowstreamAction extends StreamAction { ...@@ -169,7 +169,7 @@ class ShowstreamAction extends StreamAction {
} }
common_element('a', array('href' => common_local_url('subscriptions', common_element('a', array('href' => common_local_url('subscriptions',
array('profile' => $profile->nickname)) array('profile' => $profile->nickname)),
'class' => 'moresubscriptions'), 'class' => 'moresubscriptions'),
_t('All subscriptions')); _t('All subscriptions'));
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class SubscribeAction extends Action { class SubscribeAction extends Action {
function handle($args) { function handle($args) {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class SubscribedAction extends Action { class SubscribedAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class SubscriptionsAction extends Action { class SubscriptionsAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
/** /**
* Table Definition for notice * Table Definition for notice
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
/** /**
* Table Definition for profile * Table Definition for profile
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
/** /**
* Table Definition for remote_profile * Table Definition for remote_profile
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
/** /**
* Table Definition for subscription * Table Definition for subscription
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
/** /**
* Table Definition for user * Table Definition for user
*/ */
......
...@@ -28,10 +28,8 @@ $actionfile = INSTALLDIR."/actions/$action.php"; ...@@ -28,10 +28,8 @@ $actionfile = INSTALLDIR."/actions/$action.php";
if (file_exists($actionfile)) { if (file_exists($actionfile)) {
require_once($actionfile); require_once($actionfile);
$action_class = ucfirst($action) . "Action"; $action_class = ucfirst($action) . "Action";
if (function_exists($action_function)) { call_user_func(array($action_class, 'handle'), $_REQUEST);
call_user_func($action_function);
} else { } else {
common_user_error(_t('Unknown action')); common_user_error(_t('Unknown action'));
} }
?>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class Action { // lawsuit class Action { // lawsuit
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/* XXX: break up into separate modules (HTTP, HTML, user, files) */ /* XXX: break up into separate modules (HTTP, HTML, user, files) */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_PROFILE_SIZE', 96);
define('AVATAR_STREAM_SIZE', 48); define('AVATAR_STREAM_SIZE', 48);
...@@ -41,10 +41,11 @@ $config = ...@@ -41,10 +41,11 @@ $config =
'path' => '/'), 'path' => '/'),
'avatar' => 'avatar' =>
array('directory' => INSTALLDIR . 'files', array('directory' => INSTALLDIR . 'files',
'path' => '/files'), 'path' => '/files')
'db' => &PEAR::getStaticProperty('DB_DataObject','options'),
); );
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
$config['db'] = $config['db'] =
array('database' => 'YOU HAVE TO SET THIS IN config.php', array('database' => 'YOU HAVE TO SET THIS IN config.php',
'schema_location' => $INSTALLDIR . '/classes', 'schema_location' => $INSTALLDIR . '/classes',
...@@ -279,10 +280,10 @@ function commmon_date_string($dt) { ...@@ -279,10 +280,10 @@ function commmon_date_string($dt) {
} }
function common_redirect($url, $code=307) { function common_redirect($url, $code=307) {
static $status = (301 => "Moved Permanently", static $status = array(301 => "Moved Permanently",
302 => "Found", 302 => "Found",
303 => "See Other", 303 => "See Other",
307 => "Temporary Redirect"); 307 => "Temporary Redirect");
header("Status: ${code} $status[$code]"); header("Status: ${code} $status[$code]");
header("Location: $url"); header("Location: $url");
common_element('a', array('href' => $url), $url); common_element('a', array('href' => $url), $url);
...@@ -299,4 +300,6 @@ function common_broadcast_notices($id) { ...@@ -299,4 +300,6 @@ function common_broadcast_notices($id) {
// XXX: set up gettext // XXX: set up gettext
function _t($str) { $str } function _t($str) {
return $str;
}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
class SettingsAction extends Action { class SettingsAction extends Action {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
if (!defined('LACONICA')) { exit(1) } if (!defined('LACONICA')) { exit(1); }
define('NOTICES_PER_PAGE', 20); define('NOTICES_PER_PAGE', 20);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment