This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function pluginSplit($name, $fallback = true) { | |
$plugin = null; | |
list($first, $second) = pluginSplit($name); | |
if (CakePlugin::loaded($first) === true) { | |
$name = $second; | |
$plugin = $first; | |
} | |
if (isset($this->plugin) && !$plugin && $fallback) { | |
$plugin = $this->plugin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php | |
index f198f82..fb2952d 100644 | |
--- a/lib/Cake/View/Helper.php | |
+++ b/lib/Cake/View/Helper.php | |
@@ -267,15 +267,29 @@ class Helper extends Object { | |
* @param array $options Options array. Possible keys: | |
* `fullBase` Return full url with domain name | |
* `pathPrefix` Path prefix for relative urls | |
+ * `ext` Asset extension to append | |
* @return string Generated url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function beforeFilter() { | |
parent::beforeFilter(); | |
// Painel de Controle | |
if (isset($this->params['prefix']) && $this->params['prefix'] == 'admin') { | |
$this->layout = 'admin'; | |
// Configuração do AuthComponent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function inputDefaults($defaults = null, $merge = false) { | |
if (!is_null($defaults)) { | |
$this->_inputDefaults = array_merge($merge ? $this->_inputDefaults : array(), (array)$defaults); | |
} | |
return $this->_inputDefaults; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#celery\concurrency\processes\_win.py | |
from ctypes import byref, sizeof, windll, Structure, WinError, POINTER | |
from ctypes.wintypes import DWORD, c_size_t, LONG, c_char, c_void_p | |
### had to change to #### | |
from ctypes import c_size_t, c_char, c_void_p, byref, sizeof, windll, Structure, WinError, POINTER | |
from ctypes.wintypes import DWORD, LONG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php | |
index 42a2937..c1956c5 100644 | |
--- a/lib/Cake/Routing/Router.php | |
+++ b/lib/Cake/Routing/Router.php | |
@@ -182,7 +182,10 @@ class Router { | |
* @throws RouterException | |
*/ | |
protected static function _validateRouteClass($routeClass) { | |
- if (!class_exists($routeClass) || !is_subclass_of($routeClass, 'CakeRoute')) { | |
+ if ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('CakeRoute', 'Routing/Route'); | |
class HyphenRoute extends CakeRoute { | |
public function parse($url) { | |
if ($route = parent::parse($url)) { | |
// don't allow camel-case actions in url to prevent duplicate urls pointed to same page | |
if (strtolower($route['action'] !== $route['action'])) { | |
throw new NotFoundException(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('CakeRoute', 'Routing/Route'); | |
/** | |
* QueryStringRoute | |
* | |
* Usage: | |
* | |
* App::uses('QueryRoute', 'Route'); | |
* Router::connect('/', ['controller' => 'users'], ['routeClass' => 'QueryStringRoute', 'query' => ['foo' => 'bar']]); | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('CakeRoute', 'Routing/Route'); | |
class HyphenRoute extends CakeRoute { | |
public function parse($url) { | |
if ($route = parent::parse($url)) { | |
if (strtolower($route['action'] !== $route['action'])) { | |
throw new NotFoundException(); | |
} | |
if (strpos($route['action'], '-') !== false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import xml.etree.cElementTree as ET | |
wallpapers = ET.Element("wallpapers") | |
for root, dirs, files in os.walk(os.path.expanduser("~/Pictures")): | |
for file in files: | |
if (file.lower().endswith(('.png', '.jpg', '.jpeg'))): | |
wallpaper = ET.SubElement(wallpapers, "wallpaper") | |
wallpaper.set("deleted", "false") | |
name = ET.SubElement(wallpaper, "name") |
OlderNewer