src/Chee/Module/CheeModule.php
protected function checkRequires($modulePath)
    {
        $requires = $this->getConfig('requires', array());

        foreach($requires as $key => $value)
        {
            if (is_array($value))
            {
                if (!$this->files->exists($modulePath.'/'.$key))
                {
                    $this->errors->add($this->configFile, $this->configFile.' is corrupted.');
                    return false;
                }
                $jsonFile = json_decode($this->app['files']->get($modulePath.'/'.$key), true);
                foreach($value as $key)
                {
                    if (is_array($jsonFile))
                    {
                        if (!array_key_exists($key, $jsonFile) || empty($jsonFile[$key]))
                        {
                            $this->errors->add('module_requires', 'This module has not requires files');
                            return false;
                        }
                    }
                    else
                    {
                        $this->errors->add($this->configFile, $this->configFile.' is corrupted.');
                        return false;
                    }
                }
            }
            else
            {
                if (!$this->files->exists($modulePath.'/'.$value))
                {
                    $this->errors->add('module_requires', 'This module has not requires files');
                    return false;
                }
            }
        }
        return true;
    }
protected function checkRequires($modulePath)
    {
        $requires = $this->getConfig('requires', array());

        foreach($requires as $key => $value)
        {
            if (is_array($value))
            {
                if (!$this->files->exists($modulePath.'/'.$key))
                {
                    $this->errors->add($this->configFile, $this->configFile.' is corrupted.');
                    return false;
                }
                $jsonFile = json_decode($this->app['files']->get($modulePath.'/'.$key), true);
                foreach($value as $key)
                {
                    if (is_array($jsonFile))
                    {
                        if (!array_key_exists($key, $jsonFile) || empty($jsonFile[$key]))
                        {
                            $this->errors->add('module_requires', 'This module has not requires files');
                            return false;
                        }
                    }
                    else
                    {
                        $this->errors->add($this->configFile, $this->configFile.' is corrupted.');
                        return false;
                    }
                }
            }
            else
            {
                if (!$this->files->exists($modulePath.'/'.$value))
                {
                    $this->errors->add('module_requires', 'This module has not requires files');
                    return false;
                }
            }
        }
        return true;
    }
protected function checkRequires ( $ modulePath ) { $ requires = $ this -> getConfig ( 'requires' , array ( ) ) ; foreach ( $ requires as $ key => $ value ) { if ( is_array ( $ value ) ) { if ( ! $ this -> files -> exists ( $ modulePath . '/' . $ key ) ) { $ this -> errors -> add ( $ this -> configFile , $ this -> configFile . ' is corrupted.' ) ; return false ; } $ jsonFile = json_decode ( $ this -> app [ 'files' ] -> get ( $ modulePath . '/' . $ key ) , true ) ; foreach ( $ value as $ key ) { if ( is_array ( $ jsonFile ) ) { if ( ! array_key_exists ( $ key , $ jsonFile ) || empty ( $ jsonFile [ $ key ] ) ) { $ this -> errors -> add ( 'module_requires' , 'This module has not requires files' ) ; return false ; } } else { $ this -> errors -> add ( $ this -> configFile , $ this -> configFile . ' is corrupted.' ) ; return false ; } } } else { if ( ! $ this -> files -> exists ( $ modulePath . '/' . $ value ) ) { $ this -> errors -> add ( 'module_requires' , 'This module has not requires files' ) ; return false ; } } } return true ; }
Check module has required file

@param string $modulePath
@return bool
Check module has required file