Installation

Installation methods

It´s possible to use this api only with the oxid database (without the framework and therefore without the oxid objects and oxid hooks. Also it´s possible to use this with bootstraped oxid framework (slow!).

Installation inside OXID (using oxid objects)

1. Switch to your oxid source directory and install project
1
composer create-project oxid-community/oxid-rest-api --keep-vcs rest
Copied!
2. Add rewrite rules to .htaccess file after line RewriteRule oxseo.php$ oxseo.php?mod_rewrite_module_is=on [L]
1
# LUMEN REST start
2
RewriteCond %{HTTP:Authorization} ^(.*)
3
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
4
RewriteCond %{REQUEST_URI} .*rest.*
5
RewriteCond %{REQUEST_URI} !rest\.php$
6
RewriteCond %{REQUEST_FILENAME} !-f
7
RewriteRule .* rest/public/index.php [L,QSA]
8
# LUMEN REST end
Copied!
3. Create rest_users table and test user
1
CREATE TABLE `rest_users` (
2
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
3
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
4
`api-token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
5
`api-rights` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'rw',
6
`created_at` timestamp NULL DEFAULT NULL,
7
`updated_at` timestamp NULL DEFAULT NULL,
8
PRIMARY KEY (`id`)
9
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
10
11
12
INSERT INTO `rest_users` (`id`, `name`, `api-token`, `api-rights`, `created_at`, `updated_at`)
13
VALUES
14
(1,'Test User','t6PEqwkBpbdsf93osDSF913Bmcsd78pYWLtEgvs','rw',NULL,NULL);
Copied!

Installation outside oxid (database only)

1. Switch to your vhost (example) root directory and install project.
1
composer create-project oxid-community/oxid-rest-api --keep-vcs rest
Copied!
2. Update database credentials in .env file
3. Migrate and seed database
1
php artisan migrate
2
php artisan db:seed
Copied!

Update

Go to your rest directory and execute git pull.
Last modified 2yr ago