本文整理汇总了PHP中Configure::version方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::version方法的具体用法?PHP Configure::version怎么用?PHP Configure::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configure
的用法示例。
在下文中一共展示了Configure::version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: info
public function info()
{
echo Configure::version();
die;
phpinfo();
die;
}
示例2: _welcome
/**
* Displays a header for the shell
*
* @return void
*/
protected function _welcome()
{
$this->out();
$this->out(__d('cake_console', '<info>Welcome to CakePHP %s Console</info>', 'v' . Configure::version()));
$this->out(__d('cake_console', '<info>Customize by RikkeiSoft Co. Ltd.,</info>'));
$this->hr();
}
示例3: _welcome
/**
* Displays a header for the shell
*/
protected function _welcome()
{
$this->out();
$this->out('<info>Welcome to ' . Configure::read('App.name') . ' ' . Configure::version() . ' Console</info>');
$this->hr();
$this->out('App : ' . APP_DIR);
$this->out('Path: ' . APP);
$this->hr();
}
示例4: _setPath
function _setPath($type, $path)
{
if (version_compare(Configure::version(), '1.3') > 0) {
App::build(array(Inflector::pluralize($type) => (array) $path));
$this->Interactive->objectPath = dirname($path) . DS;
} else {
Configure::write(Inflector::singularize($type) . 'Paths', (array) $path);
$this->Interactive->objectPath = $path;
}
}
示例5: beforeRender
/**
* beforeRender - Get necessary data about environment to pass back to controller
*
* @return array
*/
public function beforeRender(Controller $controller)
{
parent::beforeRender($controller);
$return = array();
// PHP Data
$phpVer = phpversion();
$return['php'] = array_merge(array('PHP_VERSION' => $phpVer), $_SERVER);
unset($return['php']['argv']);
// CakePHP Data
$return['cake'] = array('APP' => APP, 'APP_DIR' => APP_DIR, 'APPLIBS' => APPLIBS, 'CACHE' => CACHE, 'CAKE' => CAKE, 'CAKE_CORE_INCLUDE_PATH' => CAKE_CORE_INCLUDE_PATH, 'CORE_PATH' => CORE_PATH, 'CAKE_VERSION' => Configure::version(), 'CSS' => CSS, 'CSS_URL' => CSS_URL, 'DS' => DS, 'FULL_BASE_URL' => FULL_BASE_URL, 'IMAGES' => IMAGES, 'IMAGES_URL' => IMAGES_URL, 'JS' => JS, 'JS_URL' => JS_URL, 'LOGS' => LOGS, 'ROOT' => ROOT, 'TESTS' => TESTS, 'TMP' => TMP, 'VENDORS' => VENDORS, 'WEBROOT_DIR' => WEBROOT_DIR, 'WWW_ROOT' => WWW_ROOT);
return $return;
}
示例6: groupConfigs
/**
* Returns an array of group -> config map
*
* @return array Array of group to config map
* @throws CacheException
*/
public static function groupConfigs($group = null)
{
if (version_compare(Configure::version(), '2.4', '>=')) {
return parent::groupConfigs($group);
}
if ($group == null) {
return self::$_groups;
}
if (isset(self::$_groups[$group])) {
return array($group => self::$_groups[$group]);
} else {
throw new CacheException(sprintf('Invalid cache group %s', $group));
}
}
示例7: generate
/**
* generate
* Generate .cake array
*
* @return array $dotcake
*/
public function generate()
{
$dotcake = array();
$dotcake['cake_version'] = Configure::version();
$dotcake['cake'] = $this->__cake;
$dotcake['build_path'] = array();
$paths = $this->__paths;
foreach ($paths as $key => $values) {
$formattedKey = strtolower(Inflector::pluralize(preg_replace('/\\A.+\\//', '', $key)));
$dotcake['build_path'][$formattedKey] = array();
$dotcake['build_path'][$formattedKey] = array_map(array($this, 'relativePath'), $values);
}
return $dotcake;
}
示例8: beforeRender
/**
* beforeRender - Get necessary data about environment to pass back to controller
*
* @return array
*/
public function beforeRender(Controller $controller)
{
parent::beforeRender($controller);
$return = array();
// PHP Data
$phpVer = phpversion();
$return['php'] = array_merge(array('PHP_VERSION' => $phpVer), $_SERVER);
unset($return['php']['argv']);
// CakePHP Data
$return['cake'] = array('APP' => APP, 'APP_DIR' => APP_DIR, 'APPLIBS' => APPLIBS, 'CACHE' => CACHE, 'CAKE' => CAKE, 'CAKE_CORE_INCLUDE_PATH' => CAKE_CORE_INCLUDE_PATH, 'CORE_PATH' => CORE_PATH, 'CAKE_VERSION' => Configure::version(), 'CSS' => CSS, 'CSS_URL' => CSS_URL, 'DS' => DS, 'FULL_BASE_URL' => FULL_BASE_URL, 'IMAGES' => IMAGES, 'IMAGES_URL' => IMAGES_URL, 'JS' => JS, 'JS_URL' => JS_URL, 'LOGS' => LOGS, 'ROOT' => ROOT, 'TESTS' => TESTS, 'TMP' => TMP, 'VENDORS' => VENDORS, 'WEBROOT_DIR' => WEBROOT_DIR, 'WWW_ROOT' => WWW_ROOT);
$cakeConstants = array_fill_keys(array('DS', 'ROOT', 'FULL_BASE_URL', 'TIME_START', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'YEAR', 'LOG_ERROR', 'FULL_BASE_URL'), '');
$var = get_defined_constants(true);
$return['app'] = array_diff_key($var['user'], $return['cake'], $cakeConstants);
return $return;
}
示例9: getVersion
/**
* get version
*
* @return string
*/
function getVersion()
{
if (method_exists('Configure', 'version')) {
return Configure::version();
} else {
$handle = fopen(CAKE . DS . 'VERSION.txt', "r");
if ($handle) {
while (($line = fgets($handle, 4096)) !== false) {
if (preg_match('/\\/\\//', $line)) {
continue;
}
if (preg_match('/([0-9]+\\.[0-9]+\\.[0-9]+)/', $line, $m)) {
return $m[1];
}
}
fclose($handle);
}
}
return null;
}
示例10: cakeVersion
/**
* cakeVersion method
*
* @return void
* @access protected
*/
protected static function cakeVersion()
{
if (Mi::$cakeVersion) {
return Mi::$cakeVersion;
}
return Mi::$cakeVersion = substr(Configure::version(), 0, 3);
}
示例11: Debugger
/**
* Returns a reference to the Debugger singleton object instance.
*
* @return object
* @access public
* @static
*/
function &getInstance($class = null)
{
if (!empty($class)) {
if (is_null(self::$instance) || strtolower($class) != strtolower(get_class(self::$instance))) {
self::$instance =& new $class();
if (Configure::read() > 0) {
Configure::version();
// Make sure the core config is loaded
self::$instance->helpPath = Configure::read('Cake.Debugger.HelpPath');
}
}
}
if (is_null(self::$instance)) {
self::$instance =& new Debugger();
if (Configure::read() > 0) {
Configure::version();
// Make sure the core config is loaded
self::$instance->helpPath = Configure::read('Cake.Debugger.HelpPath');
}
}
return self::$instance;
}
示例12: help
/**
* Shows console help
*
* @access public
*/
function help()
{
$this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console");
$this->stdout("---------------------------------------------------------------");
$this->stdout("Current Paths:");
$this->stdout(" -app: " . $this->params['app']);
$this->stdout(" -working: " . rtrim($this->params['working'], DS));
$this->stdout(" -root: " . rtrim($this->params['root'], DS));
$this->stdout(" -core: " . rtrim(CORE_PATH, DS));
$this->stdout("");
$this->stdout("Changing Paths:");
$this->stdout("your working path should be the same as your application path");
$this->stdout("to change your path use the '-app' param.");
$this->stdout("Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp");
$this->stdout("\nAvailable Shells:");
$_shells = array();
foreach ($this->shellPaths as $path) {
if (is_dir($path)) {
$shells = Configure::listObjects('file', $path);
$path = str_replace(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS, 'CORE' . DS, $path);
$path = str_replace(APP, 'APP' . DS, $path);
$path = str_replace(ROOT, 'ROOT', $path);
$path = rtrim($path, DS);
$this->stdout("\n " . $path . ":");
if (empty($shells)) {
$this->stdout("\t - none");
} else {
sort($shells);
foreach ($shells as $shell) {
if ($shell !== 'shell.php') {
$this->stdout("\t " . str_replace('.php', '', $shell));
}
}
}
}
}
$this->stdout("\nTo run a command, type 'cake shell_name [args]'");
$this->stdout("To get help on a specific command, type 'cake shell_name help'");
$this->_stop();
}
示例13: _welcome
/**
* Displays a header for the shell
*
* @access protected
*/
function _welcome()
{
$this->Dispatch->clear();
$this->out();
$this->out('Welcome to CakePHP v' . Configure::version() . ' Console');
$this->hr();
$this->out('App : ' . $this->params['app']);
$this->out('Path: ' . $this->params['working']);
$this->hr();
}
示例14: dispatch
/**
* Dispatches a CLI request
*
* @access public
*/
function dispatch()
{
$this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console");
$this->stdout("---------------------------------------------------------------");
if (isset($this->args[0])) {
$this->shell = $this->args[0];
$this->shiftArgs();
$this->shellName = Inflector::camelize($this->shell);
$this->shellClass = $this->shellName . 'Shell';
if ($this->shell == 'help') {
$this->help();
} else {
$loaded = false;
foreach ($this->shellPaths as $path) {
$this->shellPath = $path . $this->shell . ".php";
if (file_exists($this->shellPath)) {
$loaded = true;
break;
}
}
if ($loaded) {
require CONSOLE_LIBS . 'shell.php';
require $this->shellPath;
if (class_exists($this->shellClass)) {
$command = null;
if (isset($this->args[0])) {
$command = $this->args[0];
}
$this->shellCommand = Inflector::variable($command);
$shell = new $this->shellClass($this);
$shell->initialize();
$shell->loadTasks();
foreach ($shell->taskNames as $task) {
$shell->{$task}->initialize();
$shell->{$task}->loadTasks();
}
$task = Inflector::camelize($command);
if (in_array($task, $shell->taskNames)) {
$this->shiftArgs();
$shell->{$task}->startup();
if (isset($this->args[0]) && $this->args[0] == 'help') {
if (method_exists($shell->{$task}, 'help')) {
$shell->{$task}->help();
exit;
} else {
$this->help();
}
}
$shell->{$task}->execute();
return;
}
$classMethods = get_class_methods($shell);
$privateMethod = $missingCommand = false;
if ((in_array($command, $classMethods) || in_array(strtolower($command), $classMethods)) && strpos($command, '_', 0) === 0) {
$privateMethod = true;
}
if (!in_array($command, $classMethods) && !in_array(strtolower($command), $classMethods)) {
$missingCommand = true;
}
$protectedCommands = array('initialize', 'in', 'out', 'err', 'hr', 'createfile', 'isdir', 'copydir', 'object', 'tostring', 'requestaction', 'log', 'cakeerror', 'shelldispatcher', '__initconstants', '__initenvironment', '__construct', 'dispatch', '__bootstrap', 'getinput', 'stdout', 'stderr', 'parseparams', 'shiftargs');
if (in_array(strtolower($command), $protectedCommands)) {
$missingCommand = true;
}
if ($missingCommand && method_exists($shell, 'main')) {
$shell->startup();
$shell->main();
} elseif (!$privateMethod && method_exists($shell, $command)) {
$this->shiftArgs();
$shell->startup();
$shell->{$command}();
} else {
$this->stderr("Unknown {$this->shellName} command '{$command}'.\nFor usage, try 'cake {$this->shell} help'.\n\n");
}
} else {
$this->stderr('Class ' . $this->shellClass . ' could not be loaded');
}
} else {
$this->help();
}
}
} else {
$this->help();
}
}
示例15: cakeRender
function cakeRender($content, $type, $org_charset = null, $target_charset = null)
{
if (is_null($target_charset)) {
$target_charset = $this->charset_content;
}
if (!class_exists($this->Controller->view)) {
if (!$this->import('View', $this->view)) {
return $this->errorGather('Qdmail<->CakePHP View Load Error , the name is \'' . $this->view . '\'', __LINE__);
}
}
$type = strtolower($type);
$view = new $this->Controller->view($this->Controller, false);
$view->layout = $this->layout;
$mess = null;
$content = $view->renderElement($this->view_dir . DS . $type . DS . $this->template, array('content' => $content), true);
if (1.2 > (double) substr(Configure::version(), 0, 3)) {
$view->subDir = $this->layout_dir . DS . $type . DS;
} else {
$view->layoutPath = $this->layout_dir . DS . $type;
}
$mess .= $view->renderLayout($content);
if (is_null($org_charset)) {
$org_charset = $this->qd_detect_encoding($mess);
}
$mess = $this->qd_convert_encoding($mess, $target_charset, $org_charset);
return array($mess, $target_charset, $org_charset);
}