 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Brian Swan's Blog: SQL Server Driver for PHP Connection Options Encrypt & Failover_Partner
by Chris Cornutt March 11, 2011 @ 08:41:11
Brian Swan has posted two more in his "SQL Server Driver for PHP" series looking at some of the connection options that are available. In these two new articles he looks at the Failover_Partner and Encrypt options.
Database mirroring is primarily a software solution for increasing database availability. [...] When a PHP application connects to the primary server, the Failover_Partner connection option specifies the name of the server to which the application should connect if the primary server is not available.
[...] These two options, Encrypt and TrustServerCertificate, are often used together. The Encrypt option is used to specify whether or not the connection to the server is encrypted (the default is false). The TrustServerCertificate option is used to indicate whether the certificate on the SQL Server instance should be trusted (the default is false).
In both there's code examples showing the connection strings and what kinds of parameters you can pass to them. He also gives a few examples of scenarios when they might be useful.
voice your opinion now!
connect sqlserver driver option failoverpartner encyrpt trustservercertificate
Brian Swan's Blog: SQL Server Driver for PHP Connection Options CharacterSet
by Chris Cornutt February 28, 2011 @ 12:15:33
Brian Swan has posted another in his series looking at connection options for the SQL Server driver for PHP. In his latest he looks at the "CharacterSet" setting, an easy way to define which encoding the remote database is using.
One thing that helped me understand the CharacterSet option was to realize that its name is a bit misleading (although it seems to be inline with other uses of CharacterSet or charset). It is used to specify the encoding of data that is being sent to the server, not the character set. With that in mind, the possible values for the option begin to make sense: SQLSRV_ENC_CHAR, SQLSRV_ENC_BINARY, and UTF-8.
He looks at each of these three options in more detail - SQLSRV_ENC_CHAR being the default, SQLSRV_ENC_BINARY when binary data is needed and UTF-8 when, obviously, you need UTF-8 data transfer between the client and server.
voice your opinion now!
sqlserver connection option characterset encoding
Brian Swan's Blog: SQL Server Driver for PHP Connection Options ReturnDatesAsStrings
by Chris Cornutt February 09, 2011 @ 08:45:28
Brian Swan has a new post to his blog today looking at one of the connection options for the SQL Server driver in PHP - the "ReturnDatesAsStrings" setting that can make handling date and time information simpler for PHP.
This is short post to address a frustration I've seen mentioned on Twitter and in forums a lot: By default, the SQL Server Driver for PHP returns datetime columns as PHP DateTime objects, not strings. This can be especially frustrating if you are not aware of the ReturnDatesAsStrings connection option. By simply setting this option to 1 (or true) when you connect to the server, datetime columns will be returned as strings.
He includes some sample code showing how to use the setting (as a part of the settings array passed in to sqlsrv_connect) and the resulting array key from the fetched results on his sample table. This just gives you one more option for handling dates in your SQL Server-based application, especially if you don't need the full DateTIme object's functionality.
voice your opinion now!
sqlserver driver connection option return date string datetime
Sameer Borate's Blog: 7 essential php command-line options
by Chris Cornutt December 14, 2009 @ 07:52:38
On his Code Diesel Sameer shares seven essential options you can use to make your command-line PHP experience even better.
Most of us use PHP from a IDE or using a simple text editor with a browser, rarely dropping down to the command-line for running php programs. But php provides some interesting and quick options you can use to perform various common tasks or to debug some nasty installation problems. Below is a list of some useful options you should be familiar with.
Among those on his list, handy options like the ability to define which php.ini file to use (-c), showing what modules are compiled into the current binary (-m) and a syntax highlighted output of the file (-s).
voice your opinion now!
essential commandline option
Debuggable Blog: How to Fetch the ENUM Options of a Field - The CakePHP Enumerable Behavior
by Chris Cornutt September 08, 2009 @ 11:47:09
On the Debuggable blog, Tim Koschutzki has added a quick post looking at fetching ENUM options of a database's fields in a CakePHP application.
The field users.level is an enum type and can have the values 'guest', 'user', 'admin', 'superadmin' and 'root'. The problem is that it could be possible that new levels were added in the future. [...] So what I came up with is a very simple behavior that can extract the options for any ENUM field. It uses simple caching in order for the query to not be run all the time, so make sure to clear your cache as you update your enum field options in the db.
His code snippet creates an EnumerableBehavior for the model and grabs the column names from the given table to check the access level for each and write them out to a cache.
voice your opinion now!
cakephp framework enum option database
PHPMag.ru: Zend Framework models auto-loading
by Chris Cornutt April 03, 2009 @ 10:25:44
From the PHPMag.ru site comes a recent post looking at a technique for creating auto-loading models in your Zend Framework application.
When it comes to MVC, ZF handles almost everything - your action controllers are triggered, your views are loaded, w/o you having to worry about them. Not the same with models. If you comply to directory layout advised by ZF, you have "models" folder, but framework doesn't interact with it in any way.
There's a three step process he includes to make your models autoload - extend the Zend_Controller_action for the controller you're working with, put loadModel() method into the controller (what will actually load the models) and an optional third step of adding in class autoloading. A few alternatives are also mentioned: Zend_Load_PluginLoader, Zend_Load subclassing and a controller plugin.
voice your opinion now!
model autoload zendframework tutorial loadmodel plugin option
Jani Hartikainen' Blog: Database backed Zend_Form elements
by Chris Cornutt March 09, 2009 @ 08:45:27
Jani Hartikainen has a new post that should interest the Zend Framework developers out there - a look at automatically querying the database to fill in the right option values for a Zend_Form element.
It's not very tricky to query a database, and fill a Zend_Form element's possible values from the resultset, but it can be quite boring and extraneous code... We could also create an element which we can give some SQL, and it'll fill itself automatically! This way you can even define database-backed elements in XML or INI configuration files.
He starts with a simple Select element type example and builds from there. He creates a DbSelect layer for the element and with the help of a main method, _performSelect, the script can create a new instance of the CU_Form_Element_DbSelect to pull in the options from the SQL (given in the "dbSelect" parameter).
voice your opinion now!
database backend select option zendform zendframework query
|
Community Events
Don't see your event here? Let us know!
|