Checks if we are dealing with joomlatools/platform or not

@param string $base Base path for the Joomla installation
@return boolean
170266
public static function isPlatform($base)
    {
        $manifest = realpath($base . '/composer.json');

        if (file_exists($manifest))
        {
            $contents = file_get_contents($manifest);
            $package  = json_decode($contents);

            if ($package->name == 'joomlatools/platform') {
                return true;
            }
        }

        return false;
    }
277535
public function find($base)
    {
        $base = rtrim($base, '/');
        // Special case for a base path of /, eg. a chroot environment
        if ($base === '') {
            $base = '/';
        }

        $paths = array(array($base, 0));
        $found = array();

        $fileCallback = $this->getOption('file_callback');
        $dirCallback  = $this->getOption('dir_callback');

        while ($path = array_shift($paths)) {
            list($path, $depth) = $path;

            foreach (scandir($path) as $basename) {
                if ($basename == '.' || $basename == '..') {
                    continue;
                }

                if (is_dir("$path/$basename")) {
                    if (!$this->acceptDir($basename, "$path/$basename", $depth + 1)) {
                        continue;
                    }

                    if ($dirCallback) {
                        call_user_func(
                            $dirCallback,
                            $basename,
                            "$path/$basename",
                            $depth + 1
                        );
                    }

                    $paths[] = array("$path/$basename", $depth + 1);
                } else {
                    if (!$this->acceptFile($basename, "$path/$basename", $depth)) {
                        continue;
                    }

                    if ($fileCallback) {
                        call_user_func(
                            $fileCallback,
                            $basename,
                            "$path/$basename",
                            $depth
                        );
                    }

                    $found[] = "$path/$basename";
                }
            }
        }

        return $found;
    }
1123273
public function run($base = null)
    {
        if (empty($base)) {
            $base = PUBLIC_PATH;
        }

        // Check if the File dataobject has a "Filename" field.
        // If not, cannot migrate
        /** @skipUpgrade */
        if (!DB::get_schema()->hasField('File', 'Filename')) {
            return 0;
        }

        // Set max time and memory limit
        Environment::increaseTimeLimitTo();
        Environment::increaseMemoryLimitTo();

        // Loop over all files
        $processedCount = $migratedCount = 0;
        $originalState = null;
        if (class_exists(Versioned::class)) {
            $originalState = Versioned::get_reading_mode();
            Versioned::set_stage(Versioned::DRAFT);
        }

        $query = $this->getFileQuery();
        $total = $query->count();
        foreach ($query as $file) {
            // Bypass the accessor and the filename from the column
            $filename = $file->getField('Filename');

            $success = $this->migrateFile($base, $file, $filename);

            if ($processedCount % $this->config()->get('log_interval') === 0) {
                if ($this->logger) {
                    $this->logger->info("Iterated $processedCount out of $total files. Migrated $migratedCount files.");
                }
            }

            $processedCount++;
            if ($success) {
                $migratedCount++;
            }
        }
        if (class_exists(Versioned::class)) {
            Versioned::set_reading_mode($originalState);
        }
        return $migratedCount;
    }
1226323
function hostSupports(platform) {
    var p = platforms[platform] || {},
        hostos = p.hostos || null;
    if (!hostos)
        return true;
    if (hostos.indexOf('*') >= 0)
        return true;
    if (hostos.indexOf(process.platform) >= 0)
        return true;
    return false;
}
399179
public function hasCommandOptions($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (count($this->commandOptions) > 0) {
            return true;
        }

        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->hasCommandOptions();
        }

        return false;
    }
312537
protected function classIs($class, $base)
    {
        if (is_array($base)) {
            foreach ($base as $nextBase) {
                if ($this->classIs($class, $nextBase)) {
                    return true;
                }
            }
            return false;
        }

        // Check single origin
        return $class === $base || is_subclass_of($class, $base);
    }
669071
public static function startsWith(string $base, string $starts) : bool
    {
        if(
            $starts === "" ||
            strrpos($base, $starts, -strlen($base)) !== false
        ) {
            return true;
        }

        return false;
    }
193326
protected function isValidBase($base) {
    return strlen($base) > 1 && isset($this->partOfSpeech->getWordsList()[$base]) && $this->partOfSpeech->getWordsList()[$base] === $base;
  }
392583
private function isBaseUrl($url)
    {
        if ($url === static::BASE_URL_IDENTIFIER
            || array_key_exists($url, $this->urlMappings) && $this->baseUrl === $this->urlMappings[$url]
        ) {
            return true;
        }

        return false;
    }
646616
public function findCommonRadixRoot(NumberBase $base)
    {
        $common = array_intersect($this->getRadixRoots(), $base->getRadixRoots());

        return count($common) > 0 ? max($common) : false;
    }
1023230
protected function getTranslationPathBaseDirectory($base, $lang = null)
    {
        if (empty($lang)) {
            $lang = $this->getLanguage();
        }

        if (!empty($this->pluginName)) {

            if ($base == 'tmp') {
                return sprintf('%s/plugins/%s/lang/%s.json', StaticContainer::get('path.tmp'), $this->pluginName, $lang);
            } else {
                return sprintf('%s/lang/%s.json', Manager::getPluginDirectory($this->pluginName), $lang);
            }
        }

        if ($base == 'tmp') {
            return sprintf('%s/%s.json', StaticContainer::get('path.tmp'), $lang);
        }

        return sprintf('%s/%s/%s.json', PIWIK_INCLUDE_PATH, $base, $lang);
    }
272597
public function isAvailable( MShop_Order_Item_Base_Interface $base )
	{
		$price = $base->getPrice();
		$currency = $price->getCurrencyId();
		$value = $price->getValue() + $price->getRebate();

		$minvalue = $this->_getConfigValue( 'basketvalues.total-value-min', array() );

		if( isset( $minvalue[$currency] ) && $minvalue[$currency] > $value ) {
			return false;
		}

		$maxvalue = $this->_getConfigValue( 'basketvalues.total-value-max', array() );

		if( isset( $maxvalue[$currency] ) && $maxvalue[$currency] < $value ) {
			return false;
		}

		return parent::isAvailable( $base );
	}
1325657
protected function isPartOfJoomla($file)
    {
        foreach (static::$joomlaPaths as $joomlaPath) {
            $file = realpath($file);

            if (strpos($file, $joomlaPath) === 0) {
                return true;
            }
        }

        return false;
    }
840687
protected function aboveLevel($level, $base)
    {
        $levelOrder = $this->getLogLevelOrder();
        $baseIndex = array_search($base, $levelOrder);
        $levelIndex = array_search($level, $levelOrder);

        return $levelIndex >= $baseIndex;
    }
1225905
protected function setPlatform()
    {
        if (is_array(static::$platforms) && count(static::$platforms) > 0) {
            foreach (static::$platforms as $key => $val) {
                if (preg_match('|' . preg_quote($key) . '|i', $this->string)) {
                    $this->platform = $val;

                    return true;
                }
            }
        }

        $this->platform = 'Unknown Platform';

        return false;
    }
630723
public static function getJoomlaVersion($base)
    {
        $key = md5($base);

        if (!isset(self::$_versions[$key]))
        {
            $canonical = function($version) {
                if (isset($version->RELEASE)) {
                    return 'v' . $version->RELEASE . '.' . $version->DEV_LEVEL;
                }

                // Joomla 3.5 and up uses constants instead of properties in JVersion
                $className = get_class($version);
                if (defined("$className::RELEASE")) {
                    return $version::RELEASE . '.' . $version::DEV_LEVEL;
                }

                return 'unknown';
            };

            $files = array(
                'joomla-cms'           => '/libraries/cms/version/version.php',
                'joomla-cms-new'       => '/libraries/src/Version.php', // 3.8+
                'joomlatools-platform' => '/lib/libraries/cms/version/version.php',
                'joomla-1.5'           => '/libraries/joomla/version.php'
            );

            $code        = false;
            $application = false;
            foreach ($files as $type => $file)
            {
                $path = $base . $file;

                if (file_exists($path))
                {
                    $code        = $path;
                    $application = $type;

                    break;
                }
            }

            if ($code !== false)
            {
                if (!defined('JPATH_PLATFORM')) {
                    define('JPATH_PLATFORM', self::buildTargetPath('/libraries', $base));
                }

                if (!defined('_JEXEC')) {
                    define('_JEXEC', 1);
                }

                $identifier = uniqid();

                $source = file_get_contents($code);
                $source = preg_replace('/<\?php/', '', $source, 1);

                $pattern     = $application == 'joomla-cms-new' ? '/class Version/i' : '/class JVersion/i';
                $replacement = $application == 'joomla-cms-new' ? 'class Version' . $identifier : 'class JVersion' . $identifier;

                $source = preg_replace($pattern, $replacement, $source);

                eval($source);

                $class   = $application == 'joomla-cms-new' ? '\\Joomla\\CMS\\Version'.$identifier : 'JVersion'.$identifier;
                $version = new $class();

                self::$_versions[$key] = (object) array('release' => $canonical($version), 'type' => $application);
            }
            else self::$_versions[$key] = false;
        }

        if (!self::$_versions[$key] && self::isKodekitPlatform($base)) {
            self::$_versions[$key] = (object) array('type' => 'kodekit-platform', 'release' => 'n/a');
        }
        
        return self::$_versions[$key];
    }
1191009
public function getPlatform()
    {
        if (null === $this->platform) {
            // try to load the platform from the table
            $table = $this->getTable();
            if ($table && $database = $table->getDatabase()) {
                $this->setPlatform($database->getPlatform());
            }
        }

        if (!$this->table->isIdentifierQuotingEnabled()) {
            $this->platform->setIdentifierQuoting(false);
        }

        return $this->platform;
    }