本文整理汇总了PHP中Ak::stringToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::stringToArray方法的具体用法?PHP Ak::stringToArray怎么用?PHP Ak::stringToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ak
的用法示例。
在下文中一共展示了Ak::stringToArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAvailableLocales
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;
}
示例2: toArray
function toArray()
{
$args = func_get_args();
return is_array($args[0]) ? $args[0] : (func_num_args() === 1 ? Ak::stringToArray($args[0]) : $args);
}
示例3: instantiateModels
function instantiateModels()
{
$args = func_get_args();
$models = (count($args) > 1) ? $args : Ak::stringToArray(@$args[0]);
call_user_func_array(array($this, 'instantiateModel'), $models);
}
示例4: setSslAllowedActions
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);
}
示例5: test_for_string_to_array
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'));
}
示例6: basename
--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';