Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Collapse the numerous constants files into a few less
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Nov 18, 2014
1 parent bfaf455 commit 4dd8e30
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 353 deletions.
3 changes: 1 addition & 2 deletions core/constant/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
limitations under the License.
=========================================================================*/

// Web API error codes
define('MIDAS_INTERNAL_ERROR', -100);
define('MIDAS_INVALID_TOKEN', -101);
define('MIDAS_UPLOAD_FAILED', -105);
Expand All @@ -31,7 +30,6 @@
define('MIDAS_HTTP_ERROR', -153);
define('MIDAS_NOT_FOUND', -154);

// List of permission scopes
define('MIDAS_API_PERMISSION_SCOPE_ALL', 0);
define('MIDAS_API_PERMISSION_SCOPE_READ_USER_INFO', 1);
define('MIDAS_API_PERMISSION_SCOPE_WRITE_USER_INFO', 2);
Expand All @@ -40,6 +38,7 @@
define('MIDAS_API_PERMISSION_SCOPE_ADMIN_DATA', 5);
define('MIDAS_API_PERMISSION_SCOPE_READ_GROUPS', 6);
define('MIDAS_API_PERMISSION_SCOPE_MANAGE_GROUPS', 7);

Zend_Registry::set(
'permissionScopeMap',
array(
Expand Down
31 changes: 0 additions & 31 deletions core/constant/apierror.php

This file was deleted.

24 changes: 0 additions & 24 deletions core/constant/community.php

This file was deleted.

89 changes: 89 additions & 0 deletions core/constant/core.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
/*=========================================================================
MIDAS Server
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
All rights reserved.
More information http://www.kitware.com
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.txt
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.
=========================================================================*/

define('MIDAS_ASSETSTORE_LOCAL', 0);
define('MIDAS_ASSETSTORE_REMOTE', 1);

define('MIDAS_COMMUNITY_PUBLIC', 0);
define('MIDAS_COMMUNITY_PRIVATE', 1);
define('MIDAS_COMMUNITY_CAN_JOIN', 1);
define('MIDAS_COMMUNITY_INVITATION_ONLY', 0);

define('MIDAS_DATA', 1001);
define('MIDAS_ONE_TO_MANY', 1002);
define('MIDAS_MANY_TO_ONE', 1003);
define('MIDAS_ONE_TO_ONE', 1004);
define('MIDAS_MANY_TO_MANY', 1005);

define('MIDAS_EVENT_PRIORITY_NORMAL', 1);
define('MIDAS_EVENT_PRIORITY_LOW', 0);
define('MIDAS_EVENT_PRIORITY_HIGH', 2);

define('MIDAS_FEED_CREATE_COMMUNITY', 0);
define('MIDAS_FEED_DELETE_COMMUNITY', 1);
define('MIDAS_FEED_UPDATE_COMMUNITY', 2);
define('MIDAS_FEED_COMMUNITY_INVITATION', 3);
define('MIDAS_FEED_CREATE_USER', 10);
define('MIDAS_FEED_CREATE_FOLDER', 20);
define('MIDAS_FEED_DELETE_FOLDER', 21);
define('MIDAS_FEED_CREATE_ITEM', 30);
define('MIDAS_FEED_DELETE_ITEM', 31);
define('MIDAS_FEED_CREATE_LINK_ITEM', 32);
define('MIDAS_FEED_CREATE_REVISION', 40);

define('MIDAS_FOLDER_USERPARENT', -1);
define('MIDAS_FOLDER_COMMUNITYPARENT', -2);

define('MIDAS_GROUP_ANONYMOUS_KEY', 0);
define('MIDAS_GROUP_SERVER_KEY', -1);

define('MIDAS_METADATA_TEXT', 0);
define('MIDAS_METADATA_INT', 1);
define('MIDAS_METADATA_DOUBLE', 2);
define('MIDAS_METADATA_FLOAT', 3);
define('MIDAS_METADATA_BOOLEAN', 4);
define('MIDAS_METADATA_LONG', 5);
define('MIDAS_METADATA_STRING', 6);

define('MIDAS_POLICY_READ', 0);
define('MIDAS_POLICY_WRITE', 1);
define('MIDAS_POLICY_ADMIN', 2);

define('MIDAS_PRIORITY_CRITICAL', 2);
define('MIDAS_PRIORITY_WARNING', 4);
define('MIDAS_PRIORITY_INFO', 6);
define('MIDAS_PRIORITY_DEBUG', 7);

define('MIDAS_PRIVACY_PUBLIC', 0);
define('MIDAS_PRIVACY_PRIVATE', 2);

define('MIDAS_RESOURCE_BITSTREAM', 0);
define('MIDAS_RESOURCE_ITEM', 1);
define('MIDAS_RESOURCE_USER', 2);
define('MIDAS_RESOURCE_REVISION', 3);
define('MIDAS_RESOURCE_FOLDER', 4);
define('MIDAS_RESOURCE_ASSETSTORE', 5);
define('MIDAS_RESOURCE_COMMUNITY', 6);

define('MIDAS_TASK_ITEM_THUMBNAIL', 0);

define('MIDAS_USER_PUBLIC', 0);
define('MIDAS_USER_PRIVATE', 1);
define('MIDAS_MAXIMUM_FOLDER_NUMBERS_PER_LEVEL', 1000);
28 changes: 0 additions & 28 deletions core/constant/datatype.php

This file was deleted.

24 changes: 0 additions & 24 deletions core/constant/error.php

This file was deleted.

35 changes: 0 additions & 35 deletions core/constant/feed.php

This file was deleted.

22 changes: 0 additions & 22 deletions core/constant/folder.php

This file was deleted.

22 changes: 0 additions & 22 deletions core/constant/group.php

This file was deleted.

27 changes: 0 additions & 27 deletions core/constant/metadata.php

This file was deleted.

23 changes: 0 additions & 23 deletions core/constant/notification.php

This file was deleted.

26 changes: 0 additions & 26 deletions core/constant/policy.php

This file was deleted.

Loading

0 comments on commit 4dd8e30

Please sign in to comment.