Website portal that links to the various games running the Open RSC framework
You will need:
- PHP 8.x
- Composer 2+ (use latest version)
- Node
- phpBB3 (if you do not need to work on the Latest News module, this is optional due to a known workaround)
- Set up PHP for development.
- Download and install PHP 8. On Windows, you simply extract the ZIP file to your install directory (usually
C:\Program Files, but checkPATH). Once this is done, runphp -vin a terminal and you should see version 8.x. - In your PHP folder, rename
php.ini-developmenttophp.ini. This is thephp.inifile that the CLI and Composer will be using. - Add the following extensions to your
php.inifile (this seems to be necessary for the latest version of Composer to work):extension=php_openssl.dllextension=php_fileinfo.dll
- Uncomment the
extension_dir = "ext"line in yourphp.inifile. - Uncomment the
extension=pdo_mysqlline in yourphp.inifile.
- Download and install PHP 8. On Windows, you simply extract the ZIP file to your install directory (usually
- In your local MySQL/MariaDB server, create an empty database named
laravel. This allowsphp artisancommands to work later on. If there is a more correct way of getting thelaraveldatabase, update this readme. - In a terminal,
cdinto theportaldirectory. - Run
cp .env.example .env. This creates your.envfile for theportalapp. - In your
portal/.envfile, change theDB_HOSTto127.0.0.1 - Run
composer install. - Run
php artisan config:clear. - Run
php artisan key:generate. - Run
php artisan migrate. - Run
php artisan db:seed. - Run
npm i - Run
npm run dev - Finally, run
php artisan serve. The site should now be accessible at http://127.0.0.1:8000.
Do:
- Write mobile-specific CSS first, then handle tablet and/or desktop CSS in media queries.
- Add new
.scssfiles to pages/ for any page you want to style that doesn't have its own dedicated.scssfile yet. After adding the new.scssfile, make sure to import it inall.scss. - Use the variables in
_variables.scssto your advantage. These can be referenced in any.scssfile like this:$tablet-breakpoint.
Don't:
- Use inline styles. It's bad practice.
- Use
!important(in most cases). It's bad practice, and there are ways around it by using more specific CSS.
To see changes to .scss files on your local site, you need to compile SASS. To do this:
- In a terminal,
cdinto theportaldirectory. - Run
npm ci. This only needs to be done once. - Run
npm run dev. This runs Laravel Mix, which compiles front-end files.
Error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'board.phpbb_posts' doesn't exist seen when loading local site
You'll need to install phpBB3 towards your local MySQL/MariaDB server, which will create the necessary tables. If that isn't feasible, a workaround is to comment out the $news_feed code in HomeController.php.
They probably do not exist in your local MySQL server. Either create empty databases for each or comment out the code in HomeController.php that fetches the online player count (and set the _online variables returned to the view to an empty string '').
Make sure you are cd'd into the portal directory, then try again.