Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
An error occurs at log folder change
  • I am glad to meet you.

    My English ability is not native level.

    I use FuelPHP1.8. thank you.

    When a log folder change, it seems to have possibilities to become the error.

    When plural is_dir and mkdir are performed to a multi thread, an exception in mkdir.

    I made a modified cord. would like an opinion.

    Fuel\Core\Log::initialize

    before

        if ( ! is_dir($rootpath))
        {
             mkdir($rootpath, 0777, true);
             chmod($rootpath, $permission);
        }
        if ( ! is_dir($filepath))
        {
             mkdir($filepath, 0777, true);
             chmod($filepath, $permission);
        }

    modified

        if ( ! is_dir($rootpath))
        {
             try{
                  mkdir($rootpath, 0777, true);
             }catch( \PhpErrorException $e ){
                  if( ! is_dir($rootpath) ) throw $e;
             }
             chmod($rootpath, $permission);
        }
        if ( ! is_dir($filepath))
        {
             try{
                  mkdir($filepath, 0777, true);
             }catch( \PhpErrorException $e ){
                  if( ! is_dir($filepath) ) throw $e;
             }
             chmod($filepath, $permission);
        }

  • Has been fixed here: https://github.com/fuel/core/compare/8b07b26ab045...c4fe3b4caec7

    You might need to switch to 1.9/develop or to backport it manually, pending a new hotfix release.
  • Thank you.

    I look forward to 1.9 release.

Howdy, Stranger!

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

In this Discussion