- Router - generate urls with new style prefixes
- Helpers - Helper::assetTimestamp() - to prevent url caching
- Helpers - TextHelper - highlight function
- Helpers - NumberHelper::addFormat() function
- Error handling
- improved Scaffolding
- Logging - Configure::write('log', E_WARNING);
- Models and datasources
- Console and Shells
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
Thursday, November 05, 2009
CakePHP 1.3 alpha is out
CakePHP team announced CakePHP 1.3 alpha - ready for download.
New features include:
Friday, September 28, 2007
Oracle XE and PHP 5 on Windows
Even though most PHP applications use MySQL / SQLite / Postgres for database driven applications sometimes you need to integrate information from an Oracle database and you need PHP to do the talking.
Oracle XE helped and encouraged developers to write applications using Oracle.
So, there are several ways to connect to an Oracle:
- using odbc
- oci8 extension available for both PHP 4 and PHP 5
- PDO (pdo_oci)
extension=php_oci8.dllNote: make sure extension_path is set correctly. php_oci8.dll depends on oci.dll. You can find oci.dll in oracle bin folder (something like \oraclexe\app\oracle\product\10.2.0\server\BIN). Copy oci.dll in %WINDIR%\system32. Now restart apache web server. Sample connection script:
$ora_conn = oci_connect('hr','****','xe');
$sql = "SELECT * FROM EMPLOYEE";
$statement = oci_parse ($ora_conn, $sql);
oci_execute ($statement);
while ($row = oci_fetch_assoc($statement)) {
print_r($row);
}
oci_free_statement($statement);
And that's about it.
PHP using PDO to access Oracle XE database
Uncomment in php.ini the following lines:
extension=php_pdo.dll ;... extension=php_pdo_oci.dllAlso, see above note referring to oci.dll. Restart Apache web server. Sample script using PDO:
try {
$dbh = new PDO('oci:host=localhost;dbname=xe', 'hr', '*****');
$rs = $dbh->query('SELECT * from EMPLOYEES WHERE ROWNUM<10');
if($rs) {
foreach ($rs as $row) {
print_r($row);
}
}
$dbh = null;
} catch (PDOException $e) {
print 'Error!: ' . $e->getMessage();
die();
}
}
Labels:
Oracle XE,
PHP,
Web Development
Sunday, August 13, 2006
Phalanger - PHP Compiler for .NET
The original description is:
The Phalanger is a complex solution giving web-application developers the ability to benefit from both the ease-of-use and effectiveness of the PHP language and the power and richness of the .NET platform. This solution enables developers to painlessly deploy and run existing PHP code on an ASP.NET web server and develop cross-platform extensions to such code taking profit from the best from both sides. Compatible with PHP 5.0, the object model in Phalanger enables to combine PHP objects with the .NET ones. It is possible to use a class written in PHP from a .NET application or even to import a .NET class (written for example in C# or Visual Basic .NET) into PHP scripts provided that this class respects the PHP object model implemented in the Phalanger. The Phalanger is the only existing PHP compiler which produces .NET Framework MSIL bytecode.Some benchmarks were posted on the website with Phalanger 1.0 Beta 3, PHP 4.3.11, and PHP 5.0.4 with and without Zend Optimizer, and some php based popular apps: Nuke and phpBB compared. The tests were done on a Windows machine. Anyway, looking at the benchmarks Roadsend seems interesting too. The idea is that PHP for .NET is a viable solution, and compiled php is an improvment.
Labels:
.NET,
PHP,
Web Development
Thursday, March 09, 2006
Zend framework preview
Zend framework preview is out... after some quick fixes, the discussions started...
Chris Shiflett wrote a tutorial for php|arch (in a big hurry it seems)...
I consider the Model in an MVC framework a key component, while in this tutorial Chris uses a Database object, no ZActiveRecord ( I thought zend will find the Panacée for Active Record), no ORM library (Zend_Db_Table - Row Data Gateway, Zend_Db_Table_Row or any Zend_Db component).
He explains that:
"Because the database components of the Zend Framework are still relatively unstable, I use a class for storing and retrieving news entries and comments" ...
Is understandable because this is just a preview release, but I was expecting more...
The coding standards are not followed... (tabbed indented files, 2 spaces indented file)... It seems there is alot of work to be done..
Yesterday Zend Framework Preview 0.1.2 was released; important updates: unit tests and controller documentation :)
For testing is used: PHPUnit2, not simpleTest, not Test::More...
I hope that soon we will see a stable framework, that can be compared with Zope...
Labels:
Framework,
PHP,
Web Development,
Zend
Wednesday, August 24, 2005
PHP 4 constructor and destructor
Here is a way to have constructor and destructor functions in php4:
/*
*
* Because php 4 does not have a proper OOP implementation
* here is a way to have php4 destructor and constructor
*
*/
class demoClass
{
// {{{ constructor
/**
* php4 class contructor
*
* @return object
*/
function demoClass()
{
//destructor
register_shutdown_function(array(&$this, '__destruct'));
//constructor
$argcv = func_get_args();
call_user_func_array(array(&$this, '__construct'), $argcv);
}
// }}}
// {{{ __construct()
/*
* constructor function implementation
*/
function __construct()
{
//code for constructor goes here
}
// }}}
//{{{ __destruct()
/*
* destructor function implementation
*/
function __destruct()
{
//code for destructor goes here
}
//}}}
}
Thursday, August 18, 2005
Zend Certification Study Guide and Errata
Finally, after a week of waiting the Zend Certification Study Guide arrived. I was so eager to read it...
Started reading the tests (I was really curious about the questions): chapter 1, page 15 first error:
Discussed on phparch forum
Jason Sweet cleared that out (printing error), but still, I believe it needed a better checking before releasing it on the market, and I bought the 2nd edition...
After googleing, I found the Errata, and this discussion started by someone less patient than me...
So, now I can continue my reading... And after that, I will take the test.
Sunday, February 06, 2005
PHP Security Consortium (PHPSC) was launched
On 31st January PHP Security Consortium (PHPSC) was launched.
" Founded in January 2005, the PHP Security Consortium (PHPSC) is an international group of PHP experts dedicated to promoting secure programming practices within the PHP community. Members of the PHPSC seek to educate PHP developers about security through a variety of resources, including documentation, tools, and standards." [about]
The website has a simple design, common to wikki style. You can see it just has launched: 1 article (Using PEAR's Text_CAPTCHA to Secure Web Forms, by Marcus Whitney),
1 project (PHP Security Guide 1.0 (English) HTML,docBook Lite [soon will be available as pdf].
Today is 6th feb. and still no update since 31st jan... I printed the security guide to study it, that caused my printer to run out of paper, I'll have to buy some more...
Labels:
PHP,
Security,
Web Development
How to install and configure your own web server
Install Apache2, PHP 4.3.10 and MySQL
Here is a quick tutorial to make your own web server [Apache, PHP4, MySQL] on Windows. Of course you can always download an already made server suite, but all you do next, next, next... and then edit your php scripts. Installing your own web server and configuring it will improve your knowledge in this field, and gives you the oportunity to configure it for your own needs. Download [latest stable realeses]: Apache [httpd-2.0.52-win32-x86-src.zip] PHP PHP 4.3.10 zip package MySQL 4.1.9 [I still use MySQL 3.23] Create a folder on your disk C:\www Run apache installer:- install location c:\www [default c:\program files\apache group]: so it will install c:\www\apache2 - Hostname: localhost or your IP address - Listen: 80 - admin email address: youremail@address.com - finalize installCreate the folder: c:\www\htdocs Unzip php-4.3.10-Win32.zip to c:\www\php4 Copy [or cut] c:\www\php4\sapi\* to c:\www\php4\* Rename php.ini-dist to php.ini and edit it:
; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below doc_root = c:/www/htdocs ;........................... extension_dir = "c:/www/php4/extensions" ; Uncoment eny extension that you may need extension=php_xslt.dll ;............... display all error except notices error_reporting = E_ALL & ~E_NOTICE ;displaying script errors: display_errors = On ; if you are using for production is it recommended to be set to OffNote: php_xslt.dll requiers sablot.dll [placed under %WINDIR%\system32] php_exif requires php_mbstring.dll loaded BEFORE. For other extensions check documentation first. Copy php.ini in your %WINDIR% directory [that is c:\windows or c:\winnt] Configure apache to handle php scripts: Open and edit c:\www\apache2\conf\httpd.conf
ServerRoot "C:/www/Apache2" #....edit Listen 80 #.....ad the line LoadModule php4_module /www/php/php4apache2.dll #....edit ServerName localhost:80 #...edit DocumentRoot "C:/www/htdocs" #...edit DirectoryIndex index.html index.php default.php index.html.var #add the lines: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phpsSave it and restart Apache [Apache Monitor->Apache2->Restart]. MySQL: Unzip mysql to c:\www\mysql and run c:\www\mysql\bin\winmysqladmin.exe, set root password and you will have mysql databaser server running. I also recommend phpMyAdmin for querying and administering mysql server. Now testing instalation: create a file index.php in c:\www\htdocs and put the following content: <? phpinfo(); ?> then open your browser and go to: http://localhost/ and you should see:
PHP Version 4.3.10 ....
If not, well there is a problem. Send me an email and I will try to help you. Hope this can help... This is mainly the way I've done it several times and it worked on Windows 2000, windows xp, sp2, and last evening was running on windows media center 2005. I also installed mod-python, but that will be another post :)
Labels:
Apache,
Install,
MySQL,
PHP,
Web Development
Subscribe to:
Posts (Atom)
