File upload isn't working - file

Im trying to upload a file in a SwaggerUI, but it keeps saying no file found, can't figure out why exactly, maybe you guys can help me:
/**
* #SWG\Put(
* path="/api/v1/profile/{id}/profilepicture",
* tags={"Profile"},
* operationId="updateProfilePicture",
* summary="updates the ProfilePicture",
* description="updates the ProfilePicture",
* consumes={"multipart/form-data"},
* produces={"application/json"},
* #SWG\Parameter(
* name="profilePicture",
* in="formData",
* description="Change the profilepicture",
* required=true,
* type="file",
* #SWG\Schema(ref="#definitions/Error"),
* ),
* #SWG\Response(
* response=200,
* description="Succeed!",
* ),
* #SWG\Response(
* response=405,
* description="Validation exception",
* ),
* )
* #param Request $request
* #return BinaryFileResponse
*/
public function updateProfilePicture(Request $request)
{
$profileId = $request->get('id');
/** #var UploadedFile $file */
$file = $request->files->get('profilePicture');
if($file == null)
{
throw new BadRequestHttpException('No file found!');
}
return (new BinaryFileResponse($file));
}
tried changing the name of profilePicture and clearing the cache, still have the same problem.

Related

How can I organize files in sections according to an architecture with doxygen?

I am trying document my code using Doxygen. I want the resulting HTML to organize the tree view acording to a SW architecture for simple and fast understanding of the project. I have a project organized like this:
│ project_description.md
├───application
│ │ application.md
│ ├───app1
│ │ app1.c
│ │ app1.h
│ │ app1.md
│ └───app2
│ app2.c
│ app2.h
│ app2.md
└───ecu_abstraction
│ ecu_abstraction.md
├───component1
│ custom_timer.c
│ custom_timer.h
│ custom_timer.md
└───component2
custom_component2.c
custom_component2.h
custom_component2.md
The issue I am having is that the tree view auto-generated by doxygen is flat. All elements have the same level.
Current result is:
My objective is to have something like this:
I have made some attempts with grouping and sections but all of them seems to merge the documentation files. Any idea if this can be implemented with Doxygen?
I know I can achieve a similar result by disabling the autogenerated tree view and using #ref but creating a manual table of contex is not very flexible nor future proof.
Attempts with addtogroup functionality:
Adding the line #addtogroup application in the markdown files concatenates them in the module "application".
Adding to a group specific functions or the module declaration to a group adds those functions to the same generic module description.
This means that if I add all my applications to the application layer all of those are concatenated and one single page is created.
Sample markdown file:
#addtogroup application
# App1
bla bla
Sample C file addition to a group
/**
* #addtogroup application
* #{
* #file app2.c
*
* #brief Custom simpe timer implementation that allows for simple tick, reste...
* #}
*/
It's a little bit late answer, the OP may have solved the matter who knows. Anyway, the implementation according to the OP's requirement should be like the following steps. Assume that we have the source files as *.h and *.c pair:
app1
app2
custom_component
custom_timer
First we would implement a application doc file:
app_doc.dox
/**
* \mainpage X Application Project
* \author Author Name <author_email#example.com>
*
* Description for X Application Project.
*/
/**
* \defgroup app Application Layer
* #{
* Description for the Application group.
* #}
*/
/**
* \defgroup ecu ECU Abstraction Layer
* #{
* Description for the ECU Abstraction group.
* #}
*/
Next we would document all indiviual files. But we create new groups using the defgroup command within the related header files only. Right after creating the groups, we make them subgroups using the ingroup command. This will nest the groups and create a hierarchic documentation within the tree view as a result. Note that we also add the *.c file to their related groups. However this may not be necessary unless you have more documentations that belong the same group in the *.c files.
app1.h
/**
* \defgroup app1 App1
* \ingroup app
*
* \author Author Name (Optional)
* \date YYYY.MM.DD (Optional)
*
* #{
* Description for this specific app1 module (Optional).
*/
#ifndef APP1_H
#define APP1_H
/**
* app1Func documentation.
*/
void app1Func(void);
#endif /* APP1_H */
/// #}
app1.c
/**
* \ingroup app1
*
*/
void app1Func(void) {
}
app2.h
/**
* \defgroup app2 App2
* \ingroup app
*
* \author Author Name (Optional)
* \date YYYY.MM.DD (Optional)
*
* #{
* Description for this specific app2 module (Optional).
*/
#ifndef APP2_H
#define APP2_H
/**
* app2Func documentation.
*/
void app2Func(void);
#endif /* APP2_H */
/// #}
app2.c
/**
* \ingroup app2
*
*/
void app2Func(void) {
}
custom_timer.h
/**
* \defgroup custom_timer Custom Timer SWC
* \ingroup ecu
*
* \author Author Name (Optional)
* \date YYYY.MM.DD (Optional)
*
* #{
* Description for this specific custom_timer module (Optional).
*/
#ifndef CUSTOM_TIMER_H
#define CUSTOM_TIMER_H
/**
* customTimerFunc documentation.
*/
void customTimerFunc(void);
#endif /* CUSTOM_TIMER_H */
/// #}
custom_timer.c
/**
* \ingroup custom_timer
*
*/
void customTimerFunc(void) {
}
custom_component.h
/**
* \defgroup custom_component Custom Component SWC
* \ingroup ecu
*
* \author Author Name (Optional)
* \date YYYY.MM.DD (Optional)
*
* #{
* Description for this specific custom_component module (Optional)
*/
#ifndef CUSTOM_COMPONENT_H
#define CUSTOM_COMPONENT_H
/**
* customComponentFunc documentation.
*/
void customComponentFunc(void);
#endif /* CUSTOM_COMPONENT_H */
/// #}
custom_component.c
/**
* \ingroup custom_component
*
*/
void customComponentFunc(void) {
}
The Doxygen version I used to generate documentation is 1.9.6. I have generated the documentation using Doxywizard in Linux platform. Finally an image that shows the result.
Unfortunately I cannot add the specific doxygen config file since it is large and there is a body character limit in answers. But no worries I uploaded it in a cloud storage so that you can download and view.
Edit
Thanks to #albert for the reminder so I also leave the doxygen configuration as condensed view form in case of the original Doxyfile is not available from the cloud drive.
# Doxyfile 1.9.6
PROJECT_NAME = "X Application Project"
PROJECT_NUMBER = 1.0.0
PROJECT_BRIEF = "This is the X Project's synopsis"
OUTPUT_DIRECTORY = .
OPTIMIZE_OUTPUT_FOR_C = YES
SHOW_HEADERFILE = NO
SHOW_INCLUDE_FILES = NO
SHOW_USED_FILES = NO
SHOW_FILES = NO
INPUT = . \
../Xproject
GENERATE_TREEVIEW = YES
FULL_SIDEBAR = YES
GENERATE_LATEX = NO

do we need to write a batchable class to schedule a class

I am trying to generate a report and send a report to email as an attachment in salesforce. I have created a controller, created a class for csv stream and an email template. I want to schedule the class. when I schedule it I am unable to achieve the result. Could anyone help me in achieving this?
The code I tried is created a visualforce component, class, and an email template.
The code I tried is to schedule it for every 5 minutes. but I am getting an error.
Do we need to write a batchable class for this
global class IncrementReport implements Schedulable {
global void execute(SchedulableContext ctx) {
System.debug('Entered Cron trigger');
rptobj__c r = [SELECT Id, Name, reporttrigger__c FROM rptobj__c WHERE Name = 'ThisReport' LIMIT 1];
r.reporttrigger__c += 1;
String s = '0 0 * * * ?' ';
IncrementReport abc = new IncrementReport();
system.schedule('Report Job', s, abc);
System.debug('updating trigger to: ' + r.reporttrigger__c);
update r;
}
}
You only write the logic in your scheduler class.
global class IncrementReport implements Schedulable {
global void execute(SchedulableContext ctx) {
System.debug('Entered Cron trigger');
rptobj__c r = [SELECT Id, Name, reporttrigger__c FROM rptobj__c WHERE Name = 'ThisReport' LIMIT 1];
r.reporttrigger__c += 1;
System.debug('updating trigger to: ' + r.reporttrigger__c);
update r;
}
}
And then, can run this cron expression from Developer Console.
String sch1 = '0 0 * * * ?';
IncrementReport ir1 = new IncrementReport();
system.schedule('Every Hour plus 0 min', sch1, ir1);
String sch2 = '0 5 * * * ?';
IncrementReport ir2 = new IncrementReport();
system.schedule('Every Hour plus 5 min', sch2, ir2);
String sch3 = '0 10 * * * ?';
IncrementReport ir3 = new IncrementReport();
system.schedule('Every Hour plus 10 min', sch3, ir3);
String sch4 = '0 15 * * * ?';
IncrementReport ir4 = new IncrementReport();
system.schedule('Every Hour plus 15 min', sch4, ir4);
// And so on ir5, ir6 .... ir12
As you want to run the scheduler in every 5 minutes, you have to system.schedule 12 times as 12*5 = 60 minutes = 1 hour
You can see whether the job is running or not on
Setup -> Scheduled Jobs

Parse log file while with between lines relation

I have long log file that contents looks like
2015-06-13 20:58:32,278 60157353 [Thread-1] DEBUG ccc - start PROC, will wait 30
2015-06-13 20:58:32,302 60157377 [Thread-1] DEBUG ccc - stoping PROC 0
2015-06-13 20:58:42,339 60167414 [Thread-1] DEBUG ccc - start PROC, will wait 30
2015-06-13 20:58:42,363 60167438 [Thread-1] DEBUG ccc - stoping PROC 0
2015-06-13 20:58:52,378 60177453 [Thread-1] DEBUG ccc - start PROC, will wait 30
2015-06-13 20:58:52,404 60177479 [Thread-1] DEBUG ccc - stoping PROC 0
2015-06-13 20:58:52,430 60177506 [Thread-1] DEBUG ccc - start PROC, will wait 30
I need to check time between start PROC and stoping PROC is not longer than 30 seconds.
Is it somehow possible do this with any log parser software?
Using a LogMX Parser, you can mark each start/stop couple as "Too long" (if there is more than 30s between start PROC and stoping PROC).
In the following Parser example, when the elapsed time is greater than 30s:
The user-defined log entry field named "TooLong" is set to "x" (else, it is empty) => can easily filter/sort/search using this field
The stoping PROC entry is marked as ERROR to appear in red => can quickly see it
Of course, you can adjust this code according to your needs.
To use this parser:
Copy the following code in a new file <LogMX_dir>/parsers/src/sample/parser/VicoParser.java
Compile it using Eclipse, IntelliJ IDEA, Maven, Gradle, or Ant using files in <LogMX_dir>/parsers (see LogMX documentation)
Add this Parser in LogMX using menu "Tools" > "Options" > "Parsers" > green "+" button > "Java class Parser" tab > choose <LogMX_dir>/parsers/classes/sample.parser/VicoParser
VicoParser.java:
package sample.parser;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.lightysoft.logmx.business.ParsedEntry;
import com.lightysoft.logmx.mgr.LogFileParser;
/**
* Sample LogMX Parser able to parse a log file with multi-line support, Absolute/Relative Date support,
* and detection of too-long elapsed time between too specific entries.<BR/>
*
* Log4j Pattern for this log format is:
* %d %-4r [%t] %-5p %c %x - %m%n
*
* Here is an example of log file suitable for this parser:<BR/>
* 2015-06-13 20:58:32,278 60157353 [Thread-1] DEBUG ccc - start PROC, will wait 30
* 2015-06-13 20:58:32,302 60157377 [Thread-1] DEBUG ccc - stoping PROC 0
* 2015-06-13 20:58:42,339 60167414 [Thread-1] DEBUG ccc - start PROC, will wait 30
* 2015-06-13 20:58:42,363 60167438 [Thread-1] DEBUG ccc - stoping PROC 0
* 2015-06-13 20:58:52,378 60177453 [Thread-1] DEBUG ccc - start PROC, will wait 30
* 2015-06-13 20:58:52,404 60177479 [Thread-1] DEBUG ccc - stoping PROC 0
* 2015-06-13 20:58:52,430 60177506 [Thread-1] DEBUG ccc - start PROC, will wait 30
*/
public class VicoParser extends LogFileParser {
/** Current parsed log entry */
private ParsedEntry entry = null;
/** Entry date format (this is Log4j default ISO-8601) */
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
/** Mutex to avoid that multiple threads use the same Date formatter at the same time */
private final Object DATE_FORMATTER_MUTEX = new Object();
/** Pattern for entry begin */
private final static Pattern ENTRY_BEGIN_PATTERN = Pattern.compile(
// %d
"^(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d+?)\\s+?"
// %-4r [%t] %-5p
+ "(\\d+?)\\s+?\\[(.*?)\\]\\s+?(.*?)\\s+?"
// %c %x - %m
+ "(.*?) (.*?) - (.*)$");
/** Buffer for Entry message (improves performance for multi-lines entries) */
private StringBuilder entryMsgBuffer = null;
///////////// Elapsed-Time computation ////////////
/** Log entry message used for T0 (elapsed time calculation) */
private static final String LOG_MESSAGE_T0 = "start PROC";
/** Log entry message used for T1 (elapsed time calculation) */
private static final String LOG_MESSAGE_T1 = "stoping PROC";
/** Last encountered T0 entry */
private ParsedEntry prevT0Entry = null;
/** Max allowed time between entries, before raising "TooLong" flag */
private static final long MAXIMUM_DELTA_T = 30000L; // 30s (30,000 ms)
/////////////////////////////////////////////////////
/** Key of user-defined field "Timestamp" (internal, not displayed) */
private static final String EXTRA_FIELD_KEY__TIMESTAMP = "Timestamp";
/** Key of user-defined field "NDC" */
private static final String EXTRA_FIELD_KEY__NDC = "NDC";
/** Key of user-defined field "TooLong" */
private static final String EXTRA_FIELD_KEY__TOOLONG = "TooLong";
/** User-defined fields names */
private static final List<String> EXTRA_FIELDS_KEYS = Arrays.asList(EXTRA_FIELD_KEY__NDC,
EXTRA_FIELD_KEY__TOOLONG);
/**
* Returns the name of this parser
* #see com.lightysoft.logmx.mgr.LogFileParser#getParserName()
*/
#Override
public String getParserName() {
return "Vico Parser";
}
/**
* Returns the supported file type for this parser
* #see com.lightysoft.logmx.mgr.LogFileParser#getSupportedFileType()
*/
#Override
public String getSupportedFileType() {
return "Vico log files";
}
/**
* Process the new line of text read from file
* #see com.lightysoft.logmx.mgr.LogFileParser#parseLine(java.lang.String)
*/
#Override
protected void parseLine(String line) throws Exception {
// If end of file, records last entry if necessary, and exits
if (line == null) {
recordPreviousEntryIfExists();
return;
}
Matcher matcher = ENTRY_BEGIN_PATTERN.matcher(line);
if (matcher.matches()) {
// Record previous found entry if exists, then create a new one
prepareNewEntry();
entry.setDate(matcher.group(1));
entry.setThread(matcher.group(3));
entry.setLevel(matcher.group(4));
entry.setEmitter(matcher.group(5));
String logMsg = matcher.group(7);
// Save relative timestamp (in ms), for "getRelativeEntryDate()", but also to compute elapsed
// time between two specific log entries (faster than parsing complete absolute date)
long timestamp = Integer.parseInt(matcher.group(2), 10);
entryMsgBuffer.append(logMsg);
entry.getUserDefinedFields().put(EXTRA_FIELD_KEY__NDC, matcher.group(6)); // save NDC
entry.getUserDefinedFields().put(EXTRA_FIELD_KEY__TIMESTAMP, timestamp); // save Timestamp
if (logMsg.startsWith(LOG_MESSAGE_T0)) {
if (prevT0Entry != null) {
System.err.println("Warning: found [" + LOG_MESSAGE_T0 + "] not followed by ["
+ LOG_MESSAGE_T1 + "]");
}
prevT0Entry = entry;
} else if (logMsg.startsWith(LOG_MESSAGE_T1)) {
if (prevT0Entry == null) {
System.err.println("Warning: found [" + LOG_MESSAGE_T1 + "] not preceded by ["
+ LOG_MESSAGE_T0 + "]");
} else {
long prevT0 = (Long) prevT0Entry.getUserDefinedFields().get(
EXTRA_FIELD_KEY__TIMESTAMP);
if (timestamp - prevT0 > MAXIMUM_DELTA_T) {
entry.getUserDefinedFields().put(EXTRA_FIELD_KEY__TOOLONG, "x"); // Flag this entry as "TooLong"
prevT0Entry.getUserDefinedFields().put(EXTRA_FIELD_KEY__TOOLONG, "x"); // Flag this entry as "TooLong"
// Change log entry Level (note: cannot change Level of T0 entry because it has been already processed by LogMX)
entry.setLevel("ERROR");
}
prevT0Entry = null;
}
}
} else if (entry != null) {
entryMsgBuffer.append('\n').append(line); // appends this line to previous entry's text
}
}
/**
* Returns the ordered list of user-defined fields to display (given by their key), for each entry.
* #see com.lightysoft.logmx.mgr.LogFileParser#getUserDefinedFields()
*/
#Override
public List<String> getUserDefinedFields() {
return EXTRA_FIELDS_KEYS;
}
/**
* Returns a relative Date for the given entry
* #see com.lightysoft.logmx.mgr.LogFileParser#getRelativeEntryDate(com.lightysoft.logmx.business.ParsedEntry)
*/
#Override
public Date getRelativeEntryDate(ParsedEntry pEntry) throws Exception {
Long timestamp = (Long) pEntry.getUserDefinedFields().get(EXTRA_FIELD_KEY__TIMESTAMP);
return new Date(timestamp);
}
/**
* Returns the absolute Date for the given entry
* #see com.lightysoft.logmx.mgr.LogFileParser#getAbsoluteEntryDate(com.lightysoft.logmx.business.ParsedEntry)
*/
#Override
public Date getAbsoluteEntryDate(ParsedEntry pEntry) throws Exception {
synchronized (DATE_FORMATTER_MUTEX) { // Java date formatter is not thread-safe
return dateFormat.parse(pEntry.getDate());
}
}
/**
* Send to LogMX the current parsed log entry
* #throws Exception
*/
private void recordPreviousEntryIfExists() throws Exception {
if (entry != null) {
entry.setMessage(entryMsgBuffer.toString());
addEntry(entry);
}
}
/**
* Send to LogMX the current parsed log entry, then create a new one
* #throws Exception
*/
private void prepareNewEntry() throws Exception {
recordPreviousEntryIfExists();
entry = createNewEntry();
entryMsgBuffer = new StringBuilder(80);
entry.setUserDefinedFields(new HashMap<String, Object>(4));
}
}
And here is what I get:
Note: you can sort/filter log entries using the field named "TooLong" by clicking on its column (mouse left/middle button, or menu "Filter" > "Show filtering bar")

opengl matrix math multiplication

I am writing a simple c 4x4 matrix math library and wanted some feedback, especially from people with opengl experience.
Typically there's two ways to do matrix multiplication. I tested this code and it works, according to results from wolfram alpha but my main concern is that this matrix is in the right order.
My matrix is just an array of 16 doubles.
The code to do the multiplication is below
out->m[0] = ( a->m[0] * b->m[0]) + (a->m[1] * b->m[4]) + (a->m[2] * b->m[8]) + (a->m[3] * b->m[12] );
out->m[4] = ( a->m[4] * b->m[0]) + (a->m[5] * b->m[4]) + (a->m[6] * b->m[8]) + (a->m[7] * b->m[12] );
out->m[8] = ( a->m[8] * b->m[0]) + (a->m[9] * b->m[4]) + (a->m[10] * b->m[8]) + (a->m[11] * b->m[12] );
out->m[12] = ( a->m[12] * b->m[0]) + (a->m[13] * b->m[4]) + (a->m[14] * b->m[8]) + (a->m[15] * b->m[12] );
out->m[1] = ( a->m[0] * b->m[1]) + (a->m[1] * b->m[5]) + (a->m[2] * b->m[9]) + (a->m[3] * b->m[13] );
out->m[5] = ( a->m[4] * b->m[1]) + (a->m[5] * b->m[5]) + (a->m[6] * b->m[9]) + (a->m[7] * b->m[13] );
out->m[9] = ( a->m[8] * b->m[1]) + (a->m[9] * b->m[5]) + (a->m[10] * b->m[9]) + (a->m[11] * b->m[13] );
out->m[13] = ( a->m[12] * b->m[1]) + (a->m[13] * b->m[5]) + (a->m[14] * b->m[9]) + (a->m[15] * b->m[13] );
out->m[2] = ( a->m[0] * b->m[2]) + (a->m[1] * b->m[6]) + (a->m[2] * b->m[10]) + (a->m[3] * b->m[14] );
out->m[6] = ( a->m[4] * b->m[2]) + (a->m[5] * b->m[6]) + (a->m[6] * b->m[10]) + (a->m[7] * b->m[14] );
out->m[10] = ( a->m[8] * b->m[2]) + (a->m[9] * b->m[6]) + (a->m[10] * b->m[10]) + (a->m[11] * b->m[14] );
out->m[14] = ( a->m[12] * b->m[2]) + (a->m[13] * b->m[6]) + (a->m[14] * b->m[10]) + (a->m[15] * b->m[14] );
out->m[3] = ( a->m[0] * b->m[3]) + (a->m[1] * b->m[7]) + (a->m[2] * b->m[11]) + (a->m[3] * b->m[15] );
out->m[7] = ( a->m[4] * b->m[3]) + (a->m[5] * b->m[7]) + (a->m[6] * b->m[11]) + (a->m[7] * b->m[15] );
out->m[11] = ( a->m[8] * b->m[3]) + (a->m[9] * b->m[7]) + (a->m[10] * b->m[11]) + (a->m[11] * b->m[15] );
out->m[15] = ( a->m[12] * b->m[3]) + (a->m[13] * b->m[7]) + (a->m[14] * b->m[11]) + (a->m[15] * b->m[15] );
I wanted to make sure that this will give me the correct results for setting up my transformation matrix.
matrix m = 1,3,4,-1,5,6,7,-1,8,8,8,-1,0,0,0,1
which is arranged in memory like this:
1,3,4,-1
5,6,7,-1
8,8,8,-1
0,0,0,1
which I think is the way opengl lays out it's matrix as 16 numbers.
using my code my answer comes out to be
[ 48.000000 53.000000 57.000000 -9.000000 ]
[ 91.000000 107.000000 118.000000 -19.000000 ]
[ 112.000000 136.000000 152.000000 -25.000000 ]
[ 0.000000 0.000000 0.000000 1.000000 ]
which is the transpose of wolfram alpha's answer.
(48 | 91 | 112 | 0
53 | 107 | 136 | 0
57 | 118 | 152 | 0
-9 | -19 | -25 | 1)
Typically it looks like this, vertex point v model, view, projection matrices
position = projection * view * model * v
I can't say you why your results differ but one help is, if you send the matrix into a GLSL uniform dMat4, you can use the build in transpose functionallity of OpenGL to get the right matrix alignment:
glUniformMatrix4fv( Uniform_Location, 1, GL_TRUE, MatrixPointer );
The third parameter means, if OpenGL should transpose the matrix before setting the uniform.

Uploading cakePHP through cpanel issues

i'm using cakephp version 2.3.6, ive been trying to upload cake to a hostgator server through CPanel but been having problems configuring the index.php file in the webroot but not sure the correct configuration for my version of cake on Cpanel my cpanel username is fredenda I tried to configure this in cpanel but keeps on giving this error message
" Parse error: syntax error, unexpected ';' in /home/fredenda/public_html/index.php on line 41"
however this error isnt in the file, Please can someone help me out.
Please check the file below... bless.
<?php
/**
* Index
*
* The Front Controller for handling every request
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* #copyright Copyright (c) Cake Software Foundation, Inc.
(http://cakefoundation.org)
* #link http://cakephp.org CakePHP(tm) Project
* #package app.webroot
* #since CakePHP(tm) v 0.2.9
* #license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Use the DS to separate the directories in other defines
*/
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
/**
* These defines should only be edited if you have cake installed in
* a directory layout other than the way it is distributed.
* When using custom settings be sure to use the DS and do not add a trailing DS.
*/
/**
* The full path to the directory which holds "app", WITHOUT a trailing DS.
*
*/
if (!defined('ROOT')) {
define('ROOT', DS.'home'.DS.(fredenda);
}
/**
* The actual directory name for the "app".
*
*/
if (!defined('APP_DIR')) {
define('APP_DIR', 'app');
}
/**
* The absolute path to the "cake" directory, WITHOUT a trailing DS.
*
* Un-comment this line to specify a fixed path to CakePHP.
* This should point at the directory containing `Cake`.
*
* For ease of development CakePHP uses PHP's include_path. If you
* cannot modify your include_path set this value.
*
* Leaving this constant undefined will result in it being defined in Cake/bootstrap.php
*
* The following line differs from its sibling
* /lib/Cake/Console/Templates/skel/webroot/index.php
*/
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib')
/**
* Editing below this line should NOT be necessary.
* Change at your own risk.
*
*/
if (!defined('WEBROOT_DIR')) {
define('WEBROOT_DIR', basename(dirname(__FILE__)));
}
if (!defined('WWW_ROOT')) {
define('WWW_ROOT', dirname(__FILE__) . DS);
}
// for built-in server
if (php_sapi_name() == 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) {
return false;
}
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
if (function_exists('ini_set')) {
ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
}
if (!include ('Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
} else {
if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) {
$failed = true;
}
}
if (!empty($failed)) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
App::uses('Dispatcher', 'Routing');
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch(
new CakeRequest(),
new CakeResponse()
);
Open your eyes. ;) The parser is not lying to you. There is a missing ) but I don't think fredenda is a constant so...
define('ROOT', DS.'home'.DS.(fredenda);
This line should be:
define('ROOT', DS . 'home' . DS. 'fredenda');
I would recommend you to get an editor or IDE with proper php syntax highlighting and syntax check to see these kind of syntax issues immediately.
And follow coding standards, there should be a space between the DS and strings like in all the other places. Also a good read this book "Clean Code".

Resources