Upgrader
A task-based general-purpose Chyrp upgrader.
Performs upgrade functions based on individual tasks, and checks whether or not they need to be done.
Version-agnostic. Completely safe to be run at all times, by anyone.
Summary
| Upgrader | A task-based general-purpose Chyrp upgrader. |
| Functions | |
| config_file | Returns what config file their install is set up for. |
| database_file | Returns what database config file their install is set up for. |
| using_yaml | Are they using YAML config storage? |
| Files | |
| Helpers | Various functions used throughout Chyrp’s code. |
| Gettext | Gettext library. |
| Streams | Streams library. |
| YAML | Horde YAML parsing library. |
| SQL | SQL |
| Config | Handles writing to whichever config file they’re using. |
| Variables | |
| $yaml | Stores all of the YAML data. |
| Functions | |
| get | Returns a config setting. |
| set | Sets a config setting. |
| check | Goes a config exist? |
| fallback | Sets a config setting to $value if it does not exist. |
| remove | Removes a setting if it exists. |
| test | Attempts to perform a task, and displays a “success” or “failed” message determined by the outcome. |
| fix_htaccess | Repairs their .htaccess file. |
| tweets_to_posts | Enacts the “tweet” to “post” rename. |
| pages_parent_id_column | Adds the parent_id column to the “pages” table. |
| pages_list_order_column | Adds the list_order column to the “pages” table. |
| remove_beginning_slash_from_post_url | Removes the slash at the beginning of the post URL setting. |
| move_yml_yaml | Renames config.yml.php to config.yaml.php. |
| update_protection | Updates the PHP protection code in the config file. |
| theme_default_to_stardust | Changes their theme from “default” to “stardust”, or leaves it alone if they’re not using “default”. |
| default_db_adapter_to_mysql | Adds an “adapter” SQL setting if it doesn’t exist, and sets it to “mysql”. |
| move_upload | Renames the “upload” directory to “uploads”. |
| make_posts_xml | Updates all of the post XML data to well-formed non-CDATAized XML. |
| rss_posts_to_feed_items | Rename the feed items setting. |
| update_groups_to_yaml | Updates the groups to use YAML-based permissions instead of table columns. |
| add_permissions_table | Creates the “permissions” table and fills it in with the default set. |
| add_sessions_table | Creates the “sessions” table. |
| update_permissions_table | Updates the “permissions” table from ## (id) => foo_bar (name) to foo_bar (id) => Foo Bar (name). |
| update_custom_routes | Updates the custom routes to be path => action instead of # => path. |
| remove_database_config_file | Removes the database.yaml.php file, which is merged into config.yaml.php. |
| rename_database_setting_to_sql | Renames the “database” config setting to “sql”. |
| update_post_status_column | Updates the status column on the “posts” table to be a generic varchar field instead of enum. |
| add_post_attributes_table | Adds the “post_attributes” table. |
| post_xml_to_db | Migrates the XML post attributes to the “post_attributes” table. |
| add_group_id_to_permissions | Adds the group_id column to the “permissions” table. |
| group_permissions_to_db | Migrates the group permissions from a YAML column to the “permissions” table. |
| remove_old_files | Removes unused files from previous installs. |
| update_user_password_column | Updates the password column on the “users” table to have a length of 60. |
Config
Handles writing to whichever config file they’re using.
Summary
| Variables | |
| $yaml | Stores all of the YAML data. |
| Functions | |
| get | Returns a config setting. |
| set | Sets a config setting. |
| check | Goes a config exist? |
| fallback | Sets a config setting to $value if it does not exist. |
| remove | Removes a setting if it exists. |
| test | Attempts to perform a task, and displays a “success” or “failed” message determined by the outcome. |
| fix_htaccess | Repairs their .htaccess file. |
| tweets_to_posts | Enacts the “tweet” to “post” rename. |
| pages_parent_id_column | Adds the parent_id column to the “pages” table. |
| pages_list_order_column | Adds the list_order column to the “pages” table. |
| remove_beginning_slash_from_post_url | Removes the slash at the beginning of the post URL setting. |
| move_yml_yaml | Renames config.yml.php to config.yaml.php. |
| update_protection | Updates the PHP protection code in the config file. |
| theme_default_to_stardust | Changes their theme from “default” to “stardust”, or leaves it alone if they’re not using “default”. |
| default_db_adapter_to_mysql | Adds an “adapter” SQL setting if it doesn’t exist, and sets it to “mysql”. |
| move_upload | Renames the “upload” directory to “uploads”. |
| make_posts_xml | Updates all of the post XML data to well-formed non-CDATAized XML. |
| rss_posts_to_feed_items | Rename the feed items setting. |
| update_groups_to_yaml | Updates the groups to use YAML-based permissions instead of table columns. |
| add_permissions_table | Creates the “permissions” table and fills it in with the default set. |
| add_sessions_table | Creates the “sessions” table. |
| update_permissions_table | Updates the “permissions” table from ## (id) => foo_bar (name) to foo_bar (id) => Foo Bar (name). |
| update_custom_routes | Updates the custom routes to be path => action instead of # => path. |
| remove_database_config_file | Removes the database.yaml.php file, which is merged into config.yaml.php. |
| rename_database_setting_to_sql | Renames the “database” config setting to “sql”. |
| update_post_status_column | Updates the status column on the “posts” table to be a generic varchar field instead of enum. |
| add_post_attributes_table | Adds the “post_attributes” table. |
| post_xml_to_db | Migrates the XML post attributes to the “post_attributes” table. |
| add_group_id_to_permissions | Adds the group_id column to the “permissions” table. |
| group_permissions_to_db | Migrates the group permissions from a YAML column to the “permissions” table. |
| remove_old_files | Removes unused files from previous installs. |
| update_user_password_column | Updates the password column on the “users” table to have a length of 60. |