Skip to content
Snippets Groups Projects
Commit 486eefe6 authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

fix php-doc and prevent php-warning, refs #687

parent b32753ec
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Lifter007: TODO # Lifter007: TODO
# Lifter003: TODO # Lifter003: TODO
# Lifter010: TODO # Lifter010: TODO
/* /**
* URLHelper.php - utility functions for URL parameter handling * URLHelper.php - utility functions for URL parameter handling
* *
* Copyright (c) 2008 Elmar Ludwig * Copyright (c) 2008 Elmar Ludwig
......
<?php <?php
# Lifter007: TODO
# Lifter010: TODO
/** /**
* Factory Class for the plugin engine * Factory Class for the plugin engine
* @author Dennis Reil, <dennis.reil@offis.de> * @author Dennis Reil, <dennis.reil@offis.de>
...@@ -13,7 +12,7 @@ class PluginEngine ...@@ -13,7 +12,7 @@ class PluginEngine
/** /**
* This function maps an incoming request to a tuple * This function maps an incoming request to a tuple
* (pluginclassname, unconsumed rest). * (pluginclassname, unconsumed rest).
* * @param string $dispatch_to
* @return array the above mentioned tuple * @return array the above mentioned tuple
*/ */
public static function routeRequest($dispatch_to) public static function routeRequest($dispatch_to)
...@@ -23,7 +22,7 @@ class PluginEngine ...@@ -23,7 +22,7 @@ class PluginEngine
throw new PluginNotFoundException(_('Es wurde kein Plugin gewählt.')); throw new PluginNotFoundException(_('Es wurde kein Plugin gewählt.'));
} }
$pos = mb_strpos($dispatch_to, '/'); $pos = mb_strpos($dispatch_to, '/');
return $pos === FALSE return $pos === false
? [$dispatch_to, ''] ? [$dispatch_to, '']
: [mb_substr($dispatch_to, 0, $pos), mb_substr($dispatch_to, $pos + 1)]; : [mb_substr($dispatch_to, 0, $pos), mb_substr($dispatch_to, $pos + 1)];
} }
...@@ -59,7 +58,7 @@ class PluginEngine ...@@ -59,7 +58,7 @@ class PluginEngine
/** /**
* Get instance of the plugin specified by plugin class name. * Get instance of the plugin specified by plugin class name.
* *
* @param $class class name of plugin * @param class-string $class class name of plugin
*/ */
public static function getPlugin ($class) public static function getPlugin ($class)
{ {
...@@ -71,10 +70,11 @@ class PluginEngine ...@@ -71,10 +70,11 @@ class PluginEngine
* returns all enabled plugins. The optional context parameter can be * returns all enabled plugins. The optional context parameter can be
* used to get only plugins that are activated in the given context. * used to get only plugins that are activated in the given context.
* *
* @param $type plugin type or NULL (all types) * @param string $type plugin type or null (all types)
* @param $context context range id (optional) * @param string $context context range id (optional)
* @return array all plugins of the specified type
*/ */
public static function getPlugins ($type, $context = NULL) public static function getPlugins ($type, $context = null)
{ {
return PluginManager::getInstance()->getPlugins($type, $context); return PluginManager::getInstance()->getPlugins($type, $context);
} }
...@@ -83,16 +83,16 @@ class PluginEngine ...@@ -83,16 +83,16 @@ class PluginEngine
* Sends a message to all activated plugins of a type and returns an array of * Sends a message to all activated plugins of a type and returns an array of
* the return values. * the return values.
* *
* @param type plugin type or NULL (all types) * @param string $type plugin type or null (all types)
* @param string the method name that should be send to all plugins * @param mixed $method the method name that should be send to all plugins
* @param mixed a variable number of arguments * @param mixed a variable number of arguments
* *
* @return array an array containing the return values * @return array an array containing the return values
*/ */
public static function sendMessage($type, $method /* ... */) public static function sendMessage($type, $method /* ... */)
{ {
$args = func_get_args(); $args = func_get_args();
array_splice($args, 1, 0, [NULL]); array_splice($args, 1, 0, [null]);
return call_user_func_array([__CLASS__, 'sendMessageWithContext'], $args); return call_user_func_array([__CLASS__, 'sendMessageWithContext'], $args);
} }
...@@ -100,10 +100,10 @@ class PluginEngine ...@@ -100,10 +100,10 @@ class PluginEngine
* Sends a message to all activated plugins of a type enabled in a context and * Sends a message to all activated plugins of a type enabled in a context and
* returns an array of the return values. * returns an array of the return values.
* *
* @param type plugin type or NULL (all types) * @param string $type plugin type or null (all types)
* @param context context range id (may be NULL) * @param string $context context range id (may be null)
* @param string the method name that should be send to all plugins * @param string $method the method name that should be send to all plugins
* @param mixed a variable number of arguments * @param mixed a variable number of arguments
* *
* @return array an array containing the return values * @return array an array containing the return values
*/ */
...@@ -120,11 +120,11 @@ class PluginEngine ...@@ -120,11 +120,11 @@ class PluginEngine
/** /**
* Generates a URL which can be shown in user interfaces * Generates a URL which can be shown in user interfaces
* @param $plugin - the plugin to which should be linked * @param StudIPPlugin|string $plugin - the plugin to which should be linked
* @param $params - an array with name value pairs * @param array $params - an array with name value pairs
* @param $cmd - command to execute by clicking the link * @param string $cmd - command to execute by clicking the link
* @param bool $ignore_registered_params do not add registered params * @param bool $ignore_registered_params do not add registered params
* @return a link to the current plugin with the additional $params * @return string a link to the current plugin with the additional $params
*/ */
public static function getURL($plugin, $params = [], $cmd = 'show', $ignore_registered_params = false) public static function getURL($plugin, $params = [], $cmd = 'show', $ignore_registered_params = false)
{ {
...@@ -141,11 +141,11 @@ class PluginEngine ...@@ -141,11 +141,11 @@ class PluginEngine
/** /**
* Generates a link (entity encoded URL) which can be shown in user interfaces * Generates a link (entity encoded URL) which can be shown in user interfaces
* @param $plugin - the plugin to which should be linked * @param StudIPPlugin|string $plugin - the plugin to which should be linked
* @param $params - an array with name value pairs * @param array $params - an array with name value pairs
* @param $cmd - command to execute by clicking the link * @param string $cmd - command to execute by clicking the link
* @param bool $ignore_registered_params do not add registeredparams * @param bool $ignore_registered_params do not add registeredparams
* @return a link to the current plugin with the additional $params * @return string a link to the current plugin with the additional $params
*/ */
public static function getLink($plugin, $params = [], $cmd = 'show', $ignore_registered_params = false) public static function getLink($plugin, $params = [], $cmd = 'show', $ignore_registered_params = false)
{ {
......
...@@ -104,7 +104,7 @@ class PluginManager ...@@ -104,7 +104,7 @@ class PluginManager
* method will be called accordingly. If the method returns false or * method will be called accordingly. If the method returns false or
* throws and exception, the plugin's activation state is not updated. * throws and exception, the plugin's activation state is not updated.
* *
* @param string $id id of the plugin * @param int $id id of the plugin
* @param bool $enabled plugin status (true or false) * @param bool $enabled plugin status (true or false)
* @param bool $force force (de)activation regardless of the result * @param bool $force force (de)activation regardless of the result
* of on(en|dis)able * of on(en|dis)able
...@@ -115,10 +115,11 @@ class PluginManager ...@@ -115,10 +115,11 @@ class PluginManager
public function setPluginEnabled ($id, $enabled, $force = false) public function setPluginEnabled ($id, $enabled, $force = false)
{ {
$info = $this->getPluginInfoById($id); $info = $this->getPluginInfoById($id);
$plugin_class = '';
// Plugin is not present or no changes // Plugin is not present or no changes
if (!$info || $info['enabled'] == $enabled) { if (!$info || $info['enabled'] == $enabled) {
return; return null;
} }
if ($info['core'] || !$this->isPluginsDisabled()) { if ($info['core'] || !$this->isPluginsDisabled()) {
...@@ -154,8 +155,8 @@ class PluginManager ...@@ -154,8 +155,8 @@ class PluginManager
/** /**
* Set the navigation position of the given plugin. * Set the navigation position of the given plugin.
* *
* @param $id id of the plugin * @param int $id id of the plugin
* @param $position plugin navigation position * @param string $position plugin navigation position
* @return bool indicating whether any change occured * @return bool indicating whether any change occured
*/ */
public function setPluginPosition ($id, $position) public function setPluginPosition ($id, $position)
...@@ -180,8 +181,8 @@ class PluginManager ...@@ -180,8 +181,8 @@ class PluginManager
* Get the activation status of a plugin in the given context. * Get the activation status of a plugin in the given context.
* This also checks the plugin default activations and sem_class-settings. * This also checks the plugin default activations and sem_class-settings.
* *
* @param $id int of the plugin * @param int $id id of the plugin
* @param $context string range id * @param string $context range id
* @returns bool * @returns bool
*/ */
public function isPluginActivated ($id, $context) public function isPluginActivated ($id, $context)
...@@ -204,8 +205,8 @@ class PluginManager ...@@ -204,8 +205,8 @@ class PluginManager
* Get the activation status of a plugin for the given user. * Get the activation status of a plugin for the given user.
* This also checks the plugin default activations and sem_class-settings. * This also checks the plugin default activations and sem_class-settings.
* *
* @param $pluginId id of the plugin * @param int $pluginId id of the plugin
* @param $userId id of the user * @param string $userId id of the user
*/ */
public function isPluginActivatedForUser($pluginId, $userId) public function isPluginActivatedForUser($pluginId, $userId)
{ {
...@@ -234,9 +235,9 @@ class PluginManager ...@@ -234,9 +235,9 @@ class PluginManager
/** /**
* Sets the activation status of a plugin in the given context. * Sets the activation status of a plugin in the given context.
* *
* @param $id string id of the plugin * @param int $id id of the plugin
* @param $rangeId string context range id * @param string $rangeId context range id
* @param $active bool plugin status (true or false) * @param bool $active plugin status (true or false)
*/ */
public function setPluginActivated ($id, $rangeId, $active) public function setPluginActivated ($id, $rangeId, $active)
{ {
...@@ -262,9 +263,9 @@ class PluginManager ...@@ -262,9 +263,9 @@ class PluginManager
/** /**
* Sets the activation status of a plugin in the given context. * Sets the activation status of a plugin in the given context.
* *
* @param $pluginid string of the plugin * @param int $pluginid id of the plugin
* @param $user_id string user id * @param string $user_id user id
* @param $active bool plugin status (true or false) * @param bool $active plugin status (true or false)
*/ */
public function setPluginActivatedForUser($pluginid, $user_id, $active) public function setPluginActivatedForUser($pluginid, $user_id, $active)
{ {
...@@ -302,7 +303,7 @@ class PluginManager ...@@ -302,7 +303,7 @@ class PluginManager
* Returns the list of institutes for which a specific plugin is * Returns the list of institutes for which a specific plugin is
* enabled by default. * enabled by default.
* *
* @param $id id of the plugin * @param int $id id of the plugin
*/ */
public function getDefaultActivations ($id) public function getDefaultActivations ($id)
{ {
...@@ -338,7 +339,7 @@ class PluginManager ...@@ -338,7 +339,7 @@ class PluginManager
/** /**
* Disable loading of all non-core plugins for the current session. * Disable loading of all non-core plugins for the current session.
* *
* @param $status true: disable non-core plugins * @param bool $status true: disable non-core plugins
*/ */
public function setPluginsDisabled($status) public function setPluginsDisabled($status)
{ {
...@@ -357,8 +358,8 @@ class PluginManager ...@@ -357,8 +358,8 @@ class PluginManager
* Load a plugin class from the given file system path and * Load a plugin class from the given file system path and
* return the ReflectionClass instance for the plugin. * return the ReflectionClass instance for the plugin.
* *
* @param $class plugin class name * @param string $class plugin class name
* @param $path plugin relative path * @param string $path plugin relative path
*/ */
private function loadPlugin ($class, $path) private function loadPlugin ($class, $path)
{ {
...@@ -375,7 +376,7 @@ class PluginManager ...@@ -375,7 +376,7 @@ class PluginManager
$pluginfile = $basepath.'/'.$path.'/'.$class.'.php'; $pluginfile = $basepath.'/'.$path.'/'.$class.'.php';
if (!file_exists($pluginfile)) { if (!file_exists($pluginfile)) {
return NULL; return null;
} }
} }
...@@ -387,8 +388,8 @@ class PluginManager ...@@ -387,8 +388,8 @@ class PluginManager
/** /**
* Determine the type of a plugin to be installed. * Determine the type of a plugin to be installed.
* *
* @param $class plugin class name * @param string $class plugin class name
* @param $path plugin relative path * @param string $path plugin relative path
*/ */
private function getPluginType ($class, $path) private function getPluginType ($class, $path)
{ {
...@@ -415,14 +416,13 @@ class PluginManager ...@@ -415,14 +416,13 @@ class PluginManager
* Register a new plugin or update an existing plugin entry in the * Register a new plugin or update an existing plugin entry in the
* data base. Returns the id of the new or updated plugin. * data base. Returns the id of the new or updated plugin.
* *
* @param $name plugin name * @param string $name plugin name
* @param $class plugin class name * @param string $class plugin class name
* @param $path plugin relative path * @param string $path plugin relative path
* @param $depends id of plugin this plugin depends on * @param string $depends id of plugin this plugin depends on
*/ */
public function registerPlugin ($name, $class, $path, $depends = NULL) public function registerPlugin ($name, $class, $path, $depends = null)
{ {
$db = DBManager::get(); $db = DBManager::get();
$info = $this->getPluginInfo($class); $info = $this->getPluginInfo($class);
$type = $this->getPluginType($class, $path); $type = $this->getPluginType($class, $path);
...@@ -508,7 +508,7 @@ class PluginManager ...@@ -508,7 +508,7 @@ class PluginManager
/** /**
* Get meta data for the plugin specified by plugin class name. * Get meta data for the plugin specified by plugin class name.
* *
* @param $class class name of plugin * @param class-string $class class name of plugin
*/ */
public function getPluginInfo ($class) public function getPluginInfo ($class)
{ {
...@@ -518,13 +518,13 @@ class PluginManager ...@@ -518,13 +518,13 @@ class PluginManager
} }
} }
return NULL; return null;
} }
/** /**
* Get meta data for the plugin specified by plugin id. * Get meta data for the plugin specified by plugin id.
* *
* @param $id id of the plugin * @param int $id id of the plugin
*/ */
public function getPluginInfoById ($id) public function getPluginInfoById ($id)
{ {
...@@ -532,21 +532,21 @@ class PluginManager ...@@ -532,21 +532,21 @@ class PluginManager
return $this->plugins[$id]; return $this->plugins[$id];
} }
return NULL; return null;
} }
/** /**
* Get meta data for all plugins of the specified type. A type of NULL * Get meta data for all plugins of the specified type. A type of null
* returns meta data for all installed plugins. * returns meta data for all installed plugins.
* *
* @param $type plugin type or NULL (all types) * @param string $type plugin type or null (all types)
*/ */
public function getPluginInfos ($type = NULL) public function getPluginInfos ($type = null)
{ {
$result = []; $result = [];
foreach ($this->plugins as $id => $plugin) { foreach ($this->plugins as $id => $plugin) {
if ($type === NULL || in_array($type, $plugin['type'])) { if ($type === null || in_array($type, $plugin['type'])) {
$result[$id] = $plugin; $result[$id] = $plugin;
} }
} }
...@@ -557,17 +557,18 @@ class PluginManager ...@@ -557,17 +557,18 @@ class PluginManager
/** /**
* Check user access permission for the given plugin. * Check user access permission for the given plugin.
* *
* @param $plugin plugin meta data * @param array $plugin plugin meta data
* @param $user user id of user * @param string $user_id id of user
* @return bool
*/ */
protected function checkUserAccess ($plugin, $user) protected function checkUserAccess ($plugin, $user_id)
{ {
if (!$plugin['enabled']) { if (!$plugin['enabled']) {
return false; return false;
} }
$plugin_roles = RolePersistence::getAssignedPluginRoles($plugin['id']); $plugin_roles = RolePersistence::getAssignedPluginRoles($plugin['id']);
$user_roles = RolePersistence::getAssignedRoles($user, true); $user_roles = RolePersistence::getAssignedRoles($user_id, true);
foreach ($plugin_roles as $plugin_role) { foreach ($plugin_roles as $plugin_role) {
foreach ($user_roles as $user_role) { foreach ($user_roles as $user_role) {
...@@ -583,12 +584,15 @@ class PluginManager ...@@ -583,12 +584,15 @@ class PluginManager
/** /**
* Get instance of the plugin specified by plugin meta data. * Get instance of the plugin specified by plugin meta data.
* *
* @param $plugin_info plugin meta data * @param array $plugin_info plugin meta data
* @return object
*/ */
protected function getCachedPlugin ($plugin_info) protected function getCachedPlugin ($plugin_info)
{ {
$class = $plugin_info['class']; $class = $plugin_info['class'];
$path = $plugin_info['path']; $path = $plugin_info['path'];
$plugin_class = '';
$plugin = null;
if (isset($this->plugin_cache[$class])) { if (isset($this->plugin_cache[$class])) {
return $this->plugin_cache[$class]; return $this->plugin_cache[$class];
...@@ -608,12 +612,14 @@ class PluginManager ...@@ -608,12 +612,14 @@ class PluginManager
/** /**
* Get instance of the plugin specified by plugin class name. * Get instance of the plugin specified by plugin class name.
* *
* @param $class class name of plugin * @param class-string $class class name of plugin
* @return object
*/ */
public function getPlugin ($class) public function getPlugin ($class)
{ {
$user = $GLOBALS['user']->id; $user = $GLOBALS['user']->id;
$plugin_info = $this->getPluginInfo($class); $plugin_info = $this->getPluginInfo($class);
$plugin = null;
if (isset($plugin_info) && $this->checkUserAccess($plugin_info, $user)) { if (isset($plugin_info) && $this->checkUserAccess($plugin_info, $user)) {
$plugin = $this->getCachedPlugin($plugin_info); $plugin = $this->getCachedPlugin($plugin_info);
...@@ -625,12 +631,14 @@ class PluginManager ...@@ -625,12 +631,14 @@ class PluginManager
/** /**
* Get instance of the plugin specified by plugin id. * Get instance of the plugin specified by plugin id.
* *
* @param $id id of the plugin * @param int $id id of the plugin
* @return object $plugin
*/ */
public function getPluginById ($id) public function getPluginById ($id)
{ {
$user = $GLOBALS['user']->id; $user = $GLOBALS['user']->id;
$plugin_info = $this->getPluginInfoById($id); $plugin_info = $this->getPluginInfoById($id);
$plugin = null;
if (isset($plugin_info) && $this->checkUserAccess($plugin_info, $user)) { if (isset($plugin_info) && $this->checkUserAccess($plugin_info, $user)) {
$plugin = $this->getCachedPlugin($plugin_info); $plugin = $this->getCachedPlugin($plugin_info);
...@@ -640,14 +648,14 @@ class PluginManager ...@@ -640,14 +648,14 @@ class PluginManager
} }
/** /**
* Get instances of all plugins of the specified type. A type of NULL * Get instances of all plugins of the specified type. A type of null
* returns all enabled plugins. The optional context parameter can be * returns all enabled plugins. The optional context parameter can be
* used to get only plugins that are activated in the given context. * used to get only plugins that are activated in the given context.
* *
* @param $type plugin type or NULL (all types) * @param string $type plugin type or null (all types)
* @param $context context range id (optional) * @param string $context context range id (optional)
*/ */
public function getPlugins ($type, $context = NULL) public function getPlugins ($type, $context = null)
{ {
$user = $GLOBALS['user']->id ?: 'nobody'; $user = $GLOBALS['user']->id ?: 'nobody';
$plugin_info = $this->getPluginInfos($type); $plugin_info = $this->getPluginInfos($type);
...@@ -656,13 +664,13 @@ class PluginManager ...@@ -656,13 +664,13 @@ class PluginManager
usort($plugin_info, ['self', 'positionCompare']); usort($plugin_info, ['self', 'positionCompare']);
foreach ($plugin_info as $info) { foreach ($plugin_info as $info) {
$activated = $context == NULL $activated = $context == null
|| $this->isPluginActivated($info['id'], $context); || $this->isPluginActivated($info['id'], $context);
if ($this->checkUserAccess($info, $user) && $activated) { if ($this->checkUserAccess($info, $user) && $activated) {
$plugin = $this->getCachedPlugin($info); $plugin = $this->getCachedPlugin($info);
if ($plugin !== NULL) { if ($plugin !== null) {
$plugins[] = $plugin; $plugins[] = $plugin;
} }
} }
...@@ -673,7 +681,7 @@ class PluginManager ...@@ -673,7 +681,7 @@ class PluginManager
/** /**
* Read the manifest of the plugin in the given directory. * Read the manifest of the plugin in the given directory.
* Returns NULL if the manifest cannot be found. * Returns null if the manifest cannot be found.
* *
* @return array containing the manifest information * @return array containing the manifest information
*/ */
...@@ -683,7 +691,7 @@ class PluginManager ...@@ -683,7 +691,7 @@ class PluginManager
$result = []; $result = [];
if ($manifest === false) { if ($manifest === false) {
return NULL; return null;
} }
foreach ($manifest as $line) { foreach ($manifest as $line) {
......
<?php <?php
# Lifter010: TODO
/* /**
* PluginRepository.class.php - query plugin meta data * PluginRepository.class.php - query plugin meta data
* *
* Copyright (c) 2008 Elmar Ludwig * Copyright (c) 2008 Elmar Ludwig
...@@ -23,9 +23,9 @@ class PluginRepository ...@@ -23,9 +23,9 @@ class PluginRepository
/** /**
* Initialize a new PluginRepository and read meta data from * Initialize a new PluginRepository and read meta data from
* the given URL or the default list of URLs (if $url is NULL). * the given URL or the default list of URLs (if $url is null).
*/ */
public function __construct($url = NULL) public function __construct($url = null)
{ {
if (isset($url)) { if (isset($url)) {
$this->readMetadata($url); $this->readMetadata($url);
...@@ -40,6 +40,8 @@ class PluginRepository ...@@ -40,6 +40,8 @@ class PluginRepository
* Read plugin meta data from the given URL (using XML format). * Read plugin meta data from the given URL (using XML format).
* The structure of the XML is: * The structure of the XML is:
* *
* @param string $url given url for plugin
*
* <plugins> * <plugins>
* <plugin name="DummyPlugin" * <plugin name="DummyPlugin"
* <release * <release
...@@ -53,8 +55,6 @@ class PluginRepository ...@@ -53,8 +55,6 @@ class PluginRepository
*/ */
public function readMetadata($url) public function readMetadata($url)
{ {
global $SOFTWARE_VERSION;
$cache = StudipCacheFactory::getCache(); $cache = StudipCacheFactory::getCache();
$cache_key = 'plugin_metadata/'.$url; $cache_key = 'plugin_metadata/'.$url;
$metadata = $cache->read($cache_key); $metadata = $cache->read($cache_key);
...@@ -111,8 +111,8 @@ class PluginRepository ...@@ -111,8 +111,8 @@ class PluginRepository
/** /**
* Register a new plugin in this repository. * Register a new plugin in this repository.
* *
* @param $name string plugin name * @param string $name plugin name
* @param $meta_data array of plugin meta data * @param array $meta_data plugin meta data
*/ */
protected function registerPlugin($name, $meta_data) protected function registerPlugin($name, $meta_data)
{ {
...@@ -127,8 +127,8 @@ class PluginRepository ...@@ -127,8 +127,8 @@ class PluginRepository
/** /**
* Get meta data for the plugin with the given name (if available). * Get meta data for the plugin with the given name (if available).
* Always chooses the newest compatible version of the plugin. * Always chooses the newest compatible version of the plugin.
* * @param string $name name of the plgin
* @return array meta data for plugin (or NULL) * @return array meta data for plugin (or null)
*/ */
public function getPlugin($name) public function getPlugin($name)
{ {
...@@ -140,15 +140,15 @@ class PluginRepository ...@@ -140,15 +140,15 @@ class PluginRepository
* string. You may omit the search string to get a list of all * string. You may omit the search string to get a list of all
* available plugins. Returns the newest compatible version of * available plugins. Returns the newest compatible version of
* each plugin. * each plugin.
* * @param string $search search string
* @return array array of meta data for matching plugins * @return array array of meta data for matching plugins
*/ */
public function getPlugins($search = NULL) public function getPlugins($search = null)
{ {
$result = []; $result = [];
foreach ($this->plugins as $name => $data) { foreach ($this->plugins as $name => $data) {
if ($search === NULL || $search === '' || if ($search === null || $search === '' ||
is_int(mb_stripos($name, $search)) || is_int(mb_stripos($name, $search)) ||
is_int(mb_stripos($data['description'], $search))) { is_int(mb_stripos($data['description'], $search))) {
$result[$name] = $data; $result[$name] = $data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment