示例#1
0
文件: Language.php 项目: point/cassea
 static function init()
 {
     $processor = Config::getInstance()->language->processor;
     $classname = nameToClass($processor) . 'LanguageProcessor';
     Autoload::addVendor('language', $processor);
     self::$processor = new $classname();
     self::$processor->init();
 }
示例#2
0
文件: Session.php 项目: point/cassea
 public function __construct()
 {
     $config = Config::getInstance();
     $this->trigger("BeforeInit", $this);
     $this->params2save += array("id", "user_id", "cast", "ip", "remember_me");
     $sessionEngine = Config::getInstance()->session->engine;
     $classname = nameToClass($sessionEngine);
     Autoload::addVendor("session", $sessionEngine);
     $classname .= "Session";
     $this->engine = new $classname();
     if (!$this->engine instanceof SessionEngine) {
         throw new SessionException("Class '{$classname}' is not valid session engine");
     }
     $this->engine->init();
     Controller::getInstance()->onBeforeHeadBodyTail = array($this, "save");
     $this->trigger("AfterInit", $this);
     register_shutdown_function(array($this, "save"));
 }
示例#3
0
* THIS SOFTWARE IS PROVIDED BY CASSEA PROJECT ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL CASSEA PROJECT BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}}} -*/
//
// $Id:$
//
WidgetLoader::load("WComponent");
Autoload::addVendor("feed");
//{{{ WFeedLink
class WFeedLink extends WComponent
{
    protected $title = null, $href = null, $type = Feed::ATOM;
    // {{{ __construct
    /**
     * Method description
     *
     * More detailed method description
     * @param    void
     */
    function __construct($id = null)
    {
        parent::__construct($id);
    }
示例#4
0
文件: Storage.php 项目: point/cassea
 /**
  * Initialize storage-subsystem. Class to be used as
  * a storage engine is chosen on the base of config file.
  *
  * So, if in config string <code>storage_engine='foo'</code> 
  * exists, file/class FooStorage will be looked up 
  * int the vendors/storage directory.
  *
  * @param null
  * @return null
  */
 static function init()
 {
     $storageEngine = Config::get('STORAGE_ENGINE');
     self::$classname = nameToClass($storageEngine) . 'Storage';
     Autoload::addVendor('storage', $storageEngine);
 }
示例#5
0
 /**
  * Send the event's message by E-mail
  * @param  $event 
  * @return null 
  */
 public function write($event)
 {
     try {
         Autoload::addVendor('delayedjob');
         $towrite = $this->formatter->format($event);
         $j = new DelayedJob('sendByDJ', array($towrite, $this->fromname, $this->from, $this->email));
         $j->priority(1)->attempts(2)->queue('logger')->add();
     } catch (Exception $e) {
         throw new LogException($e);
     }
 }
示例#6
0
<?php

Autoload::addVendor("inlinehtml");
Controller::getInstance()->onBeforeBuildWidget = array("InlineHTML", "processDOM");
示例#7
0
<?php

Console::InitCore();
Autoload::addVendor('packageManager');
class PackageManagerFacade extends Command
{
    // {{{ cmdUpdate
    /**
     * Обновляет информацию о пакетах в известных репозиториях.
     *
     * Прокси метод вызывающий pm repository update
     */
    function cmdUpdate()
    {
        require_once 'commands/repository/RepositoryManager.php';
        $rm = new RepositoryManager('.', array('name' => 'repository', $this->commandsSeq));
        return $rm->cmdUpdate();
    }
    // }}}
    // {{{ cmdUpgrade
    /**
     * Поиск и установка одновлений для всех пакетов
     */
    function cmdUpgrade()
    {
        PackageManager::get()->startup();
        IO::out('~WHITE~Upgrading packages:~~~');
        $upack = array();
        foreach (PackageManager::getPackageSequence() as $p) {
            $upack[$p['name']] = 1;
        }
示例#8
0
文件: Grabber.php 项目: point/cassea
<?php

require_once "FeedData.php";
require_once "RSSFeed.php";
require_once "AtomFeed.php";
Autoload::addVendor("gCurl");
class Grabber
{
    public static function importUrl($url)
    {
        $is_html = false;
        $socket = Config::get('feed_grabber_transport');
        if ($socket == 'gCurl') {
            try {
                $curl = new gCurl($url);
                $r = $curl->exec();
                $h = $r->getHeaderValues('Content-Type');
                if (!(strpos($h, "text/html") === false)) {
                    $is_html = true;
                }
            } catch (gksException $e) {
                $message = $e->getLogMessage();
                echo $e->getHtmlMessage();
            }
        } else {
            $f = fopen($url, 'r');
            $r = stream_get_contents($f);
            $s = stream_get_meta_data($f);
            foreach ($s['wrapper_data'] as $w) {
                if (preg_match('/^Content-Type:\\s*(\\S+);/', $w, $match) && !empty($match) && $match[1] == "text/html") {
                    $is_html = true;
示例#9
0
文件: Profile.php 项目: point/cassea
 /**
  * Tries to calculate name of the class from config and add to vendor lookup
  * paths list retrieved directory.
  *
  * For performance reasons, obtained classname is memorized in internal private variable.
  *
  * @param null
  * @return string class name of the profile.
  */
 private static function getProfileClass()
 {
     if (self::$profile_classname) {
         return self::$profile_classname;
     }
     try {
         if ($_t = Config::getInstance()->profile->name != "cassea") {
             //for compatibility
             self::$profile_classname = $_t;
         }
     } catch (ConfigException $e) {
         //just normal. Using default profile class
     }
     Autoload::addVendor(self::$profile_classname);
     return self::$profile_classname = nameToClass($profile_classname);
 }