Esempio n. 1
0
 function __construct($label = false)
 {
     $label = $label ? $label : 'Test the `' . $this->tag_name . '` template tag.';
     parent::__construct($label);
     if (null === $this->tag_name) {
         throw new LogicException('You must initialize the `$tag_name` property.');
     }
     if (null === $this->tag_class) {
         throw new LogicException('You must initialize the `$tag_class` property.');
     }
     $folder = Pluf::f('tmp_folder') . '/templatetags';
     if (!file_exists($folder)) {
         mkdir($folder, 0777, true);
     }
     $this->tpl_folders = array($folder);
     Pluf_Signal::connect('Pluf_Template_Compiler::construct_template_tags_modifiers', array($this, 'addTemplatetag'));
 }
Esempio n. 2
0
Pluf_Signal::connect('Pluf_Template_Compiler::construct_template_tags_modifiers', array('IDF_Middleware', 'updateTemplateTagsModifiers'));
# -- Standard plugins, they will run only if configured --
#
# Subversion synchronization
Pluf_Signal::connect('IDF_Project::membershipsUpdated', array('IDF_Plugin_SyncSvn', 'entry'));
Pluf_Signal::connect('IDF_Project::created', array('IDF_Plugin_SyncSvn', 'entry'));
Pluf_Signal::connect('Pluf_User::passwordUpdated', array('IDF_Plugin_SyncSvn', 'entry'));
Pluf_Signal::connect('IDF_Project::preDelete', array('IDF_Plugin_SyncSvn', 'entry'));
Pluf_Signal::connect('svnpostcommit.php::run', array('IDF_Plugin_SyncSvn', 'entry'));
#
# Mercurial synchronization
Pluf_Signal::connect('IDF_Project::membershipsUpdated', array('IDF_Plugin_SyncMercurial', 'entry'));
Pluf_Signal::connect('IDF_Project::created', array('IDF_Plugin_SyncMercurial', 'entry'));
Pluf_Signal::connect('Pluf_User::passwordUpdated', array('IDF_Plugin_SyncMercurial', 'entry'));
Pluf_Signal::connect('hgchangegroup.php::run', array('IDF_Plugin_SyncMercurial', 'entry'));
#
# Git synchronization
Pluf_Signal::connect('IDF_Project::membershipsUpdated', array('IDF_Plugin_SyncGit', 'entry'));
Pluf_Signal::connect('IDF_Key::postSave', array('IDF_Plugin_SyncGit', 'entry'));
Pluf_Signal::connect('IDF_Project::created', array('IDF_Plugin_SyncGit', 'entry'));
Pluf_Signal::connect('IDF_Key::preDelete', array('IDF_Plugin_SyncGit', 'entry'));
Pluf_Signal::connect('gitpostupdate.php::run', array('IDF_Plugin_SyncGit', 'entry'));
#
# -- Processing of the webhook queue --
Pluf_Signal::connect('queuecron.php::run', array('IDF_Queue', 'process'));
#
# Processing of a given webhook, the hook can be configured
# directly in the configuration file if a different solution
# is required.
Pluf_Signal::connect('IDF_Queue::processItem', Pluf::f('idf_hook_process_item', array('IDF_Webhook', 'process')));
return $m;
Esempio n. 3
0
     * @param string Encoded data
     * @return mixed Decoded data
     */
    public static function _decodeData($encoded_data)
    {
        $check = substr($encoded_data, -32);
        $base64_data = substr($encoded_data, 0, strlen($encoded_data) - 32);
        if (md5($base64_data . Pluf::f('secret_key')) != $check) {
            throw new Exception('The session data may have been tampered.');
        }
        return unserialize(base64_decode($base64_data));
    }
    public static function processContext($signal, &$params)
    {
        $params['context'] = array_merge($params['context'], Pluf_Middleware_Session_ContextPreProcessor($params['request']));
    }
}
/**
 * Context preprocessor.
 *
 * Set the $user key.
 *
 * @param Pluf_HTTP_Request Request object
 * @return array Array to merge with the context
 */
function Pluf_Middleware_Session_ContextPreProcessor($request)
{
    return array('user' => $request->user);
}
Pluf_Signal::connect('Pluf_Template_Context_Request::construct', array('Pluf_Middleware_Session', 'processContext'));