Page MenuHomePhabricator

D610.id1936.diff
No OneTemporary

D610.id1936.diff

diff --git a/bin/controllers/subscription.php b/bin/controllers/subscription.php
--- a/bin/controllers/subscription.php
+++ b/bin/controllers/subscription.php
@@ -35,7 +35,7 @@
*
* @validate >> POST#hid(required string length[3, 50])
* @validate >> POST#app#Publisher(string required length[3, 50])
- * @validate >> POST#listen#Trigger(string required length[3, 50])
+ * @validate >> POST#event#Trigger(string required length[3, 50])
* @validate >> POST#defer#Delay(positive number)
* @validate >> POST#transliteration(string) AND POST#url(required url)
* @validate >> POST#format(in[xml, json, nvp])
@@ -79,7 +79,7 @@
$record->internalId = $_POST['hid'];
$record->publisher = db()->table('authapp')->get('appID', $_POST['app'])->first(true);
$record->subscriber = $subscriber;
- $record->listenTo = $_POST['listen'];
+ $record->event = $_POST['event'];
$record->URL = $_POST['url'];
$record->defer = $_POST['defer'];
$record->format = $_POST['format'];
@@ -143,7 +143,7 @@
$query->where('subscriber', $app);
break;
case 'name' :
- $query->where('listenTo', $value);
+ $query->where('event', $value);
break;
}
}
diff --git a/bin/directors/inbox.php b/bin/directors/inbox.php
--- a/bin/directors/inbox.php
+++ b/bin/directors/inbox.php
@@ -48,11 +48,11 @@
* "user.updated.1337" is called.
*/
$group = $query->group();
- $group->where('listenTo', $record->trigger);
+ $group->where('event', $record->trigger);
do {
array_pop($pieces);
- $group->where('listenTo', implode('.', $pieces) . '.*');
+ $group->where('event', implode('.', $pieces) . '.*');
}
while (!empty($pieces));
diff --git a/bin/models/listener.php b/bin/models/listener.php
--- a/bin/models/listener.php
+++ b/bin/models/listener.php
@@ -30,7 +30,7 @@
$schema->subscriber = new Reference('authapp');
$schema->internalId = new StringField( 50);
- $schema->listenTo = new StringField( 50);
+ $schema->event = new StringField( 50);
$schema->URL = new StringField(200);
$schema->defer = new IntegerField(true);
diff --git a/bin/templates/subscription/edit.php b/bin/templates/subscription/edit.php
--- a/bin/templates/subscription/edit.php
+++ b/bin/templates/subscription/edit.php
@@ -67,7 +67,7 @@
<label>Event name</label>
</div>
<div class="span l2">
- <input type="text" name="listen" style="width: 100%" value="<?= $listener? __($listener->listenTo) : '' ?>">
+ <input type="text" name="event" style="width: 100%" value="<?= $listener? __($listener->event) : '' ?>">
<p class="small secondary">
The event name is provided by the publishing application, whenever
the publisher distributes an event with the given name (or a child)
diff --git a/bin/templates/subscription/on.json.php b/bin/templates/subscription/on.json.php
--- a/bin/templates/subscription/on.json.php
+++ b/bin/templates/subscription/on.json.php
@@ -30,7 +30,7 @@
$registered[] = [
'id' => $listener->internalId,
'on' => [
- 'event' => $listener->listenTo,
+ 'event' => $listener->event,
'app' => $listener->publisher->appID
],
'url' => $listener->URL,
diff --git a/bin/templates/subscription/registered.json.php b/bin/templates/subscription/registered.json.php
--- a/bin/templates/subscription/registered.json.php
+++ b/bin/templates/subscription/registered.json.php
@@ -30,7 +30,7 @@
$registered[] = [
'id' => $listener->internalId,
'on' => [
- 'event' => $listener->listenTo,
+ 'event' => $listener->event,
'from' => $listener->publisher->appID,
'to' => $listener->subscriber->appID
],
diff --git a/bin/templates/subscription/registered.php b/bin/templates/subscription/registered.php
--- a/bin/templates/subscription/registered.php
+++ b/bin/templates/subscription/registered.php
@@ -24,7 +24,7 @@
<div class="row l4">
<div class="span l3">
<div>
- <a href="<?= url('app', 'hooks', $hook->publisher->_id) ?>"><?= $hook->publisher->name ?></a> :: <?= $hook->listenTo ?>
+ <a href="<?= url('app', 'hooks', $hook->publisher->_id) ?>"><?= $hook->publisher->name ?></a> :: <?= $hook->event ?>
</div>
<div>
ID: <?= $hook->internalId ?>
diff --git a/bin/templates/subscription/target.json.php b/bin/templates/subscription/target.json.php
--- a/bin/templates/subscription/target.json.php
+++ b/bin/templates/subscription/target.json.php
@@ -30,7 +30,7 @@
$registered[] = [
'id' => $listener->internalId,
'on' => [
- 'event' => $listener->listenTo,
+ 'event' => $listener->event,
'app' => $listener->publisher->appID
],
'url' => $listener->URL,

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 14, 3:44 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5857
Default Alt Text
D610.id1936.diff (4 KB)

Event Timeline