This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup_django_env(path): | |
import imp, os | |
from django.core.management import setup_environ | |
f, filename, desc = imp.find_module('settings', [path]) | |
project = imp.load_module('settings', f, filename, desc) | |
setup_environ(project) | |
setup_django_env('../django/viajala/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spider_count = 0 | |
# Get a signal that a crawler has finished its job, start another crawler | |
def spider_closed(spider, reason): | |
spider_count += 1 | |
#Only starts another crawler if available | |
if spider_count < len(spiders): | |
reactor.callLater(0, start_crawler, spider=spiders[spider_count]) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function cancelar_venda( $venda_id ) { | |
// ---------------------------- | |
// Inicia uma MYSQL TRANSACTION | |
// ---------------------------- | |
Venda::begin_transaction(); | |
//pega a venda no banco | |
$venda = Venda::where_venda_id( $venda_id )->first(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//nao precisa ser um arquivo no sistema | |
$ext = pathinfo($filename, PATHINFO_EXTENSION); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... ... @@ -17,6 +17,13 @@ class Redis { | |
17 17 protected $port; | |
18 18 | |
19 19 /** | |
20 + * The password for connect to Redis. | |
21 + * | |
22 + * @var string | |
23 + */ | |
24 + protected $password; |