Exemplo n.º 1
0
 /**
  *
  * @return string Rendered string
  * @api
  */
 public function render()
 {
     $string = $this->arguments['string'];
     if ($string === NULL) {
         $string = $this->renderChildren();
     }
     return String::cutSuffix($string, $this->arguments['suffix']);
 }
Exemplo n.º 2
0
 public function saveRecipe($arguments)
 {
     $recipeClassName = String::classNameFromPath($arguments['recipe']);
     $recipe = new $recipeClassName();
     chdir($arguments['path']);
     $recipe->saveFields($_POST);
     $this->redirect('recipe/' . $arguments['recipe'] . '/' . $arguments['path']);
 }
Exemplo n.º 3
0
 public function getUncachedControllersValue()
 {
     $value = array();
     foreach ($this->facade->uncachedControllers as $controller => $actions) {
         foreach ($actions as $action) {
             $value[] = String::cutSuffix($controller, 'Controller') . ':' . String::cutSuffix($action, 'Action');
         }
     }
     return implode(',', $value);
 }
Exemplo n.º 4
0
 public function getActions()
 {
     $actions = array();
     foreach ($this->facade->getMethods() as $method) {
         if (!String::endsWith($method->getName(), 'Action')) {
             continue;
         }
         $actions[$method->getName()] = $method;
     }
     return $actions;
 }
Exemplo n.º 5
0
 /**
  *
  * @return string Rendered string
  * @api
  */
 public function render()
 {
     if ($this->arguments['prefix'] !== NULL) {
         $this->pushPrefix($this->arguments['prefix']);
         $output = $this->renderChildren();
         $this->popPrefix();
         return $output;
     }
     $name = $this->getPrefix();
     if ($this->arguments['name'] !== NULL) {
         $name .= '.' . $this->arguments['name'];
     }
     return String::pathToformName($name);
 }
Exemplo n.º 6
0
 public function getType()
 {
     return String::relativeClass(get_class($this));
 }
Exemplo n.º 7
0
    public function save($fieldValues)
    {
        foreach ($fieldValues as $key => $value) {
            if (isset($this->data[$key])) {
                $this->data[$key] = $value;
            }
        }
        $output = sprintf('<?php

/***************************************************************
 * Extension Manager/Repository config file for ext: "%s"
 *
 * Auto generated by famelo/soup %s
 *
 * Manual updates:
 * Only the data in the array - anything else is removed by next write.
 * "version" and "dependencies" must not be touched!
 ***************************************************************/

$EM_CONF[$_EXTKEY] = %s;', basename(WORKING_DIRECTORY), date('Y-m-d'), var_export($this->data, TRUE));
        file_put_contents('ext_emconf.php', $output);
        $namespace = '';
        if (!empty($fieldValues['company'])) {
            $namespace = $fieldValues['company'] . '\\';
        }
        $namespace .= String::underscoreToCamelcase($fieldValues['extension_key']) . '\\';
        $this->composer->setNamespace($namespace, 'Classes/');
        $this->composer->save();
    }
Exemplo n.º 8
0
 public function getType()
 {
     return String::relativeClass('\\Famelo\\Soup\\TYPO3\\ExtensionRecipe');
 }
Exemplo n.º 9
0
 public function getPrefix()
 {
     $path = trim(str_replace(array('Famelo\\Soup\\Ingredients', '\\'), array('', '-'), get_class($this)), '-') . '.' . $this->getId();
     return String::pathToformName($path);
 }