CC-1927 Remove PEAR DB
* Removed all traces of PEAR functions. * Fixed AirtimeInstall::GetVersionInstalled() to return the correct answer even when it cant connect to the database. Also fixed return value to be consistent on failure. * Fixed phone_home_stat.php and soundcloud-uploader.php
This commit is contained in:
parent
c0da27b445
commit
96b010e7f0
10 changed files with 65 additions and 120 deletions
|
@ -1,14 +1,6 @@
|
|||
<?php
|
||||
require_once(dirname(__FILE__).'/../StoredFile.php');
|
||||
|
||||
$dsn = $CC_CONFIG['dsn'];
|
||||
$CC_DBC = DB::connect($dsn, FALSE);
|
||||
if (PEAR::isError($CC_DBC)) {
|
||||
echo "ERROR: ".$CC_DBC->getMessage()." ".$CC_DBC->getUserInfo()."\n";
|
||||
exit(1);
|
||||
}
|
||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
class StoredFileTest extends PHPUnit_TestCase {
|
||||
|
||||
function __construct($name) {
|
||||
|
@ -21,10 +13,6 @@ class StoredFileTest extends PHPUnit_TestCase {
|
|||
function testGetAudioMetadata() {
|
||||
$filePath = dirname(__FILE__)."/ex1.mp3";
|
||||
$metadata = Metadata::LoadFromFile($filePath);
|
||||
if (PEAR::isError($metadata)) {
|
||||
$this->fail($metadata->getMessage());
|
||||
return;
|
||||
}
|
||||
if (($metadata["dc:description"] != "Tmu sem tam videla ...")
|
||||
|| ($metadata["audio"]["dataformat"] != "mp3")
|
||||
|| ($metadata["dc:type"] != "Speech")) {
|
||||
|
@ -52,10 +40,6 @@ class StoredFileTest extends PHPUnit_TestCase {
|
|||
$values = array("filepath" => $filePath,
|
||||
"dc:description" => "Unit test ".time());
|
||||
$storedFile = Application_Model_StoredFile::Insert($values, false);
|
||||
if (PEAR::isError($storedFile)) {
|
||||
$this->fail("Failed to create StoredFile: ".$storedFile->getMessage());
|
||||
return;
|
||||
}
|
||||
//var_dump($storedFile);
|
||||
$id = $storedFile->getId();
|
||||
if (!is_numeric($id)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue