Enqueue Pako libs.

@since 170128.18158 Pako libs.

@param string $which Which library?

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

        if ($which === 'base') {
            $data = [
                'scripts' => [
                    'pako' => [
                        'version' => '1.0.4',
                        'url'     => '//cdnjs.cloudflare.com/ajax/libs/pako/%1$s/pako.min.js',
                    ],
                ],
            ];
        } elseif ($which === 'deflate') {
            $data = [
                'scripts' => [
                    'pako-deflate' => [
                        'version' => '1.0.4',
                        'url'     => '//cdnjs.cloudflare.com/ajax/libs/pako/%1$s/pako_deflate.min.js',
                    ],
                ],
            ];
        } elseif ($which === 'inflate') {
            $data = [
                'scripts' => [
                    'pako-inflate' => [
                        'version' => '1.0.4',
                        'url'     => '//cdnjs.cloudflare.com/ajax/libs/pako/%1$s/pako_inflate.min.js',
                    ],
                ],
            ];
        }
        return $this->enqueueLibs(__METHOD__, $data);
    }
1260115
public function close($which = null)
    {
        if (! $this->buffers->count()) {
            throw new LogicException('It is not possible to close a never opened block.');
        }
        list($buffer, $name) = $this->buffers->pop();
        if (! is_null($which) && $which !== $name) {
            throw new InvalidArgumentException(
                "Please close blocks in order: you need to close other block(s) before \"{$which}\"."
            );
        }
        $output = $buffer instanceof Block ? $buffer->close() : '';

        return $output;
    }
123676
function addLib($name) {
        if (isset($this->_libs[$name])) return;
        if (isset(self::$libs[$name])) {
            $this->_libs[$name] = true;
            $this->addFromArray(self::$libs[$name]);
        }
    }
41958
protected function getListLibrary()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->library->getList();
            $this->limitArray($list);
            return $list;
        }


        $library = $this->library->get($id);

        if (empty($library)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($library);

    }
243876
public static function listLibraries($type)
    {
        $home = Phing::getProperty(Phing::PHING_HOME);
        if ($home == null) {
            return [];
        }
        $currentWorkingDir = getcwd();
        chdir($home);
        exec('composer show --' . $type, $packages, $code);
        chdir($currentWorkingDir);

        return $packages;
    }
994530
protected function getLibrariesInUse()
    {
        $aNames = $this->getOption('dialogs.libraries', array());
        if(!is_array($aNames))
        {
            $aNames = array();
        }
        $libraries = array();
        foreach($aNames as $sName)
        {
            if(($library = $this->getLibrary($sName)))
            {
                $libraries[$library->getName()] = $library;
            }
        }
        if(($library = $this->getModalLibrary()))
        {
            $libraries[$library->getName()] = $library;
        }
        if(($library = $this->getAlertLibrary()))
        {
            $libraries[$library->getName()] = $library;
        }
        if(($library = $this->getConfirmLibrary()))
        {
            $libraries[$library->getName()] = $library;
        }
        return $libraries;
    }
663377
public function getForm( $which )
    {
        $which      = ucfirst( $which );
        $service    = $this->getServiceLocator();
        $locale     = $service->get( 'Locale' );
        $router     = $service->get( 'Router' );
        $request    = $service->get( 'Request' );

        $form = $service->get( 'Form' )
                        ->create( 'Grid\User\\' . $which, array(
                            'returnUri' => $request->getRequestUri()
                        ) );

        $form->setAttribute( 'action', $router->assemble(
            array( 'locale' => $locale->getCurrent() ),
            array( 'name'   => 'Grid\\User\\Authentication\\' . $which )
        ) );

        return $form;
    }
1190550
public function where($where = null)
    {
        if ($where === null) {
            return $this->where;
        }
        $this->where = $where;

        return $this->where;
    }
143320
public function findBy(array $where, array $orderBy = null, $limit = null, $offset = null)
    {
        return $this->getRepository()->findBy($where, $orderBy, $limit, $offset);
    }
979485
protected static function getLibraryPackage(OperationInterface $operation)
    {
        $package = static::getOperationPackage($operation);
        $data = null;

        if ($package && !static::isAsset($package)) {
            $data = $package;
        }

        return $data;
    }
321474
public function getBy(array $where = [], array $with = [])
    {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        return $query->get();
    }
31472
public function get(
        $where = null,
        $order = null,
        $limit = null,
        $offset = null,
        $columns = null,
        $group = null,
        $having = null
    ) {
        $result = parent::get($where, $order, $limit, $offset, $columns, $group, $having);
        return $result;
    }
34260
protected function findIterator( $where = null, $order = null )
    {
        $names = $this->queryNames( $where );

        if ( null !== $order && '' !== $order )
        {
            sort( $names, SORT_NATURAL );

            if ( ! $order )
            {
                $names = array_reverse( $names );
            }
        }

        return new StructureList( $this, $names );
    }
281267
protected function get_document_converter_classes($from, $to) {
        $classes = [];

        $converters = $this->get_enabled_plugins();
        foreach ($converters as $plugin => $classname) {
            if (!class_exists($classname)) {
                continue;
            }

            if (!$classname::are_requirements_met()) {
                continue;
            }

            if ($classname::supports($from, $to)) {
                $classes[] = $classname;
            }
        }

        return $classes;
    }
1132415
private function getAvailableDiscussionTypesPlugins()
	{
		// TODO : it would be more elegant to use array_filter
		$available = [];
		foreach (Gdn::pluginManager()->availablePlugins() as $name => $spec) {
			if (strpos($name, 'DiscussionType_') === 0 && isset($spec['DiscussionTypes'])) {
				$available[$name] = $spec;
			}
		}

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

        $data = [
            'styles' => [
                'devicons' => [
                    'version' => '4f6a4b08efdad6bb29f9cc801f5c07e263b39907',
                    'url'     => '//cdn.rawgit.com/konpa/devicon/%1$s/devicon.min.css',
                ],
            ],
        ];
        return $this->enqueueLibs(__METHOD__, $data);
    }
394090
public static function where($where=null) {

        if ( !$where || empty($where) ) return array();

        /**
         * 基于 key => value 数组语法的查询条件解析,这里借鉴的是mongodb的查询语法，以便兼容mongodb
         * array('name' => 'zhangsan', '|age' => '>12')
         * 转换后：array('name' => 'zhangsan', '$or' => array('age' => array('$lt' => 24, '$gt' => 30)))
         */
        $condi = array();
        foreach ( $where as $key => $value ) {

            if ( $key == '$or' ) { //组合or查询
                $condi['$or'] = array($value);
                continue;
            }
            if ( $key == '$and' ) {
                $condi['$and'] = array($value);
                continue;
            }
            //这里判断是AND,OR
            if ( $key[0] == '|' ) {
                $key = substr($key, 1);
                $condi['$or'][] = array($key => $value);
            } else {
                $condi[$key] = self::getFormatValue($value);
            }

            if ( is_array($value) ) {

                foreach ( $value as $key1 => $value1 ) {
                    /**
                     * 3. IN 查询,支持2种形式
                     * array('id' => array('$in' => array(1,2,3)))
                     * array('id' => array('$in' => '1,2,3'))
                     */
                    if ( $key1 == '$in' || $key1 == '$nin' ) {
                        if ( is_string($value1) ) {
                            $value[$key1] = explode(',', $value1);
                        }
                        $condi[$key] = $value;
                        continue;
                    }

                    //4. like查询 array('title' => array('$like' => 'xabc'))
                    if ( $key1 == '$like' ) {
                        $condi[$key] = array('$regex' => $value[$key1]);
                        continue;
                    }

                } //end foreach

            } //end fi
        } //end foreach

        self::replaceConditionOperation($condi, $arr);

        return $arr;
    }