It's very simple to create desktop icon, or unity launcher. Run PhpStorm, click to "Tools", then "Create Desktop Entry ...".
If you want to create it for all users, just check the checkbox and click to "OK" button. To create Unity launcher just drag and drop the icon into launcher bar.
Monday, February 25, 2013
Thursday, November 15, 2012
Disabling translator for Zend_Form_Element
If you use Zend_Form and also Zend_Translate, core Zend functionality tries to translate options of Zend_Form_Element_Select or any other options of elemenet inherited from Zend_Form_Element_Multi. This is not needed in all cases. To disable translator on the element just call function setDisableTranslator like this:
$element = new Zend_Form_Element_Select('my_element');
$element
->setDisableTranslator(true)
Wednesday, November 7, 2012
Recursively walk through directory tree
If you need to get all files (or also folders) from some folder and it's subfolders recursively, use following simple construction:
http://php.net/manual/en/class.recursiveiteratoriterator.php
http://php.net/manual/en/class.recursivedirectoryiterator.php
http://php.net/manual/en/class.splfileinfo.php
$folder = '/path/to/folder'; $objects = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($folder), RecursiveIteratorIterator::SELF_FIRST); foreach ($objects as $object) { /** * $object is instance of SplFileInfo */ if ($object->isFile()) { echo $object->getExtension(); echo $object->getRealPath(); } }Check also PHP manual
http://php.net/manual/en/class.recursiveiteratoriterator.php
http://php.net/manual/en/class.recursivedirectoryiterator.php
http://php.net/manual/en/class.splfileinfo.php
Tuesday, November 6, 2012
How to install PhpStorm on Ubuntu 12.10
If you want to try or use great php IDE PhpStorm follow these steps:
- download PhpStorm from http://www.jetbrains.com/phpstorm/download/
- unpack downloaded file with following command tar xfz PhpStorm-*.tar.gz (or right click in nautilus and choose "Extract Here")
- open folder "PhpStorm/bin/", right click to "phpstorm.sh", choose "properties. In permissions tab mark checkbox "Allow executing file as program"
- install Oracle JDK by following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
- double click on file "phpstorm.sh", click to "run"
Tuesday, November 10, 2009
timestamp from javascript date
Hi everybody, here's simple extension for javascript Date object. It returns timestamp in seconds in local time. Locale is taken from users browser.
usage is simple:
Date.prototype.getTimestamp = function ()
{
var date = this;
var timestamp = Math.round(date.getTime()/1000);
timestamp = timestamp - (date.getTimezoneOffset () * 60);
return timestamp;
}
usage is simple:
var new_Date = Date();
alert(date.getTimestamp());
Thursday, June 25, 2009
Foreach equivalent in javascript
foreach function in PHP is very nice and easy to use. I was searching for equivalent in javascritp and there are two possibilities.
1. without jquery:
2. using jquery
if you now another option using some other framework, please add it to discussion, thanks
1. without jquery:
var new_array = new Array();
new_array[0] = 'foo';
new_array[1] = 'bar';
for (var key in new_array)
{
alert(new_array[key]);
}
2. using jquery
var new_array = new Array();
new_array[0] = 'foo';
new_array[1] = 'bar';
$.each(new_array, function(key, value)
{
alert(key + '=>' + value);
});
if you now another option using some other framework, please add it to discussion, thanks
Tuesday, October 21, 2008
Debuging php using vertrigo server and xdebug in eclipse
How to debug php scripts? Answer is easy. Here are few steps, how I have set it.
platform : windows
used software:
- vertrigo server - apache and mysql (http://vertrigo.sourceforge.net/)
- eclipse PDT - php IDE (http://www.eclipse.org/pdt/downloads/)
- xdebug dll library (http://xdebug.org/)
Few easy steps, how to set it
- download, install and run vertrigo server
- download eclipse PDT
- download "php_xdebug-2.0.3-5.2.5.dll" to
"C:\Program Files\VertrigoServ\Php\ext\php_xdebug-2.0.3-5.2.5.dll" - do NOT enable xdebug via vertrigo>settings>extensions settings
- edit "php.ini" saved in "C:\Program Files\VertrigoServ\Php\" (right click on vertrigo tray icon > config files > php.ini)add at the end these lines :[xdebug]zend_extension_ts ="C:\Program Files\VertrigoServ\Php\ext\php_xdebug-2.0.3-5.2.5.dll"xdebug.remote_autostart=onxdebug.remote_enable=onxdebug.remote_host=127.0.0.1xdebug.remote_port=9000xdebug.remote_handler=dbgpxdebug.remote_mode=reqxdebug.idekey=ECLIPSE_XDEBUGyou need to turn off Zend optimizer (coment following lines):[Zend]zend_optimizer.optimization_level=15zend_extension_ts="C:\Program Files\VertrigoServ\Zend\ZendExtensionManager.dll"zend_extension_manager.optimizer_ts="C:\Program Files\VertrigoServ\Zend\Optimizer-3.3.0"like this:[Zend]zend_optimizer.optimization_level=15;zend_extension_ts="C:\Program Files\VertrigoServ\Zend\ZendExtensionManager.dll";zend_extension_manager.optimizer_ts="C:\Program Files\VertrigoServ\Zend\Optimizer-3.3.0"
- find line "memory_limit = 8M" in "php.ini"
change it to "memory_limit = 12M" - restart vertrigo (right click on tray icon > server > restart)
- set up eclipse as written here :http://devzone.zend.com/article/2930-Debugging-PHP-applications-with-xdebug
Labels:
debuging,
eclipse pdt,
php debug,
vertrigo,
xdebug
Subscribe to:
Posts (Atom)