Permalink
Browse files

Import some code, some of which may be relevant to the project.

  • Loading branch information...
1 parent 081689d commit 76258ce0e14230a7ced503ff860ca463f4178b7a @epriestley epriestley committed Jan 16, 2011
Showing with 6,203 additions and 0 deletions.
  1. +10 −0 .arcconfig
  2. +7 −0 .divinerconfig
  3. +3 −0 .gitignore
  4. +19 −0 src/__phutil_library_init__.php
  5. +120 −0 src/__phutil_library_map__.php
  6. +72 −0 src/aphront/applicationconfiguration/AphrontApplicationConfiguration.php
  7. +15 −0 src/aphront/applicationconfiguration/__init__.php
  8. +48 −0 src/aphront/controller/AphrontController.php
  9. +13 −0 src/aphront/controller/__init__.php
  10. +100 −0 src/aphront/default/configuration/AphrontDefaultApplicationConfiguration.php
  11. +17 −0 src/aphront/default/configuration/__init__.php
  12. +38 −0 src/aphront/default/controller/AphrontDefaultApplicationController.php
  13. +16 −0 src/aphront/default/controller/__init__.php
  14. +68 −0 src/aphront/mapper/AphrontURIMapper.php
  15. +10 −0 src/aphront/mapper/__init__.php
  16. +91 −0 src/aphront/request/AphrontRequest.php
  17. +10 −0 src/aphront/request/__init__.php
  18. +28 −0 src/aphront/response/404/Aphront404Response.php
  19. +12 −0 src/aphront/response/404/__init__.php
  20. +48 −0 src/aphront/response/base/AphrontResponse.php
  21. +10 −0 src/aphront/response/base/__init__.php
  22. +35 −0 src/aphront/response/dialog/AphrontDialogResponse.php
  23. +12 −0 src/aphront/response/dialog/__init__.php
  24. +41 −0 src/aphront/response/redirect/AphrontRedirectResponse.php
  25. +12 −0 src/aphront/response/redirect/__init__.php
  26. +35 −0 src/aphront/response/webpage/AphrontWebpageResponse.php
  27. +12 −0 src/aphront/response/webpage/__init__.php
  28. +46 −0 src/aphront/storage/lisk/AphrontLiskDAO.php
  29. +13 −0 src/aphront/storage/lisk/__init__.php
  30. +50 −0 src/applications/directory/controller/base/AphrontDirectoryController.php
  31. +16 −0 src/applications/directory/controller/base/__init__.php
  32. +51 −0 src/applications/directory/controller/categorydelete/AphrontDirectoryCategoryDeleteController.php
  33. +19 −0 src/applications/directory/controller/categorydelete/__init__.php
  34. +110 −0 src/applications/directory/controller/categoryedit/AphrontDirectoryCategoryEditController.php
  35. +21 −0 src/applications/directory/controller/categoryedit/__init__.php
  36. +72 −0 src/applications/directory/controller/categorylist/AphrontDirectoryCategoryListController.php
  37. +18 −0 src/applications/directory/controller/categorylist/__init__.php
  38. +50 −0 src/applications/directory/controller/itemdelete/AphrontDirectoryItemDeleteController.php
  39. +19 −0 src/applications/directory/controller/itemdelete/__init__.php
  40. +137 −0 src/applications/directory/controller/itemedit/AphrontDirectoryItemEditController.php
  41. +22 −0 src/applications/directory/controller/itemedit/__init__.php
  42. +77 −0 src/applications/directory/controller/itemlist/AphrontDirectoryItemListController.php
  43. +19 −0 src/applications/directory/controller/itemlist/__init__.php
  44. +75 −0 src/applications/directory/controller/main/AphrontDirectoryMainController.php
  45. +17 −0 src/applications/directory/controller/main/__init__.php
  46. +25 −0 src/applications/directory/storage/base/AphrontDirectoryDAO.php
  47. +12 −0 src/applications/directory/storage/base/__init__.php
  48. +24 −0 src/applications/directory/storage/category/AphrontDirectoryCategory.php
  49. +12 −0 src/applications/directory/storage/category/__init__.php
  50. +36 −0 src/applications/directory/storage/item/AphrontDirectoryItem.php
  51. +12 −0 src/applications/directory/storage/item/__init__.php
  52. +59 −0 src/applications/review/constants/action/DifferentialAction.php
  53. +10 −0 src/applications/review/constants/action/__init__.php
  54. +125 −0 src/applications/review/constants/changetype/DifferentialChangeType.php
  55. +12 −0 src/applications/review/constants/changetype/__init__.php
  56. +27 −0 src/applications/review/constants/lintstatus/DifferentialLintStatus.php
  57. +10 −0 src/applications/review/constants/lintstatus/__init__.php
  58. +39 −0 src/applications/review/constants/revisionstatus/DifferentialRevisionStatus.php
  59. +12 −0 src/applications/review/constants/revisionstatus/__init__.php
  60. +27 −0 src/applications/review/constants/unitstatus/DifferentialUnitStatus.php
  61. +10 −0 src/applications/review/constants/unitstatus/__init__.php
  62. +225 −0 src/storage/connection/base/AphrontDatabaseConnection.php
  63. +12 −0 src/storage/connection/base/__init__.php
  64. +198 −0 src/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
  65. +18 −0 src/storage/connection/mysql/__init__.php
  66. +22 −0 src/storage/exception/base/AphrontQueryException.php
  67. +10 −0 src/storage/exception/base/__init__.php
  68. +22 −0 src/storage/exception/connection/AphrontQueryConnectionException.php
  69. +12 −0 src/storage/exception/connection/__init__.php
  70. +23 −0 src/storage/exception/connectionlost/AphrontQueryConnectionLostException.php
  71. +12 −0 src/storage/exception/connectionlost/__init__.php
  72. +22 −0 src/storage/exception/count/AphrontQueryCountException.php
  73. +12 −0 src/storage/exception/count/__init__.php
  74. +22 −0 src/storage/exception/objectmissing/AphrontQueryObjectMissingException.php
  75. +12 −0 src/storage/exception/objectmissing/__init__.php
  76. +35 −0 src/storage/exception/parameter/AphrontQueryParameterException.php
  77. +12 −0 src/storage/exception/parameter/__init__.php
  78. +22 −0 src/storage/exception/recoverable/AphrontQueryRecoverableException.php
  79. +12 −0 src/storage/exception/recoverable/__init__.php
  80. +1,109 −0 src/storage/lisk/dao/LiskDAO.php
  81. +16 −0 src/storage/lisk/dao/__init__.php
  82. +14 −0 src/storage/qsprintf/__init__.php
  83. +309 −0 src/storage/qsprintf/qsprintf.php
  84. +13 −0 src/storage/queryfx/__init__.php
  85. +58 −0 src/storage/queryfx/queryfx.php
  86. +52 −0 src/view/base/AphrontView.php
  87. +10 −0 src/view/base/__init__.php
  88. +134 −0 src/view/control/table/AphrontTableView.php
  89. +14 −0 src/view/control/table/__init__.php
  90. +90 −0 src/view/dialog/AphrontDialogView.php
  91. +14 −0 src/view/dialog/__init__.php
  92. +65 −0 src/view/form/base/AphrontFormView.php
  93. +14 −0 src/view/form/base/__init__.php
  94. +127 −0 src/view/form/control/base/AphrontFormControl.php
  95. +14 −0 src/view/form/control/base/__init__.php
  96. +56 −0 src/view/form/control/select/AphrontFormSelectControl.php
  97. +14 −0 src/view/form/control/select/__init__.php
  98. +48 −0 src/view/form/control/submit/AphrontFormSubmitControl.php
  99. +14 −0 src/view/form/control/submit/__init__.php
  100. +35 −0 src/view/form/control/text/AphrontFormTextControl.php
  101. +14 −0 src/view/form/control/text/__init__.php
  102. +34 −0 src/view/form/control/textarea/AphrontFormTextAreaControl.php
  103. +14 −0 src/view/form/control/textarea/__init__.php
  104. +64 −0 src/view/form/error/AphrontErrorView.php
  105. +14 −0 src/view/form/error/__init__.php
  106. +79 −0 src/view/layout/panel/AphrontPanelView.php
  107. +14 −0 src/view/layout/panel/__init__.php
  108. +25 −0 src/view/null/AphrontNullView.php
  109. +12 −0 src/view/null/__init__.php
  110. +67 −0 src/view/page/base/AphrontPageView.php
  111. +12 −0 src/view/page/base/__init__.php
  112. +110 −0 src/view/page/standard/AphrontStandardPageView.php
  113. +15 −0 src/view/page/standard/__init__.php
  114. +86 −0 webroot/index.php
  115. +534 −0 webroot/rsrc/css/base.css
  116. BIN webroot/rsrc/image/sprite.png
View
@@ -0,0 +1,10 @@
+{
+ "project_id" : "aphront",
+ "conduit_uri" : "http://tools.epriestley-conduit.dev1557.facebook.com/api/",
+ "lint_engine" : "PhutilLintEngine",
+ "unit_engine" : "PhutilUnitTestEngine",
+ "copyright_holder" : "Facebook, Inc.",
+ "phutil_libraries" : {
+ "aphront" : "src/"
+ }
+}
View
@@ -0,0 +1,7 @@
+{
+ "name" : "differential",
+ "src_base" : "https://github.com/facebook/differential/blob/master",
+ "groups" : {
+ }
+}
+
View
@@ -0,0 +1,3 @@
+.DS_Store
+._*
+/docs/
@@ -0,0 +1,19 @@
+<?php
+
+/*
+ * Copyright 2011 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+phutil_register_library('aphront', __FILE__);
@@ -0,0 +1,120 @@
+<?php
+
+/**
+ * This file is automatically generated. Use 'phutil_mapper.php' to rebuild it.
+ * @generated
+ */
+
+phutil_register_library_map(array(
+ 'class' =>
+ array(
+ 'Aphront404Response' => 'aphront/response/404',
+ 'AphrontApplicationConfiguration' => 'aphront/applicationconfiguration',
+ 'AphrontController' => 'aphront/controller',
+ 'AphrontDatabaseConnection' => 'storage/connection/base',
+ 'AphrontDefaultApplicationConfiguration' => 'aphront/default/configuration',
+ 'AphrontDefaultApplicationController' => 'aphront/default/controller',
+ 'AphrontDialogResponse' => 'aphront/response/dialog',
+ 'AphrontDialogView' => 'view/dialog',
+ 'AphrontDirectoryCategory' => 'applications/directory/storage/category',
+ 'AphrontDirectoryCategoryDeleteController' => 'applications/directory/controller/categorydelete',
+ 'AphrontDirectoryCategoryEditController' => 'applications/directory/controller/categoryedit',
+ 'AphrontDirectoryCategoryListController' => 'applications/directory/controller/categorylist',
+ 'AphrontDirectoryController' => 'applications/directory/controller/base',
+ 'AphrontDirectoryDAO' => 'applications/directory/storage/base',
+ 'AphrontDirectoryItem' => 'applications/directory/storage/item',
+ 'AphrontDirectoryItemDeleteController' => 'applications/directory/controller/itemdelete',
+ 'AphrontDirectoryItemEditController' => 'applications/directory/controller/itemedit',
+ 'AphrontDirectoryItemListController' => 'applications/directory/controller/itemlist',
+ 'AphrontDirectoryMainController' => 'applications/directory/controller/main',
+ 'AphrontErrorView' => 'view/form/error',
+ 'AphrontFormControl' => 'view/form/control/base',
+ 'AphrontFormSelectControl' => 'view/form/control/select',
+ 'AphrontFormSubmitControl' => 'view/form/control/submit',
+ 'AphrontFormTextAreaControl' => 'view/form/control/textarea',
+ 'AphrontFormTextControl' => 'view/form/control/text',
+ 'AphrontFormView' => 'view/form/base',
+ 'AphrontLiskDAO' => 'aphront/storage/lisk',
+ 'AphrontMySQLDatabaseConnection' => 'storage/connection/mysql',
+ 'AphrontNullView' => 'view/null',
+ 'AphrontPageView' => 'view/page/base',
+ 'AphrontPanelView' => 'view/layout/panel',
+ 'AphrontQueryConnectionException' => 'storage/exception/connection',
+ 'AphrontQueryConnectionLostException' => 'storage/exception/connectionlost',
+ 'AphrontQueryCountException' => 'storage/exception/count',
+ 'AphrontQueryException' => 'storage/exception/base',
+ 'AphrontQueryObjectMissingException' => 'storage/exception/objectmissing',
+ 'AphrontQueryParameterException' => 'storage/exception/parameter',
+ 'AphrontQueryRecoverableException' => 'storage/exception/recoverable',
+ 'AphrontRedirectResponse' => 'aphront/response/redirect',
+ 'AphrontRequest' => 'aphront/request',
+ 'AphrontResponse' => 'aphront/response/base',
+ 'AphrontStandardPageView' => 'view/page/standard',
+ 'AphrontTableView' => 'view/control/table',
+ 'AphrontURIMapper' => 'aphront/mapper',
+ 'AphrontView' => 'view/base',
+ 'AphrontWebpageResponse' => 'aphront/response/webpage',
+ 'DifferentialAction' => 'applications/review/constants/action',
+ 'DifferentialChangeType' => 'applications/review/constants/changetype',
+ 'DifferentialLintStatus' => 'applications/review/constants/lintstatus',
+ 'DifferentialRevisionStatus' => 'applications/review/constants/revisionstatus',
+ 'DifferentialUnitStatus' => 'applications/review/constants/unitstatus',
+ 'LiskDAO' => 'storage/lisk/dao',
+ ),
+ 'function' =>
+ array(
+ '_qsprintf_check_scalar_type' => 'storage/qsprintf',
+ '_qsprintf_check_type' => 'storage/qsprintf',
+ 'qsprintf' => 'storage/qsprintf',
+ 'queryfx' => 'storage/queryfx',
+ 'queryfx_all' => 'storage/queryfx',
+ 'queryfx_one' => 'storage/queryfx',
+ 'vqsprintf' => 'storage/qsprintf',
+ 'vqueryfx' => 'storage/queryfx',
+ 'xsprintf_query' => 'storage/qsprintf',
+ ),
+ 'requires_class' =>
+ array(
+ 'Aphront404Response' => 'AphrontResponse',
+ 'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration',
+ 'AphrontDefaultApplicationController' => 'AphrontController',
+ 'AphrontDialogResponse' => 'AphrontResponse',
+ 'AphrontDialogView' => 'AphrontView',
+ 'AphrontDirectoryCategory' => 'AphrontDirectoryDAO',
+ 'AphrontDirectoryCategoryDeleteController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryCategoryEditController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryCategoryListController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryController' => 'AphrontController',
+ 'AphrontDirectoryDAO' => 'AphrontLiskDAO',
+ 'AphrontDirectoryItem' => 'AphrontDirectoryDAO',
+ 'AphrontDirectoryItemDeleteController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryItemEditController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryItemListController' => 'AphrontDirectoryController',
+ 'AphrontDirectoryMainController' => 'AphrontDirectoryController',
+ 'AphrontErrorView' => 'AphrontView',
+ 'AphrontFormControl' => 'AphrontView',
+ 'AphrontFormSelectControl' => 'AphrontFormControl',
+ 'AphrontFormSubmitControl' => 'AphrontFormControl',
+ 'AphrontFormTextAreaControl' => 'AphrontFormControl',
+ 'AphrontFormTextControl' => 'AphrontFormControl',
+ 'AphrontFormView' => 'AphrontView',
+ 'AphrontLiskDAO' => 'LiskDAO',
+ 'AphrontMySQLDatabaseConnection' => 'AphrontDatabaseConnection',
+ 'AphrontNullView' => 'AphrontView',
+ 'AphrontPageView' => 'AphrontView',
+ 'AphrontPanelView' => 'AphrontView',
+ 'AphrontQueryConnectionException' => 'AphrontQueryException',
+ 'AphrontQueryConnectionLostException' => 'AphrontQueryRecoverableException',
+ 'AphrontQueryCountException' => 'AphrontQueryException',
+ 'AphrontQueryObjectMissingException' => 'AphrontQueryException',
+ 'AphrontQueryParameterException' => 'AphrontQueryException',
+ 'AphrontQueryRecoverableException' => 'AphrontQueryException',
+ 'AphrontRedirectResponse' => 'AphrontResponse',
+ 'AphrontStandardPageView' => 'AphrontPageView',
+ 'AphrontTableView' => 'AphrontView',
+ 'AphrontWebpageResponse' => 'AphrontResponse',
+ ),
+ 'requires_interface' =>
+ array(
+ ),
+));
@@ -0,0 +1,72 @@
+<?php
+
+/*
+ * Copyright 2011 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @group aphront
+ */
+abstract class AphrontApplicationConfiguration {
+
+ private $request;
+ private $host;
+ private $path;
+
+ abstract public function getApplicationName();
+ abstract public function getURIMap();
+ abstract public function buildRequest();
+
+ final public function setRequest(AphrontRequest $request) {
+ $this->request = $request;
+ return $this;
+ }
+
+ final public function getRequest() {
+ return $this->request;
+ }
+
+ final public function buildController() {
+ $map = $this->getURIMap();
+ $mapper = new AphrontURIMapper($map);
+ $request = $this->getRequest();
+ $path = $request->getPath();
+ list($controller_class, $uri_data) = $mapper->mapPath($path);
+
+ PhutilSymbolLoader::loadClass($controller_class);
+ $controller = newv($controller_class, array($request));
+
+ return array($controller, $uri_data);
+ }
+
+ final public function setHost($host) {
+ $this->host = $host;
+ return $this;
+ }
+
+ final public function getHost() {
+ return $this->host;
+ }
+
+ final public function setPath($path) {
+ $this->path = $path;
+ return $this;
+ }
+
+ final public function getPath() {
+ return $this->path;
+ }
+
+}
@@ -0,0 +1,15 @@
+<?php
+/**
+ * This file is automatically generated. Lint this module to rebuild it.
+ * @generated
+ */
+
+
+
+phutil_require_module('aphront', 'aphront/mapper');
+
+phutil_require_module('phutil', 'symbols');
+phutil_require_module('phutil', 'utils');
+
+
+phutil_require_source('AphrontApplicationConfiguration.php');
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ * Copyright 2011 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @group aphront
+ */
+abstract class AphrontController {
+
+ private $request;
+
+ public function willProcessRequest(array $uri_data) {
+ return;
+ }
+
+ abstract public function processRequest();
+
+ final public function __construct(AphrontRequest $request) {
+ $this->request = $request;
+ }
+
+ final public function getRequest() {
+ return $this->request;
+ }
+
+ public function buildStandardPageResponse($view) {
+ $page = new AphrontStandardPageView();
+ $page->appendChild($view);
+ $response = new AphrontWebpageResponse();
+ $response->setContent($page->render());
+ return $response;
+ }
+
+}
@@ -0,0 +1,13 @@
+<?php
+/**
+ * This file is automatically generated. Lint this module to rebuild it.
+ * @generated
+ */
+
+
+
+phutil_require_module('aphront', 'aphront/response/webpage');
+phutil_require_module('aphront', 'view/page/standard');
+
+
+phutil_require_source('AphrontController.php');
Oops, something went wrong. Retry.

0 comments on commit 76258ce

Please sign in to comment.