-
Notifications
You must be signed in to change notification settings - Fork 17
Home
The back-end for operating v2 is identical to that for v1 (Apache, PHP, MySQL, and a virtual host setup pointing to the public
sub-folder...). See the v1 instructions.
- Clone the
phpip-v2
Git repository to a folder, sayphpip-v2
. - Install composer, then run
composer install
in thephpip-v2
folder. - Create an
.env
file with your database credentials (copy and tailor the provided.env.example
file). - Run
php artisan key:generate; php artisan config:clear
(a command-line php is required).
-
Run
php artisan migrate --seed
This creates a blank database with basic configuration. You're ready to go with the credentials phpipuser/changeme. -
For adding sample data, run
php artisan db:seed --class=SampleSeeder
.
- Copy the
phpip
MySQL schema to a new one (sayphpipv2
). - Upgrade the
phpipv2
schema with the script provided in/database/migrations/sql
. - Apply further updates to the tables by running the "xxx_update_tables.php" migration scripts - to do this, go in the
/database/migrations
folder, move all the scripts except the "xxx_update_tables.php" scripts out of the folder, and runphp artisan migrate
from the root folder. You may want to restore the/database/migrations
folder to its original state afterwards for pulling later updates without confusing git.
Then you need to update the password
field of your users. Logins are based on the login
and password
fields in the actor
table only (they are no longer replicated in the MySQL users table). Authorizations will be implemented through the default_role
field of the users - set this field to "DBA" to get full permissions in the future.
The passwords are hashed with bcrypt instead of md5, and don't use a user-provided salt. So you need to change all the md5+salt passwords of v1 to bcrypt ones. You can use the password reset functionality of the UI or change the password hashes manually in the actor
table with a bcrypt hash. You can generate a bcrypt hash using the command php -r 'echo password_hash("your password",PASSWORD_BCRYPT) . "\n";'
.
To fire a quick test, run php artisan serve
, and point your browser to http://localhost:8000.
The software is under development, so many changes can occur, sometimes on a daily basis. To stay up to date, dont forget to regularly pull the new commits by running:
-
git pull
and composer install
The database structure may be updated too, so you need to apply the new migration scripts in database/migrations
. If you have installed phpIP initially with the migration scripts, just run php artisan migrate
, which will apply the latest scripts. If you have migrated from v1, you need to manually apply the new migration scripts.