/** * Transform to Array even Json Data encoded * * @return array */ public function toArrayAll() { $data = $this->toArray(); foreach (self::$jsonable as $key) { if (isset($data[$key]) && Utils::isJson($data[$key])) { $data[$key] = json_decode($this->{$key}); } } return $data; }
/** * Get a list of available modules from Arx.io * @param array $params * @return array|bool|mixed * @throws \Exception */ public static function getModulesAvailables($params = ['type' => 'array']) { Arr::mergeWithDefaultParams($params); $result = Utils::getJSON('http://www.arx.io/api/v1/modules', true); if ($params['type'] == 'list') { return array_column($result, 'name'); } elseif ($params['type'] == 'infolist') { return array_map(function ($item) { return $item['name'] . ' : ' . $item['description']; }, $result); } return $result; }
* * Minimum constants needed to make it works and have to be instanciate before anything. * You can override this constant by defining before the autoload.php. * */ defined('ARX_STARTTIME') or define('ARX_STARTTIME', microtime(true)); defined('DS') or define('DS', DIRECTORY_SEPARATOR); /** * These classes are needed for basic manipulation */ require_once __DIR__ . DS . 'classes' . DS . 'Singleton.php'; require_once __DIR__ . DS . 'classes' . DS . 'Container.php'; require_once __DIR__ . DS . 'classes' . DS . 'Arr.php'; require_once __DIR__ . DS . 'classes' . DS . 'Str.php'; require_once __DIR__ . DS . 'classes' . DS . 'Utils.php'; defined('HTTP_SECURE') or define('HTTP_SECURE', \Arx\classes\Utils::isHttps()); defined('HTTP_PROTOCOL') or define('HTTP_PROTOCOL', 'http' . (HTTP_SECURE ? 's' : '') . '://'); /** * Composer class to helping to manage Namespace and Class (need to be relative to works) */ require_once __DIR__ . DS . 'classes/Composer.php'; /** * Classes that needs to be include and can't be include with autoload or CoreServiceProvider */ require_once __DIR__ . DS . 'classes' . DS . 'Debug.php'; require_once __DIR__ . DS . 'classes' . DS . 'Finder.php'; require_once __DIR__ . DS . 'classes' . DS . 'Hook.php'; require_once __DIR__ . DS . 'classes' . DS . 'Config.php'; require_once __DIR__ . DS . 'classes' . DS . 'Env.php'; require_once __DIR__ . DS . 'classes' . DS . 'App.php'; /**
/** * Get Ip infos from User * * @param null $ip * @return mixed */ public static function getIp($ip = null) { return Utils::getIpInfos(); }