Asked  2 Years ago    Answers:  5   Viewed   91 times

Anyone knows how to solve the error below?

Deprecated: Function ereg() is deprecated in on line 895

It is happening after installing Drupal 6.13 on wamp server 2.0i with PHP 5.3.0



Drop your error reporting level below E_DEPRECATED.

PHP 5.3 introduced two new error reporting levels, E_DEPRECATED and E_USER_DEPRECATED and - for the first time in PHP's history - they've started to walk away from older parts of their API. The ereg_* function will still work, but this warning is intended to let you know that "hey, these function will be going away soon, probably in the next major revision).

Saturday, October 15, 2022

a lot of times simply uninstalling and trying again can fix bugs like this. It's possible that there was something wrong with the installation of maybe you gave it some incorrect information.

Saturday, December 24, 2022

This is what I do:

$breadcrumb[] = l(t('Home'), NULL);
if ($parents = taxonomy_get_parents_all($tid)) {
  $parents = array_reverse($parents);
  foreach ($parents as $p) {
    $breadcrumb[] = l($p->name, 'taxonomy/term/'. $p->tid);

I'll typically stick this in a hook_view() function or hook_nodeapi($op="view") function.

Sunday, December 18, 2022

eregi() function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

you can use preg_match().

Friday, August 26, 2022

Thanks to Oleg for posting the idea behind this solution. Essentially, I enhanced his proposal to generically handle a bridge between:

  1. A functional web controller; which could receive the web request.
  2. A stream supplier; which could forward any message to a messaging infrastructure.

This solution encapsulates the concerns described in Oleg example, inside a custom implementation of a Supplier. Such implementation exposes an API to trigger the Supplier to emit a message passed as parameter. Such a class would look like the following:

import org.springframework.messaging.Message;

import java.util.function.Supplier;

import reactor.core.publisher.EmitterProcessor;
import reactor.core.publisher.Flux;

public class StreamSupplier implements Supplier<Flux<?>> {

    private static final String SPRING_CLOUD_STREAM_SENDTO_DESTINATION =

    public static <T> Message<?> createMessage(T payload, String destination) {
        MessageBuilder<T> builder = MessageBuilder.withPayload(payload);
        if (destination != null && !destination.isEmpty())
            builder.setHeader(SPRING_CLOUD_STREAM_SENDTO_DESTINATION, destination);

    private String defaultDestination;
    private EmitterProcessor<? super Object> processor = EmitterProcessor.create();

    public StreamSupplier() {

    public StreamSupplier(String defaultDestination) {
        this.defaultDestination = defaultDestination;

    // SEND APIs

    public <T> Message<?> sendMessage(T payload) {
        return sendMessage(payload, defaultDestination);

    public <T> Message<?> sendMessage(T payload, String destination) {
        return sendBody(createMessage(payload, destination));

    public <T> T sendBody(T body) {
        return body;

     * Returns {@link EmitterProcessor} used internally to programmatically publish messages onto
     * the output binding associated with this {@link Supplier}. Such programmatic publications
     * are available through the {@code sendXXX} API methods available in this class.
    public Flux<?> get() {
        return processor;

Then a developer only has to:

  1. Register an instance of this particular Supplier implementation as a bean in a Spring application; and let spring-cloud-function scan this bean into the FunctionCatalog.
  2. Create a web function that forwards any message to a streaming infrastructure using the previously registered Supplier - which can be configured using all the bells and whistles of spring-cloud-stream.

The following example demonstrate this:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

import java.util.function.Function;
import java.util.function.Supplier;

import reactor.core.publisher.Flux;

public class MyApp {

    public static void main(String[] args) {,

    // Functional Web Controller
    public Function<String, String> webToStreamFunction() {
        return msg -> streamSupplier().sendBody(msg);

    // Functional Stream Supplier
    public Supplier<Flux<?>> streamSupplierFunction() {
        return new StreamSupplier();

    public StreamSupplier streamSupplier() {
        return (StreamSupplier) streamSupplierFunction();

Again, I want to thanks Oleg for providing the required details I was looking for to build this comprehensive solution.

Complete code on GitHub

Thursday, November 10, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :

Browse Other Code Languages