exp:expbackfillordersiteaccess
Infer the siteaccess of orders placed before ezorder.siteaccess was recorded (dry run unless --apply).
Script bin/php/expbackfillordersiteaccess.php, code in kernel/private/classes/commands/expbackfillordersiteaccess.php. Run it from the installation root, as the user the web server runs as:
./console exp:expbackfillordersiteaccess --help
php bin/php/expbackfillordersiteaccess.php --helpHelp text
Infer the siteaccess of orders that have none (placed before Exponential 6.0.15 recorded it)
from the content tree each site siteaccess serves: an order whose products all lie in the tree of
exactly one site (its PathPrefix node, else its RootNode) gets that siteaccess; orders matching none
or several stay unknown. Administrations (admin, editor ...) never take orders and are left out,
decided as the siteaccess menu decides them ([AdminSiteAccessMenu] AdminSiteAccessList[], else the
design). Siteaccesses named with --exclude are never chosen either: the next candidate can win, and an
order only excluded siteaccesses serve stays unknown. An order that has a siteaccess is never changed.
Without --apply nothing is written: the siteaccesses considered, excluded and left out are listed,
then each order with the siteaccess it would get, or why it stays unknown.
Example: php bin/php/expbackfillordersiteaccess.php
php bin/php/expbackfillordersiteaccess.php --prefer-deepest-root
php bin/php/expbackfillordersiteaccess.php --exclude=site_mobile,site_preview
php bin/php/expbackfillordersiteaccess.php --exclude=site_mobile --exclude=site_preview --prefer-deepest-root
php bin/php/expbackfillordersiteaccess.php --applyOptions
| Option | Value | Help |
|---|---|---|
--apply | Write the inferred siteaccesses (the default is a dry run that changes nothing) | |
--prefer-deepest-root | Off by default. Only for public sites with nested roots (a shop inside another site's tree): of several sites that serve every product, take the one whose root is deepest when it is the only one that deep | |
--exclude | required | Never choose these siteaccesses: a comma list, and the option may be repeated (--exclude=a,b --exclude=c). A name not in AvailableSiteAccessList is a warning, not an error |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expbackfillordersiteaccess.php, kernel/private/classes/commands/expbackfillordersiteaccess.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.