partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit c793b2a71023cf88a52520bc9de6abfe2097176e
parent 6be9bd14502b84978c2afdf6baf1c5db235b5d0c
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 22 Nov 2012 03:04:06 +0100

Merge branch 'master' of github.com:partkeepr/PartKeepr

Diffstat:
Mdocumentation/developer/INSTALL-UBUNTU | 2++
Msrc/backend/PartKeepr/TempFile/TempFileService.php | 4++--
Msrc/setup/tests/check-doctrine.php | 47++++++++++++++++++++++++++++++-----------------
3 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/documentation/developer/INSTALL-UBUNTU b/documentation/developer/INSTALL-UBUNTU @@ -93,6 +93,8 @@ cp config.php.template config.php # You have now two choices: Proceed with or without sample data. # ==== WITH SAMPLE DATA ==== +# Yes, this is really a separate database! partdb is another software, and we're using the existing partdb data. +# You may remove the partdb database after migration has been taken place. mysql -uroot -p CREATE DATABASE partdb; grant usage on *.* to partdb@localhost identified by 'partdb'; diff --git a/src/backend/PartKeepr/TempFile/TempFileService.php b/src/backend/PartKeepr/TempFile/TempFileService.php @@ -10,7 +10,7 @@ class TempFileService extends Service { public function upload () { $tmpFile = new TempUploadedFile(); - if (array_key_exists("userfile", $_FILES)) + if (array_key_exists("userfile", $_FILES) && array_key_exists("error", $_FILES["userfile"])) { switch ($_FILES["userfile"]["error"]) { case 1: @@ -28,7 +28,7 @@ class TempFileService extends Service { $tmpFile->replace($file); $tmpFile->setOriginalFilename(basename($filename)); } else { - throw new \Exception("Unknown error occured while uploading the file"); + throw new \Exception(sprintf("Unknown error occurred while uploading the file. Errno %d", $_FILES["userfile"]["error"])); } } diff --git a/src/setup/tests/check-doctrine.php b/src/setup/tests/check-doctrine.php @@ -23,17 +23,17 @@ if (!class_exists("\\Doctrine\\Common\ClassLoader")) { */ use Doctrine\Common\ClassLoader; -$ormClassLoader = new ClassLoader('Doctrine\ORM'); +$ormClassLoader = new ClassLoader('Doctrine\ORM'); $ormClassLoader->register(); -$commonClassLoader = new ClassLoader('Doctrine\Common'); -$commonClassLoader->register(); +$commonClassLoader = new ClassLoader('Doctrine\Common'); +$commonClassLoader->register(); -$sfClassLoader = new ClassLoader('Symfony'); +$sfClassLoader = new ClassLoader('Symfony'); $sfClassLoader->register(); -$doctrineClassLoader = new ClassLoader('Doctrine'); -$doctrineClassLoader->register(); +$doctrineClassLoader = new ClassLoader('Doctrine'); +$doctrineClassLoader->register(); /** @@ -42,7 +42,7 @@ $doctrineClassLoader->register(); */ if (!$ormClassLoader->canLoadClass("Doctrine\\ORM\\Version")) { $installDoctrineError .= "<small>The classloader can't load Doctrine\\ORM\\Version</small>"; - echo json_encode(array("error" => true, "message" => $installDoctrineError)); + echo json_encode(array("error" => true, "message" => $installDoctrineError)); exit; } @@ -53,22 +53,21 @@ if (\Doctrine\ORM\Version::compare("2.2.0") > 0) { $versionInvalidMessage = "DoctrineORM is installed, but needs to be at Version 2.2.0 or higher. "; $versionInvalidMessage .= "Please run pear upgrade-all to bring your packages up-to-date."; - echo json_encode(array("error" => true, "message" => $versionInvalidMessage)); + echo json_encode(array("error" => true, "message" => $versionInvalidMessage)); exit; } -if (\Doctrine\ORM\Version::compare("2.3.0") <= 0) { - $aWarnings[] = sprintf( "You are using Doctrine %s, which PartKeepr isn't tested against. If you encounter any ". +if (\Doctrine\ORM\Version::compare("2.3.0") <= 0) { + $aWarnings[] = sprintf( "You are using Doctrine %s, which PartKeepr isn't tested against. If you encounter any ". "problems, please report them.", - \Doctrine\ORM\Version::VERSION); + \Doctrine\ORM\Version::VERSION); } /** * Check for the Symfony YAML component. This component is required to parse YAML files and is used during installation * of footprints. */ - if (!$doctrineClassLoader->canLoadClass("Doctrine\\Symfony\\Component\\Yaml\\Yaml")) { $yamlErrorMessage = "The YAML component of symfony is not installed. This component is required; please install "; @@ -78,10 +77,24 @@ if (!$doctrineClassLoader->canLoadClass("Doctrine\\Symfony\\Component\\Yaml\\Yam $yamlErrorMessage .= "installed and is the same as the released version</code><br/><br/>"; $yamlErrorMessage .= "please REINSTALL the package using<br/><br/><code>pear uninstall "; $yamlErrorMessage .= "doctrine/DoctrineSymfonyYaml<br/>pear install doctrine/DoctrineSymfonyYaml</code>"; - - echo json_encode(array("error" => true, "message" => $yamlErrorMessage)); - exit; + + echo json_encode(array("error" => true, "message" => $yamlErrorMessage)); + exit; +} + +/** + * Check for the Symfony Console component. + * of footprints. + */ +if (!$doctrineClassLoader->canLoadClass("Doctrine\\Symfony\\Component\\Console\\Command\\Command")) { + + $consoleErrorMessage = "The Console component of symfony is not installed. This component is required; please install "; + $consoleErrorMessage .= "it using:<br/><br/>"; + $consoleErrorMessage .= "<code>pear install pear.doctrine-project.org/DoctrineSymfonyConsole</code><br/><br/>"; + + echo json_encode(array("error" => true, "message" => $consoleErrorMessage)); + exit; } -echo json_encode(array("error" => false, "warnings" => $aWarnings)); -exit; +echo json_encode(array("error" => false, "warnings" => $aWarnings)); +exit;