public function __construct($fileNameForm)
 {
     $this->uploadDir = copperConfig::get('uploadPath');
     $this->fileNameForm = $fileNameForm;
     $this->extractPartNames();
     $this->getNewName();
 }
 public function __construct($fb)
 {
     $this->fb = $fb;
     $this->fb instanceof Facebook;
     $this->db = copperConfig::get('copperDb');
     $this->db instanceof copperDb;
 }
 public function __construct($fileNameForm)
 {
     $this->developerKey = copperConfig::get('youtubeDeveloperKey');
     $this->username = copperConfig::get('youtubeUsername');
     $this->password = copperConfig::get('youtubePassword');
     $this->createdBy = '';
     $this->pathYoutube1 = copperConfig::get('lib') . '/youtube/library/';
     $this->pathYoutube2 = copperConfig::get('lib') . '/youtube/library/Zend/Gdata/';
     ini_set("include_path", ini_get('include_path') . ':' . $this->pathYoutube1 . ':' . $this->pathYoutube2);
     include "YouTube.php";
     $this->authenticationURL = 'https://www.google.com/accounts/ClientLogin';
     $this->upload = new copperUpload($fileNameForm);
 }
 /**
  * getUidsFromRequestIds
  * 
  * Obtain the uids from a gived requestids.
  * @param array $requestIds
  * @return array $uids 
  */
 public static function getUidsFromRequestIds($requestIds)
 {
     $appid = copperConfig::get('appId');
     $secret = copperConfig::get('appSecret');
     $uids = array();
     if (copperUtils::valid($requestIds, false)) {
         $app_token = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id=' . $appid . '&client_secret=' . $secret . '&grant_type=client_credentials');
         //Get application token
         foreach ($requestIds as $key => $sent) {
             $request = file_get_contents('https://graph.facebook.com/' . $sent . '?' . $app_token);
             $request = json_decode($request);
             $uids[] = $request->to->id;
         }
     }
     return $uids;
 }
<div class='wrap'>
  <div class='logo'>
    <img src="<?php 
echo copperConfig::get('callbackUrl');
?>
img/bare_copper.jpg"/>
  </div>
  
  <div class='container'>
    <h1><?php 
echo copperConfig::get('welcome');
?>
</h1>
    </div>
</div>
 /**
  * __construct
  *
  * The constructor camelize the method
  * @param string $method
  * @param array $params
  */
 public function __construct($method, $params)
 {
     $method = copperStr::camelize($method);
     $this->model = copperConfig::get("model");
     $this->{$method}($params);
 }
    <?php 
if (copperConfig::get('facebookJsActivate')) {
    ?>
      <script type="text/javascript">
        window.fbAsyncInit = function() {
          FB.init({
            appId: '<?php 
    echo copperConfig::get('appId');
    ?>
',
            status: false,
            cookie: true,
            xfbml: true,
            channelUrl: '<?php 
    echo copperConfig::get('callbackUrl');
    ?>
channel.html'
          });
          FB.getLoginStatus(function(response) {
              if (response.session) {
                afterFbLogin();
              }
          });
          FB.Canvas.setAutoResize();
        };
        (function() {
          var e = document.createElement('script');
          e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
          e.async = true;
          document.getElementById('fb-root').appendChild(e);
        }());
<?php

/**
 * Please dont touch this. This is the JavaScript Variable Generator.
 * 
 * @author Nahuel Rosso
 * @version 1.0
 */
require_once 'config.php';
header("Content-type: text/javascript");
$jsVars = copperConfig::get('visibleVars');
foreach ($jsVars as $key => $val) {
    echo "var " . strtoupper(copperStr::revertCamelize($key)) . " = " . json_encode($val) . ";\n";
}
$customConfig = realpath('.') . DIRECTORY_SEPARATOR . 'config-custom.php';
if (!file_exists($customConfig)) {
    die('Create the file `' . basename($customConfig) . '` from  the same file -template and put your custom configurations there.' . "\n");
}
require_once $customConfig;
$copperConfig = array_merge($copperConfig, $copperConfigCustom);
require_once str_replace(array('///', '//'), "/", $copperConfig['classes'] . '/copperConfig.php');
copperConfig::init($copperConfig);
unset($copperConfig, $customConfig);
// warnings and error to log file.
ini_set('error_log', copperConfig::get('log'));
require_once copperConfig::get('lib') . '/phpmailer/class.phpmailer.php';
require_once copperConfig::get('lib') . '/facebook/facebook.php';
if (copperConfig::get('facebookActivate')) {
    try {
        $fbInstance = copperFacebook::factory(array(), array('req_perms' => copperConfig::get('facebookPerms')));
    } catch (Exception $e) {
        copperConfig::doError('Error cargando facebook: ' . $e->getMessage());
        copperConfig::doError($e->getTraceAsString());
        if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
            echo json_encode(array('error' => true, 'msg' => 'Imposible cargar Session'));
        } else {
            copperConfig::incTemplate('head.php');
            copperConfig::incTemplate('bodys/error500.php');
            copperConfig::incTemplate('foot.php');
        }
        die;
    }
    copperConfig::set('fbInstance', $fbInstance);
    $model = new copperModel($fbInstance);
    copperConfig::set('model', $model);
echo copperConfig::get('callbackUrl');
?>
';
      var CANVAS_URL  = '<?php 
echo copperConfig::get('canvasUrl');
?>
';
      <?php 
if (copperConfig::get('facebookActivate')) {
    ?>
        var SIGNED_REQUEST  = '<?php 
    echo htmlentities($_REQUEST['signed_request']);
    ?>
';
      <?php 
}
?>
    </script>
    <?php 
$fbInstance = copperConfig::get('fbInstance');
if (!empty($fbInstance)) {
    try {
        $friends = $fbInstance->facebook->api('/me/friends');
    } catch (Exception $exc) {
        copperConfig::doError("Error al intentrar inicializar el /me/ : " . $exc->getMessage());
        copperConfig::doError("Error al intentrar inicializar el /me/ con trace: " . $exc->getTraceAsString());
    }
    if (!empty($friends)) {
        copperUtils::setJsVars('myFriends', $friends);
    }
}
 public static function urlToCanvas($link, $params = array())
 {
     $params['signed_request'] = $_REQUEST['signed_request'];
     $url = copperConfig::get('callbackUrl') . $link . "?" . http_build_query($params);
     return $url;
 }
 /**
  * pubUpload
  *
  * Return the path of an public upload
  *
  * @param string $fileName
  * @return string
  */
 public static function pubUpload($fileName)
 {
     return self::publicPath(copperConfig::get('uploadsPublic') . '/' . $fileName);
 }