Enqueue Gumroad libs.

@since 17xxxx Gumroad libs.

@param string $which One of `overlay`, `embed`, `all`.

@return array Library details.
333492
public function enqueueGumroadLibs(string $which = 'all')
    {
        if (($data = $this->didEnqueueLibs(__METHOD__))) {
            return $data; // Did this already.
        } // We only need to enqueue once.

        if ($which === 'all' || $which === 'overlay') {
            $data = $this->enqueueGumroadOverlayLibs();
        }
        if ($which === 'all' || $which === 'embed') {
            $data = array_merge_recursive($data ?? [], $this->enqueueGumroadEmbedLibs());
        }
        return $data = $data ?? [];
    }
1201050
public function findVendorForSlug($slug)
    {
        return $this->em
            ->getRepository($this->vendorFqcn)
            ->findOneBy(array(
                'slug' => $slug,
                'organization' => $this->oh->getOrganization()
            ))
        ;
    }
714862
public function getServerFilename($which='main') {
		$filename =  $this->provider->getRealCertificatesDirectory() . $this->getFilename();
		return Functions::encodeUtf8ToFileSystem($filename);
	}
946412
public function prepareWhere($whereObject)
    {
        $where = null;
        $params = [];
        if (!empty($whereObject)) {
            $arr = [];

            /** @var \Dframe\Database\Chunk\ChunkInterface $chunk */
            foreach ($whereObject as $chunk) {
                list($wSQL, $wParams) = $chunk->build();
                $arr[] = $wSQL;
                foreach ($wParams as $k => $v) {
                    $params[] = $v;
                }
            }
            $this->setWhere = ' WHERE ' . implode(' AND ', $arr);

            if (is_array($this->setParams) and !empty($this->setParams)) {
                $this->setParams = array_merge($this->setParams, $params);
            } else {
                $this->setParams = $params;
            }
        } else {
            $this->setWhere = null;
            //$this->setParams = [];
        }

        //if (!empty($order))
        //    $this->prepareOrder($order, $sort);
        //

        return $this;
    }
11063
public function getLibraryHooks()
    {
        if (is_null($this->enabledLibraryHooks)) {
            return array_values($this->availableLibraryHooks);
        }

        return array_values(array_intersect_key(
            $this->availableLibraryHooks,
            array_flip($this->enabledLibraryHooks)
        ));
    }
1092991
public function load_routing_library( $location = null ) {
		// Set our location of our library
		$lib_location = $location ?: $this->get_config('routing')['routing_library_location'];

		// Let's first make sure that it hasn't already been loaded
		if ( !function_exists( 'respond' ) && !function_exists( 'dispatch' ) ) {
			require_once( $lib_location );
		}
	}
1025188
private function setWhereAllCallback(QueryBuilder $qb)
    {
        if (!empty($this->callbacks['WhereAll'])) {
            foreach ($this->callbacks['WhereAll'] as $callback) {
                $callback($qb);
            }
        }

        return $this;
    }
109817
public function getAllUnansweredTokens($where = '')
    {
        $select = $this->tracker->getTokenSelect();
        $select->andReceptionCodes()
                ->andRespondentTracks()
                ->andRounds(array())
                ->andSurveys(array())
                ->andTracks()
                ->forGroupId($this->getSurvey()->getGroupId())
                ->forRespondent($this->getRespondentId(), $this->getOrganizationId())
                ->onlySucces()
                ->forWhere('gsu_active = 1')
                ->forWhere('gro_active = 1 OR gro_active IS NULL')
                ->order('gtr_track_name')
                ->order('gr2t_track_info')
                ->order('gto_valid_until')
                ->order('gto_valid_from');

        $this->_addRelation($select);

        if (!empty($where)) {
            $select->forWhere($where);
        }

        return $select->fetchAll();
    }
804711
public function add($what = '.')
    {
        $this->clearAll();
        $this->addCommandName(self::GIT_ADD);
        $this->addCommandArgument('--all');
        $this->addCommandSubject($what);

        return $this->getCommand();
    }
31469
public function get_enrolment_instances($onlyenabled = false) {
        if ($this->_instances === null) {
            $this->_instances = enrol_get_instances($this->course->id, $onlyenabled);
        }
        return $this->_instances;
    }
44342
public function siblings(callable $where=null) {
		$p = $this->getParent();
		if ($p !== null) {
			foreach ($p->getChildren() as $child) {
				if ($child === $this) {
					continue;
				}
				if ($where === null || $where($child)) {
					yield $child;
				}
			}
		}
	}
1026030
protected function display_tablenav($which)
    {
        if ('top' == $which) {
            wp_nonce_field('bulk-' . $this->args['plural']);
        }
?>
    <div class="tablenav <?php echo esc_attr($which) ?>">

        <div class="alignleft actions">
            <?php $this->bulk_actions() ?>
        </div>
<?php
        $this->extra_tablenav($which);
        $this->pagination($which);
?>

        <br class="clear">
    </div>
<?php
    }
1172889
public function findAll($filterEnabled = true)
    {
        if (!$filterEnabled) {
            return parent::findAll();
        }

        $dql = '
          SELECT rt FROM Claroline\CoreBundle\Entity\Resource\ResourceType rt
          LEFT JOIN rt.plugin p
          WHERE (CONCAT(p.vendorName, p.bundleName) IN (:bundles)
          OR rt.plugin is NULL)
          AND rt.isEnabled = true';

        $query = $this->_em->createQuery($dql);
        $query->setParameter('bundles', $this->bundles);

        return $query->getResult();
    }
789519
public function findPublishedTreeForMenu($slug)
    {
        // Find published Menu by its slug
        $builder = $this->createQueryBuilder('m')
                        ->where('m.slug = :slug')->setParameter('slug', $slug)
                        ->andWhere('m.lvl = 0');
        /** @var Menu $menu */
        $menu = $builder->andWhere($builder->expr()->andX(
            $builder->expr()->isNotNull('m.startedAt'),
            $builder->expr()->lte('m.startedAt', ':now'),
            $builder->expr()->orX(
                $builder->expr()->isNull('m.endedAt'),
                $builder->expr()->gte('m.endedAt', ':now')
            )
        ))->setParameter('now', new \DateTime())->getQuery()->setMaxResults(1)->getOneOrNullResult();

        // Cannot find Menu
        if ($menu) {
            return;
        }

        // Build tree from Menu
        $builder = $this->createQueryBuilder('m')
                        ->where('m.root = :root')->setParameter('root', $menu->getId())
                        ->leftJoin('m.article', 'a')->addSelect('a')
                        ->orderBy('m.lft', 'ASC');
        $builder->andWhere($builder->expr()->andX(
            $builder->expr()->isNotNull('m.startedAt'),
            $builder->expr()->lte('m.startedAt', ':now'),
            $builder->expr()->orX(
                $builder->expr()->isNull('m.endedAt'),
                $builder->expr()->gte('m.endedAt', ':now')
            )
        ))->setParameter('now', new \DateTime());

        return $this->buildTree($builder->getQuery()->getArrayResult());
    }
1345227
public function getArchivers($isAvailable = null)
    {
        if ($isAvailable === null) {
            return $this->archivers;
        }

        $filteredArchivers = [];

        /** @var \Thelia\Core\Archiver\ArchiverInterface $archiver */
        foreach ($this->archivers as $archiver) {
            if ($archiver->isAvailable() === (bool) $isAvailable) {
                $filteredArchivers[] = $archiver;
            }
        }

        return $filteredArchivers;
    }
159820
public function enqueueGumroadEmbedLibs()
    {
        if (($data = $this->didEnqueueLibs(__METHOD__))) {
            return $data; // Did this already.
        } // We only need to enqueue once.

        $data = [
            'scripts' => [
                'gumroad-embed' => [
                    'sri'     => '', // No SRI, updated by Gumroad.
                    'url'     => '//gumroad.com/js/gumroad-embed.js',
                ],
            ],
        ];
        return $this->enqueueLibs(__METHOD__, $data);
    }
1181791
public static function getBOM(string $which)
    {
        $cname = self::class . '::' . strtoupper($which) . '_BOM';
        if (!defined($cname))
            return null;

        $bytes = constant($cname);
        $bom = '';
        foreach ($bytes as $ord)
            $bom .= chr($ord);
        return $bom;
    }