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


PHP Object::__construct方法代码示例

本文整理汇总了PHP中Object::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::__construct方法的具体用法?PHP Object::__construct怎么用?PHP Object::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object的用法示例。


在下文中一共展示了Object::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param string $host
  * @param int $port
  */
 public function __construct($host, $port)
 {
     parent::__construct();
     $this->host = $host;
     $this->port = $port;
     $this->socket = $this->createSocket();
 }
开发者ID:helpfulrobot,项目名称:ntb-silverstripe-statistics,代码行数:11,代码来源:AbstractNetworkAdapter.php

示例2:

 function __construct($params = null)
 {
     if ($params) {
         $this->params = $params;
     }
     parent::__construct();
 }
开发者ID:prostart,项目名称:cobblestonepath,代码行数:7,代码来源:CMSSiteTreeFilter.php

示例3: __construct

 public function __construct($name, $value, $prompt = '')
 {
     parent::__construct();
     $this->setName($name);
     $this->setValue($value);
     $this->setPrompt($prompt);
 }
开发者ID:aklump,项目名称:collection_json,代码行数:7,代码来源:Data.php

示例4: __construct

 /**
  * Constructor
  *
  * @param ObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return DatabaseRowsetAbstract
  */
 public function __construct(ObjectConfig $config)
 {
     parent::__construct($config);
     //Set the prototypable
     $this->_prototypable = $config->prototypable;
     //Set the table identifier
     $this->_table = $config->table;
     // Set the table identifier
     if (isset($config->identity_column)) {
         $this->_identity_column = $config->identity_column;
     }
     // Clear the rowset
     $this->clear();
     // Insert the data, if exists
     if (!empty($config->data)) {
         foreach ($config->data->toArray() as $properties) {
             $this->insert($properties, $config->status);
         }
         // Unset data to save memory
         unset($config->data);
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }
开发者ID:nooku,项目名称:nooku-framework,代码行数:32,代码来源:abstract.php

示例5: __construct

 public function __construct($filename = null)
 {
     // If we're working with image resampling, things could take a while.  Bump up the time-limit
     increase_time_limit_to(300);
     if ($filename && is_readable($filename)) {
         // We use getimagesize instead of extension checking, because sometimes extensions are wrong.
         list($width, $height, $type, $attr) = getimagesize($filename);
         switch ($type) {
             case 1:
                 if (function_exists('imagecreatefromgif')) {
                     $this->setImageResource(imagecreatefromgif($filename));
                 }
                 break;
             case 2:
                 if (function_exists('imagecreatefromjpeg')) {
                     $this->setImageResource(imagecreatefromjpeg($filename));
                 }
                 break;
             case 3:
                 if (function_exists('imagecreatefrompng')) {
                     $img = imagecreatefrompng($filename);
                     imagesavealpha($img, true);
                     // save alphablending setting (important)
                     $this->setImageResource($img);
                 }
                 break;
         }
     }
     parent::__construct();
     $this->quality = $this->config()->default_quality;
     $this->interlace = $this->config()->image_interlace;
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:32,代码来源:GD.php

示例6: __construct

 public function __construct($content)
 {
     if (extension_loaded('tidy')) {
         // using the tidy php extension
         $tidy = new tidy();
         $tidy->parseString($content, array('output-xhtml' => true, 'numeric-entities' => true, 'wrap' => 0), 'utf8');
         $tidy->cleanRepair();
         $tidy = str_replace('xmlns="http://www.w3.org/1999/xhtml"', '', $tidy);
         $tidy = str_replace(' ', '', $tidy);
     } elseif (@shell_exec('which tidy')) {
         // using tiny through cli
         $CLI_content = escapeshellarg($content);
         $tidy = `echo {$CLI_content} | tidy --force-output 1 -n -q -utf8 -asxhtml -w 0 2> /dev/null`;
         $tidy = str_replace('xmlns="http://www.w3.org/1999/xhtml"', '', $tidy);
         $tidy = str_replace(' ', '', $tidy);
     } else {
         // no tidy library found, hence no sanitizing
         $tidy = $content;
     }
     $this->simpleXML = @simplexml_load_string($tidy, 'SimpleXMLElement', LIBXML_NOWARNING);
     if (!$this->simpleXML) {
         throw new Exception('CSSContentParser::__construct(): Could not parse content.' . ' Please check the PHP extension tidy is installed.');
     }
     parent::__construct();
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:25,代码来源:CSSContentParser.php

示例7: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     App::uses('AclNode', 'Model');
     $this->Aro = ClassRegistry::init(array('class' => 'Aro', 'alias' => 'Aro'));
     $this->Aco = ClassRegistry::init(array('class' => 'Aco', 'alias' => 'Aco'));
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:11,代码来源:DbAcl.php

示例8: __construct

 /**
  *
  * @name __construct
  * @param MariaBlockChain\MariaBlockChain $blockchain the scope
  * @since 0.1.0
  * @return object
  */
 public function __construct($blockchain)
 {
     if (!isset($this->_cachePrefix)) {
         $this->_cachePrefix = "";
     }
     parent::__construct($blockchain);
 }
开发者ID:willgriffin,项目名称:mariablockchain,代码行数:14,代码来源:AddressesController.php

示例9:

	/**
	 * __constructor
	 *
	 * @param FormField $field The field we're validating against
	 */
	function __construct(FormField $field = null) {
		if ($field) {
			$this->setField($field);
		}
		$this->setMessageType($this->getRuleName());
		parent::__construct();
	}
开发者ID:nathancox,项目名称:silverstripe-fmfieldvalidator,代码行数:12,代码来源:FMValidationMethod.php

示例10: __construct

 /**
  * SshKey constructor.
  * @param array $json
  * @param array $headers
  * @param int $status
  */
 public function __construct(array $json = [], array $headers = [], $status = 200)
 {
     parent::__construct($json, $headers, $status);
     $this->setFromJson('id');
     $this->setFromJson('title');
     $this->setFromJson('content');
 }
开发者ID:buddy-works,项目名称:buddy-works-php-api,代码行数:13,代码来源:SshKey.php

示例11: __construct

 /**
  * WebhookRequest constructor.
  * @param array $json
  * @param array $headers
  * @param int $status
  */
 public function __construct(array $json = [], array $headers = [], $status = 200)
 {
     parent::__construct($json, $headers, $status);
     $this->setFromJson('postDate', 'post_date');
     $this->setFromJson('responseStatus', 'response_status');
     $this->setFromJson('body');
 }
开发者ID:buddy-works,项目名称:buddy-works-php-api,代码行数:13,代码来源:WebhookRequest.php

示例12: array

	/**
	 * Constructor
	 *
	 * @param array $options optional load object properties
	 */
	function __construct($options = array()) {
		parent::__construct();

		if (empty($options['name'])) {
			$this->name = preg_replace('/schema$/i', '', get_class($this));
		}
		if (!empty($options['plugin'])) {
			$this->plugin = $options['plugin'];
		}

		if (strtolower($this->name) === 'cake') {
			$this->name = Inflector::camelize(Inflector::slug(Configure::read('App.dir')));
		}

		if (empty($options['path'])) {
			if (is_dir(CONFIGS . 'schema')) {
				$this->path = CONFIGS . 'schema';
			} else {
				$this->path = CONFIGS . 'sql';
			}
		}

		$options = array_merge(get_object_vars($this), $options);
		$this->_build($options);
	}
开发者ID:ralmeida,项目名称:FoundFree.org,代码行数:30,代码来源:cake_schema.php

示例13: strtotime

 function __construct($arr = null, $arr_pre = "t_")
 {
     parent::__construct($arr, $arr_pre);
     $this->date = strtotime($this->date);
     $this->time = TrainingLog::getSecondsFromFormat($this->time);
     //$this->route = new Route($arr);
 }
开发者ID:byronwall,项目名称:runnDAILY,代码行数:7,代码来源:traininglog.php

示例14: __construct

 /**
  * Constructor
  *
  * @param  ObjectConfig $config  An optional ObjectConfig object with configuration options.
  */
 public function __construct(ObjectConfig $config)
 {
     //Bypass DatabaseRowAbstract constructor to prevent data from being added twice
     Object::__construct($config);
     //Set the table identifier
     $this->_table = $config->table;
     // Set the table identifier
     if (isset($config->identity_column)) {
         $this->_identity_column = $config->identity_column;
     }
     // Reset the row
     $this->reset();
     //Set the status
     if (isset($config->status)) {
         $this->setStatus($config->status);
     }
     // Set the row data
     if (isset($config->data)) {
         $this->setData($config->data->toArray(), $this->isNew());
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:30,代码来源:table.php

示例15: list

 function __construct($filename = null)
 {
     // If we're working with image resampling, things could take a while.  Bump up the time-limit
     increase_time_limit_to(300);
     if ($filename) {
         // We use getimagesize instead of extension checking, because sometimes extensions are wrong.
         list($width, $height, $type, $attr) = getimagesize($filename);
         switch ($type) {
             case 1:
                 if (function_exists('imagecreatefromgif')) {
                     $this->setGD(imagecreatefromgif($filename));
                 }
                 break;
             case 2:
                 if (function_exists('imagecreatefromjpeg')) {
                     $this->setGD(imagecreatefromjpeg($filename));
                 }
                 break;
             case 3:
                 if (function_exists('imagecreatefrompng')) {
                     $this->setGD(imagecreatefrompng($filename));
                 }
                 break;
         }
     }
     $this->quality = self::$default_quality;
     parent::__construct();
 }
开发者ID:rixrix,项目名称:sapphire,代码行数:28,代码来源:GD.php


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