Skip to content

Instantly share code, notes, and snippets.

@rindeal
Last active December 3, 2015 22:36
Show Gist options
  • Save rindeal/a7393fde0aaa1dc6d7d2 to your computer and use it in GitHub Desktop.
Save rindeal/a7393fde0aaa1dc6d7d2 to your computer and use it in GitHub Desktop.
OpenCart (vqMod) toolbox
#!/bin/bash
# Clear OpenCart (vqMod) caches
rm -rf ./system/cache/{cache*,smp/*}
rm -rf ./vqmod/vqcache/*
rm -f ./vqmod/*.cache
<?php
/**
* OpenCart (vqMod) mod_rewrite emulation for PHP built-in webserver
*
* Usage:
* $ php -S 0.0.0.0:8000 server.php
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
if ($uri !== '/'){
if(file_exists(__DIR__.$uri)) {
return false;
} else {
$_GET['_route_']=$uri;
}
}
require_once "{$_SERVER['DOCUMENT_ROOT']}/index.php";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment