예제 #1
0
파일: setbwd.php 프로젝트: jechiy/PHPWind
         $query = $db->query($sql);
         while ($rt = $db->fetch_array($query)) {
             HtmlConvert($rt);
             $classdb[$rt['id']] = $rt;
         }
     } else {
         $job = 'notupdate';
     }
     include_once PrintEot('filterAjax');
     ajax_footer();
 } else {
     define('AJAX', 1);
     S::gp(array('state', 'class', 'newclass'));
     //插入新分类
     if ($newclass) {
         $class = newClass($newclass);
     }
     $class_title = $db->get_value("SELECT title FROM pw_filter_class WHERE id=" . S::sqlEscape($class));
     //更改分类状态
     setClassState($class, $state);
     require_once R_P . 'require/posthost.php';
     //获取中心词库词语数量
     $app_num = $db->get_value("SELECT COUNT(*) AS count FROM pw_wordfb WHERE custom = 0");
     if (empty($app_num)) {
         //重新同步中心词库
         $data = PostHost($updateHost, "m=wordsfb&a=restart&sitehash={$sitehash}", "POST");
     } else {
         //同步中心词库
         $data = PostHost($updateHost, "m=wordsfb&a=update&sitehash={$sitehash}", "POST");
     }
     $content = pwConvert(unserialize($data), $db_charset, 'UTF8');
예제 #2
0
<?php

class TestClass
{
    public $prop = "Default value";
    public function methodName()
    {
        echo "Something";
        $this->prop = "newValue";
    }
}
$var = newClass();
$var->methodName();
$obj2 = newClass();
?>

/*
Classes:				UpperCamelCase
Functions/Methods:		lowerCamelCase()
Variables/properties:	lowerCamelCase
Constants:				CAPITAL_AND_UNDERSCORES

Indentation:			Debated

Most important:			Be consistent!
*/
예제 #3
0
$class = end($class);
//----------------------------------------------------------
require_once Import::$uber_src_path . $classPath;
//----------------------------------------------------------
if (isset($_OBJ['staticClass'])) {
    if ($_OBJ['staticClass'] == "true") {
        Constants::$conn = GenFun::hostConnect("{DATABASE}");
    }
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//init
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------
$object = !isset($_OBJ['staticClass']) ? newClass($class) : $class;
//----------------------------------------------------------
$object = SetPublicProp::findObj($object, $_OBJ['functionName']);
//----------------------------------------------------------
$orig_functionName = $_OBJ['functionName'];
//----------------------------------------------------------
$_OBJ['functionName'] = $object['string'];
$object = $object['class'];
//----------------------------------------------------------
if (isset($_OBJ['prop'])) {
    SetPublicProp::go($object, $_OBJ['prop']);
}
//----------------------------------------------------------
if (!isset($_OBJ['params'])) {
    $_OBJ['params'] = array();
}
 public function index()
 {
     $textclass = newClass('Text', 'hello');
     $textclass->test();
 }