Grep/Find all php short tags
grep -rn "<?[^p]" *
grep -rn "<?[^p]" *
I had a problem upgrading to phpStorm 3.0. Needed to kill the project data, for phpStorm to reset.
$> rm -rf .idea
to clear the project data.
I have a requirement to not serve SVN meta data with the project, once deployed on a server.
So what can I do?
Prevent Apache from serving the content:
Put an apache directive:
&amp;lt;DirectoryMatch .*\.svn/.*&amp;gt; Deny From All &amp;lt;/DirectoryMatch&amp;gt;
or:
Remove all the SVN metadata altogether
While in the *nix prompt:
find . -name ".svn" -type d -exec rm -rf {} \;
Took me a while to find out how to do this… as there was no good examples on the web.
So, here it is… so I can find it again.
keywords:
db database transaction rollback commit magento zend.
try {
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$write->beginTransaction();
// do stuff here
$write->commit();
} catch (Exception $e) {
mage::log(__METHOD__ . ':' . __LINE__ . ': Rollback happened.');
$write->rollback();
}
Please drop a line if you found this useful. Thanks!
ls -tr | tail -n 1
I always forget these commands… so I’m posting it here, so I can find them again easily.
Getting a value out of a loaded yaml config file.
[project root]/app/frontend/config/app.yml
all:
.general:
api_key: ASDFASDFASDFASDF
sfConfig::get(‘app_api_key’);
will return “ASDFASDFASDFASDF”;
I’m assuming you have a fresh install of centos 5.5.
$> yum groupinstall "Development Tools"
$> wget http://us.php.net/get/php-5.3.3.tar.bz2/from/www.php.net/mirror
$> tar xvf php-5.3.3.tar.bz2
$> yum install mysql-server httpd-devel-* libxml2-devel-* openssl-devel* xmlsec1-openssl-devel-* libpng* libjpeg* curl-devel libmcrypt* mysql-devel* mysql.*
$> cd php-5.3.3
$> ./configure --with-mysql=shared --with-openssl --enable-pdo --with-pdo-mysql=shared --with-mhash=shared --enable-soap=shared --with-config-file-path=/etc/ --with-apxs2 --with-mysqli --enable-zip --enable-shared --with-curl --enable-mbstring=all --enable-maintainer-zts --with-jpeg-dir=/usr/lib/ --with-libdir=lib64 --enable-soap --with-pdo-mysql --with-gd --with-mcrypt
$> make; make install;
$> service httpd restart
and there you go… php 5.3.3 on the box…
http://www.lloydleung.com/2009/06/17/find-svn-directories-and-remove-them/
Useful linux command to remove svn data, when you need to clean it up for some reason.
Note: Use sparingly.
SV…. thanks…
If you’re about to do the following, notify others. Or people start yelling at you.
Or… alternatively, make your own sandbox, and you can play all you want…
<?php
echo date('Y-m-d H:m:s', 1229367412.43);
// gives 2008-12-15 13:12:52
echo date('Y-m-d H:m:s', 1229367412);
// givse 2008-12-15 13:12:52
mysql
select from_unixtime(1229367412.43);
// gives 2008-12-15 13:09:22
select from_unixtime(1229367412);
// gives 2008-12-15 13:09:21
The problem is your date function is calling for H:m:s -> Hour:Month:Seconds. Next time try H:i:s -> Hour:Mintues:Seconds.
You are dumb!