diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 7c1876956f..54f01b66a5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -50,6 +50,7 @@ phutil_register_library_map(array( 'ConduitAPIRequest' => 'applications/conduit/protocol/request', 'ConduitAPI_conduit_connect_Method' => 'applications/conduit/method/conduit/connect', 'ConduitAPI_differential_creatediff_Method' => 'applications/conduit/method/differential/creatediff', + 'ConduitAPI_differential_setdiffproperty_Method' => 'applications/conduit/method/differential/setdiffproperty', 'ConduitAPI_file_upload_Method' => 'applications/conduit/method/file/upload', 'ConduitAPI_user_find_Method' => 'applications/conduit/method/user/find', 'ConduitException' => 'applications/conduit/protocol/exception', @@ -58,6 +59,7 @@ phutil_register_library_map(array( 'DifferentialChangeset' => 'applications/differential/storage/changeset', 'DifferentialDAO' => 'applications/differential/storage/base', 'DifferentialDiff' => 'applications/differential/storage/diff', + 'DifferentialDiffProperty' => 'applications/differential/storage/diffproperty', 'DifferentialHunk' => 'applications/differential/storage/hunk', 'DifferentialLintStatus' => 'applications/differential/constants/lintstatus', 'DifferentialRevision' => 'applications/differential/storage/revision', @@ -154,11 +156,13 @@ phutil_register_library_map(array( 'AphrontWebpageResponse' => 'AphrontResponse', 'ConduitAPI_conduit_connect_Method' => 'ConduitAPIMethod', 'ConduitAPI_differential_creatediff_Method' => 'ConduitAPIMethod', + 'ConduitAPI_differential_setdiffproperty_Method' => 'ConduitAPIMethod', 'ConduitAPI_file_upload_Method' => 'ConduitAPIMethod', 'ConduitAPI_user_find_Method' => 'ConduitAPIMethod', 'DifferentialChangeset' => 'DifferentialDAO', 'DifferentialDAO' => 'PhabricatorLiskDAO', 'DifferentialDiff' => 'DifferentialDAO', + 'DifferentialDiffProperty' => 'DifferentialDAO', 'DifferentialHunk' => 'DifferentialDAO', 'DifferentialRevision' => 'DifferentialDAO', 'PhabricatorConduitAPIController' => 'PhabricatorConduitController', diff --git a/src/applications/conduit/method/differential/creatediff/ConduitAPI_differential_creatediff_Method.php b/src/applications/conduit/method/differential/creatediff/ConduitAPI_differential_creatediff_Method.php index 63bc4d7ba6..b2ff481224 100644 --- a/src/applications/conduit/method/differential/creatediff/ConduitAPI_differential_creatediff_Method.php +++ b/src/applications/conduit/method/differential/creatediff/ConduitAPI_differential_creatediff_Method.php @@ -127,7 +127,7 @@ class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod { return array( 'diffid' => $diff->getID(), - 'uri' => '?'//$diff->getURI(), + 'uri' => 'http://local.aphront.com/differential/diff/'.$diff->getID().'/', ); } diff --git a/src/applications/conduit/method/differential/setdiffproperty/ConduitAPI_differential_setdiffproperty_Method.php b/src/applications/conduit/method/differential/setdiffproperty/ConduitAPI_differential_setdiffproperty_Method.php new file mode 100644 index 0000000000..5fa9d2db1e --- /dev/null +++ b/src/applications/conduit/method/differential/setdiffproperty/ConduitAPI_differential_setdiffproperty_Method.php @@ -0,0 +1,52 @@ + 'required diff_id', + 'name' => 'required string', + 'data' => 'required string', + ); + } + + public function defineReturnType() { + return 'void'; + } + + public function defineErrorTypes() { + return array( + 'ERR_NOT_FOUND' => 'Diff was not found.', + ); + } + + protected function execute(ConduitAPIRequest $request) { + $property = new DifferentialDiffProperty(); + $property->setDiffID($request->getValue('diff_id')); + $property->setName($request->getValue('name')); + $property->setData($request->getValue('data')); + $property->save(); + return; + } + +} diff --git a/src/applications/conduit/method/differential/setdiffproperty/__init__.php b/src/applications/conduit/method/differential/setdiffproperty/__init__.php new file mode 100644 index 0000000000..cb78726783 --- /dev/null +++ b/src/applications/conduit/method/differential/setdiffproperty/__init__.php @@ -0,0 +1,13 @@ +openTransaction(); $ret = parent::save(); foreach ($this->unsavedChangesets as $changeset) { -// $changeset->setDiffID($this->getID()); -// $changeset->save(); + $changeset->setDiffID($this->getID()); + $changeset->save(); } // $this->saveTransaction(); return $ret; diff --git a/src/applications/differential/storage/diffproperty/DifferentialDiffProperty.php b/src/applications/differential/storage/diffproperty/DifferentialDiffProperty.php new file mode 100644 index 0000000000..07a09776c3 --- /dev/null +++ b/src/applications/differential/storage/diffproperty/DifferentialDiffProperty.php @@ -0,0 +1,32 @@ + array( + 'data' => self::SERIALIZATION_JSON, + )) + parent::getConfiguration(); + } + +} diff --git a/src/applications/differential/storage/diffproperty/__init__.php b/src/applications/differential/storage/diffproperty/__init__.php new file mode 100644 index 0000000000..972a369202 --- /dev/null +++ b/src/applications/differential/storage/diffproperty/__init__.php @@ -0,0 +1,12 @@ +