随笔分类 - php 开发接口
摘要:http://www.phalapi.net/wikis/
阅读全文
摘要:error.phpcheck(); $errorLog = isset($_POST['error_log']) ? $_POST['error_log'] : ''; if(!$errorLog) { return Response...
阅读全文
摘要:(1)init.phpcheck(); // 获取版本升级信息 $versionUpgrade = $this->getversionUpgrade($this->app['id']); if($versionUpgrade) { if...
阅读全文
摘要:/*** version_upgrade 版本升级信息表*/CREATE TABLE `version_upgrade` ( `id` smallint(4) unsigned NOT NULL AUTO_INCREMENT, `app_id` smallint(4) unsigned NOT ...
阅读全文
摘要:一:定时缓存开发首页接口(1)原理图(2)cron.phpconnect();} catch(Exception $e) { // $e->getMessage(); file_put_contents('./logs/'.date('y-m-d') . '.txt' , $e->get...
阅读全文
摘要:一:读取缓存方式开发首页接口 流程图:从数据库获取信息--->>>封装[同时把一份数据存入缓存]----->>>>返回数据 file.php_dir = dirname(__FILE__) . '/files/'; } public fu...
阅读全文
摘要:一:读取数据库方式开发首页接口原理图 从数据库获取信息--->>>>封装------>>>生成接口数据 备注:运用场景[数据时性比较高的系统]二:代码实现(1)list.phpcacheData('index_cron_cahce');if($data) { return Response...
阅读全文
摘要:一:单例模式的三大原则(1)构造函数需要标记为非public(防止外部使用new操作符创建对象),单例类不能在其他类中实例化,只能被自身实例化。(2)拥有一个保存类的实例的静态成员变量$_instance (3)拥有一个访问这个实例的公共静态的方法二:实现代码 '127.0.0.1', ...
阅读全文
摘要:_dir=dirname(__FILE__).'/file/'; } public function cacheData($key,$value='',$path=''){ $filename=$this->_dir.$path.$key.self::EXT; ...
阅读全文
摘要:$code, 'message'=>$message, 'data'=>$data ); if($type=="json"){ self::json($code,$message,$data);die; }else...
阅读全文
摘要:$code, 'message'=>$message, 'data'=>$data ); header("Content-Type:text/xml"); $xml ="\n"; $xm...
阅读全文
摘要:\n"; $xml.="\n"; $xml.=" 200\n"; $xml.=" 返回数据成功\n"; $xml.=" \n"; $xml.=" 1\n"; $xml.=" id\n"; $xm...
阅读全文
摘要:新建一个json_api.php$code, 'message'=>$message, 'data'=>$data ); echo json_encode($result); die; }新建一个test.php1, ...
阅读全文