我正在使用elfinder,我想通过向上下文菜单添加命令来添加新功能.我在项目的github问题跟踪器上找到了一个解决方案,但我无法让它工作.这是我做的:
var elf;
jQuery().ready(function() {
elFinder.prototype._options.commands.push('editimage');
elFinder.prototype._options.contextmenu.files.push('editimage');
elFinder.prototype.i18.en.messages['cmdeditimage'] = 'Edit Image';
elFinder.prototype.i18.de.messages['cmdeditimage'] = 'Bild bearbeiten';
elFinder.prototype.commands.editimage = function() {
this.exec = function(hashes) {
console.log('hallo');
}
}
elf = jQuery('#elfinder').elfinder({
...
//elfinder initialization
Run Code Online (Sandbox Code Playgroud)
上下文菜单项未显示,控制台中未找到任何错误消息.我还尝试将editimage放在initmen中的contextmenu - >"files"下,以防初始化时覆盖.
我有以下问题:
我想运行一个PHP脚本作为一个齿轮工作者,或者作为5个工人来准确.这是我的supervisord.conf-补充:
[program:gearman-test-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /path/to/gearman-jobs/worker.php
numprocs=5
directory=/path/to/gearman-jobs/
stdout_logfile=/var/log/gearman-job-server/supervisord.log
environment=GEARMAN_USER=gearman
autostart=true
autorestart=true
user=gearman
stopsignal=KILL
Run Code Online (Sandbox Code Playgroud)
当我启动它supervisord -n(或在守护进程模式下)它只会产生1个实例而不是5个.消息看起来很好
[root@pc113 gearman-jobs]# supervisord -n
2013-09-03 14:24:58,775 CRIT Supervisor running as root (no user in config file)
2013-09-03 14:24:58,789 INFO /var/tmp/supervisor.sock:Medusa (V1.1.1.1) started at Tue Sep 3 14:24:58 2013
Hostname: <unix domain socket>
Port:/var/tmp/supervisor.sock
2013-09-03 14:24:58,850 CRIT Running without any HTTP authentication checking
2013-09-03 14:24:58,850 INFO supervisord started with pid 8722
2013-09-03 14:24:58,853 INFO spawned: 'gearman-test-worker' with pid 8723
2013-09-03 14:24:59,858 INFO success: …Run Code Online (Sandbox Code Playgroud) 我正在为 Joomla 构建一个组件!2.5 和里面我JRoute::_('index.php?option=com_myapp&view=cpanel')用来建立我的所有链接。这有效,但它会产生如下所示的链接:
/component/myapp/cpanel.html
Run Code Online (Sandbox Code Playgroud)
但是在菜单中,我定义了index.php?option=com_myapp&view=cpanel一个别名为“myapp”的链接,所以链接应该是
/myapp/cpanel.html
Run Code Online (Sandbox Code Playgroud)
该组件可通过此路径访问。如果我这样做,内部生成的所有链接也将具有/myapp前缀。但是用于模板(特殊登录链接),如果用户偶然发现/component/myapp......我仍然希望所有链接都转到/myapp前缀。
如何强制 JRoute 自行使用此菜单项条目?
php ×2
elfinder ×1
gearman ×1
javascript ×1
joomla ×1
joomla2.5 ×1
routes ×1
supervisord ×1
url-routing ×1