跳至主要内容

博文

目前显示的是 十月, 2012的博文

symfony prod debug=true , get blank page.

i have a symfony2 project works well, after some modification of html, i always get a blank page when i set in app.php: $kernel = new AppKernel('prod', false); but if i set the debug parameter to true: $kernel = new AppKernel('prod', true); everything works fine, i haven't see any log in my prod.log. I use php apc and fastCGI on my server. Anyone can tell me the difference between the parameter? Or this is just a problem of cache? finally, i have found the problem. I searched again in my log of appache, i got this error:  [Fri Oct 26 14:12:19 2012] [error] [client 127.0.0.1] PHP Fatal error: require() [function.require]: Failed opening required 'D:/workspace/symfony_bannieres/app/cache/devprod/doctrine/orm/Proxies\AcmeModerationBundleEntityModerationObjectStatusProxy.php' (include_path='.;d:\software\wamp\bin\php\php5.3.9\pear') in D:\workspace\symfony_bannieres\vendor\doctrine\lib\Doctrine\ORM\Proxy\ProxyFactory.php on line 85

更改 mysql database file location

http://article.my-addr.com/?show=linux_ubuntu_change_datadir-move_mysql_database_to_other_path 一定注意要删除原有的/var/lib/mysql, 否则是不行的。 mysqladmin - u root - p status 检查mysql是否正常工作 service mysql start 启动mysql 很奇怪的是我用其他的命令都不行: mysql start /etc/init.d/mysql start 这两个都不行,都报错, sudo touch / var / run / mysqld / mysqld . sock sudo chown - R mysql / var / run / mysqld / 来创建新的这个文件,不然,它老说找不到, 建立文件前后总是得到这么两个不同的信息 Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

ps_files_cleanup_dir pemission denied

今天遇到 session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied 这个错误 ,因为php没100此session start就会尝试清除一次session 的cache,但是 显然/var/lib/php5的权限是root,而且在/etc/cron.d/php5中已经有一个定时清理器是root的,所以需要把php.ini 中的 session.gc_probability 改为0.

symfony2 test problem

if you get this error: SYMFONY2 WARNING: SESSION_START(): THE SESSION ID IS TOO LONG OR CONTAINS ILLEGAL CHARACTERS... you should add this in your config_test.yml framework: test: ~ session: storage_id: session.storage.filesystem router: { resource: "%kernel.root_dir%/config/routing_dev.yml" } profiler: { only_exceptions: false }

javascript class properties

it seems we can not set a property value in a member function, for example: var Viewer = function() {}; Viewer.prototype.id=0; Viewer.prototype.upload=function(){ this.id=0; } and from this i get un error. If i remove this, everything works fine.

send post data by XMLHttpRequest

var url='http://localhost.bannieres/data/receive'; var xhr = new XMLHttpRequest(); xhr.open("POST",url,true); xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr.send("data="+encodeURIComponent(payload.data)); here ,teh payload.data is set by this: data=JSON.stringify(data); data is a string multi array.

随笔

没人能够得到足够的东西来满足她所有的欲望,不管你相信也好,不相信也罢,事实就是这样。所以我们不必去强求我们的愿望一定要实现,如果有,是好的,如果没有,那么我们等待着有的时候。 后悔是让人很痛苦的事,既然如此何必为了必定要痛苦的事浪费时间?又不是说分析过往以期待未来,那个也不叫后悔。所以,后悔是一生中最没有意义的事情。

chrome extension general point

You should do a content script, triggered by the specific pages. http://code.google.com/chrome/extensions/content_scripts.html Chrome injects automatically your content script in pages matching the pattern you indicate in manifest.json: http://code.google.com/chrome/extensions/manifest.html http://code.google.com/chrome/extensions/match_patterns.html The content script lets you interact with the page's DOM, thus you can find the anchors ( tags). You may hang a listener from mouseover event, or you can just write the anchors  title  attribute (the text that popup when hoovering). If your specific pages list isn't static (you want to modify the list without modifying the extension), then you may want to learn about programatic injection. http://code.google.com/chrome/extensions/content_scripts.html#pi If you choose to hang a listener, use addListener, don't use the mouseover attribute, because your listener function isn't in the same  world , it's on

php pear install phpunit 的问题

http://www.ankara-gtug.org/2011/11/15/phpunit-installation-on-wamp-in-windows-7-and-integration-with-eclipse-2/ 详细的讲解如何安装pear 和安装phpunit,但是当我执行: pear install pear.phpunit.de/PHPUnit 的是后,总是告诉我: No releases available for package "pear.phpunit.de/PHPUnit" install failed 查找之后发现需要: pear clear-cache 然后再执行就没有问题了。