Advertisement
Guest User

Untitled

a guest
Dec 6th, 2015
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. /**
  6. * Compare versions.
  7. *
  8. * @param string $version Like: 5.0.0
  9. * @param string $operator Like: <=
  10. *
  11. * @return mixed
  12. */
  13.  
  14. public function versionCompare( $version, $operator )
  15. {
  16. // return by default version compare
  17. return version_compare( Shopware()->Config()->get( 'Version' ), $version, $operator );
  18. }
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. /**
  26. * Check if current environment is shopware 5.
  27. *
  28. * @return bool
  29. */
  30.  
  31. public function isShopware5()
  32. {
  33. // return if this is shopware 5
  34. return $this->versionCompare( '5.0.0', '>=' );
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement