Skip to content

Commit

Permalink
Use local binaries for both php and phpunit and simpler local config …
Browse files Browse the repository at this point in the history
…management
  • Loading branch information
gi-lunaweb committed Apr 29, 2014
1 parent 4e0dbee commit 8932623
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
17 changes: 17 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$user_id = null;
$api_key = null;

@include 'local_config.php';

if (!function_exists('readline')) {
function readline($prompt = '')
{
echo $prompt;
return rtrim(fgets(STDIN), "\n");
}
}

if (!$user_id) $user_id = readline('User Id: ');
if (!$api_key) $api_key = readline('API Key: ');
7 changes: 2 additions & 5 deletions example.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env php5
<?php
# You must edit the following values with your own
$user_id = null;
$api_key = null;

$video_file = '.fixtures/video.3gp';

@include 'local_config.php';
require_once 'config.php';

require_once 'CloudKey.php';

Expand Down
6 changes: 1 addition & 5 deletions example_list.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env php5
<?php
# You must edit the following values with your own
$user_id = null;
$api_key = null;

@include 'local_config.php';
require_once 'config.php';

require_once 'CloudKey.php';

Expand Down
20 changes: 2 additions & 18 deletions test.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
#!/usr/bin/env phpunit
<?php

$base_url = null;
$user_id = null;
$api_key = null;

require_once 'config.php';

@include 'local_config.php';

if (!function_exists('readline'))
{
function readline($prompt = '')
{
echo $prompt;
return rtrim(fgets(STDIN), "\n");
}
}

if (!$user_id) $user_id = readline('User Id: ');
if (!$api_key) $api_key = readline('API Key: ');

require_once 'PHPUnit/Framework.php';
require_once 'vendor/autoload.php';
require_once 'CloudKey.php';

class AllTests
Expand Down

0 comments on commit 8932623

Please sign in to comment.