Resource-fs base class.
| package | commandr |
|---|
can_accept_filetype(string $filetype) : array
stringThe file type (no file extension)
arrayList of our resource types that canconvert_filename_to_id(\ID_TEXT $filename, \ID_TEXT $resource_type) : \?array
\ID_TEXTThe filename, or filepath
\ID_TEXTThe resource type
\?arrayA pair: The resource type, the resource ID (null: could not find)convert_id_to_filename(\ID_TEXT $resource_type, \ID_TEXT $resource_id) : \?ID_TEXT
\ID_TEXTThe resource type
\ID_TEXTThe resource ID
\?ID_TEXTThe filename (null: not found)convert_label_to_filename(\LONG_TEXT $label, string $subpath, \ID_TEXT $resource_type, boolean $must_already_exist= false, \?ID_TEXT $use_guid_for_new= null) : \?ID_TEXT
\LONG_TEXTResource label
stringThe path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
\ID_TEXTResource type
booleanWhether the content must already exist
\?ID_TEXTGUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)
\?ID_TEXTThe filename (null: not found)convert_label_to_id(\SHORT_TEXT $_label, string $subpath, \ID_TEXT $resource_type, boolean $must_already_exist= false, \?ID_TEXT $use_guid_for_new= null) : \?ID_TEXT
\SHORT_TEXTResource label
stringThe path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
\ID_TEXTResource type
booleanWhether the content must already exist
\?ID_TEXTGUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)
\?ID_TEXTThe ID (null: not found)file_convert_filename_to_id(\ID_TEXT $filename, \?ID_TEXT $resource_type = null) : \?array
\ID_TEXTThe filename, or filepath
\?ID_TEXTThe resource type (null: assumption of only one folder resource type for this hook; only passed as non-NULL from overridden functions within hooks that are calling this as a helper function)
\?arrayA pair: The resource type, the resource ID (null: could not find)file_convert_id_to_filename(\ID_TEXT $resource_type, \ID_TEXT $resource_id) : \?ID_TEXT
\ID_TEXTThe resource type
\ID_TEXTThe resource ID
\?ID_TEXTThe filename (null: could not find)file_load__flat(\ID_TEXT $filename, string $path) : \~string
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
\~stringResource data (false: error)file_load_xml(\ID_TEXT $filename, string $path) : \~string
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
\~stringResource data (false: error)file_save(\ID_TEXT $filename, string $path, array $properties, \?ID_TEXT $search_label_as= null, \?ID_TEXT $search_path= null) : \~ID_TEXT
\ID_TEXTFilename
stringThe path to save at (blank: root / not applicable)
arrayProperties
\?ID_TEXTWhether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXTSearch path (null: the same as the path saving at)
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)file_save__flat(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
stringResource data
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)file_save_xml(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
stringResource data
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)folder_convert_filename_to_id(\ID_TEXT $filename, \?ID_TEXT $resource_type = null) : array
\ID_TEXTThe filename, or filepath
\?ID_TEXTThe resource type (null: assumption of only one folder resource type for this hook; only passed as non-NULL from overridden functions within hooks that are calling this as a helper function)
arrayA pair: The resource type, the resource IDfolder_convert_id_to_filename(\ID_TEXT $resource_type, \ID_TEXT $resource_id) : \?ID_TEXT
\ID_TEXTThe resource type
\ID_TEXTThe resource ID
\?ID_TEXTThe filename (null: could not find)folder_load__flat(\ID_TEXT $filename, string $path) : \~string
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
\~stringResource data (false: error)folder_load_xml(\ID_TEXT $filename, string $path) : \~string
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
\~stringResource data (false: error)folder_save(\ID_TEXT $filename, string $path, array $properties, \?ID_TEXT $search_label_as= null, \?ID_TEXT $search_path= null) : \~ID_TEXT
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
arrayProperties
\?ID_TEXTWhether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXTSearch path (null: the same as the path saving at)
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)folder_save__flat(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
stringResource data
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)folder_save_xml(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXTFilename
stringThe path (blank: root / not applicable)
stringResource data
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)get_resource_access(\ID_TEXT $filename) : array
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from group ID to view accessget_resource_access__members(\ID_TEXT $filename) : array
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from member ID to view accessget_resource_privileges(\ID_TEXT $filename) : array
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA map between group ID, and a map of privilege to settingget_resource_privileges__members(\ID_TEXT $filename) : array
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA map between member ID, and a map of privilege to settingis_file_type(\ID_TEXT $resource_type) : boolean
\ID_TEXTThe resource type
booleanWhether it isis_folder_type(\ID_TEXT $resource_type) : boolean
\ID_TEXTThe resource type
booleanWhether it islisting(array $meta_dir, string $meta_root_node, object $commandr_fs) : \~array
arrayThe current meta-directory path
stringThe root node of the current meta-directory
objectA reference to the Commandr filesystem object
\~arrayThe final directory listing (false: failure)make_directory(array $meta_dir, string $meta_root_node, string $new_dir_name, object $commandr_fs) : boolean
arrayThe current meta-directory path
stringThe root node of the current meta-directory
stringThe new directory name
objectA reference to the Commandr filesystem object
booleanSuccess?read_file(array $meta_dir, string $meta_root_node, string $file_name, object $commandr_fs) : \~string
arrayThe current meta-directory path
stringThe root node of the current meta-directory
stringThe file name
objectA reference to the Commandr filesystem object
\~stringThe file contents (false: failure)remove_directory(array $meta_dir, string $meta_root_node, string $dir_name, object $commandr_fs) : boolean
arrayThe current meta-directory path
stringThe root node of the current meta-directory
stringThe directory name
objectA reference to the Commandr filesystem object
booleanSuccess?remove_file(array $meta_dir, string $meta_root_node, string $file_name, object $commandr_fs) : boolean
arrayThe current meta-directory path
stringThe root node of the current meta-directory
stringThe file name
objectA reference to the Commandr filesystem object
booleanSuccess?reset_resource_access(\ID_TEXT $filename)
\ID_TEXTResource filename (assumed to be of a folder type)
reset_resource_privileges(\ID_TEXT $filename)
\ID_TEXTResource filename (assumed to be of a folder type)
resource_add(\ID_TEXT $resource_type, \LONG_TEXT $label, string $path, \?array $properties = null) : \~ID_TEXT
\ID_TEXTResource type
\LONG_TEXTFilename OR Resource label
stringThe path (blank: root / not applicable)
\?arrayProperties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields) (null: none)
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)resource_delete(\ID_TEXT $resource_type, \ID_TEXT $filename, string $path) : boolean
\ID_TEXTResource type
\ID_TEXTThe filename
stringThe path (blank: root / not applicable)
booleanSuccess statusresource_edit(\ID_TEXT $resource_type, \ID_TEXT $filename, string $path, array $properties, boolean $explicit_move = false) : \~ID_TEXT
\ID_TEXTResource type
\ID_TEXTThe filename
stringThe path (blank: root / not applicable)
arrayProperties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)
booleanWhether we are definitely moving (as opposed to possible having it in multiple positions)
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)resource_load(\ID_TEXT $resource_type, \SHORT_TEXT $filename, string $path) : \~array
\ID_TEXTResource type
\SHORT_TEXTFilename
stringThe path (blank: root / not applicable)
\~arrayDetails of the resource (false: error)resource_save(\ID_TEXT $resource_type, \ID_TEXT $label, string $path, \?array $properties= null, \?ID_TEXT $search_label_as= null, \?ID_TEXT $search_path= null) : \~ID_TEXT
\ID_TEXTThe resource type
\ID_TEXTFilename OR Resource label
stringThe path (blank: root / not applicable)
\?arrayProperties (null: none)
\?ID_TEXTWhether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXTSearch path (null: the same as the path saving at)
\~ID_TEXTThe resource ID (false: error, could not create via these properties / here)search(\ID_TEXT $resource_type, \ID_TEXT $resource_id, boolean $full_subpath = false) : \?string
\ID_TEXTThe resource type
\ID_TEXTThe resource ID
booleanWhether to include the full subpath
\?stringThe foldername/subpath (null: not found)set_resource_access(\ID_TEXT $filename, array $groups)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from group ID to view access
set_resource_access__members(\ID_TEXT $filename, array $members)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from member ID to view access
set_resource_privileges(\ID_TEXT $filename, array $group_settings)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA map between group ID, and a map of privilege to setting
set_resource_privileges__members(\ID_TEXT $filename, array $member_settings)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA map between member ID, and a map of privilege to setting
set_resource_privileges_from_preset(\ID_TEXT $filename, array $group_presets)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from group ID to preset value. Preset values are 0 (read only) to 3 (moderation)
set_resource_privileges_from_preset__members(\ID_TEXT $filename, array $member_presets)
\ID_TEXTResource filename (assumed to be of a folder type)
arrayA mapping from member ID to preset value. Preset values are 0 (read only) to 3 (moderation)
write_file(array $meta_dir, string $meta_root_node, string $file_name, string $contents, object $commandr_fs) : boolean
arrayThe current meta-directory path
stringThe root node of the current meta-directory
stringThe file name
stringThe new file contents
objectA reference to the Commandr filesystem object
booleanSuccess?_compute_privilege_preset_scheme(\ID_TEXT $filename) : \?array
\ID_TEXTResource filename (assumed to be of a folder type)
\?arrayA mapping from privilege to minimum preset level required for privilege activation (null: unworkable)_create_name_from_label(\LONG_TEXT $label) : \ID_TEXT
\LONG_TEXTThe label
\ID_TEXTThe name_custom_fields_enumerate_properties(\ID_TEXT $type) : array
\ID_TEXTThe resource type
arrayDetails of properties_custom_fields_load(\ID_TEXT $type, \ID_TEXT $id) : array
\ID_TEXTThe resource type
\ID_TEXTThe content ID
arrayLoaded properties_custom_fields_save(\ID_TEXT $type, \ID_TEXT $id, array $properties)
\ID_TEXTThe resource type
\ID_TEXTThe content ID
arrayProperties to save
_default_property_int(array $properties, \ID_TEXT $property) : \?integer
arrayThe properties
\ID_TEXTThe property
\?integerThe value (null: NULL value)_default_property_int_modeavg(array $properties, \ID_TEXT $property, \ID_TEXT $table, integer $default, \?ID_TEXT $db_property = null) : integer
arrayThe properties
\ID_TEXTThe property
\ID_TEXTThe table to average within
integerThe last-resort default
\?ID_TEXTThe database property (null: same as $property)
integerThe value_default_property_int_null(array $properties, \ID_TEXT $property) : \?integer
arrayThe properties
\ID_TEXTThe property
\?integerThe value (null: NULL value)_default_property_str(array $properties, \ID_TEXT $property) : \?string
arrayThe properties
\ID_TEXTThe property
\?stringThe value (null: NULL value)_default_property_str_null(array $properties, \ID_TEXT $property) : \?string
arrayThe properties
\ID_TEXTThe property
\?stringThe value (null: NULL value)_file_magic_filter(\LONG_TEXT $filename, string $path, array $properties) : array
\LONG_TEXTFilename OR Resource label
stringThe path (blank: root / not applicable)
arrayProperties
arrayA pair: the resource label, Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)_folder_magic_filter(\LONG_TEXT $filename, string $path, array $properties) : array
\LONG_TEXTFilename OR Resource label
stringThe path (blank: root / not applicable)
arrayProperties
arrayA pair: the resource label, Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)_get_cma_info(\ID_TEXT $resource_type) : object
\ID_TEXTThe resource type
objectThe object_get_translated_text(\AUTO_LINK $lang_id, object $db) : array
\AUTO_LINKLanguage ID
objectDatabase connection to look up from
arrayA map of language to the text in that language_has_parent_child_relationship(\?ID_TEXT $above, \ID_TEXT $under) : \?array
\?ID_TEXTFolder resource type (null: root)
\ID_TEXTResource type (may be file or folder)
\?arrayA map: The parent referencing field, the table it is in, and the ID field of that table (null: cannot be under)_integer_category(\?ID_TEXT $category) : \?integer
\?ID_TEXTThe category value (blank: root) (null: root)
\?integerThe category (null: root)_is_active() : boolean
booleanWhether it is_log_if_save_matchup(\?ID_TEXT $resource_type, \~ID_TEXT $resource_id, string $path, array $properties)
\?ID_TEXTThe resource type (null: unknown)
\~ID_TEXTThe resource ID (false: was not added/edited)
stringThe path (blank: root / not applicable)
arrayProperties
$_cma_object
array()$file_resource_type
null$folder_resource_type
null