/** * Registers Log object for debugging * * See Zend_Log_Writer_Stream */ function _initRegisterLogger() { //@TODO put the config in main configuration file $config = array('syslog' => array('application' => 'application', 'facility' => LOG_LOCAL2), 'stream' => array('file_path_url' => 'log/debug.log', 'mode' => null)); $logger = LogService::getInstance($config); $registry = Zend_Registry::getInstance(); $registry->set('logger', $logger); }
public static function getInstance(array $config) { if (self::$_instance === null) { $instance = new self(); $instance->init($config); self::$_instance = $instance; } return self::$_instance; }
<?php /* * @auther lion * @date 2013-2-2 */ require_once './class/log_service.class.php'; require_once "./class/code_names.class.php"; $log_service = new LogService(); if (isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 'ls': require_once './problem_view_ls.php'; break; case 'add_get': if (strstr($_SESSION['user_permission_name'], CodeNames::$permission_name_order) || strstr($_SESSION['user_permission_name'], CodeNames::$permission_name_administrator)) { require_once './problem_view_add_form.php'; } else { header("Location: ./index.php?mod=home"); } break; case 'add_post': if (strstr($_SESSION['user_permission_name'], CodeNames::$permission_name_order) || strstr($_SESSION['user_permission_name'], CodeNames::$permission_name_administrator)) { require_once './class/problem_service.class.php'; require_once 'class/problem.class.php'; $problem_name_category = $_POST['problem_name_category']; $supplier_id = $_POST['supplier_id']; $description = $_POST['description']; $note = $_POST['note']; $problem = new Problem(null, $problem_name_category, $supplier_id, $description, $note);
<?php /* * @auther lion * @date 2013-2-1 */ require_once './class/log_service.class.php'; $log_service = new LogService(); if (isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 'ls': require_once './goods_category_view_ls.php'; break; case 'add_get': require_once './goods_category_view_add_form.php'; break; case 'add_post': require_once './class/goods_category_service.class.php'; require_once 'class/goods_category.class.php'; $goods_category_name = $_POST['goods_category_name']; $goods_category = new GoodsCategory(null, $goods_category_name); $goods_category_service = new GoodsCategoryService(); $id = $goods_category_service->addGoodsCategory($goods_category); $_SESSION['operation'] = true; $_SESSION['operation_msg'] = "添加产品类别:" . $goods_category_name . "成功"; $log_service->addLog("insert", "产品类别", $id); header("Location: ./index.php?mod=goods_category&action=ls"); break; case 'edit_get': if (isset($_GET['eid'])) {
<?php /* * @auther lion * @date 2013-2-4 */ require_once './class/log_service.class.php'; $log_service = new LogService(); if (isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 'ls': require_once './order_view_ls.php'; break; case 'add_get': require_once './order_view_add_form.php'; break; case 'add_post': require_once './class/order_service.class.php'; require_once 'class/order.class.php'; require_once 'class/code_names.class.php'; $order_number = "dd" . time(); $supplier_id = $_POST['supplier_id']; $status = CodeNames::$order_status_pending_audit; $note = $_POST['note']; $goods_id = $_POST['goods_id']; $goods_number = $_POST['goods_number']; $order_service = new OrderService(); $order = new Order(null, $order_number, $supplier_id, $status, $note); $order_id = $order_service->addOrder($order); $log_service->addLog("insert", "订单", $id);
<?php /* * @auther lion * @data 2013-1-30 */ require_once './class/log_service.class.php'; require_once 'class/code_names.class.php'; $log_service = new LogService(); if (isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 'ls': if (strstr($_SESSION['user_permission_name'], CodeNames::$permission_name_administrator)) { require_once './user_view_ls.php'; } else { header("Location: ./index.php?mod=home"); } break; case 'user_validate': if (!imageCodeCheck()) { $_SESSION['image_code_error'] = true; $url = "./login.php"; } else { require_once 'class/user.class.php'; require_once 'class/user_service.class.php'; $username = trim($_POST['username']); $pwd = md5(trim($_POST['pwd'])); $user = new User(null, null, null, null, $username, $pwd, null, null, null, null); $user_service = new UserService(); $rs = $user_service->validateUser($user);
<?php /* * @auther udzhou * @date 2013 1-31 */ require_once './class/log_service.class.php'; $log_service = new LogService(); if (isset($_GET['action'])) { $action = $_GET['action']; switch ($action) { case 'ls': require_once './supplier_view_ls.php'; break; case 'detail': if (isset($_GET['did'])) { $id = $_GET['did']; if (is_numeric($id)) { require_once 'class/supplier.class.php'; require_once 'class/supplier_service.class.php'; $supplier_service = new SupplierService(); if (isset($_POST['goods_id'])) { $supplier_service->addGoods($id, $_POST['goods_id']); } $supplier = $supplier_service->getSupplierById($id); $supplier = serialize($supplier); $_SESSION['supplier'] = $supplier; require_once './supplier_view_detail.php'; } else { header("Location: ./index.php?mod=supplier&action=ls"); }
public function updateGoods($goods) { $id = $goods->_get('id'); $goods_name = $goods->_get('goods_name'); $goods_category_id = $goods->_get('goods_category_id'); $system_number = $goods->_get('system_number'); $price = $goods->_get('price'); $size = $goods->_get('size'); $color = $goods->_get('color'); $description = $goods->_get('description'); $website = $goods->_get('website'); $note = $goods->_get('note'); $sql = sprintf("update t_goods set goods_name='%s',goods_category_id='%s',system_number='%s',price='%s',size='%s',color='%s',description='%s',website='%s',note='%s' where id=%d", $goods_name, $goods_category_id, $system_number, $price, $size, $color, $description, $website, $note, $id); $oldPrice = $_SESSION['price']; if ($price != $oldPrice) { $created = date('Y-m-d H:i:s'); $price_sql = sprintf("insert into t_price_change (goods_id,price,created) values(%d,'%s','%s')", $id, $price, $created); $this->g_db->Execute($price_sql); $insert_id = $this->g_db->getLastId(); require_once './class/log_service.class.php'; $log_service = new LogService(); $log_service->addLog("insert", "价格变化", $insert_id); } return $this->g_db->Execute($sql); }
define('APP_DEBUG', true); define('APP_PATH', './Yoga/'); // define('DIR_SECURE_FILENAME', 'default.html'); // define('BUILD_DIR_SECURE', false); // define('BIND_MODULE', 'Channelmanager'); // define('BIND_CONTROLLER','Ptmanager'); // define('BUILD_CONTROLLER_LIST','Index,User,Brand'); define('RUNTIME_PATH', './Runtime/'); // define('STORAGE_TYPE','sae'); // define('APP_MODE','sae');//application mode // //默认错误跳转对应的模板文件 // 'TMPL_ACTION_ERROR' => THINK_PATH . 'Tpl/dispatch_jump.tpl', // //默认成功跳转对应的模板文件 // 'TMPL_ACTION_SUCCESS' => THINK_PATH . 'Tpl/dispatch_jump.tpl', define('APP_STATUS', 'office'); // will load the status config file./application/Common/COnf/home.php define('BUILD_LITE_FILE', true); require "./LogService.class.php"; $ll = new LogService("request", "request"); $url = $_SERVER["REQUEST_URI"]; if ($url != "/Home/Task/checkTask") { $ll->debug($_SERVER["REQUEST_URI"]); if (!empty($_POST)) { $ll->debug($_POST); } if (!empty($_GET)) { $ll->debug($_GET); } } require './Framework/Core.php'; \Think\Log::save();
/* * @auther udzhou * @date 2013-1-30 */ require_once 'class/log_service.class.php'; //require_once 'class/log.class.php'; require_once 'class/sub_pages.class.php'; if (isset($_GET["p"])) { $pageCurrent = $_GET["p"]; } else { $pageCurrent = 1; } //每页显示的条数 $page_size = 10; $log_service = new LogService(); //总条目数 $nums = $log_service->getListRows(); //每次显示的页数 $sub_pages = 10; $url = "index.php?mod=log&action=ls&p="; if (isset($_GET["keywords"])) { $keywords = $_GET["keywords"]; $array_log = $log_service->listAllByKeywords($pageCurrent, $page_size, $keywords); $nums = $log_service->getListRowsByKeywords($keywords); if (!empty($keywords)) { $url = "index.php?mod=log&action=ls&keywords={$keywords}&p="; } } else { $array_log = $log_service->listAll($pageCurrent, $page_size); $nums = $log_service->getListRows();