当前位置: 首页>>代码示例>>PHP>>正文


PHP Solar_File::load方法代码示例

本文整理汇总了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'));
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:14,代码来源:CommentInfo.php

示例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'));
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:38,代码来源:Nodes.php

示例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));
     }
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:39,代码来源:Class.php

示例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');
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:14,代码来源:Comments.php

示例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'));
 }
开发者ID:agentile,项目名称:foresmo,代码行数:14,代码来源:Modules.php

示例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'));
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:15,代码来源:Groups.php

示例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']);
 }
开发者ID:agentile,项目名称:foresmo,代码行数:8,代码来源:Solar.php

示例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');
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:15,代码来源:Users.php

示例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'));
 }
开发者ID:agentile,项目名称:foresmo,代码行数:15,代码来源:Users.php

示例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'));
 }
开发者ID:agentile,项目名称:foresmo,代码行数:15,代码来源:PostsTags.php

示例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))));
 }
开发者ID:agentile,项目名称:foresmo,代码行数:15,代码来源:Tags.php

示例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');
 }
开发者ID:kalkin,项目名称:solarphp,代码行数:16,代码来源:TestSolarFoo.php

示例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');
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:17,代码来源:Taggings.php

示例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');
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:17,代码来源:Tags.php

示例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';
 }
开发者ID:kalkin,项目名称:solarphp,代码行数:17,代码来源:TestSolarSpecialCols.php


注:本文中的Solar_File::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。