Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
-Arr::merge() - all arguments must be arrays.-
  • i am trying to use Orm in which i am geting an error saying 
    -Arr::merge() - all arguments must be arrays.- 
    i Have tryed every think but i am finding any think ,
    Can Some one plz try to solve my problem, i am not fing any tutorial regarding this to ,
    Please for haven sake try to help me.                        
  • Can you give more information?

    Which version of FuelPHP are you using?

    What is the exact error? Which file? Which line number? What is the backtrace? You can make a screenshot of the error and post it somewhere if that is easier.
  • COREPATH/classes/arr.php @ line 819



    814
    815        foreach ($arrays as $arr)
    816        {
    817            if ( ! is_array($arr))
    818            {
    819                throw new \InvalidArgumentException('Arr::merge() - all arguments must be arrays.');
    820            }
    821
    822            foreach ($arr as $k => $v)
    823            {
    824                // numeric keys are appended

    the erro is on line 819

  • COREPATH/classes/config/file.php @ line 48

    43
    44        foreach ($paths as $path)
    45        {
    46            $config $overwrite ?
    47                array_merge($config$this->load_file($path)) :
    48                \Arr::merge($config$this->load_file($path));
    49        }
    50
    51        return $config;
    52    }
    53

  • Still not a lot of information, so some guesswork is involved:

    The framework is attempting to load a config file (which I don't know without a full backtrace), but that config file doesn't return an array.
  • https://www.dropbox.com/s/gtgp5ut0am7fy0p/arra_error.htm

    here is the error page plz download and view the code in (Details)
    Or Here is the another link

  • Backtrace step 3 shows an attempt to load your db.php config, which causes the error.

    So you have a db.php somewhere in your config folder which either has a syntax error, or doesn't return an array.
  • sorry i have't got the answer can u show me a example how to connect database . by using db or file which is their in config folder or how to user the developer db file to connect to data base, I have under stood most of the concept but this is the concept which i am not geting .
    Please provide with the essistence.
  • HarroHarro
    Accepted Answer
    By default, you have an empty db.php in fuel/app/config, only containing

    return array();

    Unless you have global DB settings, that have to be applied to all your environments, you should not touch this file.

    For your DB connections, you create a db.php config file in your config/<environment> folder. Unless you have set an environment, this will default to 'development'.

    You can find an example in fuel/core/config. Copy this db.php file to app/config/development, and after that add your DB settings to it.

    How is documented here: http://docs.fuelphp.com/classes/database/introduction.html#/configuration
  • Thank you, i got my answer, with this kind of support i really like it and like to promote it and tell my friends about it. 
    Thank you once again.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion