At this stage your copy is nearly ready, but none of the styling will work, which makes it difficult and annoying to use the archived copy. To fix this, first download the script I wrote to fix the stylesheets and javascript files from here.
This has been a longer and fairly complicated post, but there are very few tutorials for this around, so I thought it was worth writing one. I hope you find it useful if you ever find yourself needing to archive a phpBB forum.
If you have not yet run the tests of phpBB, it is recommended to make abreak here and try to run them first. This helps to make sure, you have setup everything correctly, before writing the tests for the extension.
These mocks allow us to check how often a method is called, what the argumentsare and let us specify the return value. This helps us to verify that ourcontroller code behaves as expected. These mocks also help prevent gettingfalse errors in cases where using the actual phpBB classes may behaveunexpectedly.
In our controller we added special handling when the provided name isbertie. So our first test is whether thephpbb\controller\helper::message() method is called once with theNO_AUTH_SPEAKING error message. We also want to make sure that thephpbb\controller\helper::render() method is not called in this case.
In most cases we will want to provide some test data to our unit test methods.A data provider is a method that returns an array of arrays containing inputvariables and expected output variables. The inner array contains the argumentsfor the test method.
Before we can run the database test, we need to create the fixture file wespecified in the getDataSet() method. This file can be used to createdatabase entries before each test run is executed. We will make use of thislater. For now we just want to check if our tables have been created, so wespecify an empty config tableext/acme/demo/tests/migrations/database/fixtures/add_database_changes.xml:
In order to get our database changes executed in unit tests, we need to tellphpBB that this test needs the extension to be set up. We can do this byoverwriting the \phpbb_database_test_case::setup_extensions() method of thetest and returning an array with the extension name:
After we added the content to the database we add a new test at the end of thefile, that queries our table to theext/acme/demo/tests/migrations/database/add_database_changes.php and testswhether the values are really in the database:
Again like with the database changes we need to tell phpBB that the test dependson the extension, then phpBB will take care of enabling the extension before thetest execution. Our little test opens the route we added and then checks for theright message, like the unit test we wrote in unit tests at the beginning:
Functional tests are slow. Depending on your server, it might take up to2 seconds per page view. phpBB is installed via page views as well, whichtakes another 20 to 100 seconds, depending on various configurations, forthe first functional tests. Subsequent functional tests do not reinstallthe board, so they do not have the long setup time.
As a final step in this tutorial, we want to explain how to set up automatedtesting of your extension using Github Actions. In order to do that, your extension mustfirst be set up as a project repository on GitHub (free of chargefor public open source repositories).
It is recommended to use the root of the extension (ext/acme/demo) asthe root for the Git repository. Otherwise the scripts that phpBB provides foreasy test execution on Travis CI will not work correctly.
To save and run your workflow, scroll to the bottom of the page and selectCreate a new branch for this commit and start a pull request. Then, to create a pullrequest, click Propose new file. After you merge this pull request, all futurecommits and pull requests on your master branch will trigger this CI workflow andyour unit, database and functional tests will be executed.
You can also set the version of phpBB you want your extension tested in using thePHPBB_BRANCH variable. This tutorial is using the current version of phpBB whichis the 3.3.x branch. Older branches of phpBB are not being supported with Github Actions,but can instead be used with Travis-CI.com .
Basic Checks: The basic-checks job does not do any PHPUnit testing. This is where EPV, Code Sniffer and Image Profile checks run. If you never intend to run these checks you may either delete or comment out the entire basic-checks job.
MySQL Tests: The mysql-tests job runs PHPUnit tests in various MySQL and MariaDB and PHP combinations. They are all defined in the matrix section. This workflow only runs in versions of PHP 7 and PHP 8 but you could, for example, add tests for versions of PHP 5. (Note that to include PHP 5 in the test matrix you must change the ubuntu server for that job to runs-on: ubuntu-16.04). You may delete or comment out some of the tests in the matrix if you do not want to test certain versions of PHP or MySQL or MariaDB.
PostgreSQL Tests: The postgres-tests job runs PHPUnit tests in various versions of PostgreSQL. The PHP version is consistent throughout since the mysql-checks job is where we do most of our PHP environment checks. You may add additional checks to this matrix or you may either delete or comment out the entire postgres-tests job if you do not intend to test PostgreSQL.
MSSQL, SQLite: The other-tests job runs PHPUnit tests in various versions of MSSQL and SQLite3. You may either delete or comment out the MSSQL or SQLite3 checks in the matrix if you do not want to test on either of those databases, or delete or comment out the entire other-tests job if you do not intend to test any of these databases.
Well written tests help prevent regressions (breaking other parts of your code)by alerting you to any problems resulting from changes to your code while fixing bugs,adding new features and other code changes to your extension.
If your tests fail after committing changes, you will receive a notification emailfrom GitHub. The logs from your Github Actions can be a little daunting at first,but once you get used to reading them they can help you pinpoint unforeseen bugsand regressions in your code that must be fixed.
Notice that while I am using the Web Platform to install PHP, I do not use it to install the phpBB forum software. I found too many issues with the additional pre-requisites it needed to install and also had problems with it wanting to use MySQL instead of MSSQL.
This is a very simple and *BASIC* installation. I am not explaining how to make this accessible from the internet (yet) so you will need to know how to publish the website through router etc.
So first of all, your instructions were very helpful because they made it clear that I was going in the right direction as I had already downloaded the SQL Server for PHP drivers and inserted the proper lines into the php.ini
No problem, glad it helped.
As for SQL performance, you would have to be running some really busy forums for SQL to be the limitation. If your server has enough capacity it should handle it easy.
If it does come to it though, moving to a new SQL server is pretty easy.
hello there, I followed your instructions to the T and managed to get it all working thank you for that, only problem is my forum is all mis aligned and search icons etc are not there? is this due to the latest version do you think?
When it throws an error you usually see the line in the install script it failed on which can give an idea of why.
When you login to ACP, again the line it fails on can give an idea of what is wrong.
Have you checked permissions on the PHP folder are correct? The phpbb support forums are good for checking if other people report similar errors.
What version/edition of SQL and why install it on Windows 10? Have you check supported requirements?
What are the first four steps you are referring to? Is there no error message or reference to the setup log?
In this tutorial we'll give you some suggestions on how to speed up and optimize phpBB3. Many of the tips are general and can be applied to other Content Management Systems (e.g. Joomla, WordPress, Magento, etc.) and some are phpBB3 specific. It's worth mentioning that you don't really need to take any optimization measures, unless your board is really getting big and it has thousands of registered users and/or you have installed some mod that slows down your whole forum. Trying to optimize and speed up a small board may sometimes give the opposite results.
Whenever there's a new upgrade release don't wait too long to update your phpBB3 board. Upgrade packages have various improvements in terms of optimization, security and others. If you need help with updating your phpBB3, check out the tutorials on updating phpBB3 with an automatic update package or updating phpBB3 through SSH, depending on your preferred method.
MODs (or modifications) are a great way to add different features and functionalities to your site. However, you shouldn't install too many of them just for the sake of it. Depending on the MODs, the more MODs you have, the more database requests; each additional request slows down your site. So install MODs that you really need or like, and if there are any that you don't need any more, uninstall them. To learn how to install MODs read the tutorial on installing phpBB3 MODs manually, or if you prefer the automatic way, check out the tutorial on installing phpBB3 MODs with AutoMOD.
By enabling gzip compression the data transfer between the server and the client will be compressed. You can turn on gzip compression from the administration control panel of your phpBB3 board. For some more details read the article on enabling gzip compression in phpBB3.
Another thing you can do is to disable the search function for guests and leave it for registered users. You can do this by adding some code in the search.php file, which is in the root phpBB3 directory on your hosting account. For example, if your phpBB3 board is installed in a folder called phpbb3 in the root public_html directory on your account, the path to the file would be public_html/phpbb3/search.php.
7fc3f7cf58