Frontend\Core\Engine\Language::getActiveLanguages PHP Метод

getActiveLanguages() публичный статический Метод

Get the active languages
public static getActiveLanguages ( ) : array
Результат array
    public static function getActiveLanguages()
    {
        trigger_error('Frontend\\Core\\Engine\\Language is deprecated.
             It has been moved to Frontend\\Core\\Language\\Language', E_USER_DEPRECATED);
        return parent::getActiveLanguages();
    }

Usage Example

Пример #1
0
 /**
  * This method exists because the service container needs to be set before
  * the page's functionality gets loaded.
  */
 public function initialize()
 {
     // because some cronjobs will be run on the command line we should pass parameters
     if (isset($_SERVER['argv'])) {
         // init var
         $first = true;
         // loop all passes arguments
         foreach ($_SERVER['argv'] as $parameter) {
             // ignore first, because this is the scripts name.
             if ($first) {
                 // reset
                 $first = false;
                 // skip
                 continue;
             }
             // split into chunks
             $chunks = explode('=', $parameter, 2);
             // valid parameters?
             if (count($chunks) == 2) {
                 // build key and value
                 $key = trim($chunks[0], '--');
                 $value = $chunks[1];
                 // set in GET
                 if ($key != '' && $value != '') {
                     $_GET[$key] = $value;
                 }
             }
         }
     }
     // define the Named Application
     if (!defined('NAMED_APPLICATION')) {
         define('NAMED_APPLICATION', 'Backend');
     }
     // set the module
     $this->setModule(\SpoonFilter::toCamelCase(\SpoonFilter::getGetValue('module', null, '')));
     // set the requested file
     $this->setAction(\SpoonFilter::toCamelCase(\SpoonFilter::getGetValue('action', null, '')));
     // set the language
     $this->setLanguage(\SpoonFilter::getGetValue('language', FrontendLanguage::getActiveLanguages(), SITE_DEFAULT_LANGUAGE));
     // mark cronjob as run
     $cronjobs = (array) $this->get('fork.settings')->get('Core', 'cronjobs');
     $cronjobs[] = $this->getModule() . '.' . $this->getAction();
     $this->get('fork.settings')->set('Core', 'cronjobs', array_unique($cronjobs));
     $this->execute();
 }
All Usage Examples Of Frontend\Core\Engine\Language::getActiveLanguages