0) { $tmp .= "// name: ".$rowhelper['name']." \n"; $tmp .= "// description: ".$rowhelper['description']." \n\n"; $tmp .= base64_decode($rowhelper['php']); $tmp .= "\n"; } } } $tmp .= <<< EOF sleep(1); } ?> EOF; $fout = fopen("/usr/local/pkg/phpservice.php", "w"); fwrite($fout, $tmp); unset($tmp); fclose($fout); restart_service("phpservice"); conf_mount_ro(); } else { stop_service("phpservice"); } } function phpservice_install_command() { conf_mount_rw(); write_rcfile(array( "file" => "phpservice.sh", "start" => "/usr/local/bin/php /usr/local/pkg/phpservice.php >> /var/log/phpservice.log &", "stop" => "/bin/rm -f /tmp/phpmonitor.pid; sleep 3" ) ); phpservice_sync_package(); conf_mount_ro(); } function phpservice_deinstall_command() { conf_mount_rw(); stop_service("phpservice"); unlink_if_exists("/usr/local/etc/rc.d/phpservice.sh"); conf_mount_ro(); } ?>