title: How do I use a standalone class in cakephp 1.3?
body: <p>I have a standalone class I wrote in PHP for some very basic LDAP/AD functions. and I would like to use this class in a project I am working on in cakephp.</p>
  
  <p>It looks like in cakephp 1.2 I could just add the class as a vendor, however it looks like cakephp 1.3 removed support for vendors. So how would I go about calling a few function from this class?</p>
  
  <p>(I'd like to try to keep the class itself the same and not turn it into a plugin, as that seems unnecessary)</p>
  
  <p>Thanks!</p>
  
  <p>code below:</p>
  
  <pre><code>**&lt;?php
  class UsersController extends AppController {
  
  var $name = 'Users';
  
      //commented out because it breaks the script
      //App::import('Lib', 'ldap');
  
  
  function index() {
      $this-&gt;User-&gt;recursive = 0;
      $this-&gt;set('users', $this-&gt;paginate());
  }
  
      function login() {
  
          if (!empty($this-&gt;data)) {
                  if ($ldap-&gt;auth($this-&gt;data['User']['user'],$this-&gt;data['User']['password'])) {
                          $this-&gt;Session-&gt;setFlash(__('The user has been saved', true));
                          $this-&gt;Session-&gt;write('user', $this-&gt;data['User']['user']);
                          $this-&gt;redirect(array('action' =&gt; 'index'));
                  } else {
                          $this-&gt;Session-&gt;setFlash(__('Login Failed', true));
                  }
          }
      }
  
      function logout() {
          $this-&gt;Session-&gt;delete('user');
          $this-&gt;redirect($this-&gt;referer());
  
      }
  
  function view($id = null) {
      if (!$id) {
          $this-&gt;Session-&gt;setFlash(__('Invalid user', true));
          $this-&gt;redirect(array('action' =&gt; 'index'));
      }
      $this-&gt;set('user', $this-&gt;User-&gt;read(null, $id));
  }
  
  function add() {
      if (!empty($this-&gt;data)) {
          $this-&gt;User-&gt;create();
          if ($this-&gt;User-&gt;save($this-&gt;data)) {
              $this-&gt;Session-&gt;setFlash(__('The user has been saved', true));
              $this-&gt;redirect(array('action' =&gt; 'index'));
          } else {
              $this-&gt;Session-&gt;setFlash(__('The user could not be saved. Please, try again.', true));
          }
      }
      $projects = $this-&gt;User-&gt;Project-&gt;find('list');
      $this-&gt;set(compact('projects'));
  }
  
  function edit($id = null) {
      if (!$id &amp;&amp; empty($this-&gt;data)) {
          $this-&gt;Session-&gt;setFlash(__('Invalid user', true));
          $this-&gt;redirect(array('action' =&gt; 'index'));
      }
      if (!empty($this-&gt;data)) {
          if ($this-&gt;User-&gt;save($this-&gt;data)) {
              $this-&gt;Session-&gt;setFlash(__('The user has been saved', true));
              $this-&gt;redirect(array('action' =&gt; 'index'));
          } else {
              $this-&gt;Session-&gt;setFlash(__('The user could not be saved. Please, try again.', true));
          }
      }
      if (empty($this-&gt;data)) {
          $this-&gt;data = $this-&gt;User-&gt;read(null, $id);
      }
      $projects = $this-&gt;User-&gt;Project-&gt;find('list');
      $this-&gt;set(compact('projects'));
  }
  
  function delete($id = null) {
      if (!$id) {
          $this-&gt;Session-&gt;setFlash(__('Invalid id for user', true));
          $this-&gt;redirect(array('action'=&gt;'index'));
      }
      if ($this-&gt;User-&gt;delete($id)) {
          $this-&gt;Session-&gt;setFlash(__('User deleted', true));
          $this-&gt;redirect(array('action'=&gt;'index'));
      }
      $this-&gt;Session-&gt;setFlash(__('User was not deleted', true));
      $this-&gt;redirect(array('action' =&gt; 'index'));
  }
  }
  ?&gt;**
  </code></pre>