V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  leeyuzhe  ›  全部回复第 39 页 / 共 41 页
回复总数  806
1 ... 31  32  33  34  35  36  37  38  39  40 ... 41  
国外网站强制 play 能让人感觉放心,这应用是经过谷歌审核过的,在国内去第三方平台大部分是因为第三方平台给钱了
2015-09-01 16:24:32 +08:00
回复了 leeyuzhe 创建的主题 Atom Atom 下有没有转换字符编码的插件?
@hdcola 我已经换回 sublime 了。。
2015-09-01 10:27:03 +08:00
回复了 tesion99 创建的主题 程序员 HTML5 自定义属性 data-*属性名一定要小写吗?
负责的跟你说,三楼正解
2015-08-31 17:51:55 +08:00
回复了 leeyuzhe 创建的主题 PHP php 为什么能 foreache 到一个对象的受保护属性
@haiyang416 @freefcw @lijinma @solupro
首先是返回这个对象的方法。
```
/**
* Fetches all rows.
*
* @param string|array $where OPTIONAL An SQL WHERE clause
* @param string|array $order OPTIONAL An SQL ORDER clause.
* @param int $count OPTIONAL An SQL LIMIT count.
* @param int $offset OPTIONAL An SQL LIMIT offset.
* @return APP_Db_Table_Rowset_Abstract object
*/
public function fetchAll ($where = null, $order = null, $count = null, $offset = null )
{
$table = $this->_schema . '.' . $this->_db->quoteIdentifier ($this->_name );
$select = "SELECT * FROM $table";

// if ($where !== null )
if ($where !== null && !empty ($where ))
{
$select .= ' WHERE ' . $this->_where ($where );
}

if ($order !== null && !empty ($order ))
{
$select .= ' ORDER BY ' . $this->_order ($order );
}


if ($count !== null || $offset !== null )
{
$select = $select . $this->_db->limit ($count, $offset );
// $select = $this->_db->limit ($select, $count, $offset );
}

$data = $this->_fetch ($select );

require_once 'APP/Loader.php';
APP_Loader::loadClass ($this->_rowsetClass );
return new $this->_rowsetClass ($data );
}





```
然后是包含进来的 APP/Loader.php
```
<?php

/**
* @category APP
* @package APP_Loader
* @version $Id: Loader.php v1.0 2009-2-25 0:08:04 tomsui $
*/
class APP_Loader
{
/**
* Load a class
*
* Load a APP class file. If the class already exists in memory, return
* directly.
*
* @static
* @param string $class String name of the class to load.
* @param array $config OPTIONAL; an array with adapter parameters.
* @return void
* @throws APP_Exception
*/
public static function loadClass ($class )
{
if (class_exists ($class, false ) || interface_exists ($class, false )) {
return;
}

$file = str_replace ('_', DIRECTORY_SEPARATOR, $class ) . '.php';
self::_securityCheck ($file );

require ($file ) ;
}

/**
* Autoload switch
*
* if switch opens, APP class can be used without loading previously
*
* @static
* @param boolean $use to set wheather Autoload switcher in use or not.
* @return void
*/
public static function Autoload ($use = true )
{
if ($use ){
spl_autoload_register (array ('APP_Loader', 'loadClass'));
}else{
spl_autoload_unregister (array ('APP_Loader', 'loadClass'));
}

}

/**
* Security Check
*
* File name of APP classs can just contain alpha,digits,backslash (/),
* slash (\),underline (_),period (.) and dash (-). If contains other irregular
* charactor, an APP_Exception is thrown.
*
* @static
* @param boolean $filename the filename string to be check.
* @return void
* @throws APP_Exception
*/
protected static function _securityCheck ($filename )
{
if (preg_match ('/[^a-z0-9\\/\\\\_.-]/i', $filename )) {
require_once 'APP/Exception.php';
throw new APP_Exception ('Security check: Illegal character in filename');
}
}
}


```
2015-08-31 17:29:41 +08:00
回复了 leeyuzhe 创建的主题 PHP php 为什么能 foreache 到一个对象的受保护属性
@haiyang416 对我就是是将该对象作为 foreach 的遍历参数。 iterator 接口如何实现的?整个对象就这么一个属性,没有任何方法,
2015-08-31 17:28:21 +08:00
回复了 leeyuzhe 创建的主题 PHP php 为什么能 foreache 到一个对象的受保护属性
@timsims 我这里真能,我快疯了,不知道为啥。整个对象没有方法只有这么一个 protected 属性。
你直接 foreach $object 别 foreach ($object->_data )试试
你们这是招 PHP 程序员吗?直接招核心架构师的了
怎么看着都像是复制粘贴的招聘启示
2015-08-27 14:42:39 +08:00
回复了 dhnUphp 创建的主题 程序员 [mysql 插入缓慢]
把索引删了,手工建立另外的索引表
2015-08-26 17:11:07 +08:00
回复了 haoli58 创建的主题 程序员 php 程序员 1-3 年工作经验 五险一金
目测要求掌握这些的八九不离外包
2015-08-26 10:52:14 +08:00
回复了 jtam 创建的主题 JavaScript 有偿求助,注册页面的图形验证码刷新
你直接贴代码,免费就帮你解决了,你这样扭扭捏捏,出 300 块也不一定有人干
2015-08-25 11:14:09 +08:00
回复了 luoer 创建的主题 PHP help!有哪位大哥见过这种错误哇。
H,Պ9 这难道是个中文类名乱码了?
2015-08-24 15:45:12 +08:00
回复了 MOS 创建的主题 云计算 美团云新区开放,来这里免费领取云主机/RDS/Redis 五折优惠券!
@SourceMan 那一旦需要抢购怎么办?突然增加的并发肯定影响客户体验,先暂停云服务吗?
2015-08-24 14:59:09 +08:00
回复了 MOS 创建的主题 云计算 美团云新区开放,来这里免费领取云主机/RDS/Redis 五折优惠券!
云计算这么挣钱?连美团都来插一脚
2015-08-24 14:16:37 +08:00
回复了 xuyl 创建的主题 PHP 关于 php curl 模拟登录的问题。。。。
我上次采集美丽说也是这个坑,返回的数据是 gzip 压缩过的,怎么调都是乱码
2015-08-24 10:31:28 +08:00
回复了 kisshere 创建的主题 程序员 v2ex 最初是怎么推广的?咋会聚集这么多程序员?
chrome 吧 火狐吧 知乎 V2EX 用户重合度很高,然后我在另外三个圈子都待过,自然而然就来这了
安卓 6.0 表示没有这个 bug ,添加新账户输入用户名密码
@caicai0126 在这下面配置Data\Packages\User 你说的那个配置路径是sublime text 2 的,没有的话就新建一个
2015-08-14 12:12:22 +08:00
回复了 datxiaoy 创建的主题 程序员 现在 web 前端的都这么高吗
这跟我一个水平呀,但我主要是后端,前端就是副业
1 ... 31  32  33  34  35  36  37  38  39  40 ... 41  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5476 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 03:16 · PVG 11:16 · LAX 20:16 · JFK 23:16
Developed with CodeLauncher
♥ Do have faith in what you're doing.