mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Udating template home.ctp and providing a default skel dir in tamplate task
This commit is contained in:
parent
a1f5fe706a
commit
8213160bb1
5 changed files with 45 additions and 41 deletions
|
@ -75,6 +75,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require LIBS . 'Routing' . DS .'Dispatcher.php';
|
App::uses('Dispatcher', 'Routing');
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
$Dispatcher->dispatch(new CakeRequest());
|
$Dispatcher->dispatch(new CakeRequest());
|
||||||
|
|
|
@ -52,14 +52,6 @@ class ProjectTask extends Shell {
|
||||||
$project = $_SERVER['PWD'] . DS . $project;
|
$project = $_SERVER['PWD'] . DS . $project;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->params['skel'])) {
|
|
||||||
$core = App::core('Console');
|
|
||||||
$skelPath = dirname($core[0]) . DS . 'templates' . DS . 'skel';
|
|
||||||
if (is_dir($skelPath) === true) {
|
|
||||||
$this->params['skel'] = $skelPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!$project) {
|
while (!$project) {
|
||||||
$prompt = __("What is the full path for this app including the app directory name?\n Example:");
|
$prompt = __("What is the full path for this app including the app directory name?\n Example:");
|
||||||
$default = APP_PATH . 'myapp';
|
$default = APP_PATH . 'myapp';
|
||||||
|
@ -387,6 +379,7 @@ class ProjectTask extends Shell {
|
||||||
))->addOption('empty', array(
|
))->addOption('empty', array(
|
||||||
'help' => __('Create empty files in each of the directories. Good if you are using git')
|
'help' => __('Create empty files in each of the directories. Good if you are using git')
|
||||||
))->addOption('skel', array(
|
))->addOption('skel', array(
|
||||||
|
'default' => current(App::core('Console')) . DS . 'templates' . DS . 'skel',
|
||||||
'help' => __('The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
|
'help' => __('The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
$output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!</h2>\n";
|
$output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP!</h2>\n";
|
||||||
$output .="
|
$output .="
|
||||||
<?php
|
<?php
|
||||||
App::import('Core', 'Debugger');
|
App::uses('Debugger', 'Utility');
|
||||||
if (Configure::read() > 0):
|
if (Configure::read() > 0):
|
||||||
Debugger::checkSecurityKeys();
|
Debugger::checkSecurityKeys();
|
||||||
endif;
|
endif;
|
||||||
|
@ -52,27 +52,38 @@ endif;
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
<?php
|
||||||
if (!empty(\$filePresent)):
|
if (isset(\$filePresent)):
|
||||||
if (!class_exists('ConnectionManager')) {
|
App::uses('ConnectionManager', 'Model');
|
||||||
require LIBS . 'model' . DS . 'connection_manager.php';
|
try {
|
||||||
|
\$connected = ConnectionManager::getDataSource('default');
|
||||||
|
} catch (Exception \$e) {
|
||||||
|
\$connected = false;
|
||||||
}
|
}
|
||||||
\$db = ConnectionManager::getInstance();
|
|
||||||
\$connected = \$db->getDataSource('default');
|
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
|
<?php
|
||||||
|
if (\$connected && \$connected->isConnected()):
|
||||||
|
echo '<span class=\"notice success\">';
|
||||||
|
echo __('Cake is able to connect to the database.');
|
||||||
|
echo '</span>';
|
||||||
|
else:
|
||||||
|
echo '<span class=\"notice\">';
|
||||||
|
echo __('Cake is NOT able to connect to the database.');
|
||||||
|
echo '</span>';
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
<?php endif;?>
|
||||||
<?php
|
<?php
|
||||||
if (\$connected->isConnected()):
|
App::uses('Validation', 'Utility');
|
||||||
echo '<span class=\"notice success\">';
|
if (!Validation::alphaNumeric('cakephp')) {
|
||||||
echo __('Cake is able to connect to the database.');
|
echo '<p><span class=\"notice\">';
|
||||||
echo '</span>';
|
__('PCRE has not been compiled with Unicode support.');
|
||||||
else:
|
echo '<br/>';
|
||||||
echo '<span class=\"notice\">';
|
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
|
||||||
echo __('Cake is NOT able to connect to the database.');
|
echo '</span></p>';
|
||||||
echo '</span>';
|
}
|
||||||
endif;
|
?>\n";
|
||||||
?>
|
|
||||||
</p>\n";
|
|
||||||
$output .= "<?php endif;?>\n";
|
|
||||||
$output .= "<h3><?php echo __('Editing this Page') ?></h3>\n";
|
$output .= "<h3><?php echo __('Editing this Page') ?></h3>\n";
|
||||||
$output .= "<p>\n";
|
$output .= "<p>\n";
|
||||||
$output .= "<?php\n";
|
$output .= "<?php\n";
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||||
define('CAKE_CORE_INCLUDE_PATH', ROOT);
|
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
define('APP_PATH', ROOT . DS . APP_DIR . DS);
|
define('APP_PATH', ROOT . DS . APP_DIR . DS);
|
||||||
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
||||||
}
|
}
|
||||||
if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
|
if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
|
||||||
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
|
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require LIBS . 'dispatcher.php';
|
require LIBS . 'Routing' . DS .'Dispatcher.php';
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
$Dispatcher->dispatch(new CakeRequest());
|
$Dispatcher->dispatch(new CakeRequest());
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
if (Configure::read('debug') == 0):
|
if (Configure::read('debug') == 0):
|
||||||
throw new NotFoundException();
|
throw new NotFoundException();
|
||||||
endif;
|
endif;
|
||||||
App::import('Core', 'Debugger');
|
App::uses('Debugger', 'Utility');
|
||||||
?>
|
?>
|
||||||
<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
|
<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
|
||||||
<a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a>
|
<a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a>
|
||||||
|
@ -71,16 +71,6 @@ endif;
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
<?php
|
|
||||||
App::uses('Validation', 'Utility');
|
|
||||||
if (!Validation::alphaNumeric('cakephp')) {
|
|
||||||
echo '<p><span class="notice">';
|
|
||||||
__('PCRE has not been compiled with Unicode support.');
|
|
||||||
echo '<br/>';
|
|
||||||
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
|
|
||||||
echo '</span></p>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($filePresent)):
|
if (isset($filePresent)):
|
||||||
App::uses('ConnectionManager', 'Model');
|
App::uses('ConnectionManager', 'Model');
|
||||||
|
@ -104,6 +94,16 @@ if (isset($filePresent)):
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
<?php
|
||||||
|
App::uses('Validation', 'Utility');
|
||||||
|
if (!Validation::alphaNumeric('cakephp')) {
|
||||||
|
echo '<p><span class="notice">';
|
||||||
|
__('PCRE has not been compiled with Unicode support.');
|
||||||
|
echo '<br/>';
|
||||||
|
__('Recompile PCRE with Unicode support by adding <code>--enable-unicode-properties</code> when configuring');
|
||||||
|
echo '</span></p>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
<h3><?php echo __('Editing this Page'); ?></h3>
|
<h3><?php echo __('Editing this Page'); ?></h3>
|
||||||
<p>
|
<p>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in a new issue