Skip to content

Commit

Permalink
version 1.3.1:
Browse files Browse the repository at this point in the history
  - Change call_user_function to zend_call_function with zend_fcall_info_cache
  - Remove methods errorAction and error404 in the class Yod_Request
  - Add support for config tpldata and plugins
  - Add a public method plugin in the class Yod_Controller, Yod_Model and Yod_Application
  - Fixed a bug in yod_controller_assign when parameters 3 is null
  - Add support for config urlrules and url_rules
  - Fixed a bug in yod_charset, yod_viewext, yod_pathvar, yod_runpath, yod_extpath and yod_logpath
  - Fixed a bug in yod_controller_forward
  - Remove yod_application_run in yod_application__destruct
  - Optimized code in yod_runpath, yod_extpath, yod_init_compile_file, yod_request_route etc
  - Add a public method isAjax in the class Yod_Request
  - Support config file YOD_RUNPATH/config.php
  - Fixed a bug in yod_application_init_config
  - Modify the method update of class Yod_Model an Yod_DbModel
  - Fixed 2 bugs in yod_request_route (support $_REQUEST etc.)
  - Fixed a bug in yod_application_config (support numeric key)
  - Add a public property uri in the class Yod_Request
  - Support short tag in the view file
  - Fixed a bug in yod_dbpdo_connect (charset)
  • Loading branch information
zmrnet committed Mar 11, 2014
1 parent af204c3 commit 08260f1
Show file tree
Hide file tree
Showing 102 changed files with 2,190 additions and 660 deletions.
28 changes: 25 additions & 3 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
This file documents changes for Yod Framework release 1.3.0 and earlier.
This file documents changes for Yod Framework release 1.3.1 and earlier.

version 1.3.1:

- Change call_user_function to zend_call_function with zend_fcall_info_cache
- Remove methods errorAction and error404 in the class Yod_Request
- Add support for config tpldata and plugins
- Add a public method plugin in the class Yod_Controller, Yod_Model and Yod_Application
- Fixed a bug in yod_controller_assign when parameters 3 is null
- Add support for config urlrules and url_rules
- Fixed a bug in yod_charset, yod_viewext, yod_pathvar, yod_runpath, yod_extpath and yod_logpath
- Fixed a bug in yod_controller_forward
- Remove yod_application_run in yod_application__destruct
- Optimized code in yod_runpath, yod_extpath, yod_init_compile_file, yod_request_route etc
- Add a public method isAjax in the class Yod_Request
- Support config file YOD_RUNPATH/config.php
- Fixed a bug in yod_application_init_config
- Modify the method update of class Yod_Model an Yod_DbModel
- Fixed 2 bugs in yod_request_route (support $_REQUEST etc.)
- Fixed a bug in yod_application_config (support numeric key)
- Add a public property uri in the class Yod_Request
- Support short tag in the view file
- Fixed a bug in yod_dbpdo_connect (charset)

version 1.3.0:

Expand All @@ -16,7 +38,7 @@ version 1.2.2:
- Add an abstract method count in the class Yod_Database
- Add a public method count in the class Yod_DbPdo
- Change the method find of class Yod_Model an Yod_DbModel

version 1.2.1:

- Add constants YOD_VIEWEXT, YOD_LOGPATH
Expand All @@ -38,7 +60,7 @@ version 1.2.0:
- Compatible with ThinkPHP extended libraries
- Written in C and build as PHP extension
- Add the class Yod_DbPdo to the Yod extension

version 1.1.0:

- Add constants YOD_CHARSET, YOD_PATHVAR
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ index.php is the application entry
error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');

define('YOD_RUNPATH', dirname(__FILE__) . '/app');
defined('YOD_RUNPATH') or define('YOD_RUNPATH', dirname(__FILE__) . '/app');

```

Expand All @@ -95,13 +95,13 @@ hello.php is the application hello entry
error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');

define('YOD_RUNPATH', dirname(__FILE__) . '/app');
defined('YOD_RUNPATH') or define('YOD_RUNPATH', dirname(__FILE__) . '/app');

class HelloController extends Yod_Controller
{
public function indexAction()
{
$this->assign('content', 'Hello World');
$this->assign('content', $this->model('Hello')->content());
$this->display('/index/index');
}

Expand All @@ -112,6 +112,14 @@ class HelloController extends Yod_Controller
}
}

class HelloModel extends Yod_Model
{
public function content()
{
return 'Hello World!';
}
}

```

### config.php
Expand Down Expand Up @@ -144,6 +152,16 @@ return array(
'tpl_data' => array(
'_PUBLIC_' => '/public/'
),
// url_rules (v1.3.1+)
'url_rules' => array(
'en/*' => '*',
'zh/*' => array('*', array('lang' => 'zh')),
'rule1' => 'index/rule1/p/v',
'index/rule1' => 'index/rule1/id/1',
'index/rule2/:id' => 'index/rule2',
'index/rule3/:id/edit' => 'index/rule3/action/edit',
'index/rule4/:id/remove' => array('index/rule4', array('action' => 'remove'),
),
);

```
Expand Down
Binary file removed dll/php_yod-1.3.0-5.2-nts-vc6-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-nts-vc6-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-nts-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-vc6-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-vc6-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.2-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-nts-vc9-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-nts-vc9-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-nts-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-vc9-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-vc9-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.3-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-nts-vc9-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-nts-vc9-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-nts-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-vc9-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-vc9-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-vc9-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.4-vc9-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-nts-vc11-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-nts-vc11-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-nts-vc11-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-nts-vc11-x86.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-vc11-x64-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-vc11-x64.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-vc11-x86-debug.dll
Binary file not shown.
Binary file removed dll/php_yod-1.3.0-5.5-vc11-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-nts-vc6-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-nts-vc6-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-nts-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-vc6-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-vc6-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.2-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-nts-vc9-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-nts-vc9-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-nts-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-vc9-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-vc9-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.3-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-nts-vc9-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-nts-vc9-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-nts-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-nts-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-vc9-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-vc9-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-vc9-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.4-vc9-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-nts-vc11-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-nts-vc11-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-nts-vc11-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-nts-vc11-x86.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-vc11-x64-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-vc11-x64.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-vc11-x86-debug.dll
Binary file not shown.
Binary file added dll/php_yod-1.3.1-5.5-vc11-x86.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions ext/drivers/DbMysql.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// +----------------------------------------------------------------------
// | yodphp [ Yod PHP Framework ]
// | yodphp [ Yod Framework for PHP ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://yodphp.com All rights reserved.
// +----------------------------------------------------------------------
Expand Down Expand Up @@ -281,11 +281,11 @@ public function rollback()
}

/**
* insertid
* insertId
* @access public
* @return integer
*/
public function insertid()
public function insertId()
{
return mysql_insert_id($this->_linkid);
}
Expand Down Expand Up @@ -328,4 +328,4 @@ public function error()
return false;
}
}
}
}
8 changes: 4 additions & 4 deletions ext/drivers/DbMysqli.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// +----------------------------------------------------------------------
// | yodphp [ Yod PHP Framework ]
// | yodphp [ Yod Framework for PHP ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://yodphp.com All rights reserved.
// +----------------------------------------------------------------------
Expand Down Expand Up @@ -340,11 +340,11 @@ public function rollback()
}

/**
* insertid
* insertId
* @access public
* @return integer
*/
public function insertid()
public function insertId()
{
return $this->_linkid->insert_id;
}
Expand Down Expand Up @@ -392,4 +392,4 @@ public function error()
}
}

}
}
85 changes: 85 additions & 0 deletions ext/extends/Utils.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
// +----------------------------------------------------------------------
// | yodphp [ Yod Framework for PHP ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://yodphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Baoqiang Su <zmrnet@qq.com>
// +----------------------------------------------------------------------

abstract class Yod_Utils
{

/**
* config
* @access public
* @param string $name
* @return array
*/
public static function config($name = null)
{
return Yod_Application::config($name);
}

/**
* import
* @access public
* @param string $alias
* @param string $classext
* @return boolean
*/
public static function import($alias, $classext = '.class.php')
{
return Yod_Application::import($alias, $classext);
}

/**
* plugin
* @access public
* @param string $alias
* @param string $classext
* @return mixed
*/
public static function plugin($alias, $classext = '.class.php')
{
return Yod_Application::plugin($alias, $classext);
}

/**
* model
* @access public
* @param string $name
* @param mixed $config
* @return Yod_Model
*/
public static function model($name = '', $config = '')
{
return Yod_Model::getInstance($name, $config);
}

/**
* dbmodel
* @access public
* @param string $name
* @param mixed $config
* @return Yod_DbModel
*/
public static function dbmodel($name = '', $config = '')
{
return Yod_DbModel::getInstance($name, $config);
}

/**
* db
* @access public
* @param mixed $config
* @return Yod_Database
*/
public static function db($config = 'db_dsn')
{
return Yod_Database::getInstance($config);
}

}
4 changes: 2 additions & 2 deletions ext/extends/ViewController.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// +----------------------------------------------------------------------
// | yodphp [ Yod PHP Framework ]
// | yodphp [ Yod Framework for PHP ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://yodphp.com All rights reserved.
// +----------------------------------------------------------------------
Expand All @@ -22,7 +22,7 @@ abstract class Yod_ViewController extends Yod_Controller
*/
public function init()
{
$tpl_view = $this->config('tpl_view');
($tpl_view = $this->config('tplview')) or ($tpl_view = $this->config('tpl_view'));

if (empty($tpl_view['class'])) {
return;
Expand Down
90 changes: 90 additions & 0 deletions ext/plugins/Fcache.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
// +----------------------------------------------------------------------
// | yodphp [ Yod Framework for PHP ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://yodphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Baoqiang Su <zmrnet@qq.com>
// +----------------------------------------------------------------------

class Yod_Fcache
{
protected $_path;

/**
* __construct
* @access public
* @param mixed $config
* @return void
*/
public function __construct($config = null)
{
$this->_path = empty($config['path']) ? YOD_RUNPATH . '/caches' : $config['path'];
is_dir($this->_path) or mkdir($this->_path);
}

/**
* set
* @access public
* @param string $key
* @param mixed $var
* @param integer $expire
* @return boolean
*/
public function set($key, $var, $expire = 0)
{
$file = $this->file($key);
$path = dirname($file);
is_dir($path) or mkdir($path, 0700, true);
$data = var_export(array('var' => $var, 'exp' => time() + $expire), true);
return file_put_contents($file, '<?php return '. $data .';');
}

/**
* get
* @access public
* @param string $key
* @return mixed
*/
public function get($key)
{
$file = $this->file($key);
if (is_file($file)) {
$data = include $file;
if (empty($data['exp']) || ($data['exp'] > time())) {
return isset($data['var']) ? $data['var'] : null;
}
}
return false;
}

/**
* del
* @access public
* @param string $key
* @return boolean
*/
public function del($key)
{
$file = $this->file($key);
if (is_file($file)) {
return unlink($file);
}
return false;
}

/**
* file
* @access protected
* @param string $key
* @return string
*/
protected function file($key)
{
$md5key = md5($key);
return $this->_path .'/'. $md5key[0] .'/'. $md5key[1] .'/'. $md5key[2] .'/'. $md5key .'.php';
}

}
Loading

0 comments on commit 08260f1

Please sign in to comment.