{"id":15984843,"url":"https://github.com/gggeek/ezdbintegrity","last_synced_at":"2025-09-01T12:11:31.071Z","repository":{"id":3316355,"uuid":"4359128","full_name":"gggeek/ezdbintegrity","owner":"gggeek","description":"eZ Publish Legacy extension allowing to check integrity of data in the database and filesystem storage","archived":false,"fork":false,"pushed_at":"2023-03-11T11:36:52.000Z","size":222,"stargazers_count":5,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-22T14:44:05.252Z","etag":null,"topics":["database","ezpublish","referential-integrity"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gggeek.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-05-17T14:11:35.000Z","updated_at":"2022-12-06T17:40:12.000Z","dependencies_parsed_at":"2023-01-13T12:25:42.645Z","dependency_job_id":null,"html_url":"https://github.com/gggeek/ezdbintegrity","commit_stats":{"total_commits":126,"total_committers":4,"mean_commits":31.5,"dds":0.2777777777777778,"last_synced_commit":"4c457d5045ceda8239a13a26bbded7aa9176a7b3"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/gggeek/ezdbintegrity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gggeek%2Fezdbintegrity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gggeek%2Fezdbintegrity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gggeek%2Fezdbintegrity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gggeek%2Fezdbintegrity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gggeek","download_url":"https://codeload.github.com/gggeek/ezdbintegrity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gggeek%2Fezdbintegrity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273122129,"owners_count":25049539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","ezpublish","referential-integrity"],"created_at":"2024-10-08T02:10:46.501Z","updated_at":"2025-09-01T12:11:31.012Z","avatar_url":"https://github.com/gggeek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"eZ DB Integrity Extension for eZPublish / eZPlatform\n====================================================\n\nFor eZPlatform 3.0 and later, please check out: https://github.com/tanoconsulting/ezdbintegritybundle\n\nGoals:\n------\n\nAllow checking integrity of data in a database (the eZ Publish one, but any other as well).\nAllow checking integrity of the eZPublish storage files (images and binary files from content).\n\n\nChecks supported:\n-----------------\n\n1. Foreign Key integrity\n\n    This applies to databases which have no FK enabled, but where parent-child relationships do in fact exist.\n    The relationships to check are defined via configuration files.\n    The standard configuration has FK definitions for the eZPublish/eZPlatform schema (versions 4.x =\u003e 5.x)\n\n2. Data integrity\n\n    Similar to FK checks, these are custom sql queries which can be executed to find out any type of data inconsistency.\n    The queries to run are defined via configuration files.\n    The standard configuration has many data integrity queries for the eZPublish/eZPlatform schema (versions 4.x =\u003e 5.x)\n\n3. Content Objects integrity\n\n    This checks eZPublish Content Objects, validating every attribute based on its datatype definition.\n    F.e. it checks if attributes are null which should not be, or if image files are missing.\n    NB: not all datatypes are supported for now, just a limited set.\n\n4. Orphan storage files\n\n    This checks all files found on disk in the known eZPublish storage directories,\n    and lists any which are not found in the database, corresponding to the ezmedia, ezimage and ezbinaryfile\n    attributes.\n\n    *NOTE* be warned that:\n    - image variations generated via the eZ5 stack are not stored in the ezimage table in the db. As such, they\n        will be reported as orphans. If you delete them, eZ5 will regenerate them, so it's not a huge deal, but\n        that might include many gigs of files which are actually in use\n\n    The script can optionally delete the files as well. We assume no responsibility if you use this feature!\n\n\nHow to use it:\n--------------\n\n- run `php extension/ezdbintegrity/bin/php/checkschema.php --help`,\n    `php extension/ezdbintegrity/bin/php/checkattributes.php --help` and\n    `php extension/ezdbintegrity/bin/php/checkstorage.php --help` to get started\n\n- you can define more FKs and attribute types to be checked, in ezdbintegrity.ini.append.php\n\n\nDISCLAIMER\n----------\n\n!!! DO NOT BLINDLY DELETE ANY DATA IN THE DB WHICH IS REPORTED AS FOREIGN KEY VIOLATION !!!\n\n!!! DO NOT BLINDLY DELETE ANY STORAGE FILE WHICH IS REPORTED AS ORPHAN !!!\n\nWe take no responsibility for consequences if you do.\nYou should carefully investigate the reason for such violations.\nThere is a good chance that the problem lies within this extension and not your data - the FK definitions provided\nhave been reverse-engineered from existing codebase and databases, and are not cast in stone.\n\n## Running tests:\n\nThe bundle uses PHPUnit to run functional tests.\n\n*NB* the tests do *not* mock interaction with the database, but create/modify/delete many types of data in it.\nAs such, there are good chances that running tests will leave stale/broken data.\nIt is recommended to run the tests suite using a dedicated eZPublish installation or at least a dedicated database.\n\n#### Setting up a dedicated test environment for the bundle\n\nA safe choice to run the tests of the extension is to set up a dedicated environment, similar to the one used when the\ntest suite is run on GitHub Actions.\nThe advantages are multiple: on one hand you can start with any version of eZPublish you want; on the other you will\nbe more confident that any tests you add or modify will also pass on GitHub.\nThe disadvantages are that you will need Docker and Docker-compose, and that the environment you will use will look\nquite unlike a standard eZPublish setup! Also, it will take a considerable amount of disk space and time to build.\n\nSteps to set up a dedicated test environment and run the tests in it:\n\n    git clone --depth 1 https://github.com/tanoconsulting/euts.git teststack\n    # if you have a github auth token, it is a good idea to copy it now to teststack/docker/data/.composer/auth.json\n\n    # this config sets up a test environment with eZPlatform 2.5 running on php 7.4 / ubuntu jammy\n    export TESTSTACK_CONFIG_FILE=Tests/environment/.euts.2.5.env\n\n    ./teststack/teststack build\n    ./teststack/teststack runtests\n    ./teststack/teststack stop\n\nNote: this will take some time the 1st time your run it, but it will be quicker on subsequent runs.\nNote: make sure to have enough disk space available.\n\nIn case you want to run manually commands, such as the symfony console:\n\n    ./teststack/teststack console cache:clear\n\nOr easily get to a database shell prompt:\n\n    ./teststack/teststack dbconsole\n\nOr command-line shell prompt to the Docker container where tests are run:\n\n    ./teststack/teststack shell\n\nThe tests in the Docker container run using the version of debian/php/mysql/eZPlatform kernel specified in the file\n`Tests/environment/.euts.2.5.env`, as specified in env var `TESTSTACK_CONFIG_FILE`.\nIf no value is set for that environment variable, a file named `.euts.env` is looked for.\nIf no such file is present, some defaults are used, you can check the documentation in ./teststack/README.md to find out\nwhat they are.\nIf you want to test against a different version of eZ/php/debian, feel free to:\n- create the `.euts.env` file, if it does not exist\n- add to it any required var (see file `teststack/.euts.env.example` as guidance)\n- rebuild the test stack\n- run tests the usual way\n\nYou can even keep multiple test stacks available in parallel, by using different env files, eg:\n- create a file `.euts.env.local` and add to it any required env var, starting with a unique `COMPOSE_PROJECT_NAME`\n- build the new test stack via `./teststack/teststack. -e .euts.env.local build`\n- run the tests via: `./teststack/teststack -e .euts.env.local runtests`\n\n[![License](https://poser.pugx.org/gggeek/ezdbintegrity/license)](https://packagist.org/packages/gggeek/ezdbintegrity)\n[![Latest Stable Version](https://poser.pugx.org/gggeek/ezdbintegrity/v/stable)](https://packagist.org/packages/gggeek/ezdbintegrity)\n[![Total Downloads](https://poser.pugx.org/gggeek/ezdbintegrity/downloads)](https://packagist.org/packages/gggeek/ezdbintegrity)\n\n[![Build Status](https://github.com/gggeek/ezdbintegrity/actions/workflows/ci.yml/badge.svg)](https://github.com/gggeek/ezdbintegrity/actions/workflows/ci.yml)\n[![Code Coverage](https://codecov.io/gh/gggeek/ezdbintegrity/branch/main/graph/badge.svg)](https://codecov.io/gh/gggeek/ezdbintegrity/tree/main)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgggeek%2Fezdbintegrity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgggeek%2Fezdbintegrity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgggeek%2Fezdbintegrity/lists"}