-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 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
Showing
102 changed files
with
2,190 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} | ||
|
||
} |
Oops, something went wrong.