本文整理汇总了PHP中Solar_File::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Solar_File::load方法的具体用法?PHP Solar_File::load怎么用?PHP Solar_File::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Solar_File
的用法示例。
在下文中一共展示了Solar_File::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_belongsTo('comments', array('foreign_class' => 'Foresmo_Model_Comments'));
}
示例2: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_index = Solar_File::load($dir . 'index_info.php');
/**
* Special columns
*/
$this->_serialize_cols[] = 'prefs';
$this->_calculate_cols[] = 'tags_as_string';
/**
* Filters
*/
// make sure the name is unique for its area and model
$where = array('inherit = :inherit', 'area_id = :area_id');
$this->_addFilter('name', 'validateUnique', $where);
// other filters
$this->_addFilter('email', 'validateEmail');
$this->_addFilter('uri', 'validateUri');
$this->_addFilter('editor_ipaddr', 'validateIpv4');
$this->_addFilter('locale', 'validateLocaleCode');
$this->_addFilter('mime', 'validateMimeType');
$this->_addFilter('tags_as_string', 'validateSepWords');
/**
* Relationships.
*/
$this->_belongsTo('area');
$this->_hasMany('taggings');
$this->_hasMany('tags', array('through' => 'taggings'));
}
示例3: autoload
/**
*
* Loads a class or interface file from the include_path.
*
* Thanks to Robert Gonzalez for the report leading to this method.
*
* @param string $name A Solar (or other) class or interface name.
*
* @return void
*
* @todo Add localization for errors
*
*/
public static function autoload($name)
{
// did we ask for a non-blank name?
if (trim($name) == '') {
throw Solar::exception('Solar_Class', 'ERR_AUTOLOAD_EMPTY', 'No class or interface named for loading.', array('name' => $name));
}
// pre-empt further searching for the named class or interface.
// do not use autoload, because this method is registered with
// spl_autoload already.
$exists = class_exists($name, false) || interface_exists($name, false);
if ($exists) {
return;
}
// convert the class name to a file path.
$file = str_replace('_', DIRECTORY_SEPARATOR, $name) . '.php';
// include the file and check for failure. we use Solar_File::load()
// instead of require() so we can see the exception backtrace.
Solar_File::load($file);
// if the class or interface was not in the file, we have a problem.
// do not use autoload, because this method is registered with
// spl_autoload already.
$exists = class_exists($name, false) || interface_exists($name, false);
if (!$exists) {
throw Solar::exception('Solar_Class', 'ERR_AUTOLOAD_FAILED', 'Class or interface does not exist in loaded file', array('name' => $name, 'file' => $file));
}
}
示例4: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_belongsTo('node');
}
示例5: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_hasMany('moduleinfo', array('foreign_class' => 'Foresmo_Model_ModuleInfo', 'foreign_key' => 'module_id'));
}
示例6: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_hasMany('comments');
$this->_hasMany('permissions', array('through' => 'groupspermissions'));
}
示例7: testCallbacks_instanceMethod
public function testCallbacks_instanceMethod()
{
$file = Solar_Class::dir('Mock_Solar') . 'callbacks-instance-method.php';
Solar_File::load($file);
$instance = Solar::factory('Solar_Callbacks_Instance_Method');
Solar::callbacks(array(array($instance, 'callback')));
$this->assertTrue($GLOBALS['SOLAR_CALLBACKS_INSTANCE_METHOD']);
}
示例8: _setup
/**
*
* Model setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_model_name = 'users';
$this->_index = array('created', 'updated', 'handle' => 'unique');
}
示例9: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_hasMany('userinfo', array('foreign_class' => 'Foresmo_Model_UserInfo', 'foreign_key' => 'user_id'));
$this->_hasOne('groups', array('foreign_class' => 'Foresmo_Model_Groups', 'native_col' => 'group_id', 'foreign_col' => 'id'));
}
示例10: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_belongsTo('tags', array('foreign_key' => 'id'));
$this->_belongsTo('posts', array('foreign_key' => 'id'));
}
示例11: _setup
/**
*
* Model-specific setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = $this->_config['prefix'] . Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_hasMany('posts_tags', array('foreign_class' => 'Foresmo_Model_PostsTags', 'foreign_key' => 'tag_id'));
$this->_hasMany('posts', array('foreign_class' => 'Foresmo_Model_Posts', 'through' => 'posts_tags', 'through_key' => 'post_id', 'through_native_col' => 'tag_id', 'through_foreign_col' => 'post_id', 'conditions' => array('status = ?' => array(1))));
}
示例12: _setup
/**
*
* Model setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_addFilter('email', 'validateEmail');
$this->_addFilter('uri', 'validateUri');
$this->_index_info = array('created', 'updated', 'email' => 'unique', 'uri');
}
示例13: _setup
/**
*
* Model setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_model_name = 'taggings';
$this->_belongsTo('node');
$this->_belongsTo('tag');
$this->_index = array('node_id', 'tag_id');
}
示例14: _setup
/**
*
* Model setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
$this->_model_name = 'tags';
$this->_hasMany('taggings');
$this->_hasMany('nodes', array('through' => 'taggings'));
$this->_index = array('name' => 'unique');
}
示例15: _setup
/**
*
* Model setup.
*
* @return void
*
*/
protected function _setup()
{
$dir = str_replace('_', DIRECTORY_SEPARATOR, __CLASS__) . DIRECTORY_SEPARATOR . 'Setup' . DIRECTORY_SEPARATOR;
$this->_table_name = Solar_File::load($dir . 'table_name.php');
$this->_table_cols = Solar_File::load($dir . 'table_cols.php');
// recognize sequence columns
$this->_sequence_cols = array('seq_foo' => 'test_solar_foo', 'seq_bar' => 'test_solar_bar');
// recognize serialize columns
$this->_serialize_cols = 'serialize';
}