Running the installation.
@return string
324961
public function actionRun()
    {
        Yii::$app->session->set(Installation::SESSION_KEY, 0);

        if ($this->module->userComponent !== true && empty($this->module->adminId)) {
            $this->warning(Yii::t('podium/flash', "{userComponent} is set to custom but no administrator ID has been set with {adminId} parameter. Administrator privileges will not be set.", [
                'userComponent' => '$userComponent',
                'adminId' => '$adminId'
            ]));
        }
        return $this->render('run', ['version' => $this->module->version]);
    }
958913
public function run()
	{
		if (!is_dir($this->path)) {
			$message = 'The directory with CSS files was not found.';

		} elseif (!$this->findCssFiles($this->path)) {
			$message = 'The directory does not contain any CSS files.';

		} else {
			$this->applyCssRules($this->findCssFiles($this->path), $this->filename);
			$file = 'CSS file: ' . $this->filename . ' size: ' . filesize($this->filename) . ' Bytes were generated.';
		}
		return print isset($file) ? $file : $message;
	}
580814
protected function _install() {
		$this->waiting->animateMessage();

		$installTasks = $this->ConfigInstaller->getListInstallerTasks();
		$this->waiting->animateMessage();
		if (empty($installTasks)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Empty command list for action install. See config file.') . '</error>');

			return;
		}

		$installerCommands = $this->ConfigInstaller->getListInstallerCommands();
		$this->waiting->animateMessage();
		if (empty($installerCommands)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Empty command list. See config file.') . '</error>');

			return;
		}

		$tasks = array_values(array_intersect($installerCommands, $installTasks));
		$this->waiting->animateMessage();
		if (empty($tasks)) {
			$this->waiting->hideMessage();
			$this->out('<error>' . __d('cake_installer', 'Invalid command list for action install. See config file.') . '</error>');

			return;
		}

		$this->waiting->hideMessage();
		$isAppInstalled = $this->InstallerCheck->isAppInstalled(null, false);
		if ($isAppInstalled) {
			if (!$this->_checkSure(__d('cake_installer', 'Application is installed. Reinstall?'))) {
				return;
			}

			$this->InstallerCheck->removeMarkerFileIsInstalled();
		}

		$taskCount = count($tasks);
		$result = true;
		$this->progress->init([
			'total' => $taskCount,
			'width' => $this->maxWidth,
		]);
		for ($step = 0; $step < $taskCount; $step++) {
			$this->clear();
			$this->hr();
			$this->out('<info>' . __d('cake_installer', 'Intsall: step %d of %d', $step + 1, $taskCount) . '</info>');
			$this->out(null, 0);
			$this->progress->draw();
			$this->hr(1);
			$timeProcess = 0;
			$taskName = '_' . $tasks[$step];
			if (!is_callable([$this, $taskName])) {
				$result = false;
				break;
			} else {
				$timeStart = microtime(true);
				$stepResult = call_user_func([$this, $taskName], true);
				$timeEnd = microtime(true);
				$timeProcess = $timeEnd - $timeStart;
				if (is_null($stepResult)) {
					$this->out('<success>' . __d('cake_installer', 'To apply the changes, restart the installer.') . '</success>');
					$this->InstallerCheck->setNeedRestart();

					return $this->_stop();
				} elseif (!$stepResult) {
					$result = false;
					break;
				}
			}

			$this->progress->increment(1);
			if ($timeProcess < 0.2) {
				usleep(200000);
			}
		}
		if ($result) {
			$this->clear();
			$this->hr();
			$this->out('<info>' . __d('cake_installer', 'Intsall: completed') . '</info>');
			$this->out(null, 0);
			$this->progress->draw();
			$this->hr(1);
			if (!$this->InstallerCheck->isAppInstalled(null, true)) {
				$result = false;
			}
			if ($result) {
				$this->out('<info>' . __d('cake_installer', 'Running post-install actions') . '</info>');
				$this->waiting->animateMessage();
				if (!$this->InstallerCompleted->intsallCompleted()) {
					$result = false;
				}
				$this->waiting->hideMessage();
			}
		}
		if ($result) {
			$this->out('<success>' . __d('cake_installer', 'The installation process is completed successfully.') . '</success>');
		} else {
			$this->out('<error>' . __d('cake_installer', 'The installation process is completed unsuccessfully.') . '</error>');
		}
		$this->hr();
	}
508706
public function install()
    {
        $build = $this('mysql',
            $this->databases['default']['host'],
            '',
            $this->databases['default']['user'],
            $this->databases['default']['pass']);

        $main = $this('mysql',
            $this->databases['default']['host'],
            $this->databases['default']['name'],
            $this->databases['default']['user'],
            $this->databases['default']['pass']);

        $build->query('DROP DATABASE IF EXISTS `'.$this->databases['default']['name'].'`');
        $build->query('CREATE DATABASE `'.$this->databases['default']['name'].'`');

        //get schema
        $schema = $this('file', $this->cwd.'/schema.sql')->getContent();

        //add queries
        $queries = explode(';', $schema);

        $queries[] = "INSERT INTO `app` (
            `app_id`,
            `app_name`,
            `app_domain`,
            `app_token`,
            `app_secret`,
            `app_permissions`,
            `app_website`,
            `app_active`,
            `app_type`,
            `app_flag`,
            `app_created`,
            `app_updated`
        ) VALUES (
            1,
            'Main Application',
            '*.openovate.com',
            '986e7ce6bec660838491c1cd0a1f4ef6',
            'ba0d2fc7aab09dfa3463943c0aaa8551',
            '".implode(',', array(
                'public_profile',
                'public_sso',
                'personal_profile',
                'user_profile'
            ))."',
            'http://openovate.com/',
            1, NULL, 0, '2015-08-21 00:00:00', '2015-08-21 00:00:00'
        )";

        $queries[] = "INSERT INTO `auth` (
            `auth_id`,
            `auth_slug`,
            `auth_password`,
            `auth_token`,
            `auth_secret`,
            `auth_permissions`,
            `auth_facebook_token`,
            `auth_facebook_secret`,
            `auth_linkedin_token`,
            `auth_linkedin_secret`,
            `auth_twitter_token`,
            `auth_twitter_secret`,
            `auth_google_token`,
            `auth_google_secret`,
            `auth_active`,
            `auth_type`,
            `auth_flag`,
            `auth_created`,
            `auth_updated`
        ) VALUES (
            1,
            'admin@openovate.com',
            MD5('admin'),
            '986e7ce6bec660838491c1cd0a1f4ef6',
            'ba0d2fc7aab09dfa3463943c0aaa8551',
            '".implode(',', array(
                'public_profile',
                'public_sso',
                'personal_profile',
                'user_profile'
            ))."',
            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, 0,
            '2015-09-11 23:05:17', '2015-09-11 23:05:17'
        )";

        $queries[] = "INSERT INTO `profile` (
            `profile_id`,
            `profile_name`,
            `profile_email`,
            `profile_phone`,
            `profile_detail`,
            `profile_company`,
            `profile_job`,
            `profile_gender`,
            `profile_birth`,
            `profile_website`,
            `profile_facebook`,
            `profile_linkedin`,
            `profile_twitter`,
            `profile_google`,
            `profile_active`,
            `profile_type`,
            `profile_flag`,
            `profile_created`,
            `profile_updated`
        ) VALUES (
            1,
            'Admin',
            'admin@openovate.com',
            '+63 (2) 654-5110',
            NULL, NULL, NULL, NULL, NULL,
            NULL, NULL, NULL, NULL, NULL, 1, NULL,
            0, '2015-09-11 23:05:16', '2015-09-11 23:05:16')";

        $queries[] = "INSERT INTO `app_profile` (`app_profile_app`, `app_profile_profile`) VALUES (1, 1)";
        $queries[] = "INSERT INTO `auth_profile` (`auth_profile_auth`, `auth_profile_profile`) VALUES (1, 1)";

        //now call the queries
        foreach($queries as $query) {
            $lines = explode("\n", $query);

            foreach($lines as $i => $line) {
                if(strpos($line, '--') === 0 || !trim($line)) {
                    unset($lines[$i]);
                    continue;
                }
            }

            $query = trim(implode("\n", $lines));

            if(!$query) {
                continue;
            }

            $main->query($query);
        }
    }
484551
public function run()
    {
        $console = $this->console;
        $this->app->instance('console', $console);

        $this->loadBootstrap();
        $this->initializeSystemTimezone();

        $input = new ArgvInput();
        if ($input->getFirstArgument() !== 'c5:update') {
            if ($this->app->isInstalled()) {
                $this->app->setupPackageAutoloaders();
                $this->app->setupPackages();
            }
        }

        // Handle legacy backwards compatibility
        if (method_exists($console, 'setupDefaultCommands')) {
            $console->setupDefaultCommands();
        }

        \Events::dispatch('on_before_console_run');

        $console->run($input);

        \Events::dispatch('on_after_console_run');
    }
640258
public function main()
	{
		ob_start();
		$exectimeStart = microtime( true );

		if( ( $result = $this->checkEnvironment() ) !== null ) {
			return $result;
		}

		try
		{
			\Aimeos\Aimeos\Setup::execute();
			$output = ob_get_contents();
		}
		catch( Exception $e )
		{
			$output = ob_get_contents();
			$output .= PHP_EOL . $e->getMessage();
			$output .= PHP_EOL . $e->getTraceAsString();
		}

		ob_end_clean();


		return '<pre>' . $output . '</pre>' . PHP_EOL .
			sprintf( "Setup process lasted %1\$f sec</br>\n", (microtime( true ) - $exectimeStart) );
	}
438575
public function run()
    {
        $baseName = str_slug(basename(base_path()), '-');
        if ($baseName == 'src') {
            $baseName = str_slug(basename(dirname(base_path())), '-');
        }

        $application = Application::withoutGlobalScopes()->firstOrCreate([
            'name' => ucwords(str_replace('-', ' ', $baseName)),
        ]);

        ApplicationUrl::withoutGlobalScopes()->firstOrCreate([
            'domain'         => $baseName.'.test',
            'application_id' => $application->getKey(),
        ]);
    }
339788
public function run()
    {
        gc_collect_cycles();
        gc_disable();

        if ($this->dryRun) {
            $this->verbose = true;
            $this->runScripts = false;
            $this->installationManager->addInstaller(new NoopInstaller);
            $this->mockLocalRepositories($this->repositoryManager);
        }

        // TODO remove this BC feature at some point
        // purge old require-dev packages to avoid conflicts with the new way of handling dev requirements
        $devRepo = new InstalledFilesystemRepository(new JsonFile($this->config->get('vendor-dir').'/composer/installed_dev.json'));
        if ($devRepo->getPackages()) {
            $this->io->writeError('<warning>BC Notice: Removing old dev packages to migrate to the new require-dev handling.</warning>');
            foreach ($devRepo->getPackages() as $package) {
                if ($this->installationManager->isPackageInstalled($devRepo, $package)) {
                    $this->installationManager->uninstall($devRepo, new UninstallOperation($package));
                }
            }
            unlink($this->config->get('vendor-dir').'/composer/installed_dev.json');
        }
        unset($devRepo, $package);
        // end BC

        if ($this->runScripts) {
            // dispatch pre event
            $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
            $this->eventDispatcher->dispatchScript($eventName, $this->devMode);
        }

        $this->downloadManager->setPreferSource($this->preferSource);
        $this->downloadManager->setPreferDist($this->preferDist);

        // clone root package to have one in the installed repo that does not require anything
        // we don't want it to be uninstallable, but its requirements should not conflict
        // with the lock file for example
        $installedRootPackage = clone $this->package;
        $installedRootPackage->setRequires(array());
        $installedRootPackage->setDevRequires(array());

        // create installed repo, this contains all local packages + platform packages (php & extensions)
        $localRepo = $this->repositoryManager->getLocalRepository();
        if (!$this->update && $this->locker->isLocked()) {
            $platformOverrides = $this->locker->getPlatformOverrides();
        } else {
            $platformOverrides = $this->config->get('platform') ?: array();
        }
        $platformRepo = new PlatformRepository(array(), $platformOverrides);
        $repos = array(
            $localRepo,
            new InstalledArrayRepository(array($installedRootPackage)),
            $platformRepo,
        );
        $installedRepo = new CompositeRepository($repos);
        if ($this->additionalInstalledRepository) {
            $installedRepo->addRepository($this->additionalInstalledRepository);
        }

        $aliases = $this->getRootAliases();
        $this->aliasPlatformPackages($platformRepo, $aliases);

        try {
            $this->suggestedPackages = array();
            $res = $this->doInstall($localRepo, $installedRepo, $platformRepo, $aliases, $this->devMode);
            if ($res !== 0) {
                return $res;
            }
        } catch (\Exception $e) {
            $this->installationManager->notifyInstalls();

            throw $e;
        }
        $this->installationManager->notifyInstalls();

        // output suggestions if we're in dev mode
        if ($this->devMode) {
            foreach ($this->suggestedPackages as $suggestion) {
                $target = $suggestion['target'];
                foreach ($installedRepo->getPackages() as $package) {
                    if (in_array($target, $package->getNames())) {
                        continue 2;
                    }
                }

                $this->io->writeError($suggestion['source'].' suggests installing '.$suggestion['target'].' ('.$suggestion['reason'].')');
            }
        }

        # Find abandoned packages and warn user
        foreach ($localRepo->getPackages() as $package) {
            if (!$package instanceof CompletePackage || !$package->isAbandoned()) {
                continue;
            }

            $replacement = (is_string($package->getReplacementPackage()))
                ? 'Use ' . $package->getReplacementPackage() . ' instead'
                : 'No replacement was suggested';

            $this->io->writeError(
                sprintf(
                    "<warning>Package %s is abandoned, you should avoid using it. %s.</warning>",
                    $package->getPrettyName(),
                    $replacement
                )
            );
        }

        if (!$this->dryRun) {
            // write lock
            if ($this->update || !$this->locker->isLocked()) {
                $localRepo->reload();

                // if this is not run in dev mode and the root has dev requires, the lock must
                // contain null to prevent dev installs from a non-dev lock
                $devPackages = ($this->devMode || !$this->package->getDevRequires()) ? array() : null;

                // split dev and non-dev requirements by checking what would be removed if we update without the dev requirements
                if ($this->devMode && $this->package->getDevRequires()) {
                    $policy = $this->createPolicy();
                    $pool = $this->createPool(true);
                    $pool->addRepository($installedRepo, $aliases);

                    // creating requirements request
                    $request = $this->createRequest($this->package, $platformRepo);
                    $request->updateAll();
                    foreach ($this->package->getRequires() as $link) {
                        $request->install($link->getTarget(), $link->getConstraint());
                    }

                    $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::PRE_DEPENDENCIES_SOLVING, false, $policy, $pool, $installedRepo, $request);
                    $solver = new Solver($policy, $pool, $installedRepo);
                    $ops = $solver->solve($request, $this->ignorePlatformReqs);
                    $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, false, $policy, $pool, $installedRepo, $request, $ops);
                    foreach ($ops as $op) {
                        if ($op->getJobType() === 'uninstall') {
                            $devPackages[] = $op->getPackage();
                        }
                    }
                }

                $platformReqs = $this->extractPlatformRequirements($this->package->getRequires());
                $platformDevReqs = $this->devMode ? $this->extractPlatformRequirements($this->package->getDevRequires()) : array();

                $updatedLock = $this->locker->setLockData(
                    array_diff($localRepo->getCanonicalPackages(), (array) $devPackages),
                    $devPackages,
                    $platformReqs,
                    $platformDevReqs,
                    $aliases,
                    $this->package->getMinimumStability(),
                    $this->package->getStabilityFlags(),
                    $this->preferStable || $this->package->getPreferStable(),
                    $this->preferLowest,
                    $this->config->get('platform') ?: array()
                );
                if ($updatedLock) {
                    $this->io->writeError('<info>Writing lock file</info>');
                }
            }

            if ($this->dumpAutoloader) {
                // write autoloader
                if ($this->optimizeAutoloader) {
                    $this->io->writeError('<info>Generating optimized autoload files</info>');
                } else {
                    $this->io->writeError('<info>Generating autoload files</info>');
                }

                $this->autoloadGenerator->setDevMode($this->devMode);
                $this->autoloadGenerator->dump($this->config, $localRepo, $this->package, $this->installationManager, 'composer', $this->optimizeAutoloader);
            }

            if ($this->runScripts) {
                // dispatch post event
                $eventName = $this->update ? ScriptEvents::POST_UPDATE_CMD : ScriptEvents::POST_INSTALL_CMD;
                $this->eventDispatcher->dispatchScript($eventName, $this->devMode);
            }

            $vendorDir = $this->config->get('vendor-dir');
            if (is_dir($vendorDir)) {
                touch($vendorDir);
            }
        }

        return 0;
    }
247431
protected function run()
    {
        $versionString = rtrim($this->readHeaderRaw(8));
        $subVersion = round($this->readHeader('f', 4), 2);

        $version = $this->getVersion($versionString, $subVersion);

        $analysis = new Version($this->rec, $versionString, $subVersion);
        $analysis->version = $version;

        $analysis->isTrial = in_array($version, $this->trialVersions);
        $analysis->isAoK = in_array($version, $this->aokVersions);
        $analysis->isUserPatch = in_array($version, $this->userpatchVersions);
        $analysis->isUserPatch15 = $version === Version::VERSION_USERPATCH15;
        $analysis->isHDEdition = in_array($version, $this->hdVersions);
        $analysis->isHDPatch4 = $analysis->isHDEdition && $subVersion >= 12.00;
        $analysis->isAoC = $analysis->isUserPatch || $analysis->isHDEdition ||
            in_array($version, $this->aocVersions);

        $analysis->isMgl = $analysis->isAoK;
        $analysis->isMgx = $analysis->isAoC;
        $analysis->isMgz = $analysis->isUserPatch;
        // FIXME Not sure if this is the correct cutoff point.
        //
        // test/recs/versions/mgx2_simple.mgx2
        //    has subVersion == 12.31
        // test/recs/versions/MP Replay v4.3 @2015.09.11 221142 (2).msx
        //    has subVersion == 12.34
        // So it's somewhere between those two.
        $analysis->isMsx = $subVersion >= 12.32;
        $analysis->isAoe2Record = $subVersion >= 12.36;

        return $analysis;
    }
328176
public function run()
    {
        try {
            return $this
                ->preRun()
                ->check();
        } catch (Exception $e) {
            return $this
                ->setMessage($e->getMessage())
                ->setCode($e->getCode());
        }
    }
70675
public function run()
    {
        // Load in the /application/bootstrap/app.php file
        $this->loadBootstrap();

        $response = null;

        // Check if we're installed
        if ($this->app->isInstalled()) {
            // Call each step in the line
            // @todo Move these to individual middleware, this is basically a duplicated middleware pipeline
            $response = $this->trySteps([
                // Set the active language for the site, based either on the site locale, or the
                // current user record. This can be changed later as well, during runtime.
                // Start localization library.
                'setSystemLocale',

                // Set the system time zone (what should be the same as the database one)
                'initializeSystemTimezone',

                // Handle updating automatically
                'handleUpdates',

                // Set up packages first.
                // We do this because we don't want the entity manager to be loaded and we
                // want to give packages an opportunity to replace classes and load new classes
                'setupPackages',

                // Load site specific timezones. Has to come after packages because it
                // instantiates the site service, which sometimes packages need to override.
                'initializeSiteTimezone',

                // Define legacy urls, this may be the first thing that loads the entity manager
                'initializeLegacyUrlDefinitions',

                // Register legacy tools routes
                'registerLegacyRoutes',

                // Register legacy config values
                'registerLegacyConfigValues',

                // Handle loading permission keys
                'handlePermissionKeys',

                // Handle eventing
                'handleEventing',
            ]);
        } else {
            $this->initializeSystemTimezone();
        }

        // Create the request to use
        $request = $this->createRequest();

        if (!$response) {
            $response = $this->server->handleRequest($request);
        }

        // Prepare and return the response
        return $response->prepare($request);
    }
351034
public function run() {

		$categories = $this->getItems();

		if (empty($categories)) {
			return;
		}

		return $this->renderFile($this->template, [
        	'data' => [
        		'categories' => $categories,
            	'active_id' => $this->active_id,
            ],
		]);
	}
559974
public function run()
	{
		$this->say("Building library folder " . $this->libName);

		if (!file_exists($this->source))
		{
			$this->say("Folder " . $this->source . " does not exist!");

			return true;
		}

		$this->prepareDirectory();

		// Libaries are problematic.. we have libraries/name/libraries/name in the end for the build script
		$tar = $this->target;

		if (!$this->hasComponent)
		{
			$tar = $this->target . "/libraries/" . $this->libName;
		}

		$files = $this->copyTarget($this->source, $tar);

		$lib = $this->libName;

		// Workaround for libraries without lib_
		if (substr($this->libName, 0, 3) != "lib")
		{
			$lib = 'lib_' . $this->libName;
		}

		// Build media (relative path)
		$media = $this->buildMedia("media/" . $lib, $lib);
		$media->run();

		$this->addFiles('media', $media->getResultFiles());

		// Build language files for the component
		$language = $this->buildLanguage($lib);
		$language->run();

		// Copy XML
		$this->createInstaller($files);

		return true;
	}
7149
public function run()
	{
		// Start handling errors before doing anything else
		if ($this->has('error'))
		{
			array_walk($this->serviceProviders, function($p)
			{
				if (method_exists($p, 'startHandling'))
				{
					return $p->startHandling();
				}
			});
		}

		// Boot the application
		//
		// This allows service providers to finish performing any
		// needed setup.
		$this->boot();

		// Initialise
		if (!$this->runningInConsole() && $this->has('dispatcher'))
		{
			$this['dispatcher']->trigger('system.onAfterInitialise');

			if ($this->has('profiler') && $this->get('profiler'))
			{
				$this['profiler']->mark('afterInitialise');
			}
		}

		// Create a new stack and bind to application then
		$this['stack'] = new Stack($this);

		// Send request throught stack and finally send response
		$this['stack']
			->send($this['request'])
			->through($this->middleware($this->serviceProviders))
			->then(function($request, $response)
			{
				$response->prepare($request);
				$response->send();
			});
	}
66587
public function install()
    {
        $definition = $this->file->read();
        $excluded   = $definition['archive']['exclude'] ?? [];

        $excluded = array_map(
            function (string $exclude): string {
                return substr($exclude, 0, 1) !== '/'
                    ? '/' . $exclude
                    : $exclude;
            },
            $excluded
        );

        $files = array_merge(
            $this->defaults,
            array_map(
                function (FileMappingInterface $mapping): string {
                    return '/' . $mapping->getRelativeDestination();
                },
                iterator_to_array(
                    $this->resolver->resolve()
                )
            )
        );

        foreach ($files as $file) {
            if (!in_array($file, $excluded)
                && file_exists($this->destination . $file)
            ) {
                $excluded[] = $file;
                $this->io->write(
                    sprintf(
                        '<info>Added:</info> %s to archive exclude in composer.json',
                        $file
                    )
                );
            }
        }

        $definition['archive']['exclude'] = $excluded;
        $this->file->write($definition);
    }
618018
public function run()
    {
        $template = $this->twig->load('cloudbuild.yaml.tmpl');
        $context = [
            'cloud_sql_instances' => $this->cloudSqlInstances,
            'cloud_sql_proxy_image' => self::CLOUD_SQL_PROXY_IMAGE,
            'target_image' => $this->image,
            'commands' => implode(
                ',',
                array_map('escapeshellarg', $this->commands)
            )
        ];
        $cloudBuildYaml = $template->render($context);
        file_put_contents("$this->workdir/cloudbuild.yaml", $cloudBuildYaml);
        list($result, $cmdOutput) = $this->gcloud->exec(
            [
                'container',
                'builds',
                'submit',
                "--config=$this->workdir/cloudbuild.yaml",
                "$this->workdir"
            ]
        );
        file_put_contents(
            "$this->workdir/cloudbuild.log",
            implode(PHP_EOL, $cmdOutput)
        );
        if ($result !== 0) {
            throw new \RuntimeException("Failed to run the command");
        }
        $ret = '';
        if ($this->cloudSqlInstances) {
            $targetStep = 'Step #3';
        } else {
            $targetStep = 'Step #1';
        }
        foreach ($cmdOutput as $line) {
            if (\strpos($line, $targetStep) !== false) {
                $ret .= $line . PHP_EOL;
            }
        }
        return $ret;
    }
1020093
public function run()
	{
		$this->say('Building template: ' . $this->templateName);

		// Prepare directories
		$this->prepareDirectories();

		$files = $this->copyTarget($this->source, $this->target);

		// Build media (relative path)
		$media = $this->buildMedia("media/" . $this->templateName, $this->templateName);
		$media->run();

		$this->addFiles('media', $media->getResultFiles());

		// Build language files for the component
		$language = $this->buildLanguage('tpl_' . $this->templateName);
		$language->run();

		// Update XML and script.php
		$this->createInstaller($files);

		return true;
	}