Coder Social home page Coder Social logo

codeigniter-chinese / codeigniter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcit-ci/codeigniter

65.0 65.0 26.0 43.99 MB

开源 PHP 框架 CodeIgniter **社区分支

Home Page: http://codeigniter.org.cn/

License: MIT License

PHP 97.52% Python 0.56% CSS 0.11% JavaScript 0.26% ApacheConf 0.01% HTML 1.31% Makefile 0.22%

codeigniter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter's Issues

校验提交的数组数据时的问题

提交数组类型的数据到服务器,例如names[],没有在校验规则中添加required规则,而只是添加了一个min_length[3]的校验规则,如果提交的names[0]是一个空字符串,那么校验是不能通过的,提示字符长度至少需要三个字符。这和校验单个值的情况并不一致。

session类库失效时间有bug

场景:
步骤1 get('cookie') 不存在.这时已经new session了,

步骤2: set('cookie',过期时间想保留n天之后,),可惜上面的get已经new过了session,这里不再new,所以load(session,newConfig)的newConfig不会被使用.

然后 我的setcookie还是get时设置的关闭浏览器就失效了,并不是n天后,目前我修改了set_user_data方法起用config

PDO trans bug

PDO driver does not automatically enable transaction, even worse, the constructor disables transaction (line #84pdo_driver.php).

$this->trans_enabled = FALSE;

But, the driver does not have the interface/public methods to re-enable transaction. This causes all transactioncan not be rolled back.

is this a bug?I change like below and its works.
$this->trans_enabled = TRUE;

IS IT A BUG OR TRANS IS CLOSED intentionally?

codeigniter 连接远程oracle

我的电脑只安装了mysql,没有安装过oracle的客户端产品
现在想用CI框架连接远程的oracle数据库,修改了php.ini文件后,重启xampp后

出现没有oci.dll这个库
我想知道有什么解决办法吗?

使用upload类上传zip失败

使用upload上传zip文件失败,然后发现,chrome将zip的mime类型视为application/octet-stream,然后ci的/config/mime.php中的zip没有这个项目。
算bug,还是特性?

form_dropdown

如果需要默认被选中的值是很长的一个数字串的时候如:10011001100110011001.选择的值就不准确了.需要将form_dropdown函数中的这个in_array($key, $selected)改为in_array($key, $selected,true)

CI upload class bug

Ci upload zip is error in the firefox.The reason is that zip is to detected in 'application/octet-stream' in the firefox. So you need to add to zip with 'application/octet-stream' in 'config/mimes.php'.Problem solved.

DB class trouble with pcntl

hello, when I use DB class after pcntl_fork, there will be a Error: "2006 mysql server has gone away". Only the first sql can be executed successly. I think CI will close all mysql connections after execute any one sql. I tried "$this->db->db_connect();$this->db->query();$this->db->close();" and "$this->db->reconnect()", but both didn't work. At last ,I have to new Mysqli to finish it . So ,how to write this code like CI's case? thank you.

CI不能被类include方式使用

有一个种需求是,我在另一个平台已经存在登录权限其它的判断了,我只是想使用ci的部分处理,因为ci这边也是一个平台的入口,在另一个平台中,我需要在类中include CI进来使用.但是发现CI的初始化是靠全局变量来储存信息的.
请问是否可以修改一下,做成static类来实现呢?这样就不会出现include时全局变量变局部了导致各种问题....要么就是这些全局变量都写上global干脆.

虽然可以使用加密或是在另一个平台重复实现model什么的.但是很麻烦.最简单的就是include进来.

现在可以通过一个入口文件把另一个平台和ci同时include进来就可以了.

CI default_controller setting

$route['default_controller'] = 'index/home'; this index is a folder and the home is a controller in it, but when I ran the code, the page showed "The page you requested was not found." why doesn't default_controller work?

继承类的权限判断后中止执行并提示的需求

有一种需求是
需要登录类继承ci_conctrolls,且登录状态在这个类中判断并做通过处理,只有通过了,才能继续执行子类的方法,否则应该输出提示,终止执行

其它子类就继承登录类,

这时,如果在登录类中直接使用exit中止就会导致view之类后续处理不会运行.
我看了一下ci的主体,没找到可以直接的方法,

目前我是在__construct中检查,异常,设定类内值,在remap中改变$CI的下步运行的类.
可能hook也可以做,但是比较绕不是用来终止子类运行的好方法.

关于input类的“不可见字符”被屏蔽的问题

这边在“不可见字符”加上了引号。
在post一个数据时,内容包括"%10",这是3个字符组成的字符串而不是一个不可见字符,是在文本框中输入的。但是ci的input类会把"%10"这3个字符也给屏蔽了。
ci的上下文如下:

        if ($url_encoded)
        {
            $non_displayables[] = '/%0[0-8bcef]/';  // url encoded 00-08, 11, 12, 14, 15
            $non_displayables[] = '/%1[0-9a-f]/';   // url encoded 16-31
        }
        $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S';   // 00-08, 11, 12, 14-31, 127
        do
        {
            $str = preg_replace($non_displayables, '', $str, -1, $count);
        }
        while ($count);

其中,我认为/%0[0-8bcef]/这个正则有点问题,因为%不是正则表达式的元字符,他会把%10这样的给屏蔽掉。

CI libraries 加载语言文件错误。

如果在config中配置了config['language'] = 'chinese'; 那么当发送email失败时。就会报错说加载不到语言文件。 英语水平很烂,就用中文了。盼复

view can not get data!

CI V2.1.3
PHP V5.2.5


//controller------------------------------------------------------------------------------------
    public function index()
    {
        $data = array(
                'blog_title'   => 'My Blog Title',
                'blog_heading' => 'My Blog Heading',
                'blog_entries' => array(
                      array('title' => 'Title 1', 'body' => 'Body 1'),
                      array('title' => 'Title 2', 'body' => 'Body 2'),
                      array('title' => 'Title 3', 'body' => 'Body 3'),
                      array('title' => 'Title 4', 'body' => 'Body 4'),
                      array('title' => 'Title 5', 'body' => 'Body 5')
                 )
            );

         $this->load->view('welcome_message',$data);
    }
// END----------------------------------------------------------------------------------------


//view---------------------------------------------------------------------------------------





//END--------------------------------------------------------------------------------------

ERROR Notice

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: data

Message: mysql_errno(): XXX is not a valid MySQL-Link resource

there are many database operation on a controller. every db operation operate by clone ($_db = clone $this -> db). the page show some notice:

A PHP Error was encountered

Severity: Warning

Message: mysql_errno(): 31 is not a valid MySQL-Link resource

Filename: mysql/mysql_driver.php

Line Number: 470
A PHP Error was encountered

Severity: Warning

Message: mysql_error(): 31 is not a valid MySQL-Link resource

Filename: mysql/mysql_driver.php

Line Number: 457

A Database Error Occurred

Error Number:

SELECT * FROM ....

when i delete some db operation , the page shows correct.
is there anyone meets this problem?

$_SERVER['HTTPS']

$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
but,my server infomation is :
'HTTPS' => string '' (length=0)
so,The base url is wrong !
I replace it with :
$base_url = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';

_csrf_hash 的值不会自动更新。

// We kill this since we're done and we don't want to
// polute the _POST array
unset($_POST[$this->_csrf_token_name]);
// Nothing should last forever
unset($_COOKIE[$this->_csrf_cookie_name]);
$this->_csrf_set_hash();
$this->csrf_set_cookie();

$this->_csrf_hash 没有重置成空,调用_csrf_set_hash()之后每次对比后生成的value还是跟之前生成的是一样的。

I can not understand the "helper" function

system/core/loader.php

I can not understand the "helper" function.

Why the "helper" has loaded "application/helper/test_func.php" and even try to check "system/helper/test_func.php" ?

There are too many "foreach" .

public function helper($helpers = array())
{
foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper)
{
if (isset($this->_ci_helpers[$helper]))
{
continue;
}

        // Is this a helper extension request?
        $ext_helper = config_item('subclass_prefix').$helper;
        $ext_loaded = FALSE;
        foreach ($this->_ci_helper_paths as $path)
        {
            if (file_exists($path.'helpers/'.$ext_helper.'.php'))
            {
                include_once($path.'helpers/'.$ext_helper.'.php');
                $ext_loaded = TRUE;
            }
        }

        // If we have loaded extensions - check if the base one is here
        if ($ext_loaded === TRUE)
        {
            $base_helper = BASEPATH.'helpers/'.$helper.'.php';
            if ( ! file_exists($base_helper))
            {
                show_error('Unable to load the requested file: helpers/'.$helper.'.php');
            }

            include_once($base_helper);
            $this->_ci_helpers[$helper] = TRUE;
            log_message('debug', 'Helper loaded: '.$helper);
            continue;
        }

        // No extensions found ... try loading regular helpers and/or overrides
        foreach ($this->_ci_helper_paths as $path)
        {
            if (file_exists($path.'helpers/'.$helper.'.php'))
            {
                include_once($path.'helpers/'.$helper.'.php');

                $this->_ci_helpers[$helper] = TRUE;
                log_message('debug', 'Helper loaded: '.$helper);
                break;
            }
        }

        // unable to load the helper
        if ( ! isset($this->_ci_helpers[$helper]))
        {
            show_error('Unable to load the requested file: helpers/'.$helper.'.php');
        }
    }

    return $this;
}

Cannot redeclare class ci_exceptions

    our web application, sometime appearance Fatal  Cannot redeclare class ci_exceptions in XX.php ,but in this php has nothing contain ci_exceptions。Do you someone get this problems? thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.