本文整理汇总了PHP中Signal::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP Signal::connect方法的具体用法?PHP Signal::connect怎么用?PHP Signal::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::connect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootstrap
public function bootstrap()
{
$config = $this->getConfig();
if ($config->get('ajax_submission_enable')) {
Signal::connect('ajax.client', ['AjaxPlugin', 'registerDispatch']);
}
}
示例2: bootstrap
public function bootstrap()
{
if ($this->firstRun()) {
$this->install();
}
Signal::connect('apps.scp', array('EquipmentPlugin', 'callbackDispatch'));
$this->createStaffMenu();
}
示例3: array
}, 30);
// Manage materialized view on custom data updates
Signal::connect('model.created', array('TicketForm', 'updateDynamicDataView'), 'DynamicFormEntryAnswer');
Signal::connect('model.updated', array('TicketForm', 'updateDynamicDataView'), 'DynamicFormEntryAnswer');
// Recreate the dynamic view after new or removed fields to the ticket
// details form
Signal::connect('model.created', array('TicketForm', 'dropDynamicDataView'), 'DynamicFormField', function ($o) {
return $o->getForm()->get('type') == 'T';
});
Signal::connect('model.deleted', array('TicketForm', 'dropDynamicDataView'), 'DynamicFormField', function ($o) {
return $o->getForm()->get('type') == 'T';
});
// If the `name` column is in the dirty list, we would be renaming a
// column. Delete the view instead.
Signal::connect('model.updated', array('TicketForm', 'dropDynamicDataView'), 'DynamicFormField', function ($o, $d) {
return isset($d['dirty']) && (isset($d['dirty']['name']) || isset($d['dirty']['type']));
});
require_once INCLUDE_DIR . "class.json.php";
class DynamicFormField extends VerySimpleModel
{
static $meta = array('table' => FORM_FIELD_TABLE, 'ordering' => array('sort'), 'pk' => array('id'), 'joins' => array('form' => array('null' => true, 'constraint' => array('form_id' => 'DynamicForm.id'))));
var $_field;
// Multiple inheritance -- delegate to FormField
function __call($what, $args)
{
return call_user_func_array(array($this->getField(), $what), $args);
}
function getField($cache = true)
{
if (!$cache) {
return new FormField($this->ht);
示例4: bootstrap
function bootstrap()
{
if ($this->getConfig()->get('reindex', true)) {
Signal::connect('cron', array($this, 'IndexOldStuff'));
}
}
示例5: bootstrap
function bootstrap()
{
if ($this->firstRun()) {
if (!$this->configureFirstRun()) {
return false;
}
} else {
if ($this->needUpgrade()) {
$this->configureUpgrade();
}
}
$config = $this->getConfig();
if ($config->get('equipment_backend_enable')) {
$this->createStaffMenu();
}
if ($config->get('equipment_frontend_enable')) {
$this->createFrontMenu();
}
Signal::connect('apps.scp', array('EquipmentPlugin', 'callbackDispatch'));
}
示例6: triggerAuth
</div>
<?php
}
?>
</a><?php
}
function triggerAuth()
{
$_SESSION['ext:bk:class'] = get_class($this);
}
}
Signal::connect('api', function ($dispatcher) {
$dispatcher->append(url('^/auth/ext$', function () {
if ($class = $_SESSION['ext:bk:class']) {
$bk = StaffAuthenticationBackend::getBackend($class::$id) ?: UserAuthenticationBackend::getBackend($class::$id);
if ($bk instanceof ExternalAuthentication) {
$bk->triggerAuth();
}
}
}));
});
abstract class UserAuthenticationBackend extends AuthenticationBackend
{
private static $_registry = array();
static function _register($class)
{
static::$_registry[$class::$id] = $class;
}
static function allRegistered()
{
return array_merge(self::$_registry, parent::allRegistered());
}
示例7: bootstrap
function bootstrap()
{
Signal::connect('model.created', array($this, 'onTicketCreated'), 'Ticket');
Signal::connect('model.created', array($this, 'onThreadEntryCreated'), 'ThreadEntry');
}
示例8: bootstrap
function bootstrap()
{
Signal::connect('cron', array($this, 'IndexOldStuff'));
}