System management scripts

add_user_own_access.php

The add_user_own_access.php script ensures that each user in the system has permissions to access their Matrix user asset and is provided as a fail-safe measure in case the permissions have become corrupted. Primarily, this script is used during upgrade procedures.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

$ php add_user_own_access.php [system_root]

WARNING: You are running this integrity checker on the whole system.
This is fine but:
  it may take a long time; and
  it will acquire locks on many of your assets (meaning you wont be able to
  edit content for a while)

Root User [ # 5 ]            [ OK ]

asset_listing_change_metadata_sort_option.php

The asset_listing_change_metadata_sort_option.php script will generate the SQL queries needed to change the metadata sorting options from raw to presentation or vice versa for an asset listing page. It does not run this SQL on the system but instead allows you to run it using a client of your choice.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

check_requirements.php

The check_requirements.php script is a requirements checking script that will verify the program requirements of a Matrix installation against your server configuration. Notification will be made for any required third-party applications, PHP extensions, and PEAR packages. Utilities providing optional functionality within Matrix will also be suggested.

This script is located in the /install directory of your Matrix system and takes the following parameter:

  • The system root directory.

The clean_old_shadow_links.php script cleans links to shadow assets within Matrix that are no longer valid. This is usually due to the assets having since been removed from the data source (for example, an LDAP backend user is linked under a user group but is later removed from the LDAP directory).

When this script is first run, it will return a list of shadow links for review. These links can then be saved to a specified file (as either SQL statements or a PHP array) and passed back into the script for deletion.

This script is located in the /scripts/dev directory of your Matrix system and takes the following parameters:

-m

The system root directory.

-s

The file path to save SQL statements to delete old shadow links (optional).

You will need to use an SQL client, such as psql, to execute the SQL statements generated on this parameter.
-p

The file path to save a PHP array of old shadow links (optional).

-d

The path of a PHP file, generated by this script’s -p option, to delete old shadow links from the database (optional).

In the following example, the clean_old_shadow_links.php script is run three times.

On the first run, the script returns a list of old shadow links in the system:

Example
$ php clean_old_shadow_links.php -m [system_root]

List of old shadow links:

  linkid | type | majorid | minorid
-------+------+---------+--------------------------------------------------------
 11583 |    1 |    6    | 7094:uid=Manager,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net
 11599 |    1 |    3091 | 3038:3

(Number of links: 2)

You will need to run this script with -s or -p option to save the shadow links to files
and -d option to delete the shadow links stored in the output file generated by -p option.
(You have to use an SQL client like psql to execute the SQL statements generated by -s option)

--------------------------------------------------------------------------------------------------------

On the second run, the deleted shadow links are saved to the old_links.php file, as specified in the -p parameter.

Example
$ php clean_old_shadow_links.php -m [system_root] -p old_shadow_links.php

List of old shadow links:

linkid | type | majorid | minorid
--------+------+---------+--------------------------------------------------------
 11583 |    1 |    6    | 7094:uid=Manager,ou=Staff,o=Squiz,c=au,dc=demo,dc=squiz,dc=net
 11599 |    1 |    3091 | 3038:3
(Number of links: 2)

The PHP array to delete the old shadow links are saved to old_links.php

---------------------------------------------------------------------------------------------------------

On the final run, the old_links.php file is passed into the script (through the -d parameter), and the old shadow links are deleted from the database.

Example
$ php clean_old_shadow_links.php -m [system_root] -d old_shadow_links.php

2 old shadow link(s) from old_links.php were deleted successfully.

clear_cron_deadlock.php

Clears the deadlock on the scheduled jobs manager (cron manager).

The script takes the following parameters:

[system_root]

The system root directory.

--clear

Tell the script that you want to clear the deadlock manually. If this is not passed, the script will tell you if there is a deadlock or not.

--force

Force the clearing of the deadlock. If this is not passed, the script will only clear the deadlock if the cron is meant to be running and has tried to run more times than the maximum warning limit.

Example
$ php scripts/clear_cron_deadlock.php .
--clear --force
Cron Running: No, Run Checks: 0/3
Manual Clear Complete
Before version 5.4.1.0, the --clear parameter was called --reset. For any system before this version, you need to use --reset instead of --clear.

generate_ssh_key.php

This script can generate an SSH key, which can be used on external services supporting SSH key authorization, such as the git file bridge.

If an SSH key has not yet been generated on your system, you can use this script to generate the SSH RSA public/private key pair.

This script takes the following parameters:

  • The root directory of your system.

    --generate

    Indicates to generate the SSH key.

    --info

    Display existing SSH key info.

Example
$ php scripts/generate_ssh_key.php <system_root> --generate --info

Generating public/private rsa key pair ...
Generating public/private rsa key pair ...

Your identification has been saved in ~/data/private/system/.ssh/matrix_ssh_key.
Your public key has been saved in ~/data/private/system/.ssh/matrix_ssh_key.pub.

The key fingerprint is:

The key's randomart image is:

RSA SSH keys pair generated successfully.

get_design_area_setable_attrs.php

The get_design_area_setable_attrs.php script is a diagnostic script that prints out the names of all the settable attributes of all the design areas in the Matrix system, along with their descriptions.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

hipo_management.php

The hipo_management.php script displays any HIPO jobs currently running on the system, allowing you to manage jobs that may have stalled.

While this script is running, you will be prompted to select a HIPO job to manage and then provided with the options of either resuming or killing the job.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

    -remove_all_jobs

    Kills all HIPO jobs currently running on the system.

Example
$ php hipo_management.php [system_root]

1: HIPO Job Acquire Locks( 7% ) Last Updated: 1 minute and 3 seconds ago
2: HIPO Job Create Links( 27% ) Last Updated: 38 seconds ago
Enter the number of the job to change: (Press q to quit) 2

Options
        r - resume
        k - kill
        q - quit
Choice:r

Resuming HIPO Job HIPO Job Create Links [  OK  ]
$ php hipo_management.php [system_root] -remove_all_jobs

Found 4 jobs.
Make sure no HIPO jobs are running currently.
Selecting 'yes' will remove
those HIPO jobs too.
Are you sure you want to continue removing all HIPO jobs? (y/n) y

Now truncating Hipo job table   [  OK  ]

indent_list_to_xml.php

The indent_list_to_xml.php script takes a text file containing a list of indented items and converts it into a thesaurus XML import file. It is set up so that the relationships defined in the XML match the indenting in the text file.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The text file to convert.

Example

For example, create a file with the following content called thesaurus.txt:

Fruit
    Apple
    Banana
Vegetables
    Cabbage
        White
        Purple
    Daikon
    Eggplant

Passing the above file to the script will result in the following output:

$ php indent_list_to_xml.php thesaurus.txt

<thesaurus>
    <term name="Fruit">
        <relation name="Category">
            <term name="Apple"></term>
            <term name="Banana"></term>
        </relation>
    </term>
    <term name="Vegetables">
        <relation name="Category">
            <term name="Cabbage">
                <relation name="Category">
                    <term name="White"></term>
                    <term name="Purple"></term>
                </relation>
            </term>
            <term name="Daikon"></term>
            <term name="Eggplant"></term>
        </relation>
    </term>
</thesaurus>

locale_backup.php

As of 5.0.0.0, this script has been removed from the official Matrix releases. This script is for development use only.

The locale_backup.php script gathers all of the locale information stored in locale/<language>/* underneath each asset and package to assist with translating the interface and error messages to different languages.

This script is located in the /scripts/locale directory of your Matrix system and takes the following parameters:

  • The system root directory.

    --locale=<language_code>

    Where <language_code> is a two-letter ISO 3166 country code. Can be used multiple times to export different languages (for example, --locale=en --locale=fr) or only specific types of localization (errors, internal_messages, screens, and strings. For example, --locale=en-screens, errors will backup all the screens and errors in English).

    --output=<output_directory>

    Where <output_directory> is the directory to write the compiled locale files to; if none is specified, they will be written to <system_root>/data/temp/locale_backup/.

locale_restore.php

The locale_restore.php script takes all the locale string data generated by locale_backup.php and reintegrates it with your installation.

This script is located in the /scripts/locale directory of your Matrix system and takes the following parameters:

  • The system root directory.

    -d

    Specifies the directory of the backed-up files. If omitted, defaults to <system_root>`/data/temp/locale_backup` (optional).

    -r

    Recurse subdirectories (recommended if using the output from locale_backup.php) (optional).

    -f

    Force overwriting of language files. If not set, this script will ask you to confirm overwriting of each file that already exists (optional).

morph_assets.php

The morph_assets.php script allows you to morph an asset from one asset type to another. This is useful when dealing with file and user asset types, for example, morphing a user asset into a backend user.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The root directory of your system.

  • The root ID of which to morph the child assets.

  • The asset type code from which you want to morph assets.

  • The asset type code to which you want to morph assets.

    --simulate

    Runs the script in simulation mode.

Example
$ php scripts/morph_assets.php [system_root] 100 user backend_user

There are 1 user assets to morph, are you sure you want to continue? Type 'yes' to continue: yes
Morphing assets...
Morph Asset #202
Finished morphing assets.
1 of 1 user assets were morphed to backend_user assets.

In the above usage, asset 100 has been morphed from a user asset into a backend user.

permission_change.php

This script is deprecated because it has memory issues when used on a large number of assets. Use system_apply_permission.php instead.

recreate_rollback_triggers.php

The recreate_rollback_triggers.php script regenerates the rollback triggers in the database and may be required during upgrades.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

regen_metadata_by_root_nodes.php

The regen_metadata_by_root_nodes.php script will take an argument of a list of root nodes separated by commas and regenerate the metadata for the child assets of each root node.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • A comma-separated list of the asset IDs for the root nodes for which to regenerate the metadata.

  • The maximum thread count. This parameter is optional, and by default, it is set to 3.

  • The number of assets to process per batch. This parameter is optional, and by default, it is set to 50.

    --skip-asset-update

    Prevent the metadata regeneration process from firing an asset updated event on regenerated assets. The updated date of these assets will also remain unchanged when this parameter is used. This parameter is optional.

    --direct-children-only

    Will make the script only affect direct child assets (1 level down) from the selected root nodes. This parameter is optional.

If you want to use the --skip-asset-update or --direct-children-only parameters, you must use the first two parameters for the script to work correctly.

regen_metadata_schemas.php

The regen_metadata_schemas.php script regenerates the metadata schemas from the command line.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • The ID of the metadata schema to regenerate. This parameter is optional. If no ID is specified, all metadata schemas in the system will be regenerated.

regen_system_assets_config.php

The regen_system_assets_config.php script generates the system assets config for installed systems. This script is provided for use if your system becomes thoroughly corrupted. For example, if your system starts giving System asset not found errors.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

regenerate_file_system.php

The regenerate_file_system.php script regenerates the asset file contents within the system, including metadata, design, and bodycopy content files.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

--system=<SYSTEM_ROOT>

Where <SYSTEM_ROOT> is the root directory of your Matrix system.

--rootnode=<ROOT_NODE>

Where <ROOT_NODE> is the root node from which you wish to regenerate the file contents.

--designs

Specifies only to regenerate design files.

--metadata

Specifies only to regenerate metadata files.

--bodycopies

Specifies only to regenerate bodycopy content files.

--all

Specifies to regenerate all file content (metadata, design, and bodycopy content files).

regenerate_treeids_for_triggers.php

The regenerate_treeids_for_triggers.php script regenerates the IDs in the database for all triggers. This script should be run in conjunction with the recreate_link_tree.php script when regenerating the link tree in a database that includes triggers.

Read the Recreate link tree script documentation for more information.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

remove_old_cron_jobs.php

The remove_old_cron_jobs.php script removes any cron jobs scheduled to run more than a week ago.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

remove_permissions.php

The remove_permissions.php script removes the permissions of assets under a specified root node(s).

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

--system=<SYSTEM_ROOT>

The root directory of your Matrix system.

--rootnode=<ROOTNODES>

The asset IDs of the root nodes to be processed.

--includeuser=<INCLUDE_USERIDS>

An optional parameter, allowing you only to remove permissions for a set of specified users.

--excludeuser=<EXCLUDE_USERIDS>

An optional parameter, allowing you to specify a set of users for which to retain permissions.

--type=<PERMISSION_TYPE>

An optional parameter, allowing you to specify the permission types to remove (1 for read, 2 for write, and 3 for admin).

In the following example, we are removing any write permissions on assets #100, #130, and #205 and all their children; permissions will not be removed for user #65.

Example
$ php remove_permissions.php --system=[system_root] --rootnode=100,130,205 --excludeuser=65 --type=2

This script is about to remove ALL permissions for assets under root node:100,130,205 excluding user:65 with permission type:2
39 assets to check
Are you sure you want to proceed (Y/N)? Y
32 permission rows have been deleted

rename_thesaurus_term.php

The rename_thesaurus_term.php script allows you to set a new name for a thesaurus term asset. After the name of the thesaurus term is altered, this script will update any relevant tags on assets and regenerate any metadata containing the term.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The root directory of the Matrix system.

  • The asset ID of the thesaurus term to rename.

  • The existing name of the thesaurus term.

  • The value to which the thesaurus term will be renamed.

Example
$ php scripts/rename_thesaurus_term.php [system_root] 100 Apple Orange

Renaming Thesaurus Term.
                       [ Done ]
Finding Metadata Schemas to regenerate.
        [ Done ]
Updating Thesaurus Term on Assets.
             [ Done ]
Total asset found to regenerate schema on :     7

replace_text.php

The replace_text.php script runs the WYSIWYG editor’s replace text plugin on all editable content under a specified set of root URLs.

Read the WYSIWYG component documentation for more information.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • The root nodes to include when running this script.

  • The root nodes to exclude when running this script (optional).

This script includes a number of editable configuration options that can be set on the script (1 to enabled, 0 to disable).

$options = Array (
        //non-extreme options
        'Remove <font> tags' => 1,
         'Remove double spaces' => 1,
        'Remove non-HTML tags' => 1,
        'Change Microsoft Words bullets' => 1,
        'Remove soft hyphens' => 1,
        //extreme options
        'Remove style attribute' => 0,
        'Remove class attribute' => 0,
        'Remove <table> tags' => 0,
        'Remove <span> tags' => 0,
        'Remove all empty tags' => 0,
        'Remove all tags attributes (except HREF and SRC)' => 0,
    );
Example
$ php replace_text.php [system_root] 100 150

Examining wysiwyg content type of Asset ID: 105
Examining wysiwyg content type of Asset ID: 465
Examining wysiwyg content type of Asset ID: 469
Examining wysiwyg content type of Asset ID: 476
...

The rewrite_assetid_links.php script will rewrite asset ID ./?a= links within your content to hard-coded absolute links.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

--system=<SYSTEM_ROOT>

The root directory of your system.

--sites-to-keep=<SITES>

A list of the sites to keep, that is, the site URLs that you do not want to be affected by this script.

--sites-to-delete=<SITES>

A list of the sites to delete, that is, the site URLs that you want to be rewritten by this script.

--rewrite-urls=<URLS>

A list of the URLs to which you want to rewrite asset ID links.

[--execute]

Specifies to execute the rewrite on this script; if this parameter is not specified, this script will run in report mode.

run_cron_job.php

This script is for development use only.

The run_cron_job.php script runs a specified cron job once, regardless of whether the cron job should be run at the time.

This script is located in the /scripts/dev directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • The asset ID of the cron job to execute.

set_files_unrestricted.php

The set_files_unrestricted.php script sets all files underneath a particular root node to either restricted or unrestricted. Files that are marked unrestricted, have a status of live or higher, and have public read permissions are directed through the web server using the __data alias instead of being passed through Matrix.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • The asset ID of the root node from which to change.

  • Either 1 for unrestricted or 0 for restricted.

shrink_matrix_file_assets.php

Previously in Matrix, files used to get stored in three different locations on the file system:

  • data/file_repository

  • data/private

  • data/public

This script reduces the space on the server taken up by physical files produced from file assets. When run, it will replace the physical copies of the files in data/private and data/public with hard links instead, reducing the total amount of data taken up on the server.

Parameters:

  • The system root directory.

  • The asset ID of the root node from which to process files. If not specified, all file assets in the system will be processed.

Example
$ php shrink_matrix_file_assets.php [system_root] 100

Processing 2364 file assets under root node #100

done

There are 2364 files assets that have redundant copies removed!

status_change.php

The status_change.php script changes the status of an asset with the option to cascade the status change to child assets.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • The asset ID of the asset of which to change the status.

  • The status code of the status to which the asset will change.

  • The status codes that you can use are shown in the table below.

    Status Code

    Archived

    1

    Up for Review

    32

    Under Construction

    2

    Safe Editing

    64

    Pending Approval

    4

    Safe Editing Pending Approval

    128

    Approved to go Live

    8

    Safe Editing Approved to go Live

    256

    Live

    16

    Use comma-separated statuses to step through multiple steps.

  • Whether to cascade the status change to child assets (indicated as y). This parameter is optional.

Example

In the following example, the asset has been set to safe editing approved to go live then live, with the change cascaded to all its children.

$ php status_change.php [system_root] 100 256,16 y

 START STATUS CHANGE

 FINISHED

system_apply_metadata_schema.php

The system_apply_metadata_schema.php script applies a metadata schema to a set of specified assets and their children. It will also generate the metadata for these assets.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory. This parameter is mandatory.

  • A comma-separated list of asset IDs to apply the metadata schema to. This parameter is mandatory.

  • The asset ID of the metadata schema to apply. This parameter is mandatory.

  • The asset type to which the metadata schema application will be restricted.

    --access

    The access to set when applying the metadata schema to the specified assets (either granted or denied). By default, this option is set to Granted.

    -nc

    No cascade. The applied metadata schema will not be inherited by newly created assets under the specified parent.

    -d

    Deletes the metadata schema from the specified assets.

    -f

    Forces the application of the metadata schema, ignoring any existing conflicting applications (granted or denied).

    -u

    Notifies each asset that it has been updated.

    --max-threads

    Maximum concurrent processes (maximum of 5).

    --batch-size

    the number of assets to process at once. By default, this is set to 50.

Example

The following example applies a metadata schema (#300) to assets #150, #160, and #170, restricting it to standard page assets only and with access denied.

$ php system_apply_metadata_schema.php [system_root] 150,160,170 300 page_standard --access denied -nc -u --max-threads 5 --batch-size 25

Will attempt to set schema 300 to asset(s) 150,160,170.

  Access: denied
  Cascade:
  Force:
  Update assets: 1
  Max threads: 5
  Batch size: 25

-- Remaining: 5
-- Remaining: 4
-- Remaining: 3
-- Remaining: 2
-- Remaining: 1
-- Remaining: 0

system_apply_permissions.php

The system_apply_permissions.php script applies permissions to a set of specified assets and their children.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory. This parameter is mandatory.

  • A comma-separated list of asset IDs on which to apply the permissions. This parameter is mandatory.

  • The permission string representing the permissions to change. In this string, r, w, and a represent read, write, and admin permissions, respectively.

  • The access applied on these permissions is specified as + (grant), - (deny), and / (remove).

    For example, the string r+101;w-102;a/103 will grant read permission for user #101, deny write permission for user #102 and remove (whether currently granted or denied) admin permission for user #103. This parameter is mandatory.

    -nc

    No cascade. Newly created assets will not inherit the applied permissions under the specified parent.

    -f

    Forces the permissions application, ignoring any existing conflicting applications (granted or denied).

    --max-threads

    Maximum concurrent processes (maximum of 5).

    --batch-size

    The number of assets to process at once. By default, this is set to 50.

Example

The following example applies permissions to assets #100 and #200, granting read permission for user #150 and admin permission for user #250.

$ php system_apply_permissions.php [system_root] 100,200 "r+150;a+250" --max-threads 4 --batch-size 40

Will attempt to set permissions to asset(s) 100,200.

  Max threads: 4
  Batch size: 40

-- Remaining: 10
-- Remaining: 9
-- Remaining: 8
-- Remaining: 7
-- Remaining: 6
-- Remaining: 5
-- Remaining: 4
-- Remaining: 3
-- Remaining: 2
-- Remaining: 1
-- Remaining: 0

system_update_lookups.php

The system_update_lookups.php script refreshes the lookups (URLs and designs) on all the sites in the system (and their children).

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

  • The system root directory.

  • A comma-separated list of asset IDs to restrict refreshing to a list of root nodes (optional).

    --verbose

    Display errors that may occur due to using this script to update lookups (optional).

    --batch-size

    The number of assets to process at once.

Example
php scripts/system_update_lookups.php $(pwd) 612 --verbose

Updating lookups from asset (s): 612.
Batch size: 1000

Determining assets to process...
Updating lookups for 10 assets...
-- Remaining: 10
-- Remaining: 9
-- Remaining: 8
-- Remaining: 7
-- Remaining: 6
-- Remaining: 5
-- Remaining: 4
-- Remaining: 3
-- Remaining: 2
-- Remaining: 1
-- Remaining: 0
Done

system_virus_scan.php

The system_virus_scan.php script runs the virus checker against the system’s data directory, removing any viruses found.

To use this script, your system must have a configured virus checker enabled on the External tools configuration screen. Read the External tools configuration documentation for more information.

This script is located in the /scripts directory of your Matrix system and takes the following parameter:

  • The system root directory.

webpath_search_and_replace.php

The webpath_search_and_replace.php script will search for and replace a given string on URLs within your system.

This script is located in the /scripts directory of your Matrix system and takes the following parameters:

--system=<SYSTEM_ROOT>

The root directory of your system.

--search=<SEARCH_STRING>

The string for which to search.

--replace=<REPLACE_STRING>

The replacement string.

[--include-site-urls]

Specifies to include site URLs (will not replace root URLs or static root URLs).

Reset root password script

The reset_root_password.php script is a simple script that resets the root password to root.

You should sign in to Matrix and reset the root password immediately after running this script.

This script is located in the /scripts directory and takes one parameter, the system root directory.

System check script

The system_check.php script checks and identifies system integrity issues and reports back on any known inconsistencies in the system.

This script (for the most part) does not resolve any issues that may be found. The results of this script should be interpreted and acted upon appropriately at your discretion.

The system tests run by this script are:

Dead file revisions

Checks for file revisions that have not been cleaned (that is, multiple file versions in the data directory). You can run the --execute argument to clean up any orphaned file repositories found.

Form integrity test

Checks forms for valid questions and sections, invalid form actions, and invalid submissions.

Dead assets test

Checks for assets that do not exist anymore but are still present in the asset tree.

General status check

Checks and returns the number of assets and asset links on the system.

Submission integrity test

Checks form submissions for valid questions.

Fragmented rollback test

Checks the rollback table for multiple active entries.

Fragmented attributes test

Checks the sq_ast_attr_val table for attributes and assets that do not exist in sq_ast_attr.

Invalid number of kids on link tree test

Checks for incorrect child counts on asset tree lineages.

Invalid incomplete attachments test

Checks for form submissions with incomplete attachments.

Broken sort order test

Checks for sort order errors on the link tree table.

Orphaned assets test

Checks for orphaned assets (assets without links).

Invalid links on link tree test

Checks for entries in the link tree table that do not exist in the link table.

HTML tidy errors test

Checks for HTML tidy issues on the system.

User permissions test

Checks for permissions applied for users that no longer exist.

This script takes the system root and can optionally pass the following arguments:

--verbose

Displays more detailed errors.

--colours

Uses colors in results.

--stats

Shows statistics for this process.

--help

Shows the help screen.

--execute

Executes an action on the script.

Currently, only the dead file revisions test allows you to execute a system clean.

An example of the usage of this script is shown below.

The highlighted content demonstrates the --execute argument:

php system_check.php --system=<root> --execute

Dead File Revisions                              [  !!  ]
        There are 5 orphaned file repository entries to clean up.
        The following assets were cleaned up successfully:
        140,141,170,192,19
Form Integrity Test                              [  OK  ]
Dead Assets Test                                 [  !!  ]
        There are 8 dead asset(s) on the system
General Status Check                             [ info ]
        There are 681 asset(s) on the system
        There are 713 asset link(s) on the system
Submission Integrity Test                        [  !!  ]
        There are 5 submissions found with problems
Fragmented Rollback Test                         [  OK  ]
Fragmented Attributes Test                       [  OK  ]
Invalid Number of Kids on Link Tree Test         [  !!  ]
        There are 1 invalid number of kids found on the system
Invalid Incomplete Attachments Test              [  OK  ]
Broken Sort Order Test                           [  OK  ]
Orphaned Assets Test                             [  OK  ]
Invalid Links on Link Tree Test                  [  OK  ]
HTML Tidy Errors Test                            [  !!  ]
        There are 115 content types with HTML Tidy issues
Invalid {matrix} Links Test                        [  OK  ]
User Permissions Test                            [  OK  ]

© 2015- Squiz Pty Ltd