Example #1
0
 public function __construct()
 {
     global $table;
     $this->table = $table;
     $this->cdb = helper::getDB('phpcms');
     $this->wdb = helper::getDB('cmsware');
 }
Example #2
0
 public function syncContent()
 {
     $start = time();
     $id = $this->indexid;
     $wdb = helper::getDB('cmsware');
     $cdb = helper::getDB('phpcms');
     $sql = "select IndexID from cmsware_content_index where IndexID >= {$this->indexid} order by IndexID asc limit 10000";
     $res = $wdb->fetchAll($sql);
     foreach ($res as $k => $v) {
         $id = $v['IndexID'];
         error_log($id . "\n", 3, "process{$this->indexid}.log");
         $url = sprintf(ADDCONENTURL, $id);
         $res = curl_post($url, array());
         $tmp = json_decode($res, true);
         if (!isset($tmp['status']) || $tmp['status'] != 1) {
             error_log($id . "\t" . strip_tags($res) . "\n", 3, "fail_content.log");
         }
     }
     $end = time();
     error_log($end - $start . "\n", 3, "time");
 }
Example #3
0
        $obj->run();
    }
    public function syncTableModel()
    {
        $obj = new tableid();
        $obj->run();
    }
}
$obj = new syncPHPcms();
$res = $obj->loginCms();
if ($res) {
    $obj->syncSite();
    $obj->syncModel();
    $obj->syncModelFields();
    if (is_file("alter.sql")) {
        $cdb = helper::getDB("phpcms");
        $c = file("alter.sql");
        foreach ($c as $v) {
            $sql = trim($v);
            $res = $cdb->execute($sql);
        }
    }
    $obj->syncUrlrule();
    $obj->syncCategory();
    //$obj->syncIndexId();
    $obj->syncHists();
    //$obj->syncTableModel();
    $obj->syncAdminUser();
} else {
    exit("登陆错误了");
}
Example #4
0
 public function __construct()
 {
     $this->wdb = helper::getDB('cmsware');
     $this->getBaseWareSites();
     $this->getcmsware_psn();
 }
Example #5
0
File: gen.php Project: lestatmq/cms
<?php

require_once __DIR__ . "/../init.php";
$db = helper::getDB("cmsware");
$sql = "select max(IndexID) as cnt from cmsware_content_index";
$res = $db->fetchOne($sql);
$max = $res['cnt'];
for ($i = 1; $i <= $max; $i = $i + 10000) {
    echo "php syncContent.php {$i} &\n";
}