Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Method visibility according to coding conventions

  • Loading branch information...
commit e2f073f38ab3e3168f2d824d972f880e96842b46 1 parent d3112f7
Ingo Schommer chillu authored
Showing with 2,576 additions and 2,576 deletions.
  1. +1 −1  admin/code/AdminRootController.php
  2. +5 −5 admin/code/CMSBatchAction.php
  3. +8 −8 admin/code/CMSBatchActionHandler.php
  4. +2 −2 admin/code/CMSMenu.php
  5. +2 −2 admin/code/CMSPreviewable.php
  6. +1 −1  admin/code/CMSProfileController.php
  7. +2 −2 admin/code/GroupImportForm.php
  8. +40 −40 admin/code/LeftAndMain.php
  9. +3 −3 admin/code/LeftAndMainExtension.php
  10. +4 −4 admin/code/MemberImportForm.php
  11. +6 −6 admin/code/ModelAdmin.php
  12. +5 −5 admin/code/SecurityAdmin.php
  13. +3 −3 admin/tests/LeftAndMainTest.php
  14. +3 −3 admin/tests/ModelAdminTest.php
  15. +6 −6 admin/tests/SecurityAdminTest.php
  16. +8 −8 api/DataFormatter.php
  17. +12 −12 api/RSSFeed.php
  18. +16 −16 api/RestfulService.php
  19. +5 −5 cache/Cache.php
  20. +3 −3 cli/CliController.php
  21. +9 −9 control/ContentNegotiator.php
  22. +21 −21 control/Controller.php
  23. +5 −5 control/Cookie.php
  24. +33 −33 control/Director.php
  25. +13 −13 control/HTTP.php
  26. +40 −40 control/HTTPRequest.php
  27. +15 −15 control/HTTPResponse.php
  28. +1 −1  control/NullHTTPRequest.php
  29. +1 −1  control/PjaxResponseNegotiator.php
  30. +5 −5 control/RequestHandler.php
  31. +2 −2 control/Session.php
  32. +7 −7 core/ArrayLib.php
  33. +10 −10 core/ClassInfo.php
  34. +14 −14 core/Config.php
  35. +15 −15 core/Convert.php
  36. +12 −12 core/DAG.php
  37. +27 −27 core/Diff.php
  38. +4 −4 core/Extension.php
  39. +1 −1  core/HTMLCleaner.php
  40. +3 −3 core/Object.php
  41. +9 −9 core/manifest/ConfigManifest.php
  42. +3 −3 core/manifest/TokenisedRegularExpression.php
  43. +5 −5 dev/Backtrace.php
  44. +1 −1  dev/BuildTask.php
  45. +1 −1  dev/BulkLoader.php
  46. +4 −4 dev/CSSContentParser.php
  47. +9 −9 dev/CSVParser.php
  48. +4 −4 dev/Cli.php
  49. +2 −2 dev/CliDebugView.php
  50. +27 −27 dev/Debug.php
  51. +3 −3 dev/DebugView.php
  52. +9 −9 dev/DevelopmentAdmin.php
  53. +17 −17 dev/FunctionalTest.php
  54. +1 −1  dev/InstallerTest.php
  55. +8 −8 dev/JSTestRunner.php
  56. +1 −1  dev/LogEmailWriter.php
  57. +1 −1  dev/LogFileWriter.php
  58. +6 −6 dev/MigrationTask.php
  59. +14 −14 dev/Profiler.php
  60. +4 −4 dev/SapphireInfo.php
  61. +1 −1  dev/SapphireREPL.php
  62. +19 −19 dev/SapphireTest.php
  63. +2 −2 dev/SapphireTestSuite.php
  64. +3 −3 dev/TaskRunner.php
  65. +4 −4 dev/TestMailer.php
  66. +19 −19 dev/TestRunner.php
  67. +20 −20 dev/TestSession.php
  68. +3 −3 dev/YamlFixture.php
  69. +4 −4 dev/install/DatabaseAdapterRegistry.php
  70. +2 −2 dev/phpunit/PhpUnitWrapper.php
  71. +1 −1  dev/phpunit/PhpUnitWrapper_3_5.php
  72. +2 −2 docs/en/howto/customize-cms-tree.md
  73. +4 −4 docs/en/howto/simple-contact-form.md
  74. +5 −5 docs/en/reference/modeladmin.md
  75. +1 −1  docs/en/reference/rssfeed.md
  76. +2 −2 docs/en/reference/sitetree.md
  77. +1 −1  docs/en/topics/data-types.md
  78. +1 −1  docs/en/topics/javascript.md
  79. +13 −13 email/Email.php
  80. +4 −4 email/Mailer.php
  81. +30 −30 filesystem/File.php
  82. +6 −6 filesystem/FileNameFilter.php
  83. +5 −5 filesystem/Filesystem.php
  84. +15 −15 filesystem/Folder.php
  85. +20 −20 filesystem/GD.php
  86. +1 −1  filesystem/Upload.php
  87. +3 −3 forms/AjaxUniqueTextField.php
  88. +8 −8 forms/CheckboxField.php
  89. +10 −10 forms/CheckboxSetField.php
  90. +54 −54 forms/ComplexTableField.php
  91. +13 −13 forms/CompositeField.php
  92. +10 −10 forms/ConfirmedPasswordField.php
  93. +2 −2 forms/CountryDropdownField.php
  94. +3 −3 forms/CreditCardField.php
  95. +8 −8 forms/CurrencyField.php
  96. +9 −9 forms/DatalessField.php
  97. +22 −22 forms/DateField.php
  98. +19 −19 forms/DatetimeField.php
  99. +1 −1  forms/DisabledTransformation.php
  100. +11 −11 forms/DropdownField.php
  101. +3 −3 forms/EmailField.php
  102. +7 −7 forms/FieldGroup.php
  103. +1 −1  forms/FieldList.php
  104. +3 −3 forms/FileField.php
  105. +2 −2 forms/FileIFrameField.php
  106. +2 −2 forms/Form.php
  107. +10 −10 forms/FormAction.php
  108. +57 −57 forms/FormField.php
  109. +1 −1  forms/FormScaffolder.php
  110. +1 −1  forms/FormTransformation.php
  111. +2 −2 forms/GroupedDropdownField.php
  112. +10 −10 forms/HasManyComplexTableField.php
  113. +7 −7 forms/HasOneComplexTableField.php
  114. +3 −3 forms/HeaderField.php
  115. +4 −4 forms/HiddenField.php
  116. +16 −16 forms/HtmlEditorConfig.php
  117. +19 −19 forms/HtmlEditorField.php
  118. +2 −2 forms/ImageFormAction.php
  119. +7 −7 forms/InlineFormAction.php
  120. +1 −1  forms/LabelField.php
  121. +13 −13 forms/ListboxField.php
  122. +7 −7 forms/LiteralField.php
  123. +4 −4 forms/LookupField.php
  124. +4 −4 forms/ManyManyComplexTableField.php
  125. +4 −4 forms/MemberDatetimeOptionsetField.php
  126. +11 −11 forms/MoneyField.php
  127. +2 −2 forms/NestedForm.php
  128. +8 −8 forms/NullableField.php
  129. +3 −3 forms/NumericField.php
  130. +5 −5 forms/OptionsetField.php
  131. +4 −4 forms/PasswordField.php
  132. +1 −1  forms/PhoneNumberField.php
  133. +3 −3 forms/PrintableTransformation.php
  134. +4 −4 forms/ReadonlyField.php
  135. +8 −8 forms/RequiredFields.php
  136. +2 −2 forms/ResetFormAction.php
  137. +5 −5 forms/SelectionGroup.php
  138. +4 −4 forms/SimpleImageField.php
  139. +23 −23 forms/TableField.php
  140. +96 −96 forms/TableListField.php
  141. +7 −7 forms/TabularStyle.php
  142. +5 −5 forms/TextField.php
  143. +7 −7 forms/TextareaField.php
  144. +13 −13 forms/TimeField.php
  145. +3 −3 forms/ToggleField.php
  146. +5 −5 forms/TreeDropdownField.php
  147. +7 −7 forms/TreeMultiselectField.php
  148. +6 −6 forms/UploadField.php
  149. +7 −7 forms/Validator.php
  150. +2 −2 forms/gridfield/GridField.php
  151. +10 −10 forms/gridfield/GridFieldComponent.php
  152. +14 −14 forms/gridfield/GridFieldDetailForm.php
  153. +9 −9 forms/gridfield/GridFieldExportButton.php
  154. +1 −1  forms/gridfield/GridFieldFilterHeader.php
  155. +7 −7 forms/gridfield/GridFieldPrintButton.php
  156. +1 −1  forms/gridfield/GridFieldSortableHeader.php
  157. +6 −6 forms/gridfield/GridState.php
  158. +25 −25 i18n/i18n.php
  159. +2 −2 i18n/i18nEntityProvider.php
  160. +2 −2 i18n/i18nSSLegacyAdapter.php
  161. +10 −10 i18n/i18nTextCollector.php
  162. +1 −1  model/ArrayList.php
  163. +1 −1  model/ComponentSet.php
  164. +23 −23 model/DB.php
  165. +5 −5 model/DataDifferencer.php
  166. +21 −21 model/DataExtension.php
  167. +1 −1  model/DataList.php
  168. +4 −4 model/DataModel.php
  169. +36 −36 model/DataObject.php
  170. +7 −7 model/DataObjectInterface.php
  171. +29 −29 model/DataQuery.php
  172. +56 −56 model/Database.php
  173. +11 −11 model/DatabaseAdmin.php
  174. +4 −4 model/HasManyList.php
  175. +6 −6 model/Hierarchy.php
  176. +20 −20 model/Image.php
  177. +6 −6 model/ManyManyList.php
  178. +14 −14 model/Map.php
  179. +20 −20 model/MySQLDatabase.php
  180. +2 −2 model/RelationList.php
  181. +21 −21 model/SQLQuery.php
  182. +1 −1  model/Transliterator.php
  183. +7 −7 model/URLSegmentFilter.php
  184. +8 −8 model/ValidationResult.php
  185. +49 −49 model/Versioned.php
  186. +7 −7 model/fieldtypes/Boolean.php
  187. +7 −7 model/fieldtypes/CompositeDBField.php
  188. +5 −5 model/fieldtypes/Currency.php
  189. +24 −24 model/fieldtypes/DBField.php
  190. +6 −6 model/fieldtypes/DBLocale.php
  191. +30 −30 model/fieldtypes/Date.php
  192. +11 −11 model/fieldtypes/Datetime.php
  193. +6 −6 model/fieldtypes/Decimal.php
  194. +4 −4 model/fieldtypes/Double.php
  195. +7 −7 model/fieldtypes/Float.php
  196. +1 −1  model/fieldtypes/ForeignKey.php
  197. +1 −1  model/fieldtypes/HTMLText.php
  198. +7 −7 model/fieldtypes/Int.php
  199. +24 −24 model/fieldtypes/Money.php
  200. +3 −3 model/fieldtypes/MultiEnum.php
  201. +3 −3 model/fieldtypes/Percentage.php
  202. +1 −1  model/fieldtypes/PrimaryKey.php
  203. +11 −11 model/fieldtypes/StringField.php
  204. +13 −13 model/fieldtypes/Text.php
  205. +6 −6 model/fieldtypes/Time.php
  206. +5 −5 model/fieldtypes/Varchar.php
  207. +1 −1  model/fieldtypes/Year.php
  208. +9 −9 parsers/BBCodeParser.php
  209. +1 −1  parsers/HTML/BBCodeParser/Filter/EmailLinks.php
  210. +1 −1  parsers/HTML/BBCodeParser/Filter/Extended.php
  211. +1 −1  parsers/HTML/BBCodeParser/Filter/Images.php
  212. +3 −3 parsers/HTML/BBCodeParser/Filter/Links.php
  213. +1 −1  parsers/HTML/BBCodeParser/Filter/Lists.php
  214. +20 −20 parsers/HTML/HTMLBBCodeParser.php
  215. +3 −3 parsers/TextParser.php
  216. +4 −4 search/FulltextSearchable.php
  217. +2 −2 search/SearchContext.php
  218. +3 −3 search/filters/SearchFilter.php
  219. +1 −1  search/filters/SubstringFilter.php
  220. +3 −3 search/filters/WithinRangeFilter.php
  221. +3 −3 security/BasicAuth.php
  222. +2 −2 security/ChangePasswordForm.php
  223. +8 −8 security/Group.php
  224. +2 −2 security/GroupCsvBulkLoader.php
  225. +1 −1  security/LoginAttempt.php
  226. +1 −1  security/LoginForm.php
  227. +41 −41 security/Member.php
  228. +4 −4 security/MemberCsvBulkLoader.php
  229. +4 −4 security/MemberLoginForm.php
  230. +2 −2 security/MemberPassword.php
  231. +27 −27 security/PasswordEncryptor.php
  232. +4 −4 security/PasswordValidator.php
  233. +5 −5 security/Permission.php
  234. +8 −8 security/PermissionCheckboxSetField.php
  235. +1 −1  security/PermissionProvider.php
  236. +3 −3 security/PermissionRole.php
  237. +2 −2 security/RandomGenerator.php
  238. +7 −7 security/Security.php
  239. +23 −23 security/SecurityToken.php
  240. +1 −1  tasks/EncryptAllPasswordsTask.php
  241. +1 −1  tasks/i18nTextCollectorTask.php
  242. +1 −1  tests/FakeController.php
  243. +4 −4 tests/MemoryLimitTest.php
  244. +2 −2 tests/PhpSyntaxTest.php
  245. +11 −11 tests/api/RSSFeedTest.php
  246. +11 −11 tests/api/RestfulServiceTest.php
  247. +5 −5 tests/cache/CacheTest.php
  248. +15 −15 tests/control/ControllerTest.php
  249. +9 −9 tests/control/DirectorTest.php
  250. +2 −2 tests/control/HTTPRequestTest.php
  251. +2 −2 tests/control/HTTPResponseTest.php
  252. +2 −2 tests/control/NullHTTPRequestTest.php
  253. +4 −4 tests/control/PjaxResponseNegotiatorTest.php
  254. +44 −44 tests/control/RequestHandlingTest.php
  255. +8 −8 tests/control/SessionTest.php
  256. +7 −7 tests/core/ArrayDataTest.php
  257. +3 −3 tests/core/ArrayLibTest.php
  258. +2 −2 tests/core/ClassInfoTest.php
  259. +6 −6 tests/core/ConfigTest.php
  260. +10 −10 tests/core/ConvertTest.php
  261. +1 −1  tests/core/DiffTest.php
  262. +1 −1  tests/core/HTMLCleanerTest.php
  263. +15 −15 tests/core/ObjectTest.php
  264. +3 −3 tests/core/manifest/ClassLoaderTest.php
  265. +1 −1  tests/core/manifest/ConfigManifestTest.php
  266. +6 −6 tests/core/manifest/TokenisedRegularExpressionTest.php
  267. +2 −2 tests/dev/BacktraceTest.php
  268. +3 −3 tests/dev/CSVParserTest.php
  269. +7 −7 tests/dev/CsvBulkLoaderTest.php
  270. +12 −12 tests/dev/DeprecationTest.php
  271. +5 −5 tests/dev/LogTest.php
  272. +4 −4 tests/filesystem/FileNameFilterTest.php
  273. +22 −22 tests/filesystem/FileTest.php
  274. +16 −16 tests/filesystem/FolderTest.php
  275. +9 −9 tests/filesystem/UploadTest.php
  276. +8 −8 tests/forms/CheckboxFieldTest.php
  277. +4 −4 tests/forms/CheckboxSetFieldTest.php
  278. +7 −7 tests/forms/ComplexTableFieldTest.php
  279. +3 −3 tests/forms/CompositeFieldTest.php
  280. +2 −2 tests/forms/ConfirmedPasswordFieldTest.php
  281. +3 −3 tests/forms/CurrencyFieldTest.php
  282. +18 −18 tests/forms/DateFieldTest.php
  283. +1 −1  tests/forms/DatefieldViewJQueryTest.php
  284. +15 −15 tests/forms/DatetimeFieldTest.php
  285. +14 −14 tests/forms/DropdownFieldTest.php
  286. +5 −5 tests/forms/EmailFieldTest.php
  287. +30 −30 tests/forms/FieldListTest.php
  288. +4 −4 tests/forms/FormFieldTest.php
  289. +7 −7 tests/forms/FormScaffolderTest.php
  290. +18 −18 tests/forms/FormTest.php
  291. +3 −3 tests/forms/GridFieldTest.php
  292. +9 −9 tests/forms/HtmlEditorConfigTest.php
  293. +12 −12 tests/forms/ListboxFieldTest.php
  294. +6 −6 tests/forms/LookupFieldTest.php
  295. +6 −6 tests/forms/MemberDatetimeOptionsetFieldTest.php
  296. +6 −6 tests/forms/MoneyFieldTest.php
  297. +5 −5 tests/forms/NullableFieldTests.php
  298. +1 −1  tests/forms/OptionsetFieldTest.php
  299. +9 −9 tests/forms/RequirementsTest.php
  300. +6 −6 tests/forms/TableFieldTest.php
Sorry, we could not display the entire diff because too many files (376) changed.
2  admin/code/AdminRootController.php
View
@@ -66,7 +66,7 @@ protected static function add_rule_for_controller($controllerClass) {
}
}
- function handleRequest(SS_HTTPRequest $request, DataModel $model) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
// If this is the final portion of the request (i.e. the URL is just /admin), direct to the default panel
if ($request->allParsed()) {
$base = $this->config()->url_base;
10 admin/code/CMSBatchAction.php
View
@@ -20,13 +20,13 @@
/**
* The the text to show in the dropdown for this action
*/
- abstract function getActionTitle();
+ abstract public function getActionTitle();
/**
* Run this action for the given set of pages.
* Return a set of status-updated JavaScript to return to the CMS.
*/
- abstract function run(SS_List $objs);
+ abstract public function run(SS_List $objs);
/**
* Helper method for responding to a back action request
@@ -111,7 +111,7 @@ public function batchaction(SS_List $objs, $helperMethod, $successMessage, $argu
* @param $checkStagePages Set to true if you want to check stage pages
* @param $checkLivePages Set to true if you want to check live pages (e.g, for deleted-from-draft)
*/
- function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
+ public function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
if(!is_array($ids)) user_error("Bad \$ids passed to applicablePagesHelper()", E_USER_WARNING);
if(!is_string($methodName)) user_error("Bad \$methodName passed to applicablePagesHelper()", E_USER_WARNING);
@@ -159,14 +159,14 @@ function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $chec
// if your batchaction has parameters, return a FieldList here
- function getParameterFields() {
+ public function getParameterFields() {
return false;
}
/**
* If you wish to restrict the batch action to some users, overload this function.
*/
- function canView() {
+ public function canView() {
return true;
}
}
16 admin/code/CMSBatchActionHandler.php
View
@@ -38,7 +38,7 @@ class CMSBatchActionHandler extends RequestHandler {
* action will be admin/batchactions/(urlSegment)
* @param $batchActionClass The name of the CMSBatchAction subclass to register
*/
- static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
+ public static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
if(is_subclass_of($batchActionClass, 'CMSBatchAction')) {
self::$batch_actions[$urlSegment] = array(
'class' => $batchActionClass,
@@ -54,7 +54,7 @@ static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTre
* @param string $urlSegment
* @param string $recordClass
*/
- function __construct($parentController, $urlSegment, $recordClass = null) {
+ public function __construct($parentController, $urlSegment, $recordClass = null) {
$this->parentController = $parentController;
$this->urlSegment = $urlSegment;
if($recordClass) $this->recordClass = $recordClass;
@@ -62,11 +62,11 @@ function __construct($parentController, $urlSegment, $recordClass = null) {
parent::__construct();
}
- function Link() {
+ public function Link() {
return Controller::join_links($this->parentController->Link(), $this->urlSegment);
}
- function handleAction($request) {
+ public function handleAction($request) {
// This method can't be called without ajax.
if(!$request->isAjax()) {
$this->parentController->redirectBack();
@@ -128,7 +128,7 @@ function handleAction($request) {
return $actionHandler->run($pages);
}
- function handleApplicablePages($request) {
+ public function handleApplicablePages($request) {
// Find the action handler
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
$actionClass = $actions[$request->param('BatchAction')];
@@ -150,7 +150,7 @@ function handleApplicablePages($request) {
return $response;
}
- function handleConfirmation($request) {
+ public function handleConfirmation($request) {
// Find the action handler
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
$actionClass = $actions[$request->param('BatchAction')];
@@ -177,7 +177,7 @@ function handleConfirmation($request) {
* - Link
* - Title
*/
- function batchActionList() {
+ public function batchActionList() {
$actions = $this->batchActions();
$actionList = new ArrayList();
@@ -202,7 +202,7 @@ function batchActionList() {
*
* @return array See {@link register()} for the returned format.
*/
- function batchActions() {
+ public function batchActions() {
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
if($actions) foreach($actions as $action) {
if($action['recordClass'] != $this->recordClass) unset($action);
4 admin/code/CMSMenu.php
View
@@ -278,14 +278,14 @@ public static function get_cms_classes($root = 'LeftAndMain', $recursive = true)
/**
* IteratorAggregate Interface Method. Iterates over the menu items.
*/
- function getIterator() {
+ public function getIterator() {
return new ArrayIterator(self::get_menu_items());
}
/**
* Provide menu titles to the i18n entity provider
*/
- function provideI18nEntities() {
+ public function provideI18nEntities() {
$cmsClasses = self::get_cms_classes();
$entities = array();
foreach($cmsClasses as $cmsClass) {
4 admin/code/CMSPreviewable.php
View
@@ -14,12 +14,12 @@
* @return String Absolute URL to the end-user view for this record.
* Example: http://mysite.com/my-record
*/
- function Link();
+ public function Link();
/**
* @return String Absolute URL to the CMS-author view. Should point to a controller subclassing {@link LeftAndMain}.
* Example: http://mysite.com/admin/edit/6
*/
- function CMSEditLink();
+ public function CMSEditLink();
}
2  admin/code/CMSProfileController.php
View
@@ -16,7 +16,7 @@ public function Member_ProfileForm() {
return new Member_ProfileForm($this, 'Member_ProfileForm', Member::currentUser());
}
- function canView($member = null) {
+ public function canView($member = null) {
if(!$member && $member !== FALSE) $member = Member::currentUser();
// cms menus only for logged-in members
4 admin/code/GroupImportForm.php
View
@@ -13,7 +13,7 @@ class GroupImportForm extends Form {
*/
protected $group;
- function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
+ public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
if(!$fields) {
$helpHtml = _t(
'GroupImportForm.Help1',
@@ -62,7 +62,7 @@ function __construct($controller, $name, $fields = null, $actions = null, $valid
$this->addExtraClass('import-form');
}
- function doImport($data, $form) {
+ public function doImport($data, $form) {
$loader = new GroupCsvBulkLoader();
// load file
80 admin/code/LeftAndMain.php
View
@@ -128,7 +128,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
* @param Member $member
* @return boolean
*/
- function canView($member = null) {
+ public function canView($member = null) {
if(!$member && $member !== FALSE) $member = Member::currentUser();
// cms menus only for logged-in members
@@ -160,7 +160,7 @@ function canView($member = null) {
* @uses LeftAndMainExtension->accessedCMS()
* @uses CMSMenu
*/
- function init() {
+ public function init() {
parent::init();
SSViewer::setOption('rewriteHashlinks', false);
@@ -349,7 +349,7 @@ function init() {
SSViewer::set_theme(null);
}
- function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
$response = parent::handleRequest($request, $model);
$title = $this->Title();
if(!$response->getHeader('X-Controller')) $response->addHeader('X-Controller', $this->class);
@@ -366,7 +366,7 @@ function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
* it means we would request the same redirection URL twice if we want to update the URL as well.
* See LeftAndMain.js for the required jQuery ajaxComplete handlers.
*/
- function redirect($url, $code=302) {
+ public function redirect($url, $code=302) {
if($this->request->isAjax()) {
$this->response->addHeader('X-ControllerURL', $url);
if($this->request->getHeader('X-Pjax') && !$this->response->getHeader('X-Pjax')) {
@@ -389,7 +389,7 @@ function redirect($url, $code=302) {
}
}
- function index($request) {
+ public function index($request) {
return $this->getResponseNegotiator()->respond($request);
}
@@ -397,7 +397,7 @@ function index($request) {
* admin/ping can be visited with ajax to keep a session alive.
* This is used in the CMS.
*/
- function ping() {
+ public function ping() {
return 1;
}
@@ -407,7 +407,7 @@ function ping() {
*
* @return boolean
*/
- function ShowSwitchView() {
+ public function ShowSwitchView() {
return false;
}
@@ -440,7 +440,7 @@ public function Link($action = null) {
* Implemented static so that we can get this value without instantiating an object.
* Menu title is *not* internationalised.
*/
- static function menu_title_for_class($class) {
+ public static function menu_title_for_class($class) {
$title = Config::inst()->get($class, 'menu_title', Config::FIRST_SET);
if(!$title) $title = preg_replace('/Admin$/', '', $class);
return $title;
@@ -453,7 +453,7 @@ static function menu_title_for_class($class) {
* @param type $class
* @return string
*/
- static function menu_icon_for_class($class) {
+ public static function menu_icon_for_class($class) {
$icon = Config::inst()->get($class, 'menu_icon', Config::FIRST_SET);
if (!empty($icon)) {
$class = strtolower($class);
@@ -683,7 +683,7 @@ public function SiteTreeAsUL() {
* Children, AllChildrenIncludingDeleted, or AllHistoricalChildren
* @return String Nested unordered list with links to each page
*/
- function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
+ public function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $numChildrenMethod = null, $filterFunction = null, $minNodeCount = 30) {
// Filter criteria
$params = $this->request->getVar('q');
if(isset($params['FilterClass']) && $filterClass = $params['FilterClass']){
@@ -983,7 +983,7 @@ public function CanOrganiseSitetree() {
/**
* @return Form
*/
- function EditForm($request = null) {
+ public function EditForm($request = null) {
return $this->getEditForm();
}
@@ -1103,7 +1103,7 @@ public function getEditForm($id = null, $fields = null) {
*
* @return Form
*/
- function EmptyForm() {
+ public function EmptyForm() {
$form = new Form(
$this,
"EditForm",
@@ -1182,14 +1182,14 @@ public function EditFormTools() {
/**
* Batch Actions Handler
*/
- function batchactions() {
+ public function batchactions() {
return new CMSBatchActionHandler($this, 'batchactions', $this->stat('tree_class'));
}
/**
* @return Form
*/
- function BatchActionsForm() {
+ public function BatchActionsForm() {
$actions = $this->batchactions()->batchActionList();
$actionsMap = array('-1' => _t('LeftAndMain.DropdownBatchActionsDefault', 'Actions'));
foreach($actions as $action) $actionsMap[$action->Link] = $action->Title;
@@ -1235,7 +1235,7 @@ public function printable() {
*
* @return ArrayData
*/
- function getSilverStripeNavigator() {
+ public function getSilverStripeNavigator() {
$page = $this->currentPage();
if($page) {
$navigator = new SilverStripeNavigator($page);
@@ -1338,7 +1338,7 @@ public function CMSVersion() {
/**
* @return array
*/
- function SwitchView() {
+ public function SwitchView() {
if($page = $this->currentPage()) {
$nav = SilverStripeNavigator::get_for_record($page);
return $nav['items'];
@@ -1348,7 +1348,7 @@ function SwitchView() {
/**
* @return SiteConfig
*/
- function SiteConfig() {
+ public function SiteConfig() {
return (class_exists('SiteConfig')) ? SiteConfig::current_site_config() : null;
}
@@ -1363,7 +1363,7 @@ function SiteConfig() {
/**
* @param String $name
*/
- static function setApplicationName($name) {
+ public static function setApplicationName($name) {
self::$application_name = $name;
}
@@ -1372,14 +1372,14 @@ static function setApplicationName($name) {
*
* @return string
*/
- function getApplicationName() {
+ public function getApplicationName() {
return self::$application_name;
}
/**
* @return string
*/
- function Title() {
+ public function Title() {
$app = $this->getApplicationName();
return ($section = $this->SectionTitle()) ? sprintf('%s - %s', $app, $section) : $app;
@@ -1391,7 +1391,7 @@ function Title() {
*
* @return string
*/
- function SectionTitle() {
+ public function SectionTitle() {
$class = get_class($this);
$defaultTitle = LeftAndMain::menu_title_for_class($class);
if($title = _t("{$class}.MENUTITLE", $defaultTitle)) return $title;
@@ -1404,7 +1404,7 @@ function SectionTitle() {
/**
* Return the base directory of the tiny_mce codebase
*/
- function MceRoot() {
+ public function MceRoot() {
return MCE_ROOT;
}
@@ -1415,22 +1415,22 @@ function MceRoot() {
*
* @return String
*/
- function BaseCSSClasses() {
+ public function BaseCSSClasses() {
return $this->CSSClasses('Controller');
}
- function IsPreviewExpanded() {
+ public function IsPreviewExpanded() {
return ($this->request->getVar('cms-preview-expanded'));
}
/**
* @return String
*/
- function Locale() {
+ public function Locale() {
return DBField::create_field('DBLocale', i18n::get_locale());
}
- function providePermissions() {
+ public function providePermissions() {
$perms = array(
"CMS_ACCESS_LeftAndMain" => array(
'name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'),
@@ -1488,7 +1488,7 @@ public static function require_css($file, $media = null) {
* @param $name String The identifier of the file. For example, css/MyFile.css would have the identifier "MyFile"
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
*/
- static function require_themed_css($name, $media = null) {
+ public static function require_themed_css($name, $media = null) {
self::$extra_requirements['themedcss'][] = array($name, $media);
}
@@ -1508,7 +1508,7 @@ class LeftAndMainMarkingFilter {
/**
* @param array $params Request params (unsanitized)
*/
- function __construct($params = null) {
+ public function __construct($params = null) {
$this->ids = array();
$this->expanded = array();
$parents = array();
@@ -1560,7 +1560,7 @@ protected function getQuery($params) {
);
}
- function mark($node) {
+ public function mark($node) {
$id = $node->ID;
if(array_key_exists((int) $id, $this->expanded)) $node->markOpened();
return array_key_exists((int) $id, $this->ids) ? $this->ids[$id] : false;
@@ -1574,11 +1574,11 @@ class LeftAndMain_HTTPResponse extends SS_HTTPResponse {
protected $isFinished = false;
- function isFinished() {
+ public function isFinished() {
return (parent::isFinished() || $this->isFinished);
}
- function setIsFinished($bool) {
+ public function setIsFinished($bool) {
$this->isFinished = $bool;
}
@@ -1607,7 +1607,7 @@ class LeftAndMain_TreeNode extends ViewableData {
*/
protected $isCurrent;
- function __construct($obj, $link = null, $isCurrent = false) {
+ public function __construct($obj, $link = null, $isCurrent = false) {
$this->obj = $obj;
$this->link = $link;
$this->isCurrent = $isCurrent;
@@ -1621,7 +1621,7 @@ function __construct($obj, $link = null, $isCurrent = false) {
*
* @return String
*/
- function forTemplate() {
+ public function forTemplate() {
$obj = $this->obj;
return "<li id=\"record-$obj->ID\" data-id=\"$obj->ID\" data-pagetype=\"$obj->ClassName\" class=\"" . $this->getClasses() . "\">" .
"<ins class=\"jstree-icon\">&nbsp;</ins>" .
@@ -1631,7 +1631,7 @@ function forTemplate() {
"</span></a>";
}
- function getClasses() {
+ public function getClasses() {
$classes = $this->obj->CMSTreeClasses();
if($this->isCurrent) $classes .= " current";
$flags = $this->obj->hasMethod('getStatusFlags') ? $this->obj->getStatusFlags() : false;
@@ -1639,29 +1639,29 @@ function getClasses() {
return $classes;
}
- function getObj() {
+ public function getObj() {
return $this->obj;
}
- function setObj($obj) {
+ public function setObj($obj) {
$this->obj = $obj;
return $this;
}
- function getLink() {
+ public function getLink() {
return $this->link;
}
- function setLink($link) {
+ public function setLink($link) {
$this->link = $link;
return $this;
}
- function getIsCurrent() {
+ public function getIsCurrent() {
return $this->isCurrent;
}
- function setIsCurrent($bool) {
+ public function setIsCurrent($bool) {
$this->isCurrent = $bool;
return $this;
}
6 admin/code/LeftAndMainExtension.php
View
@@ -7,13 +7,13 @@
*/
abstract class LeftAndMainExtension extends Extension {
- function init() {
+ public function init() {
}
- function accessedCMS() {
+ public function accessedCMS() {
}
- function augmentNewSiteTreeItem(&$item) {
+ public function augmentNewSiteTreeItem(&$item) {
}
}
8 admin/code/MemberImportForm.php
View
@@ -13,7 +13,7 @@ class MemberImportForm extends Form {
*/
protected $group;
- function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
+ public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
if(!$fields) {
$helpHtml = _t(
'MemberImportForm.Help1',
@@ -64,7 +64,7 @@ function __construct($controller, $name, $fields = null, $actions = null, $valid
$this->addExtraClass('import-form');
}
- function doImport($data, $form) {
+ public function doImport($data, $form) {
$loader = new MemberCsvBulkLoader();
// optionally set group relation
@@ -97,14 +97,14 @@ function doImport($data, $form) {
/**
* @param $group Group
*/
- function setGroup($group) {
+ public function setGroup($group) {
$this->group = $group;
}
/**
* @return Group
*/
- function getGroup($group) {
+ public function getGroup($group) {
return $this->group;
}
}
12 admin/code/ModelAdmin.php
View
@@ -122,7 +122,7 @@ public function Link($action = null) {
return parent::Link($action);
}
- function getEditForm($id = null, $fields = null) {
+ public function getEditForm($id = null, $fields = null) {
$list = $this->getList();
$exportButton = new GridFieldExportButton('before');
$exportButton->setExportColumns($this->getExportFields());
@@ -261,7 +261,7 @@ protected function unsanitiseClassName($class) {
/**
* @return array Map of class name to an array of 'title' (see {@link $managed_models})
*/
- function getManagedModels() {
+ public function getManagedModels() {
$models = $this->stat('managed_models');
if(is_string($models)) {
$models = array($models);
@@ -294,7 +294,7 @@ function getManagedModels() {
*
* @return array Map of model class names to importer instances
*/
- function getModelImporters() {
+ public function getModelImporters() {
$importerClasses = $this->stat('model_importers');
// fallback to all defined models if not explicitly defined
@@ -384,7 +384,7 @@ public function ImportForm() {
* @param Form $form
* @param SS_HTTPRequest $request
*/
- function import($data, $form, $request) {
+ public function import($data, $form, $request) {
if(!$this->showImportForm || (is_array($this->showImportForm) && !in_array($this->modelClass,$this->showImportForm))) {
return false;
}
@@ -444,14 +444,14 @@ public function Breadcrumbs($unlinked = false) {
* overwrite the static page_length of the admin panel,
* should be called in the project _config file.
*/
- static function set_page_length($length){
+ public static function set_page_length($length){
self::$page_length = $length;
}
/**
* Return the static page_length of the admin, default as 30
*/
- static function get_page_length(){
+ public static function get_page_length(){
return self::$page_length;
}
10 admin/code/SecurityAdmin.php
View
@@ -266,7 +266,7 @@ public function Breadcrumbs($unlinked = false) {
return $crumbs;
}
- function providePermissions() {
+ public function providePermissions() {
$title = _t("SecurityAdmin.MENUTITLE", LeftAndMain::menu_title_for_class($this->class));
return array(
"CMS_ACCESS_SecurityAdmin" => array(
@@ -298,7 +298,7 @@ function providePermissions() {
*
* @param $codes String|Array
*/
- static function add_hidden_permission($codes){
+ public static function add_hidden_permission($codes){
if(is_string($codes)) $codes = array($codes);
self::$hidden_permissions = array_merge(self::$hidden_permissions, $codes);
}
@@ -306,7 +306,7 @@ static function add_hidden_permission($codes){
/**
* @param $codes String|Array
*/
- static function remove_hidden_permission($codes){
+ public static function remove_hidden_permission($codes){
if(is_string($codes)) $codes = array($codes);
self::$hidden_permissions = array_diff(self::$hidden_permissions, $codes);
}
@@ -314,14 +314,14 @@ static function remove_hidden_permission($codes){
/**
* @return Array
*/
- static function get_hidden_permissions(){
+ public static function get_hidden_permissions(){
return self::$hidden_permissions;
}
/**
* Clear all permissions previously hidden with {@link add_hidden_permission}
*/
- static function clear_hidden_permissions(){
+ public static function clear_hidden_permissions(){
self::$hidden_permissions = array();
}
}
6 admin/tests/LeftAndMainTest.php
View
@@ -9,7 +9,7 @@ class LeftAndMainTest extends FunctionalTest {
protected $extraDataObjects = array('LeftAndMainTest_Object');
- function setUp() {
+ public function setUp() {
parent::setUp();
// @todo fix controller stack problems and re-activate
@@ -21,7 +21,7 @@ function setUp() {
* Note: This test would typically rely on SiteTree and CMSMain, but is mocked by
* LeftAndMain_Controller and LeftAndMain_Object here to remove this dependency.
*/
- public function testSaveTreeNodeSorting() {
+ public function testSaveTreeNodeSorting() {
$this->loginWithPermission('ADMIN');
$rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0', '"ID"'); // forcing sorting for non-MySQL
@@ -110,7 +110,7 @@ public function testLeftAndMainSubclasses() {
}
- function testCanView() {
+ public function testCanView() {
$adminuser = $this->objFromFixture('Member', 'admin');
$securityonlyuser = $this->objFromFixture('Member', 'securityonlyuser');
$allcmssectionsuser = $this->objFromFixture('Member', 'allcmssectionsuser');
6 admin/tests/ModelAdminTest.php
View
@@ -9,20 +9,20 @@ class ModelAdminTest extends FunctionalTest {
'ModelAdminTest_Player'
);
- function testModelAdminOpens() {
+ public function testModelAdminOpens() {
$this->autoFollowRedirection = false;
$this->logInAs('admin');
$this->assertTrue((bool)Permission::check("ADMIN"));
$this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode());
}
- function testExportFieldsDefaultIsSummaryFields() {
+ public function testExportFieldsDefaultIsSummaryFields() {
$admin = new ModelAdminTest_Admin();
$admin->modelClass = 'ModelAdminTest_Contact';
$this->assertEquals($admin->getExportFields(), singleton('ModelAdminTest_Contact')->summaryFields());
}
- function testExportFieldsOverloadedMethod() {
+ public function testExportFieldsOverloadedMethod() {
$admin = new ModelAdminTest_PlayerAdmin();
$admin->modelClass = 'ModelAdminTest_Player';
$this->assertEquals($admin->getExportFields(), array(
12 admin/tests/SecurityAdminTest.php
View
@@ -10,7 +10,7 @@ class SecurityAdminTest extends FunctionalTest {
protected $extraDataObjects = array('LeftAndMainTest_Object');
// TODO Fix export feature (moved from MemberTableField to GridFieldExportButton)
- // function testGroupExport() {
+ // public function testGroupExport() {
// $this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
// /* First, open the applicable group */
@@ -28,7 +28,7 @@ class SecurityAdminTest extends FunctionalTest {
// }
// TODO Fix export feature (moved from MemberTableField to GridFieldExportButton)
- // function testEmptyGroupExport() {
+ // public function testEmptyGroupExport() {
// $this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
// /* First, open the applicable group */
@@ -45,7 +45,7 @@ class SecurityAdminTest extends FunctionalTest {
// $this->assertEquals($lines[1], '', "Empty export only has no content row");
// }
- function testAddHiddenPermission() {
+ public function testAddHiddenPermission() {
SecurityAdmin::add_hidden_permission('CMS_ACCESS_ReportAdmin');
$this->assertContains('CMS_ACCESS_ReportAdmin', SecurityAdmin::get_hidden_permissions());
@@ -53,7 +53,7 @@ function testAddHiddenPermission() {
SecurityAdmin::clear_hidden_permissions();
}
- function testRemoveHiddenPermission() {
+ public function testRemoveHiddenPermission() {
SecurityAdmin::add_hidden_permission('CMS_ACCESS_ReportAdmin');
$this->assertContains('CMS_ACCESS_ReportAdmin', SecurityAdmin::get_hidden_permissions());
SecurityAdmin::remove_hidden_permission('CMS_ACCESS_ReportAdmin');
@@ -63,14 +63,14 @@ function testRemoveHiddenPermission() {
SecurityAdmin::clear_hidden_permissions();
}
- function testClearHiddenPermission() {
+ public function testClearHiddenPermission() {
SecurityAdmin::add_hidden_permission('CMS_ACCESS_ReportAdmin');
$this->assertContains('CMS_ACCESS_ReportAdmin', SecurityAdmin::get_hidden_permissions());
SecurityAdmin::clear_hidden_permissions('CMS_ACCESS_ReportAdmin');
$this->assertNotContains('CMS_ACCESS_ReportAdmin', SecurityAdmin::get_hidden_permissions());
}
- function testPermissionFieldRespectsHiddenPermissions() {
+ public function testPermissionFieldRespectsHiddenPermissions() {
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
$group = $this->objFromFixture('Group', 'admin');
16 api/DataFormatter.php
View
@@ -88,7 +88,7 @@
* @param string $extension
* @return DataFormatter
*/
- static function for_extension($extension) {
+ public static function for_extension($extension) {
$classes = ClassInfo::subclassesFor("DataFormatter");
array_shift($classes);
$sortedClasses = array();
@@ -110,7 +110,7 @@ static function for_extension($extension) {
* @param array $extensions
* @return DataFormatter
*/
- static function for_extensions($extensions) {
+ public static function for_extensions($extensions) {
foreach($extensions as $extension) {
if($formatter = self::for_extension($extension)) return $formatter;
}
@@ -124,7 +124,7 @@ static function for_extensions($extensions) {
* @param string $mimeType
* @return DataFormatter
*/
- static function for_mimetype($mimeType) {
+ public static function for_mimetype($mimeType) {
$classes = ClassInfo::subclassesFor("DataFormatter");
array_shift($classes);
$sortedClasses = array();
@@ -148,7 +148,7 @@ static function for_mimetype($mimeType) {
* @param array $mimetypes
* @return DataFormatter
*/
- static function for_mimetypes($mimetypes) {
+ public static function for_mimetypes($mimetypes) {
foreach($mimetypes as $mimetype) {
if($formatter = self::for_mimetype($mimetype)) return $formatter;
}
@@ -274,20 +274,20 @@ protected function getFieldsForObj($obj) {
/**
* Return an array of the extensions that this data formatter supports
*/
- abstract function supportedExtensions();
+ abstract public function supportedExtensions();
- abstract function supportedMimeTypes();
+ abstract public function supportedMimeTypes();
/**
* Convert a single data object to this format. Return a string.
*/
- abstract function convertDataObject(DataObjectInterface $do);
+ abstract public function convertDataObject(DataObjectInterface $do);
/**
* Convert a data object set to this format. Return a string.
*/
- abstract function convertDataObjectSet(SS_List $set);
+ abstract public function convertDataObjectSet(SS_List $set);
/**
* @param string $strData HTTP Payload as string
24 api/RSSFeed.php
View
@@ -105,7 +105,7 @@ class RSSFeed extends ViewableData {
* @param string $etag The ETag is an unique identifier that is changed
* every time the representation does
*/
- function __construct(SS_List $entries, $link, $title,
+ public function __construct(SS_List $entries, $link, $title,
$description = null, $titleField = "Title",
$descriptionField = "Content", $authorField = null,
$lastModified = null, $etag = null) {
@@ -130,7 +130,7 @@ function __construct(SS_List $entries, $link, $title,
* @param string $url URL of the feed
* @param string $title Title to show
*/
- static function linkToFeed($url, $title = null) {
+ public static function linkToFeed($url, $title = null) {
$title = Convert::raw2xml($title);
Requirements::insertHeadTags(
'<link rel="alternate" type="application/rss+xml" title="' . $title .
@@ -142,7 +142,7 @@ static function linkToFeed($url, $title = null) {
*
* @return SS_List Returns the {@link RSSFeed_Entry} objects.
*/
- function Entries() {
+ public function Entries() {
$output = new ArrayList();
if(isset($this->entries)) {
@@ -158,7 +158,7 @@ function Entries() {
*
* @return string Returns the title of the feed.
*/
- function Title() {
+ public function Title() {
return $this->title;
}
@@ -168,7 +168,7 @@ function Title() {
* @param string $action
* @return string Returns the URL of the feed.
*/
- function Link($action = null) {
+ public function Link($action = null) {
return Controller::join_links(Director::absoluteURL($this->link), $action);
}
@@ -177,7 +177,7 @@ function Link($action = null) {
*
* @return string Returns the description of the feed.
*/
- function Description() {
+ public function Description() {
return $this->description;
}
@@ -267,7 +267,7 @@ class RSSFeed_Entry extends ViewableData {
/**
* Create a new RSSFeed entry.
*/
- function __construct($entry, $titleField, $descriptionField,
+ public function __construct($entry, $titleField, $descriptionField,
$authorField) {
$this->failover = $entry;
$this->titleField = $titleField;
@@ -282,7 +282,7 @@ function __construct($entry, $titleField, $descriptionField,
*
* @return string Returns the description of the entry.
*/
- function Title() {
+ public function Title() {
return $this->rssField($this->titleField, 'Varchar');
}
@@ -291,7 +291,7 @@ function Title() {
*
* @return string Returns the description of the entry.
*/
- function Description() {
+ public function Description() {
return $this->rssField($this->descriptionField, 'Text');
}
@@ -300,7 +300,7 @@ function Description() {
*
* @return string Returns the author of the entry.
*/
- function Author() {
+ public function Author() {
if($this->authorField) return $this->failover->obj($this->authorField);
}
@@ -308,7 +308,7 @@ function Author() {
* Return the named field as an obj() call from $this->failover.
* Default to the given class if there's no casting information.
*/
- function rssField($fieldName, $defaultClass = 'Varchar') {
+ public function rssField($fieldName, $defaultClass = 'Varchar') {
if($fieldName) {
if($this->failover->castingHelper($fieldName)) {
$value = $this->failover->$fieldName;
@@ -328,7 +328,7 @@ function rssField($fieldName, $defaultClass = 'Varchar') {
*
* @return string Returns the URL of this entry
*/
- function AbsoluteLink() {
+ public function AbsoluteLink() {
if($this->failover->hasMethod('AbsoluteLink')) return $this->failover->AbsoluteLink();
else if($this->failover->hasMethod('Link')) return Director::absoluteURL($this->failover->Link());
else user_error($this->failover->class . " object has neither an AbsoluteLink nor a Link method. Can't put a link in the RSS feed", E_USER_WARNING);
32 api/RestfulService.php
View
@@ -27,7 +27,7 @@ class RestfulService extends ViewableData {
* @param string $password The proxy auth password
* @param boolean $socks Set true to use socks5 proxy instead of http
*/
- static function set_default_proxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
+ public static function set_default_proxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
self::$default_proxy = array(
CURLOPT_PROXY => $proxy,
CURLOPT_PROXYUSERPWD => "{$user}:{$password}",
@@ -41,7 +41,7 @@ static function set_default_proxy($proxy, $port = 80, $user = "", $password = ""
* @param string $base Base URL of the web service eg: api.example.com
* @param int $expiry Set the cache expiry interva. Defaults to 1 hour (3600 seconds)
*/
- function __construct($base, $expiry=3600){
+ public function __construct($base, $expiry=3600){
$this->baseURL = $base;
$this->cache_expire = $expiry;
$this->proxy = self::$default_proxy;
@@ -52,7 +52,7 @@ function __construct($base, $expiry=3600){
* Sets the Query string parameters to send a request.
* @param array $params An array passed with necessary parameters.
*/
- function setQueryString($params=NULL){
+ public function setQueryString($params=NULL){
$this->queryString = http_build_query($params,'','&');
}
@@ -65,7 +65,7 @@ function setQueryString($params=NULL){
* @param string $password The proxy auth password
* @param boolean $socks Set true to use socks5 proxy instead of http
*/
- function setProxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
+ public function setProxy($proxy, $port = 80, $user = "", $password = "", $socks = false) {
$this->proxy = array(
CURLOPT_PROXY => $proxy,
CURLOPT_PROXYUSERPWD => "{$user}:{$password}",
@@ -77,7 +77,7 @@ function setProxy($proxy, $port = 80, $user = "", $password = "", $socks = false
/**
* Set basic authentication
*/
- function basicAuth($username, $password) {
+ public function basicAuth($username, $password) {
$this->authUsername = $username;
$this->authPassword = $password;
}
@@ -85,7 +85,7 @@ function basicAuth($username, $password) {
/**
* Set a custom HTTP header
*/
- function httpHeader($header) {
+ public function httpHeader($header) {
$this->customHeaders[] = $header;
}
@@ -227,7 +227,7 @@ public function curlRequest($url, $method, $data = null, $headers = null, $curlO
* Returns a full request url
* @param string
*/
- function getAbsoluteRequestURL($subURL) {
+ public function getAbsoluteRequestURL($subURL) {
$url = $this->baseURL . $subURL; // Url for the request
if($this->queryString) {
if(strpos($url, '?') !== false) {
@@ -355,7 +355,7 @@ protected function getRecurseValues($xml,&$data,$parent=""){
* @param string $element The element we need to extract the node value.
*/
- function getValue($xml, $collection=NULL, $element=NULL){
+ public function getValue($xml, $collection=NULL, $element=NULL){
$xml = new SimpleXMLElement($xml);
if($collection)
@@ -372,7 +372,7 @@ function getValue($xml, $collection=NULL, $element=NULL){
* @param string $xml source xml to parse, this could be the original response received.
* @param string $node Node to search for
*/
- function searchValue($xml, $node=NULL){
+ public function searchValue($xml, $node=NULL){
$xml = new SimpleXMLElement($xml);
$childElements = $xml->xpath($node);
@@ -385,7 +385,7 @@ function searchValue($xml, $node=NULL){
* @param string $xml the source xml to parse, this could be the original response received.
* @param string $node Node to search for
*/
- function searchAttributes($xml, $node=NULL){
+ public function searchAttributes($xml, $node=NULL){
$xml = new SimpleXMLElement($xml);
$output = new ArrayList();
@@ -418,13 +418,13 @@ class RestfulService_Response extends SS_HTTPResponse {
*/
protected $cachedBody = false;
- function __construct($body, $statusCode = 200, $headers = null) {
+ public function __construct($body, $statusCode = 200, $headers = null) {
$this->setbody($body);
$this->setStatusCode($statusCode);
$this->headers = $headers;
}
- function simpleXML() {
+ public function simpleXML() {
if(!$this->simpleXML) {
try {
$this->simpleXML = new SimpleXMLElement($this->body);
@@ -439,28 +439,28 @@ function simpleXML() {
/**
* @return string
*/
- function getCachedBody() {
+ public function getCachedBody() {
return $this->cachedBody;
}
/**
* @param string
*/
- function setCachedBody($content) {
+ public function setCachedBody($content) {
$this->cachedBody = $content;
}
/**
* Return an array of xpath matches
*/
- function xpath($xpath) {
+ public function xpath($xpath) {
return $this->simpleXML()->xpath($xpath);
}
/**
* Return the first xpath match
*/
- function xpath_one($xpath) {
+ public function xpath_one($xpath) {
$items = $this->xpath($xpath);
return $items[0];
}
10 cache/Cache.php
View
@@ -88,7 +88,7 @@ protected static function init(){
* @param array $options The Zend_Cache backend options (see http://framework.zend.com/manual/en/zend.cache.html)
* @return none
*/
- static function add_backend($name, $type, $options=array()) {
+ public static function add_backend($name, $type, $options=array()) {
self::init();
self::$backends[$name] = array($type, $options);
}
@@ -102,7 +102,7 @@ static function add_backend($name, $type, $options=array()) {
* A backend picked for a specific cache name will always be used instead of 'any' if it exists, no matter the priority.
* @return none
*/
- static function pick_backend($name, $for, $priority=1) {
+ public static function pick_backend($name, $for, $priority=1) {
self::init();
$current = -1;
@@ -115,7 +115,7 @@ static function pick_backend($name, $for, $priority=1) {
* Return the cache lifetime for a particular named cache.
* @return array
*/
- static function get_cache_lifetime($for) {
+ public static function get_cache_lifetime($for) {
return (isset(self::$cache_lifetime[$for])) ? self::$cache_lifetime[$for] : false;
}
@@ -126,7 +126,7 @@ static function get_cache_lifetime($for) {
* @param integer $lifetime The lifetime of an item of the cache, in seconds, or -1 to disable caching
* @param integer $priority The priority. The highest priority setting is used. Unlike backends, 'any' is not special in terms of priority.
*/
- static function set_cache_lifetime($for, $lifetime=600, $priority=1) {
+ public static function set_cache_lifetime($for, $lifetime=600, $priority=1) {
self::init();
$current = -1;
@@ -175,7 +175,7 @@ static function set_cache_lifetime($for, $lifetime=600, $priority=1) {
* See the Zend_Cache documentation at http://framework.zend.com/manual/en/zend.cache.html for more
*
*/
- static function factory($for, $frontend='Output', $frontendOptions=null) {
+ public static function factory($for, $frontend='Output', $frontendOptions=null) {
self::init();
$backend_name = 'default';
6 cli/CliController.php
View
@@ -15,7 +15,7 @@
'index'
);
- function init() {
+ public function init() {
parent::init();
// Unless called from the command line, all CliControllers need ADMIN privileges
if(!Director::is_cli() && !Permission::check("ADMIN")) {
@@ -23,7 +23,7 @@ function init() {
}
}
- function index() {
+ public function index() {
foreach(ClassInfo::subclassesFor($this->class) as $subclass) {
echo $subclass . "\n";
$task = new $subclass();
@@ -35,6 +35,6 @@ function index() {
/**
* Overload this method to contain the task logic.
*/
- function process() {}
+ public function process() {}
}
18 control/ContentNegotiator.php
View
@@ -1,7 +1,7 @@
<?php
/**
* The content negotiator performs "text/html" or "application/xhtml+xml" switching.
- * It does this through the static function ContentNegotiator::process().
+ * It does this through the public static function ContentNegotiator::process().
* By default, ContentNegotiator will comply to the Accept headers the clients
* sends along with the HTTP request, which is most likely "application/xhtml+xml"
* (see "Order of selection" below).
@@ -36,7 +36,7 @@ class ContentNegotiator {
* Set the character set encoding for this page. By default it's utf-8, but you could change it to, say, windows-1252, to
* improve interoperability with extended characters being imported from windows excel.
*/
- static function set_encoding($encoding) {
+ public static function set_encoding($encoding) {
self::$encoding = $encoding;
}
@@ -44,21 +44,21 @@ static function set_encoding($encoding) {
* Return the character encoding set bhy ContentNegotiator::set_encoding(). It's recommended that all classes that need to
* specify the character set make use of this function.
*/
- static function get_encoding() {
+ public static function get_encoding() {
return self::$encoding;
}
/**
* Enable content negotiation for all templates, not just those with the xml header.
*/
- static function enable() {
+ public static function enable() {
self::$enabled = true;
}
/*
* Disable content negotiation for all templates, not just those with the xml header.
*/
- static function disable() {
+ public static function disable() {
self::$enabled = false;
}
@@ -66,7 +66,7 @@ static function disable() {
* Returns true if negotation is enabled for the given response.
* By default, negotiation is only enabled for pages that have the xml header.
*/
- static function enabled_for($response) {
+ public static function enabled_for($response) {
$contentType = $response->getHeader("Content-Type");
// Disable content negotation for other content types
@@ -76,7 +76,7 @@ static function enabled_for($response) {
else return (substr($response->getBody(),0,5) == '<' . '?xml');
}
- static function process(SS_HTTPResponse $response) {
+ public static function process(SS_HTTPResponse $response) {
if(!self::enabled_for($response)) return;
$mimes = array(
@@ -129,7 +129,7 @@ static function process(SS_HTTPResponse $response) {
* @return string
* @todo More flexible tag and entity parsing through regular expressions or tag definition lists
*/
- function xhtml(SS_HTTPResponse $response) {
+ public function xhtml(SS_HTTPResponse $response) {
$content = $response->getBody();
// Only serve "pure" XHTML if the XML header is present
@@ -159,7 +159,7 @@ function xhtml(SS_HTTPResponse $response) {
* Replaces all occurrences of "application/xhtml+xml" with "text/html" in the template.
* Removes "xmlns" attributes and any <?xml> Pragmas.
*/
- function html(SS_HTTPResponse $response) {
+ public function html(SS_HTTPResponse $response) {
$response->addHeader("Content-Type", "text/html; charset=" . self::$encoding);
$response->addHeader("Vary", "Accept");
42 control/Controller.php
View
@@ -68,7 +68,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
*
* @uses BasicAuth::requireLogin()
*/
- function init() {
+ public function init() {
if($this->basicAuthEnabled) BasicAuth::protect_site_if_necessary();
// Directly access the session variable just in case the Group or Member tables don't yet exist
@@ -87,7 +87,7 @@ function init() {
/**
* Returns a link to this controller. Overload with your own Link rules if they exist.
*/
- function Link() {
+ public function Link() {
return get_class($this) .'/';
}
@@ -122,7 +122,7 @@ function Link() {
* @return SS_HTTPResponse The response that this controller produces,
* including HTTP headers such as redirection info
*/
- function handleRequest(SS_HTTPRequest $request, DataModel $model) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
if(!$request) user_error("Controller::handleRequest() not passed a request!", E_USER_ERROR);
$this->pushCurrent();
@@ -205,14 +205,14 @@ public function handleAction($request) {
}
}
- function setURLParams($urlParams) {
+ public function setURLParams($urlParams) {
$this->urlParams = $urlParams;
}
/**
* @return array The parameters extracted from the URL by the {@link Director}.
*/
- function getURLParams() {
+ public function getURLParams() {
return $this->urlParams;
}
@@ -220,7 +220,7 @@ function getURLParams() {
* Returns the SS_HTTPResponse object that this controller is building up.
* Can be used to set the status code and headers
*/
- function getResponse() {
+ public function getResponse() {
return $this->response;
}
@@ -230,7 +230,7 @@ function getResponse() {
* Return the object that is going to own a form that's being processed, and handle its execution.
* Note that the result needn't be an actual controller object.
*/
- function getFormOwner() {
+ public function getFormOwner() {
// Get the appropraite ocntroller: sometimes we want to get a form from another controller
if(isset($this->requestParams['formController'])) {
$formController = Director::getControllerForURL($this->requestParams['formController']);
@@ -249,14 +249,14 @@ function getFormOwner() {
* This is the default action handler used if a method doesn't exist.
* It will process the controller object with the template returned by {@link getViewer()}
*/
- function defaultAction($action) {
+ public function defaultAction($action) {
return $this->getViewer($action)->process($this);
}
/**
* Returns the action that is being executed on this controller.
*/
- function getAction() {
+ public function getAction() {
return $this->action;
}
@@ -264,7 +264,7 @@ function getAction() {
* Return an SSViewer object to process the data
* @return SSViewer The viewer identified being the default handler for this Controller/Action combination
*/
- function getViewer($action) {
+ public function getViewer($action) {
// Hard-coded templates
if($this->templates[$action]) {
$templates = $this->templates[$action];
@@ -347,7 +347,7 @@ public function hasActionTemplate($action) {
* @param array $params Key-value array for custom template variables (Optional)
* @return string Parsed template content
*/
- function render($params = null) {
+ public function render($params = null) {
$template = $this->getViewer($this->getAction());
// if the object is already customised (e.g. through Controller->run()), use it
@@ -363,7 +363,7 @@ function render($params = null) {
* This must be called before Controller::init(). That is, you must call it in your controller's
* init method before it calls parent::init().
*/
- function disableBasicAuth() {
+ public function disableBasicAuth() {
$this->basicAuthEnabled = false;
}
@@ -394,7 +394,7 @@ public static function has_curr() {
* in user.
* @return boolean
*/
- function can($perm, $member = null) {
+ public function can($perm, $member = null) {
if(!$member) $member = Member::currentUser();
if(is_array($perm)) {
$perm = array_map(array($this, 'can'), $perm, array_fill(0, count($perm), $member));
@@ -414,7 +414,7 @@ function can($perm, $member = null) {
* This means that any redirection, session setting, or other things that rely on Controller::curr() will now write to this
* controller object.
*/
- function pushCurrent() {
+ public function pushCurrent() {
array_unshift(self::$controller_stack, $this);
// Create a new session object
if(!$this->session) {
@@ -429,7 +429,7 @@ function pushCurrent() {
/**
* Pop this controller off the top of the stack.
*/
- function popCurrent() {
+ public function popCurrent() {
if($this === self::$controller_stack[0]) {
array_shift(self::$controller_stack);
} else {
@@ -440,7 +440,7 @@ function popCurrent() {
/**
* Redirect to the given URL.
*/
- function redirect($url, $code=302) {
+ public function redirect($url, $code=302) {
if(!$this->response) $this->response = new SS_HTTPResponse();
if($this->response->getHeader('Location')) {
@@ -464,7 +464,7 @@ function redirect($url, $code=302) {
* URL (see {@link Director::baseURL()}).
* @uses redirect()
*/
- function redirectBack() {
+ public function redirectBack() {
$url = null;
// In edge-cases, this will be called outside of a handleRequest() context; in that case,
@@ -493,7 +493,7 @@ function redirectBack() {
* Tests whether a redirection has been requested.
* @return string If redirect() has been called, it will return the URL redirected to. Otherwise, it will return null;
*/
- function redirectedTo() {
+ public function redirectedTo() {
return $this->response && $this->response->getHeader('Location');
}
@@ -501,14 +501,14 @@ function redirectedTo() {
* Get the Session object representing this Controller's session
* @return Session
*/
- function getSession() {
+ public function getSession() {
return $this->session;
}
/**
* Set the Session object.
*/