Posts Tagged ‘Pear library’

Oct
10
2009

How to include PEAR libraries with CakePHP?

Suggested solutions from other sites:
1) Modify /config/paths.php
2) Create separate php.ini settings file with the path to PEAR library
3) Modify the app_controller.php with the PEAR path settings

My preference is to add the PEAR library to the “vendors” folder and to modify the app_controller to have the PEAR path included through it.

if( file_exists(VENDORS.’Pear’)){
ini_set(’include_path’, ini_get(’include_path’) . PATH_SEPARATOR . PEAR);
}

Above solution suggested at CakePHP’s trac

Depending on the library that you want to get included in the programs, add the library to the respective view

App::import(’vendor’, ‘XML_Feed_Parser’, array(’file’ => ‘../vendors/pear/XML/Feed/Parser.php’));

  • Share/Save/Bookmark
May
17
2009

PHP XSS: htmlspecialchars vs. htmlentities

Cross site scripting XSS is a term used to refer attacks or loop holes present in the scripting used by websites favoring hackers to exploit this path towards identity theft or phishing.

In PHP, two functions are mainly used to circumvent XSS attacks.
i) htmlspecialchars
ii) htmlentities
(more…)

  • Share/Save/Bookmark