Permalink
Browse files

Merge pull request #29 from sams/master

Fix #28
  • Loading branch information...
2 parents 4eb2aca + c59043e commit e3b6159971c8b1f008bfdf35c9053ded283d1151 @ProLoser committed Aug 31, 2012
@@ -155,16 +155,19 @@ protected function _welcome() {
* @return void
*/
public function init($working) {
- $this->out("\n<info>Making temp folders writeable...</info>");
+ $this->out(__d('baking_plate', "\n<info>Making temp folders writeable...</info>"));
$tmp = array(
- 'tmp', 'tmp' . DS . 'cache', 'tmp' . DS . 'cache' . DS . 'models',
+ 'tmp' . DS . 'cache', 'tmp' . DS . 'cache' . DS . 'models',
'tmp' . DS . 'cache' . DS . 'persistent', 'tmp' . DS . 'cache' . DS . 'views',
'tmp' . DS . 'logs', 'tmp' . DS . 'sessions', 'tmp' . DS . 'tests',
'webroot' . DS . 'ccss', 'webroot' . DS . 'cjs', 'webroot' . DS . 'uploads',
);
foreach ($tmp as $dir) {
- if (is_dir($working . DS . $dir)) {
- $this->out($dir);
+ if (!is_dir($working . DS . $dir)) {
+ $this->out(__d('baking_plate', "\n<info>Creating Directory %s with permissions 0777</info>", $dir));
+ mkdir($working . DS . $dir, 0777);
+ } else {
+ $this->out(__d('baking_plate', "\n<info>Setting Permissions of %s to 0777</info>", $dir));
chmod($working . DS . $dir, 0777);
}
}
@@ -348,8 +351,8 @@ protected function _loadCustom() {
/**
* Adds a submodule via git
*
- * @param string $path
- * @param string $url
+ * @param string $path
+ * @param string $url
* @return void
*/
protected function _addSubmodule($path) {
@@ -414,7 +417,7 @@ protected function _getSubmodules() {
/**
* Installs a submodule into the project
*
- * @param string $url
+ * @param string $url
* @param string $folder
* @return void
*/
@@ -428,4 +431,4 @@ protected function _install($url, $folder) {
// Delete the plugin cache
Cache::delete('object_map', '_cake_core_');
}
-}
+}
@@ -31,9 +31,9 @@
* @package app.Model
*/
class AppModel extends Model {
-
- var $recursive = -1;
-
+
+ public $recursive = -1;
+
public $actsAs = array(
'Containable',
);
@@ -46,7 +46,7 @@ class AppModel extends Model {
* @param string $table
* @param string $ds
*/
- function __construct($id = false, $table = null, $ds = null) {
+ public function __construct($id = false, $table = null, $ds = null) {
foreach ($this->validate as $field => $rules) {
if (isset($this->validate[$field]['message'])) {
$this->validate[$field]['message'] = __($this->validate[$field]['message']);
@@ -70,7 +70,7 @@ function __construct($id = false, $table = null, $ds = null) {
* @return void
* @author Dean
*/
- public function beforeValidate() {
+ public function beforeValidate($options = array()) {
// Makes the HABTM fields validateable
foreach($this->hasAndBelongsToMany as $alias => $options) {
if (isset($this->data[$alias][$alias])) {
@@ -87,7 +87,7 @@ public function beforeValidate() {
* @param array $extra
* @return array
*/
- function paginateCount($conditions = array(), $recursive = 0, $extra = array()) {
+ public function paginateCount($conditions = array(), $recursive = 0, $extra = array()) {
$parameters = compact('conditions');
if ($recursive != $this->recursive) {
@@ -1,7 +1,7 @@
<?php
/**
* PlateComponent
- *
+ *
* A collection of common controller-level fixes and functionality in baking plate
*
* @package BakingPlate Plugin
@@ -37,7 +37,7 @@ class PlateComponent extends Component {
* @access public
* @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components
*/
- public function initialize($controller, $settings = array()) {
+ public function initialize(Controller $controller, $settings = array()) {
$this->_Controller = $controller;
if (!isset($this->_Settings[$controller->name])) {
$this->_Settings[$controller->name] = $settings;
@@ -53,7 +53,7 @@ public function initialize($controller, $settings = array()) {
* @access public
* @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components
*/
- public function startup($controller) {
+ public function startup(Controller $controller) {
$this->_paginationLimit();
}
@@ -65,7 +65,7 @@ public function startup($controller) {
* @return void
* @access public
*/
- public function beforeRender($controller) {
+ public function beforeRender(Controller $controller) {
// An annoying fix for asset_compress
if (empty($this->_Controller)) {
$this->_Controller = $controller;
@@ -82,7 +82,7 @@ public function beforeRender($controller) {
* @return void
* @access public
*/
- public function shutdown($controller) {
+ public function shutdown(Controller $controller) {
}
/**
@@ -92,7 +92,7 @@ public function shutdown($controller) {
* @param mixed A string or array containing the redirect location
* @access public
*/
- public function beforeRedirect($controller, $url, $status = null, $exit = true) {
+ public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
}
/**
@@ -140,7 +140,7 @@ protected function _habtmValidation() {
* Checks to see if there is a limit set for pagination results
* to prevent overloading the database
*
- * @param string $value
+ * @param string $value
* @return void
* @author Jose Gonzalez (savant)
*/
@@ -171,7 +171,7 @@ protected function _populateView() {
/**
* Add component just in time (inside actions - only when needed)
- * aware of plugins and config array (if passed). Doesn't load
+ * aware of plugins and config array (if passed). Doesn't load
* dependent components.
*
* @param mixed $components (single string or multiple array)
@@ -271,4 +271,4 @@ public function redirectUnless($data = null, $message = null) {
}
}
-}
+}

0 comments on commit e3b6159

Please sign in to comment.