Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add missing App::uses() to avoid fatal error #1201

Merged
merged 1 commit into from

3 participants

@markstory markstory merged commit 5695d0e into master
@ceeram ceeram deleted the master-app-uses branch
@lorenzo
Owner

Hmm, how can that work? Can you call a function on a class that is not declared? Surprising

@markstory
Owner

That is a good point, that I didn't even think of. I'll double check this.

@markstory
Owner

Looks like PHP parses classes before running code that uses said classes. An example of this is

<?php

$a = new Apple();
$a->hi();

class Apple {
    function hi() {
        echo 'hi';
    }
}
@lorenzo
Owner

Interesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @dereuromark
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/Cake/Core/App.php
View
1  lib/Cake/Core/App.php
@@ -17,6 +17,7 @@
* @since CakePHP(tm) v 1.2.0.6001
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+App::uses('Inflector', 'Utility');
/**
* App is responsible for path management, class location and class loading.
Something went wrong with that request. Please try again.