Skip to content

Commit

Permalink
Fixed directory separator for all OS - Fixes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
phiamo committed May 2, 2012
1 parent bb67ab1 commit 73bb05b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Model/BarcodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function saveAs($type, $text, $file){
@unlink($file);
switch ($type){
case $type == 'qr':
include __DIR__."/../Resources/phpqrcode/qrlib.php";
include __DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."Resources".DIRECTORY_SEPARATOR."phpqrcode".DIRECTORY_SEPARATOR."qrlib.php";
\QRcode::png($text, $file);
break;
case is_numeric($type):
Expand Down Expand Up @@ -59,7 +59,8 @@ public function get($type, $enctext, $absolut = false, $options = array()){
$this->saveAs($type, $text, $filename);
}
if(!$absolut){
return "/".$this->webdir.$this->getTypeDir($type).$this->getBarcodeFilename($text);
$path = DIRECTORY_SEPARATOR.$this->webdir.$this->getTypeDir($type).$this->getBarcodeFilename($text);
return str_replace(DIRECTORY_SEPARATOR, "/", $path);
}
return $filename;
}
Expand All @@ -80,6 +81,6 @@ protected function getAbsoluteBarcodeDir($type){
return $path;
}
protected function getAbsolutePath(){
return $this->kernelrootdir."/../web/".$this->webdir;
return $this->kernelrootdir.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."web".DIRECTORY_SEPARATOR.$this->webdir;
}
}

0 comments on commit 73bb05b

Please sign in to comment.