public function getAvailableLocales() { static $available_locales; if (empty($available_locales)) { if (defined('AK_ACTIVE_RECORD_DEFAULT_LOCALES')) { $available_locales = Ak::stringToArray(AK_ACTIVE_RECORD_DEFAULT_LOCALES); } else { $available_locales = Ak::langs(); } } return $available_locales; }
function toArray() { $args = func_get_args(); return is_array($args[0]) ? $args[0] : (func_num_args() === 1 ? Ak::stringToArray($args[0]) : $args); }
function instantiateModels() { $args = func_get_args(); $models = (count($args) > 1) ? $args : Ak::stringToArray(@$args[0]); call_user_func_array(array($this, 'instantiateModel'), $models); }
function setSslAllowedActions($actions) { $this->_ssl_allowed_actions = empty($this->_ssl_allowed_actions) ? is_string($actions) ? Ak::stringToArray($actions) : $actions : array_merge($this->_ssl_allowed_actions, is_string($actions) ? Ak::stringToArray($actions) : $actions); }
public function test_for_string_to_array() { $this->assertEqual(Ak::stringToArray('es,en,va'), array('es', 'en', 'va')); $this->assertEqual(Ak::stringToArray('es , en , va'), array('es', 'en', 'va')); }
--format Comma separated list of release file formats. By default it will use all formats git supports "git archive -l" --skip_gzip Tarfiles will be gzipped unless this option is set --revision Repositiory revision, default HEAD --checksum Generate checksum files HELP ); } $default_app_name = AK_APP_NAME == 'Application' ? basename(MAKELOS_BASE_DIR) : AK_APP_NAME; $is_akelos_core = defined('AK_CORE_DIR'); $available_formats = array_diff(explode("\n", @`git archive -l`), array('')); if (empty($available_formats)) { die("Could not find archive formats when running 'git archive -l'\n"); } $options['format'] = !empty($options['format']) ? Ak::stringToArray($options['format']) : $available_formats; foreach ($options['format'] as $format) { if (!in_array($format, $available_formats)) { die("Format " . $format . " not supported by git. 'git archive -l' reports these available formats: " . join(",", $available_formats) . "\n"); } } $options['app_name'] = AkInflector::underscore(empty($options['app_name']) ? $is_akelos_core ? 'akelos' : $default_app_name : $options['app_name']); $options['revision'] = empty($options['revision']) ? 'HEAD' : $options['revision']; if ($options['revision'] == 'HEAD' && preg_match('/commit (.+)/', `git log --no-color --abbrev-commit -n 1`, $matches)) { $options['revision'] = $matches[1]; } $options['revision'] = trim($options['revision'], '. '); $options['commit'] = isset($options['commit']) ? $is_akelos_core : false; $version_file = empty($options['version_file']) ? MAKELOS_BASE_DIR . DS . 'version.txt' : $options['version_file']; if (!is_file($version_file)) { $version_file = MAKELOS_BASE_DIR . DS . '..' . DS . 'version.txt';