Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Mar 6, 2025
1 parent 5ecba26 commit b73d958
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 79 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ This is the official Live Helper Chat documentation [https://doc.livehelperchat.

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Build locally
### Build the website locally

To build the website locally, run the following commands:

```
npm install
npm run build
```
```
15 changes: 15 additions & 0 deletions docs/chat/statistic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,21 @@ This chart is available only if you are using ElasticSearch

<Image img={require('../../static/img/statistic/pending-vs-online.jpg')} />

### How it works
* It is handled by this cronjob running every minute `php cron.php -s site_admin -e elasticsearch -c cron/cron_1m`
* Every minute we log
* Pending chats
* Active chats
* Operator who were online and active in the last 60 seconds
* During chat generation we group by date time and chat status `pending` and `active`
* Afterwards we group by online operator which selected operators who were online

### How can I determine an operator's workload at a specific time for a particular department?

* If you are using ElasticSearch extension you can generate this data using same chart
* Regular way you can go to users list and click `Chats momentary history` and you will see how many chats he had at specific time.
* Also you can check agent `Online hours` where you will see how many chats he took in specific period of time.

## Configuration

In this section you can choose what charts should be checked by default for generation.
Expand Down
156 changes: 79 additions & 77 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,81 +3,83 @@ id: upgrading
title: Upgrading
---

This is a basic tutorial on how to perform upgrades since version 2.04. This version can automatically update the database from any previous LHC version. Since version 3.30, we require `composer` dependencies to be installed if you are installing from source code.

If you are upgrading from an older version to any version 3.30 or higher, you must install composer dependencies.
```
cd lhc_web
composer.phar install
```

If you don't have `composer.phar`, you can download it from https://getcomposer.org/download/.

* You can download a version with dependencies included from https://github.com/LiveHelperChat/livehelperchat/releases. Look for the newest file named `*.**v-with-dependencies.tgz`. **PHP version 8.2** is required.

This file includes a folder `lib/vendor`, so you don't need to install composer yourself. Just copy it to `lib/vendor`.

1. Read the new version announcement article for any possible changes in `settings/settings.ini.php`. If the article does not mention anything, you do not have to do anything.
2. Go to "System" -> "Update information" and check if LHC finds any differences in the database. If it does, click on "Update database." You may not see differences if your server does not allow making requests to remote URLs.
* You need to run these commands from the root folder (where `index.php` is located).
* `php cron.php -s site_admin -c cron/util/update_database` tries to update the database from a remote URL. If this does not work, run:
* `php cron.php -s site_admin -c cron/util/update_database -p local` after replacing all files.
3. If you accidentally overwrite files before updating the database, you can:
1. [Update the database from the local definition](system/command.md#updates-live-helper-chat-database-directly-from-console).
2. Copy `doc/shell/upgrade.php` to the root folder, the same folder where `index.php` exists.
1. In your browser, enter `https://example.com/upgrade.php` to update the database directly.
4. Log out from LHC.
5. [Download the most recent LHC version](http://livehelperchat.com/article/static/5). Overwrite the following folders: `doc`, `ezcomponents`, `lib`, `modules`, `pos`, `translations`, and `design`. Also, overwrite `index.php` and `cron.php` files with the new version.
1. https://github.com/remdex/livehelperchat/archive/master.zip - latest master branch zip without composer dependencies.
2. https://github.com/LiveHelperChat/livehelperchat/releases - latest release with composer dependencies.
6. Overwrite `composer.json` and `composer.lock` files and run `composer.phar install` or `composer.phar update` command.
7. Disable [cache in `settings.ini.php`](debug.md#disabling-cache).
8. Log in to LHC again and go to `"System configuration" -> "Clear Cache"` and click "Clear Cache."
1. You can also clear the cache by executing this command from the command line: `php cron.php -s site_admin -c cron/util/clear_cache`.
9. Now you can re-enable the cache in your `settings.ini.php`.
10. If you still encounter errors, then [Enable debug output](debug.md).

If you are updating from any older version, you can follow this pattern, which can also be applied to new versions:

1. [Download the most recent LHC version](http://livehelperchat.com/article/static/5). Overwrite the following folders: `doc`, `ezcomponents`, `lib`, `modules`, `pos`, `translations`, and `design`. Also, overwrite `index.php` and `cron.php` files with the new version.
2. Install composer dependencies as described above. You can just download the most recent `*.**v-with-dependencies.tgz` file from https://github.com/LiveHelperChat/livehelperchat/releases and copy `lhc_web/lib/vendor` to your existing installation. This folder should not exist if you are upgrading from a version older than 4.29.
3. Copy `doc/shell/upgrade.php` to the root folder of LHC.
4. In your browser, type `chatfolder/upgrade.php`. It will update the database to the most recent version and clear the cache automatically.
5. Delete `upgrade.php` from the root folder.

In all cases, I suggest making a backup.

* [Old update instructions](https://livehelperchat.com/old-upgrading-instructions-335a.html)
* [How to automate live helper chat updates?](https://livehelperchat.com/how-to-automate-live-helper-chat-updates-338a.html)

## How to make PHP 8.1 version compatible?

You will lose Facebook Messenger compatibility.

* Modify the `lhc_web/composer.json` file and
* Change `"php": ">=8.2"` to `"php": ">=8.1"`.
* Remove

```
"tgallice/fb-messenger-sdk": "dev-master#47498e9926df01f2633835ff3ffb310f88ac444f",
"symfony/event-dispatcher": "^7.1",
```

* Execute `composer.phar update`.

## Permissions

To be able to see `Update information`, the operator must have

> 'lhsystem', 'performupdate'.
## Troubleshooting Upgrade Issues

If you encounter issues during the upgrade process, consider the following steps:

1. Ensure that all files have been correctly uploaded and that there are no missing files.
2. Check the server error logs for any specific error messages that may indicate what went wrong.
3. Verify that your PHP version meets the requirements specified in the documentation.
4. If the upgrade fails, you can revert to the previous version by restoring from the backup you created before starting the upgrade.
5. Consult the community forums or support channels for assistance if you are unable to resolve the issue.
This guide explains how to upgrade Live Helper Chat (LHC) from version 2.04 onwards. LHC can automatically update the database from any previous version. Since version 3.30, installing from source requires [Composer](https://getcomposer.org/) dependencies.

### Prerequisites

* **Composer:** Required for source installations (version 3.30+).
* If you don't have it, download `composer.phar` from [https://getcomposer.org/download/](https://getcomposer.org/download/).
* **PHP 8.2 (Recommended):** For the latest version with dependencies, download the `*.v-with-dependencies.tgz` file from [https://github.com/LiveHelperChat/livehelperchat/releases](https://github.com/LiveHelperChat/livehelperchat/releases). This includes the `lib/vendor` folder, so you don't need to install Composer separately. Just extract it to `lib/vendor`.

### Upgrade Steps

1. **Check Announcement:** Review the new version's announcement for any required changes in `settings/settings.ini.php`.
2. **Update Database:**
* Go to "System" -> "Update information" to check for database differences. If found, click "Update database."
* If the web interface doesn't work, run these commands from the root folder:
* `php cron.php -s site_admin -c cron/util/update_database` (updates from remote URL)
* If the above fails, use: `php cron.php -s site_admin -c cron/util/update_database -p local` (after replacing files).
* **Manual Database Update (If Overwritten Files):**
1. [Update the database from the local definition](system/command.md#updates-live-helper-chat-database-directly-from-console).
2. Alternatively, copy `doc/shell/upgrade.php` to the root folder and access it via browser (e.g., `https://example.com/upgrade.php`).
3. **Logout:** Log out of LHC.
4. **Replace Files:**
* [Download the latest LHC version](http://livehelperchat.com/article/static/5).
* Overwrite these folders: `doc`, `ezcomponents`, `lib`, `modules`, `pos`, `translations`, and `design`.
* Also, overwrite `index.php` and `cron.php`.
* **Downloads:**
1. [https://github.com/remdex/livehelperchat/archive/master.zip](https://github.com/remdex/livehelperchat/archive/master.zip) (latest master branch without Composer dependencies)
2. [https://github.com/LiveHelperChat/livehelperchat/releases](https://github.com/LiveHelperChat/livehelperchat/releases) (latest release with Composer dependencies)
5. **Update Composer Dependencies (If Applicable):**
* Overwrite `composer.json` and `composer.lock`.
* Run `composer.phar install` or `composer.phar update`.
6. **Disable Cache:** Disable the cache in `settings.ini.php` (see [debug.md#disabling-cache](debug.md#disabling-cache)).
7. **Clear Cache:**
* Log back in and go to "System configuration" -> "Clear Cache" and click "Clear Cache."
* Alternatively, run `php cron.php -s site_admin -c cron/util/clear_cache` from the command line.
8. **Re-enable Cache:** Re-enable the cache in `settings.ini.php`.
9. **Troubleshooting:** If errors persist, [enable debug output](debug.md).

### Upgrading from Older Versions

For older versions, follow this process:

1. **Replace Files:** As in step 4 above.
2. **Install Composer Dependencies:** As in step 5 above, or download the `*.v-with-dependencies.tgz` file and copy `lhc_web/lib/vendor` to your installation.
3. **Run Upgrade Script:** Copy `doc/shell/upgrade.php` to the LHC root folder.
4. **Access Script:** Open `chatfolder/upgrade.php` in your browser to update the database and clear the cache.
5. **Delete Script:** Remove `upgrade.php` from the root folder.

### Important Considerations

* **Backup:** Always create a backup before upgrading.
* **Further Reading:**
* [Old update instructions](https://livehelperchat.com/old-upgrading-instructions-335a.html)
* [Automating updates](https://livehelperchat.com/how-to-automate-live-helper-chat-updates-338a.html)

### PHP 8.1 Compatibility (Losing Facebook Messenger)

1. **Edit `composer.json`:**
* Change `"php": ">=8.2"` to `"php": ">=8.1"`.
* Remove these lines:

```json
"tgallice/fb-messenger-sdk": "dev-master#47498e9926df01f2633835ff3ffb310f88ac444f",
"symfony/event-dispatcher": "^7.1",
```
2. **Update Composer:** Run `composer.phar update`.

### Permissions

The operator needs the `'lhsystem', 'performupdate'` permission to see "Update information."

### Troubleshooting

If you encounter issues:

1. **Verify Files:** Ensure all files are uploaded correctly.
2. **Check Logs:** Review server error logs for specific messages.
3. **PHP Version:** Confirm your PHP version meets the requirements.
4. **Revert:** Restore from your backup if the upgrade fails.
5. **Seek Help:** Consult community forums or support channels.

0 comments on commit b73d958

Please sign in to comment.