Resource-fs base class.
package | commandr |
---|
can_accept_filetype(string $filetype) : array
string
The file type (no file extension)
array
List of our resource types that canconvert_filename_to_id(\ID_TEXT $filename, \ID_TEXT $resource_type) : \?array
\ID_TEXT
The filename, or filepath
\ID_TEXT
The resource type
\?array
A 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_TEXT
The resource type
\ID_TEXT
The resource ID
\?ID_TEXT
The 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_TEXT
Resource label
string
The path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
\ID_TEXT
Resource type
boolean
Whether the content must already exist
\?ID_TEXT
GUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)
\?ID_TEXT
The 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_TEXT
Resource label
string
The path (blank: root / not applicable). It may end in "/*" if you want to look for a match under a certain directory
\ID_TEXT
Resource type
boolean
Whether the content must already exist
\?ID_TEXT
GUID to auto-create with (null: either not auto-creating, or not specifying the GUID if we are)
\?ID_TEXT
The ID (null: not found)file_convert_filename_to_id(\ID_TEXT $filename, \?ID_TEXT $resource_type = null
) : \?array
\ID_TEXT
The filename, or filepath
\?ID_TEXT
The 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)
\?array
A 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_TEXT
The resource type
\ID_TEXT
The resource ID
\?ID_TEXT
The filename (null: could not find)file_load__flat(\ID_TEXT $filename, string $path) : \~string
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
\~string
Resource data (false: error)file_load_xml(\ID_TEXT $filename, string $path) : \~string
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
\~string
Resource 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_TEXT
Filename
string
The path to save at (blank: root / not applicable)
array
Properties
\?ID_TEXT
Whether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXT
Search path (null: the same as the path saving at)
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)file_save__flat(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
string
Resource data
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)file_save_xml(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
string
Resource data
\~ID_TEXT
The 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_TEXT
The filename, or filepath
\?ID_TEXT
The 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)
array
A pair: The resource type, the resource IDfolder_convert_id_to_filename(\ID_TEXT $resource_type, \ID_TEXT $resource_id) : \?ID_TEXT
\ID_TEXT
The resource type
\ID_TEXT
The resource ID
\?ID_TEXT
The filename (null: could not find)folder_load__flat(\ID_TEXT $filename, string $path) : \~string
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
\~string
Resource data (false: error)folder_load_xml(\ID_TEXT $filename, string $path) : \~string
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
\~string
Resource 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_TEXT
Filename
string
The path (blank: root / not applicable)
array
Properties
\?ID_TEXT
Whether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXT
Search path (null: the same as the path saving at)
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)folder_save__flat(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
string
Resource data
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)folder_save_xml(\ID_TEXT $filename, string $path, string $data) : \~ID_TEXT
\ID_TEXT
Filename
string
The path (blank: root / not applicable)
string
Resource data
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)get_resource_access(\ID_TEXT $filename) : array
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A mapping from group ID to view accessget_resource_access__members(\ID_TEXT $filename) : array
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A mapping from member ID to view accessget_resource_privileges(\ID_TEXT $filename) : array
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A map between group ID, and a map of privilege to settingget_resource_privileges__members(\ID_TEXT $filename) : array
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A map between member ID, and a map of privilege to settingis_file_type(\ID_TEXT $resource_type) : boolean
\ID_TEXT
The resource type
boolean
Whether it isis_folder_type(\ID_TEXT $resource_type) : boolean
\ID_TEXT
The resource type
boolean
Whether it islisting(array $meta_dir, string $meta_root_node, object $commandr_fs) : \~array
array
The current meta-directory path
string
The root node of the current meta-directory
object
A reference to the Commandr filesystem object
\~array
The final directory listing (false: failure)make_directory(array $meta_dir, string $meta_root_node, string $new_dir_name, object $commandr_fs) : boolean
array
The current meta-directory path
string
The root node of the current meta-directory
string
The new directory name
object
A reference to the Commandr filesystem object
boolean
Success?read_file(array $meta_dir, string $meta_root_node, string $file_name, object $commandr_fs) : \~string
array
The current meta-directory path
string
The root node of the current meta-directory
string
The file name
object
A reference to the Commandr filesystem object
\~string
The file contents (false: failure)remove_directory(array $meta_dir, string $meta_root_node, string $dir_name, object $commandr_fs) : boolean
array
The current meta-directory path
string
The root node of the current meta-directory
string
The directory name
object
A reference to the Commandr filesystem object
boolean
Success?remove_file(array $meta_dir, string $meta_root_node, string $file_name, object $commandr_fs) : boolean
array
The current meta-directory path
string
The root node of the current meta-directory
string
The file name
object
A reference to the Commandr filesystem object
boolean
Success?reset_resource_access(\ID_TEXT $filename)
\ID_TEXT
Resource filename (assumed to be of a folder type)
reset_resource_privileges(\ID_TEXT $filename)
\ID_TEXT
Resource 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_TEXT
Resource type
\LONG_TEXT
Filename OR Resource label
string
The path (blank: root / not applicable)
\?array
Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields) (null: none)
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)resource_delete(\ID_TEXT $resource_type, \ID_TEXT $filename, string $path) : boolean
\ID_TEXT
Resource type
\ID_TEXT
The filename
string
The path (blank: root / not applicable)
boolean
Success statusresource_edit(\ID_TEXT $resource_type, \ID_TEXT $filename, string $path, array $properties, boolean $explicit_move = false
) : \~ID_TEXT
\ID_TEXT
Resource type
\ID_TEXT
The filename
string
The path (blank: root / not applicable)
array
Properties (may be empty, properties given are open to interpretation by the hook but generally correspond to database fields)
boolean
Whether we are definitely moving (as opposed to possible having it in multiple positions)
\~ID_TEXT
The resource ID (false: error, could not create via these properties / here)resource_load(\ID_TEXT $resource_type, \SHORT_TEXT $filename, string $path) : \~array
\ID_TEXT
Resource type
\SHORT_TEXT
Filename
string
The path (blank: root / not applicable)
\~array
Details 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_TEXT
The resource type
\ID_TEXT
Filename OR Resource label
string
The path (blank: root / not applicable)
\?array
Properties (null: none)
\?ID_TEXT
Whether to look for existing records using $filename as a label and this resource type (null: $filename is a strict file name)
\?ID_TEXT
Search path (null: the same as the path saving at)
\~ID_TEXT
The 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_TEXT
The resource type
\ID_TEXT
The resource ID
boolean
Whether to include the full subpath
\?string
The foldername/subpath (null: not found)set_resource_access(\ID_TEXT $filename, array $groups)
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A mapping from group ID to view access
set_resource_access__members(\ID_TEXT $filename, array $members)
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A mapping from member ID to view access
set_resource_privileges(\ID_TEXT $filename, array $group_settings)
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A map between group ID, and a map of privilege to setting
set_resource_privileges__members(\ID_TEXT $filename, array $member_settings)
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A map between member ID, and a map of privilege to setting
set_resource_privileges_from_preset(\ID_TEXT $filename, array $group_presets)
\ID_TEXT
Resource filename (assumed to be of a folder type)
array
A 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_TEXT
Resource filename (assumed to be of a folder type)
array
A 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
array
The current meta-directory path
string
The root node of the current meta-directory
string
The file name
string
The new file contents
object
A reference to the Commandr filesystem object
boolean
Success?_compute_privilege_preset_scheme(\ID_TEXT $filename) : \?array
\ID_TEXT
Resource filename (assumed to be of a folder type)
\?array
A mapping from privilege to minimum preset level required for privilege activation (null: unworkable)_create_name_from_label(\LONG_TEXT $label) : \ID_TEXT
\LONG_TEXT
The label
\ID_TEXT
The name_custom_fields_enumerate_properties(\ID_TEXT $type) : array
\ID_TEXT
The resource type
array
Details of properties_custom_fields_load(\ID_TEXT $type, \ID_TEXT $id) : array
\ID_TEXT
The resource type
\ID_TEXT
The content ID
array
Loaded properties_custom_fields_save(\ID_TEXT $type, \ID_TEXT $id, array $properties)
\ID_TEXT
The resource type
\ID_TEXT
The content ID
array
Properties to save
_default_property_int(array $properties, \ID_TEXT $property) : \?integer
array
The properties
\ID_TEXT
The property
\?integer
The value (null: NULL value)_default_property_int_modeavg(array $properties, \ID_TEXT $property, \ID_TEXT $table, integer $default, \?ID_TEXT $db_property = null
) : integer
array
The properties
\ID_TEXT
The property
\ID_TEXT
The table to average within
integer
The last-resort default
\?ID_TEXT
The database property (null: same as $property)
integer
The value_default_property_int_null(array $properties, \ID_TEXT $property) : \?integer
array
The properties
\ID_TEXT
The property
\?integer
The value (null: NULL value)_default_property_str(array $properties, \ID_TEXT $property) : \?string
array
The properties
\ID_TEXT
The property
\?string
The value (null: NULL value)_default_property_str_null(array $properties, \ID_TEXT $property) : \?string
array
The properties
\ID_TEXT
The property
\?string
The value (null: NULL value)_file_magic_filter(\LONG_TEXT $filename, string $path, array $properties) : array
\LONG_TEXT
Filename OR Resource label
string
The path (blank: root / not applicable)
array
Properties
array
A 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_TEXT
Filename OR Resource label
string
The path (blank: root / not applicable)
array
Properties
array
A 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_TEXT
The resource type
object
The object_get_translated_text(\AUTO_LINK $lang_id, object $db) : array
\AUTO_LINK
Language ID
object
Database connection to look up from
array
A map of language to the text in that language_has_parent_child_relationship(\?ID_TEXT $above, \ID_TEXT $under) : \?array
\?ID_TEXT
Folder resource type (null: root)
\ID_TEXT
Resource type (may be file or folder)
\?array
A 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_TEXT
The category value (blank: root) (null: root)
\?integer
The category (null: root)_is_active() : boolean
boolean
Whether it is_log_if_save_matchup(\?ID_TEXT $resource_type, \~ID_TEXT $resource_id, string $path, array $properties)
\?ID_TEXT
The resource type (null: unknown)
\~ID_TEXT
The resource ID (false: was not added/edited)
string
The path (blank: root / not applicable)
array
Properties
$_cma_object
array()
$file_resource_type
null
$folder_resource_type
null