<?php

class Banana
{
    public static function create()
    {
        return new static();
    }
    public function eat()
    {
        ExceptionThrower::throwWithMessage('Rotten banana');
    }
}
class ExceptionThrower
{
    public static function throwWithMessage($message)
    {
        throw new Exception($message);
    }
}
try {
    Banana::create()->eat();
} catch (Exception $e) {
    var_export($e->getTrace());
}
// This file is included to allow Trace to read context and post/pre-context lines
Exemple #2
0
#!/usr/bin/php5
<?php 
/********************************************************************************
 * spoolgen.php : spool generation
 * --------------
 *
 * This file is part of the banana distribution
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
require_once 'connect.db.inc.php';
require_once dirname(__FILE__) . '/../../include/banana/forum.inc.php';
ini_set('memory_limit', '128M');
Banana::$mbox_helper = $globals->spoolroot . '/banana/mbox-helper/mbox-helper';
Banana::$spool_root = $globals->spoolroot . '/spool/banana/';
Banana::$nntp_host = ForumsBanana::buildURL();
Banana::refreshAllFeeds(array('NNTP'));
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
Exemple #3
0
 public function post($dest, $reply, $subject, $body)
 {
     global $globals;
     Banana::$profile['headers']['From'] = $this->user->fullName() . ' <' . $this->user->bestEmail() . '>';
     Banana::$profile['headers']['Organization'] = make_Organization();
     return parent::post($dest, $reply, $subject, $body);
 }
Exemple #4
0
#!/usr/bin/php5
<?php 
/********************************************************************************
 * spoolgen.php : spool generation
 * --------------
 *
 * This file is part of the banana distribution
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
require_once 'connect.db.inc.php';
require_once dirname(__FILE__) . '/../include/banana/forum.inc.php';
ini_set('memory_limit', '128M');
Banana::$mbox_helper = $globals->spoolroot . '/banana/mbox-helper/mbox-helper';
Banana::$spool_root = $globals->spoolroot . '/spool/banana/';
Banana::$nntp_host = ForumsBanana::buildURL();
Banana::createAllSpool(array('NNTP', 'MLArchive'));
system("chown -R www-data:www-data " . Banana::$spool_root);
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
Exemple #5
0
 public function run()
 {
     global $platal, $globals;
     $nom = S::v('prenom') . ' ' . S::v('nom');
     $mail = $this->user->bestEmail();
     $sig = $nom . ' (' . S::v('promo') . ')';
     Banana::$msgedit_headers['X-Org-Mail'] = $this->user->forlifeEmail();
     // Tree color
     $req = XDB::query('SELECT  tree_unread, tree_read
                          FROM  forum_profiles
                         WHERE  uid= {?}', $this->user->id());
     if (!(list($unread, $read) = $req->fetchOneRow())) {
         $unread = 'o';
         $read = 'dg';
     }
     Banana::$tree_unread = $unread;
     Banana::$tree_read = $read;
     // Build user profile
     Banana::$profile['headers']['From'] = "{$nom} <{$mail}>";
     Banana::$profile['headers']['Organization'] = make_Organization();
     Banana::$profile['signature'] = $sig;
     // Page design
     Banana::$page->killPage('forums');
     Banana::$page->killPage('subscribe');
     // Run Banana
     return parent::run();
 }
Exemple #6
0
#!/usr/bin/php5
<?php 
/********************************************************************************
 * spoolgen.php : spool generation
 * --------------
 *
 * This file is part of the banana distribution
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
require_once 'connect.db.inc.php';
require_once dirname(__FILE__) . '/../include/banana/forum.inc.php';
ini_set('memory_limit', '128M');
Banana::$mbox_helper = $globals->spoolroot . '/banana/mbox-helper/mbox-helper';
Banana::$spool_root = $globals->spoolroot . '/spool/banana/';
Banana::$nntp_host = ForumsBanana::buildURL();
Banana::refreshAllFeeds(array('NNTP', 'MLArchive'));
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
Exemple #7
-1
 function __construct(User $user, $params = null)
 {
     ini_set('memory_limit', '128M');
     global $globals;
     ModerationBanana::$client = $params['client'];
     ModerationBanana::$listname = $params['listname'];
     ModerationBanana::$domain = isset($params['domain']) ? $params['domain'] : $globals->mail->domain;
     $params['group'] = ModerationBanana::$listname . '@' . ModerationBanana::$domain;
     Banana::$spool_root = $globals->spoolroot . '/spool/banana/';
     Banana::$spool_boxlist = false;
     Banana::$msgshow_withthread = false;
     Banana::$withtabs = false;
     Banana::$msgshow_externalimages = false;
     Banana::$msgshow_mimeparts[] = 'source';
     Banana::$feed_active = false;
     Banana::$debug_smarty = $globals->debug & DEBUG_SMARTY;
     array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
     parent::__construct($params, 'MLInterface', 'ModerationPage');
 }
Exemple #8
-1
function xorg_autoload($cls)
{
    if (!pl_autoload($cls)) {
        $cls = strtolower($cls);
        if (substr($cls, 0, 4) == 'ufc_' || substr($cls, 0, 4) == 'ufo_' || $cls == 'profilefilter' || $cls == 'userfiltercondition' || $cls == 'userfilterorder') {
            xorg_autoload('userfilter');
            return;
        } else {
            if (substr($cls, 0, 4) == 'pfc_' || substr($cls, 0, 4) == 'pfo_' || substr($cls, 0, 8) == 'plfilter') {
                xorg_autoload('plfilter');
                return;
            } else {
                if ($cls == 'direnumeration' || substr($cls, 0, 3) == 'de_') {
                    xorg_autoload('direnum');
                    return;
                } else {
                    if ($cls == 'validate' || substr($cls, -3, 3) == 'req' || substr($cls, -8, 8) == 'validate' || substr($cls, 0, 8) == 'validate') {
                        require_once 'validations.inc.php';
                        return;
                    } else {
                        if (substr($cls, 0, 6) == 'banana') {
                            require_once 'banana/hooks.inc.php';
                            Banana::load(substr($cls, 6));
                            return;
                        } else {
                            if (substr($cls, 0, 5) == 'raven') {
                                // Handled by Raven autoloader.
                                return;
                            }
                        }
                    }
                }
            }
        }
        include "{$cls}.inc.php";
    }
}
Exemple #9
-1
 public function __construct()
 {
     global $platal;
     Banana::$withtabs = false;
     $this->handler = 'BananaHandler';
     $this->base = $platal->pl_self(0);
     parent::__construct();
 }