本文整理汇总了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'];
}
示例2:
function __construct($config)
{
parent::__construct($config);
$this->api_key = $this->config['api_key'];
$this->username = $this->config['username'];
$this->password = $this->config['password'];
}
示例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;
}
示例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;
}
示例5: HttpSocket
function __construct($config)
{
parent::__construct($config);
$this->Http =& new HttpSocket();
$this->username = $this->config['username'];
$this->password = $this->config['password'];
}
示例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);
}
示例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);
}
示例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'];
}
示例10: __construct
public function __construct($config = null)
{
if ($config === null) {
$config = $this->config;
}
parent::__construct($config);
}
示例11: HttpSocket
function __construct($config)
{
parent::__construct($config);
$this->Http =& new HttpSocket();
$this->params['login'] = $this->config['login'];
$this->params['apiKey'] = $this->config['apiKey'];
}
示例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();
}
示例13:
/**
* Constructor
*/
function __construct($config = null)
{
$this->debug = Configure::read() > 0;
$this->fullDebug = Configure::read() > 1;
parent::__construct($config);
return $this->connect();
}
示例14: __construct
public function __construct($config = null, $autoConnect = true)
{
parent::__construct($config);
if ($autoConnect) {
return $this->connect();
}
}
示例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();
}