Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

integrating aws (composer installation) with Codeigniter

Posted on 2015-02-17
3
Medium Priority
?
306 Views
Last Modified: 2015-03-17
Hello,
I'm using Codeigniter 2.1

Inside index.php I added:

 
 require $application_folder .'/vendor/autoload.php'; 

Open in new window


aws is isntalled in application/vendor directory  Screen-Shot-2015-02-17-at-10.09.17-PM.pn
inside my Controller , I am trying to put a file inside a bucket:

 
             
  
     $s3= Aws\S3\S3Client::factory([
       
           'key' => 'SK2AILHWLV6CO7H3BE4L',
           'secret' => 'LtBvZWW/T//79HcGbA129e658VtlkPRxxQNqpKoMysz',
           'bucket' => 'zzz'
       
       ]);
       
       
       $result = $s3->putObject(array(
           'Key' => 'Files2',
           'Bucket' => 'zzz',
           'SourceFile'   => 'start.csv',
           'ContentType'  => 'text/plain',
           'ACL'          => 'public-read',
           'StorageClass' => 'REDUCED_REDUNDANCY',
           'Metadata'     => array(
               'param1' => 'value 1',
               'param2' => 'value 2'
           )
       ));
       
       echo $result['ObjectURL'];

Open in new window





but I'm getting an error:

Fatal error: Class 'Aws\S3\S3Client' not found in /www/server/application/controllers/testComp.php on line 34

Open in new window



To integrate Composer with Codeigniter I folllowed the instuctions :  http //philsturgeon.uk/blog/2012/05/composer-with-codeigniter/
0
Comment
Question by:sniger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 40615978
First, try to replace this:
 require $application_folder .'/vendor/autoload.php'; 

Open in new window

with this:
 require base_url('vendor/autoload.php'); 

Open in new window

Second, are you sure this is correct?
$s3= Aws\S3\S3Client::factory([

Open in new window

I think if the class is correctly installed and loaded, it should be available this way:
$s3= S3Client::factory([

Open in new window

0
 

Accepted Solution

by:
sniger earned 0 total points
ID: 40618580
Sorry, it did not work
0
 

Author Closing Comment

by:sniger
ID: 40670010
did not work
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question