@var string

@return array

@throws \marvin255\bxmigrate\migrate\Exception
434663
protected function UserGroupDelete($groupName)
    {
        $return = [];
        $id = $this->UserGetGroupIdByCode($groupName);
        if ($id) {
            $group = new CGroup();
            if ($group->Delete($id)) {
                $return[] = "Delete group {$groupName}";
            } else {
                throw new Exception("Can't delete group {$groupName}");
            }
        } else {
            throw new Exception("Group {$groupName} does not exist");
        }

        return $return;
    }
570835
public function generateMigration(): string
    {
        return $this->view->renderFile(Yii::getAlias($this->templateFile), [
            'table' => $this->table,
            'className' => $this->className,
            'namespace' => $this->normalizedNamespace
        ]);
    }
1132235
public function getFlashVarsAsString()
    {
        $params=array();
        foreach($this->flashVars as $k=>$v)
        {
            if(!is_string($v))
                $v = json_encode($v);
            $params[] = $k.':"'.urlencode($v).'"';
        }

        if(!array_key_exists('baseUrl', $this->flashVars))
            $params[] = 'baseUrl:"'.urlencode($this->baseUrl).'"';

        if(!array_key_exists('moduleBaseUrl', $this->flashVars))
            $params[] = 'moduleBaseUrl:"'.urlencode($this->moduleBaseUrl).'"';

        if(!array_key_exists('rslBaseUrl', $this->flashVars))
            $params[] = 'rslBaseUrl:"'.urlencode($this->rslBaseUrl).'"';

        if(!array_key_exists('locale', $this->flashVars))
            $params[] = 'locale:"'.urlencode($this->getFlexLocale(Yii::$app->language)).'"';

        return implode(',',$params);
    }
452266
public function getExportModes()
    {
        return array(
            'listHandle' =>         ExportableField::LIST_OF
                                    + ExportableField::HANDLE,
            'listValue' =>          ExportableField::LIST_OF
                                    + ExportableField::VALUE,
            'listHandleToValue' =>  ExportableField::LIST_OF
                                    + ExportableField::HANDLE
                                    + ExportableField::VALUE,
            'getPostdata' =>        ExportableField::POSTDATA
        );
    }
981712
public function getMigrations( )
    {
        $migrations = array();
        
        $dir = opendir( $this->migrationPath );
        
        while ( ( $file = readdir( $dir ) ) !== FALSE )
        {
            if ( '.' !== $file && '..' !== $file )
            {
                $migrations[] = str_replace( '.php', '', $file );
            }
        }
        
        closedir( $dir );
        
        usort( $migrations, array( $this, '_sortMigrations' ) );
        
        return $this->filter( self::ON_GET_MIGRATIONS_FILTER, $migrations );
    }
809134
public function toString()
    {

        $preApproval = array();
        $preApproval['code'] = $this->code;
        $preApproval['email'] = $this->sender ? $this->sender->getEmail() : "null";
        $preApproval['date'] = $this->date;
        $preApproval['reference'] = $this->reference;
        $preApproval['status'] = $this->status ? $this->status->getValue() : "null";
        $preApproval['charge'] = $this->charge;
        $preApproval['tracker'] = $this->tracker;
     
        $preApproval = "PreApproval: " . var_export($preApproval, true);

        return $preApproval;

    }
584333
public static function varToText($var) {
				
		$type = gettype($var);
		$text = is_null($type) ? 'NULL' : $type . ':';
		
		switch ($type) {

			case 'boolean':
				$text .= $var ? 'TRUE' : 'FALSE';
				break;

			default:
				$text .= $var;
				break;
				
			case 'array':
				$parts = array();
				foreach ($var as $k=>$v) {
					$parts[] = $k . '=>' . self::varToText($v);
				}
				$text .= 'array:[' . implode(',', $parts) . ']';
				break;
				
			case 'object':
				$text .= get_class($var);
				break;
				
			case 'NULL':
				break;

		}
					
		return $text;
		
	}
1030302
protected function getMigrationPath()
    {
        // First, try the non-interactive option:
        $path = $this->getOption('path');

        if (!empty($path)) {
            return $path;
        }

        $paths = $this->getConfig()->getMigrationPaths();

        // No paths? That's a problem.
        if (empty($paths)) {
            throw new \InvalidArgumentException('No migration paths set in your migrate configuration file.');
        }

        $paths = Util::globAll($paths);

        if (empty($paths)) {
            throw new \InvalidArgumentException(
                'You probably used curly braces to define migration path in your migrate configuration file, ' .
                'but no directories have been matched using this pattern. ' .
                'You need to create a migration directory manually.'
            );
        }

        // Only one path set, so select that:
        if (1 === \count($paths)) {
            return \current($paths);
        }

        // Ask the user which of their defined paths they'd like to use:
        return $this->getPrompter()->choose('Which migrations path would you like to use?', $paths);
    }
905195
protected function getMigrationPath(): string
    {
        if (! $this->laravel->files->exists($path = $this->laravel['path'].DIRECTORY_SEPARATOR.$this->moduleName())) {
            throw new \Exception("Invalid path: {$path}");
        }

        return $path.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'migrations';
    }
963148
public function migrate()
    {
        // find migrations
        $folders = $this->app->pathfinder->search('dbupdates', '', 'path');
        // todo - sort files in folders
        foreach ($folders as $dir) {
            $files = scandir($dir);
            sort($files);
            foreach ($files as $name) {
                if (strtolower(substr($name, -4)) != '.sql') {
                    continue;
                }
                $q = $this->db->dsql()
                    ->table('_db_update')
                    ->where('name', strtolower($name))
                    ->field('status');
                if ($q->getOne() === 'ok') {
                    continue;
                }
                $migration = file_get_contents($dir.'/'.$name);
                $q->set('name', strtolower($name));
                try {
                    $this->db->dbh->exec($migration);
                    $q->set('status', 'ok')->replace();
                } catch (Exception $e) {
                    $q->set('status', 'fail')->replace();
                    if (!$e instanceof BaseException) {
                        $e = $this->exception()
                            ->addMoreInfo('Original error', $e->getMessage());
                    }
                    throw $e->addMoreInfo('file', $name);
                }
            }
        }

        return $this;
    }
775225
public function getVars()
    {
        $vars = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);

        $vars->env = $_ENV;
        $vars->server = $_SERVER;
        $vars->session = $_SESSION;
        $vars->cookies = $_COOKIE;
        $vars->get = $_GET;
        $vars->post = $_POST;
        $vars->files = $_FILES;

        if (function_exists('apache_request_headers')) {
            $vars->headers = apache_request_headers();
        } elseif (function_exists('getallheaders')) {
            $vars->headers = getallheaders();
        } else {
            $vars->headers = [];
            foreach ($_SERVER as $name => $value) {
                if (substr($name, 0, 5) == 'HTTP_') {
                    $vars->headers[ str_replace(' ', '-',
                        ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))) ] = $value;
                }
            }
        }

        return $vars;
    }
1029835
private function getOnceVarName()
    {
        $name = (string) $this->getRequiredParameter('name');
        $varName = preg_replace('/[^a-zA-Z0-9_]+/i', '', $name);
        if (empty($varName))
            throw new Exception('variable name [' . $name . '] is invalid');

        return $varName;
    }
428312
protected function executedMigrations()
    {
        $result = [];
        foreach ($this->getRepository()->get() as $row) {
            $result[] = $row['migration'];
        }

        return $result;
    }
1208452
public function getRanMigrations()
    {
        $migrations = [];

        $dbRes = $this->db->query("SELECT MIGRATION FROM {$this->table} ORDER BY ID ASC");
        while ($result = $dbRes->fetch()) {
            $migrations[] = $result['MIGRATION'];
        }

        return $migrations;
    }
940530
private function extractGettextStrings()
    {
        $translation = null;
        $translationObjects = array();
        $lookupDirectories = array(
            Strata::getVendorPath() . 'strata-mvc' . DIRECTORY_SEPARATOR . 'strata' . DIRECTORY_SEPARATOR . 'src',
            Strata::getSrcPath(),
            Strata::getThemesPath(),
        );

        foreach ($lookupDirectories as $directory) {
            $translationObjects = $this->recurseThroughDirectory($directory);

            // Merge all translation objects into a bigger one
            foreach ($translationObjects as $t) {
                if (is_null($translation)) {
                    $translation = $t;
                } else {
                    $translation->mergeWith($t);
                }
            }
        }

        return $translation;
    }
1134126
public function toArray()
    {
        if ($this->jobIdPrefix) {
            $this->config['jobReference']['jobId'] = sprintf(
                '%s-%s',
                $this->jobIdPrefix,
                $this->config['jobReference']['jobId']
            );
        }

        return $this->config;
    }
52515
public function toJavaScript()
    {
        $lines = [];

        foreach (get_object_vars($this) as $key => $value) {
            if (!is_null($value)) {
                $line = $key . ": ";

                if ($key == 'version') {
                    $line .= 'new Version({ ' . $value->toJavaScript() . ' })';
                } elseif ($key == 'family') {
                    $line .= 'new Family({ ' . $value->toJavaScript() . ' })';
                } elseif ($key == 'using') {
                    $line .= 'new Using({ ' . $value->toJavaScript() . ' })';
                } else {
                    switch (gettype($value)) {
                        case 'boolean':
                            $line .= $value ? 'true' : 'false';
                            break;
                        case 'string':
                            $line .= '"' . addslashes($value) . '"';
                            break;
                        case 'integer':
                            $line .= $value;
                            break;
                    }
                }

                $lines[] = $line;
            }
        }

        return implode($lines, ", ");
    }