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


PHP DataSource::__construct方法代码示例

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


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

示例1: HttpSocket

 function __construct($config)
 {
     parent::__construct($config);
     $this->Http =& new HttpSocket();
     $this->email = $this->config['email'];
     $this->password = $this->config['password'];
 }
开发者ID:naterkane,项目名称:lithium-foursquare-datasource,代码行数:7,代码来源:foursquare-source.php

示例2:

 function __construct($config)
 {
     parent::__construct($config);
     $this->api_key = $this->config['api_key'];
     $this->username = $this->config['username'];
     $this->password = $this->config['password'];
 }
开发者ID:Jewgonewild,项目名称:Pikchur-Datasource-for-CakePHP,代码行数:7,代码来源:pikchur_source.php

示例3: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->Node = ClassRegistry::init('Nodes.Node');
     $this->TypeField = ClassRegistry::init('CustomFields.TypeField');
     $this->columns = $this->Node->getDataSource()->columns;
 }
开发者ID:cvo-technologies,项目名称:croogo-nodes-datasource-plugin,代码行数:7,代码来源:CroogoNodesSource.php

示例4: switch

 /**
  * Constructor
  */
 function __construct($config = null)
 {
     $this->debug = Configure::read() > 0;
     $this->fullDebug = Configure::read() > 1;
     parent::__construct($config);
     $link = $this->connect();
     //People Have been asking for this forever.
     if (isset($config['type']) && !empty($config['type'])) {
         switch ($config['type']) {
             case 'Netscape':
                 $this->setNetscapeEnv();
                 break;
             case 'OpenLDAP':
                 $this->setOpenLDAPEnv();
                 break;
             case 'ActiveDirectory':
                 $this->setActiveDirectoryEnv();
                 break;
             default:
                 $this->setNetscapeEnv();
                 break;
         }
     }
     $this->setSchemaPath();
     return $link;
 }
开发者ID:analogrithems,项目名称:datasources,代码行数:29,代码来源:ldap_source.php

示例5: HttpSocket

 function __construct($config)
 {
     parent::__construct($config);
     $this->Http =& new HttpSocket();
     $this->username = $this->config['username'];
     $this->password = $this->config['password'];
 }
开发者ID:afzet,项目名称:cake-cart,代码行数:7,代码来源:twitter_source.php

示例6: GoogleApiContacts

 /**
  * Default Constructor
  *
  * @param array $config options
  * @access public
  */
 function __construct($config)
 {
     //Select contacts service for login token
     $this->GoogleApiContacts = new GoogleApiContacts($config);
     $this->_schema = $this->GoogleApiContacts->getSchema();
     parent::__construct($config);
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:13,代码来源:GoogleContactsSource.php

示例7: __construct

 /**
  * Constructor
  * @param array $config An array defining the configuration settings
  */
 public function __construct($config)
 {
     //Construct API version in this to go to SalesforceBaseClass!
     parent::__construct($config);
     $this->_baseConfig = $config;
     $this->connect();
 }
开发者ID:richardvella,项目名称:Salesforce-Enterprise-API-CakePHP-2.x-Plugin,代码行数:11,代码来源:SalesforceSource.php

示例8: __construct

 public function __construct($config)
 {
     $this->indexFile = $config['indexFile'];
     $this->__setSources($config['source']);
     $this->__loadIndex(TMP . $this->indexFile);
     parent::__construct($config);
 }
开发者ID:jamienay,项目名称:zend_search_lucene_source,代码行数:7,代码来源:zend_search_lucene.php

示例9: __construct

 public function __construct($config = array(), $autoConnect = true)
 {
     parent::__construct($config);
     $config['region'] = $this->region;
     $this->S3 = S3Client::factory($config);
     $this->bucketName = $config['bucket_name'];
 }
开发者ID:katsukii,项目名称:cakephp2_aws_s3_datasource,代码行数:7,代码来源:S3.php

示例10: __construct

 public function __construct($config = null)
 {
     if ($config === null) {
         $config = $this->config;
     }
     parent::__construct($config);
 }
开发者ID:issasouktel,项目名称:Multiattach,代码行数:7,代码来源:Vimeo.php

示例11: HttpSocket

 function __construct($config)
 {
     parent::__construct($config);
     $this->Http =& new HttpSocket();
     $this->params['login'] = $this->config['login'];
     $this->params['apiKey'] = $this->config['apiKey'];
 }
开发者ID:studdrcom,项目名称:Bitly-Datasource-for-CakePHP,代码行数:7,代码来源:bitly_source.php

示例12: __construct

 /**
  * Datasource constructor, creates the Configuration, Connection and DocumentManager objects
  *
  * ### You can pass the following configuration options
  *
  *	- server: name of the server that will be used to connect to Mongo (default: `localhost`)
  *	- database: name of the database to use when connecting to Mongo (default: `cake`)
  *	- documentPaths: array containing a list of full path names where Document classes can be located (default: `App::path('Model')`)
  *	- proxyDir: full path to the directory that will contain the generated proxy classes for each document (default: `TMP . 'cache'`)
  *	- proxyNamespace: string representing the namespace the proxy classes will reside in (default: `Proxies`)
  *	- hydratorDir: directory well the hydrator classes will be generated in (default: `TMP . 'cache'`)
  *	- hydratorNamespace:  string representing the namespace the hydrator classes will reside in (default: `Hydrators`)
  *
  * @param arary $config
  * @param boolean $autoConnect whether this object should attempt connection on creation
  * @throws MissingConnectionException if it was not possible to connect to MongoDB
  */
 public function __construct($config = array(), $autoConnect = true)
 {
     $modelPaths = $this->_cleanupPaths(App::path('Model'));
     $this->_baseConfig = array('proxyDir' => TMP . 'cache', 'proxyNamespace' => 'Proxies', 'hydratorDir' => TMP . 'cache', 'hydratorNamespace' => 'Hydrators', 'server' => 'localhost', 'database' => 'cake', 'documentPaths' => $modelPaths, 'prefix' => null);
     foreach (CakePlugin::loaded() as $plugin) {
         $this->_baseConfig['documentPaths'] = array_merge($this->_baseConfig['documentPaths'], $this->_cleanupPaths(App::path('Model', $plugin)));
     }
     parent::__construct($config);
     extract($this->config, EXTR_OVERWRITE);
     $configuration = new Configuration();
     $configuration->setProxyDir($proxyDir);
     $configuration->setProxyNamespace($proxyNamespace);
     $configuration->setHydratorDir($hydratorDir);
     $configuration->setHydratorNamespace($hydratorNamespace);
     $configuration->setDefaultDB($database);
     $configuration->setMetadataDriverImpl($this->_getMetadataReader($documentPaths));
     if (Configure::read('debug') === 0) {
         $configuration->setAutoGenerateHydratorClasses(false);
         $configuration->setAutoGenerateProxyClasses(false);
         $configuration->setMetadataCacheImpl(new ApcCache());
     }
     $this->configuration = $configuration;
     $this->connection = new Connection($server, array(), $configuration);
     $this->documentManager = DocumentManager::create($this->connection, $configuration);
     $this->documentManager->getEventManager()->addEventListener(array(Events::prePersist, Events::preUpdate, Events::preRemove, Events::postPersist, Events::postUpdate, Events::postRemove), $this);
     try {
         if ($autoConnect) {
             $this->connect();
         }
     } catch (Exception $e) {
         throw new MissingConnectionException(array('class' => get_class($this)));
     }
     $this->setupLogger();
 }
开发者ID:beyondkeysystem,项目名称:MongoCake,代码行数:51,代码来源:CakeMongoSource.php

示例13:

 /**
  * Constructor
  */
 function __construct($config = null)
 {
     $this->debug = Configure::read() > 0;
     $this->fullDebug = Configure::read() > 1;
     parent::__construct($config);
     return $this->connect();
 }
开发者ID:stas,项目名称:intranet,代码行数:10,代码来源:ldap_source.php

示例14: __construct

 public function __construct($config = null, $autoConnect = true)
 {
     parent::__construct($config);
     if ($autoConnect) {
         return $this->connect();
     }
 }
开发者ID:nanapi,项目名称:cakephp-fluent-logger-datasource,代码行数:7,代码来源:FluentLoggerDebugSource.php

示例15: __construct

 /**
  * Constructor. Sets API key and throws an error if it's not defined in the
  * db config
  *
  * @param array $config
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (empty($config['api_key'])) {
         throw new CakeException('StripeSource: Missing api key');
     }
     $this->Http = new HttpSocket();
 }
开发者ID:pratik-neptrox,项目名称:stripe,代码行数:14,代码来源:StripeSource.php


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