Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup improvements #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions data/rebuild_db.php → bin/rebuild_db.php 100644 → 100755
@@ -1,7 +1,8 @@
#!/usr/bin/env php
<?php

// determine where the sqlite DB will go
$dir = __DIR__.'/oauth.sqlite';
$dir = dirname(__DIR__) . '/data/oauth.sqlite';

// remove sqlite file if it exists
if (file_exists($dir)) {
Expand All @@ -15,8 +16,8 @@
$db->exec('CREATE TABLE oauth_access_tokens (access_token TEXT, client_id TEXT, user_id TEXT, expires TIMESTAMP, scope TEXT)');
$db->exec('CREATE TABLE oauth_authorization_codes (authorization_code TEXT, client_id TEXT, user_id TEXT, redirect_uri TEXT, expires TIMESTAMP, scope TEXT)');

// add test data
$db->exec('INSERT INTO oauth_clients (client_id, client_secret) VALUES ("demoapp", "demopass")');
$db->exec('CREATE TABLE oauth_refresh_tokens (refresh_token TEXT, client_id TEXT, user_id TEXT, expires TIMESTAMP, scope TEXT)');
$db->exec('INSERT INTO oauth_clients (client_id, client_secret, redirect_uri) VALUES ("demoapp", "demopass", "http://localhost/demo/authorized")');

chmod($dir, 0777);
// $db->exec('INSERT INTO oauth_access_tokens (access_token, client_id) VALUES ("testtoken", "Some Client")');
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"require": {
"silex/silex": "1.0.*",
"symfony/twig-bridge": "2.1.*",
"bshaffer/oauth2-server-php": "dev-develop",
"bshaffer/oauth2-server-php": "dev-master",
"bshaffer/oauth2-server-httpfoundation-bridge": "dev-master"
},
"autoload" : {
Expand Down