Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to ZendFramework to Symfony #66

Draft
wants to merge 147 commits into
base: master
Choose a base branch
from
Draft

Migrate to ZendFramework to Symfony #66

wants to merge 147 commits into from

Conversation

adamfranco
Copy link
Member

Fixes #47.

@adamfranco adamfranco self-assigned this Sep 26, 2024
The use of '/' as a separator in subcomponents turned out to be a bad idea
because these slashes need to be escaped as %2F, but these escaped slashes
can interfere with some webserver configuration.

For example Apache redirects require the NE "No Escape" option to preserve
%2F slashes without double-escaping:

    # Redirect all traffic to https
    #
    # We're using mod_rewrite here rather than mod_alias's `Redirect`
    # because mod_alias doesn't allow the "NE" == "noescape" parameter
    # that allows URLs includinging encoded slashes (%2F) to be returned
    # without double-escaping.
    RewriteRule .* https://<%= node["app_domain"] %>$0 [L,R=301,NE]

Similarly, Symfony refuses to allow slashes in parameters passed as tokens
in routes.

To address this problematic choice, use '.' as a separator of
sub-components in identifiers. Periods don't require special escaping in
URLs or database queries, though they do in regular expressions.
Many parts still broken:
 - Add sections
 - Print view
 - JS weekly calendar
 - email functions

This commit was getting to be too big to keep track of, so will break out
further work into subsequent commits.
…years.

Will re-add this functionality once a replacement library is identified
which can be added without bringing in ancient versions of jqueryui.
Unfortunately, the normal way of using AssetMapper to include it as a
module was failing because jQuery isn't registered in the global scope
at the point that jquery-ui gets imported. My work-around was to add a line
at the top of jquery-ui.js to import jquery and make the variable available
to the library for modification. This is a bit of a hack, but get both
libraries loaded and available for now.
This version of PHP still requires oci8-3.2.1. When PHP is upgraded I can
update to oci8-3.4.0.
The previous lines:
  _defaults:
    autoconfigure: true # Automatically registers your services as commands, event subscribers, etc
ensure that these are registered based on the classes that they extend, so
there is no need to explicitly configure these tags.

https://symfonycasts.com/screencast/symfony-fundamentals/autoconfiguration#how-does-this-work-the-black-magic-behind
…ally.

osid_NotFoundException are converted to NotFoundHttpException and give a
404 status code to clients.

osid_InvalidArgumentException are converted to BadRequestHttpException and
give a 400 status code to clients.

These central conversions of exceptions uncaught in the controller means
that the controller methods don't have to do as much exception handling
except for cases where they want to ignore certain exceptions and continue.
Made these symfony console commands and made the CatalogSyncer library as
set of services.

Still need to update the commands to use console outputs and they mailer
service. Also should specify return types in the interfaces to be more
strict.
This uses an encoded JSON array to pass from shell, to YAML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade from ZendFramework 1
1 participant