Exemplo n.º 1
0
<?php

ini_set('log_errors', 'On');
ini_set('error_log', dirname(__FILE__) . '/php_errors.log');
include "../../config.php";
include "../../core/function.php";
set_time_limit(1000);
//chdir(ROOT);
Cfg::add($CONFIG);
$r = DB::select("SELECT UPPER(name) AS name,value FROM sc_config");
while ($r->next()) {
    if ($r->get('value')) {
        $CONFIG[$r->get('name')] = $r->get('value');
    }
}
Cfg::add($CONFIG);
$last_time_fname = 'catalog_subscribe.txt';
$last_date = now();
if (file_exists($last_time_fname)) {
    $last_date = file_get_contents($last_time_fname);
}
$id = strtotime($last_date);
$q = "SELECT * FROM sc_shop_item i,sc_shop_proposal p,sc_users v WHERE p.itemid=i.id AND i.vendor=v.u_id AND p.create_time>'{$last_date}'";
$rs = DB::select($q)->toArray();
if (!$rs) {
    exit;
}
ob_start();
include dirname(__FILE__) . "/catalog_subscribe.tpl.php";
$content = ob_get_contents();
ob_end_clean();
Exemplo n.º 2
0
class_alias("CoreWine\\Http\\Flash", "Flash");
class_alias("CoreWine\\Http\\Request", "Request");
class_alias("CoreWine\\Http\\Response\\Response", "Response");
class_alias("CoreWine\\Component\\Cache", "Cache");
class_alias("CoreWine\\Component\\Cfg", "Cfg");
# Make dir cache if doesn't exists
# Add cache dir
Cache::setDir(PATH_APP . '/cache/data');
# Initialize Handler
Handler::register();
Handler::add(\Kernel\Exceptions\ExceptionHandler::class);
# Initialize request
Request::ini();
# Initialize config
$config = (include PATH_CONFIG . '/app.php');
Cfg::add("app", $config);
\CoreWine\View\Engine::ini(PATH_APP . "/cache/views");
\CoreWine\DataBase\DB::connect($config['database']);
# Compile
\CoreWine\View\Engine::compile(PATH_APP, 'Resources/views');
foreach (\Kernel\Manager::$list as $name => $dir) {
    \CoreWine\View\Engine::compile(PATH_APP, "Resources/" . $name . "/views", $name);
}
\CoreWine\DataBase\ORM\SchemaBuilder::setFields(include PATH_CONFIG . '/orm.php');
# Load all sources
\Kernel\Manager::loadAll(PATH_SRC);
foreach (\Kernel\Manager::$list as $name => $dir) {
    \CoreWine\View\Engine::compile(PATH_SRC, $name . "/Resources/views", $name);
}
Cfg::set('app.drive.public', __DIR__ . "/../" . Cfg::get('app.public'));
Cfg::set('app.drive', __DIR__ . "/../");